-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Importer] Add the ability to import flags from a CSV file generated from OpenSRP 1 data. #322
Comments
Product Flag sample{
"resourceType": "Flag",
"id": "a065c211-cf3e-4b5b-972f-fdac0e45fef7",
"identifier": [
{"use": "usual", "value": "a065c211-cf3e-4b5b-972f-fdac0e45fef7"}
],
"status": "active",
"category": [
{
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "PRODCHECK" ,
"display": "Product Check"
}
],
"text": "Product Check"
}
],
"code": {
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "65347579" ,
"display": "Vist Flag"
}
],
"text": "Vist Flag"
},
"subject": {"reference": "Group/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"},
"period": {"start": "2024-02-01T00:00:00.00Z"},
"encounter": {"reference": "Encounter/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"}
} Product Observation Sample{
"resourceType": "Observation",
"id": "a065c211-cf3e-4b5b-972f-fdac0e45fef7",
"identifier": [
{"use": "usual", "value": "a065c211-cf3e-4b5b-972f-fdac0e45fef7"}
],
"status": "final",
"category": [
{
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "PRODCHECK" ,
"display": "Product Check"
}
],
"text": "Product Check"
}
],
"code": {
"coding": [
{
"system" : "http://snomed.info/sct",
"code" : "issue_details" ,
"display": "Issue Details"
}
],
"text": "Issue Details"
},
"subject": {"reference": "Group/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"},
"focus": [
{"reference": "Location/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"}
],
"encounter": {"reference": "Encounter/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"},
"effectivePeriod": {
"start": "2024-02-01T00:00:00.00Z",
"end" : "2024-02-01T00:00:00.00Z"
},
"performer": [
{"reference": "Practitioner/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"}
],
"valueString": "Issue Details"
}
|
Service Point check Flag sample{
"resourceType": "Flag",
"id": "a065c211-cf3e-4b5b-972f-fdac0e45fef7",
"identifier": [
{"use": "usual", "value": "a065c211-cf3e-4b5b-972f-fdac0e45fef7"}
],
"status": "active",
"category": [
{
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "SPCHECK" ,
"display": "Service Point Check"
}
],
"text": "Service Point Check"
}
],
"code": {
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "65347579" ,
"display": "Vist Flag"
}
],
"text": "Vist Flag"
},
"subject": {"reference": "Location/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"},
"period": {"start": "2024-02-01T00:00:00.00Z"},
"encounter": {"reference": "Encounter/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"}
} Service Point Good Order (NO) Reason {
"resourceType": "Observation",
"id": "a065c211-cf3e-4b5b-972f-fdac0e45fef7",
"identifier": [
{"use": "usual", "value": "a065c211-cf3e-4b5b-972f-fdac0e45fef7"}
],
"status": "final",
"category": [
{
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "SPCHECK" ,
"display": "Service Point Check"
}
],
"text": "Service Point Check"
}
],
"code": {
"coding": [
{
"system" : "http://smartregister.org/" ,
"code" : "34657579" ,
"display": "Service Point Good Order Check"
}
],
"text": "Service Point Good Order Check"
},
"subject": {"reference": "Location/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"},
"encounter": {"reference": "Encounter/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"},
"effectivePeriod": {
"start": "2024-02-01T00:00:00.00Z",
"end" : "2024-02-01T00:00:00.00Z"
},
"performer": [
{"reference": "Practitioner/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"}
],
"valueCodeableConcept": {
"coding": [
{
"system" : "http://snomed.info/sct",
"code" : "373067005" ,
"display": "No (qualifier value)"
}
],
"text": "No (qualifier value)"
}
"note": [
{"time": "2024-02-01T00:00:00.00Z", "text": "Please describe:"}
]
}
|
Consult beneficiaries flag sample{
"resourceType": "Flag",
"id": "a065c211-cf3e-4b5b-972f-fdac0e45fef7",
"identifier": [
{"use": "usual", "value": "a065c211-cf3e-4b5b-972f-fdac0e45fef7"}
],
"status": "inactive",
"category": [
{
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "CNBEN" ,
"display": "Consult Beneficiaries Visit"
}
],
"text": "Consult Beneficiaries Visit"
}
],
"code": {
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "65347579" ,
"display": "Vist Flag"
}
],
"text": "Vist Flag"
},
"subject": {"reference": "Location/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"},
"period": {
"start": "2024-02-01T00:00:00.00Z",
"end" : "2024-02-01T00:00:00.00Z"
},
"encounter": {"reference": "Encounter/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"}
} Consult Beneficiaries Issue raised{
"resourceType": "Observation",
"id": "a065c211-cf3e-4b5b-972f-fdac0e45fef7",
"identifier": [
{"use": "usual", "value": "a065c211-cf3e-4b5b-972f-fdac0e45fef7"}
],
"status": "final",
"category": [
{
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "CNBEN" ,
"display": "Consult Beneficiaries Visit"
}
],
"text": "Consult Beneficiaries Visit"
}
],
"code": {
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "77223346" ,
"display": "Consult Beneficiaries"
}
],
"text": "Consult Beneficiaries"
},
"subject": {"reference": "Location/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"},
"encounter": {"reference": "Encounter/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"},
"effectivePeriod": {
"start": "2024-02-01T00:00:00.00Z",
"end" : "2024-02-01T00:00:00.00Z"
},
"performer": [
{"reference": "Practitioner/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"}
],
"valueCodeableConcept": {
"coding": [
{
"system" : "http://snomed.info/sct",
"code" : "373066001" ,
"display": "Yes (qualifier value)"
}
],
"text": "Yes (qualifier value)"
},
"note": [
{"time": "2024-02-01T00:00:00.00Z", "text": "Issues raised" }
]
}
|
Warehouse Flag{
"resourceType": "Flag",
"id": "a065c211-cf3e-4b5b-972f-fdac0e45fef7",
"identifier": [
{"use": "usual", "value": "a065c211-cf3e-4b5b-972f-fdac0e45fef7"}
],
"status": "active",
"category": [
{
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "WHCHECK" ,
"display": "WareHouse check Visit"
}
],
"text": "Consult Beneficiaries Visit"
}
],
"code": {
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "65347579" ,
"display": "Vist Flag"
}
],
"text": "Vist Flag"
},
"subject": {"reference": "Location/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"},
"period": {"start": "2024-02-01T00:00:00.00Z"},
"encounter": {"reference": "Encounter/6f3980e0-d1d6-4a7a-a950-939f3ca7b301"}
} Warehouse Flag Obsersavation{
"resource": {
"resourceType": "Observation",
"id": "observation_id",
"identifier": {
"value": "obs_identifier_value",
"use": "usual"
},
"status": "final",
"category": {
"coding": [
{
"system": "https://smartregister.org/",
"code": "WHCHECK",
"display": "Warehouse check Visit"
}
],
"text": "Warehouse check Visit"
},
"code": {
"coding": [
{
"system": "https://smartregister.org/",
"code": "68561322",
"display": "Required action"
}
],
"text": "Required action"
},
"subject": {
"reference": "LocationReference"
},
"encounter": {
"reference": "Encounter"
},
"effective": {
"start": "2024-08-02T00:00:00Z",
"end": "2024-08-02T00:00:00Z"
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "373066001",
"display": "Yes (enter action required)"
}
],
"text": "Yes (enter action required)"
}
}
}
|
@dubdabasoduba thanks for the detailed samples above |
Sample Import Visit Encounter{
"resourceType": "Encounter",
"id": "2492dd29-81bf-4628-96cd-f747f48d7e16",
"status": "in-progress",
"class": {
"system" : "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code" : "OBSENC" ,
"display": "Observation Encounter"
},
"type": [
{
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "SVISIT" ,
"display": "Service Point Visit"
}
],
"text": "Service Point Visit"
},
{
"coding": [
{
"system" : "http://smartregister.org/CodeSystem/visit" ,
"code" : "SVIST_IMPORT" ,
"display": "Service Point Visit Import"
}
],
"text": "Service Point Visit Import"
}
],
"priority": {
"coding": [
{
"system" : "http://terminology.hl7.org/ValueSet/v3-ActPriority",
"code" : "EL" ,
"display": "elective"
}
],
"text": "elective"
},
"participant": [
{
"individual": {
"reference": "Practitioner/631f2c90-43cc-4ae3-a3a5-c539dff7bc3c"
}
}
],
"period": {
"start": "2023-09-13T03:56:00.000+00:00",
"end" : "2023-09-13T23:59:00.000+00:00"
},
"reasonCode": [
{
"coding": [
{
"system" : "http://smartregister.org/",
"code" : "SVISIT" ,
"display": "Service Point Visit"
}
],
"text": "Service Point Visit"
},
{
"coding": [
{
"system" : "http://smartregister.org/CodeSystem/visit" ,
"code" : "SVIST_IMPORT" ,
"display": "Service Point Visit Import"
}
],
"text": "Service Point Visit Import"
}
],
"location": [
{
"location": {
"reference": "Location/493f46d8-6dfe-4505-ab63-9d78c789400e"
},
"status": "active"
}
]
} |
Yes, we are assuming that this would only be run once but, there is a potential of running it multiple times in case the clients use OpenSRP 1 to collect data. Based on this I was thinking we can create a new Visit encounter every time the CSV import is run. What are your thoughts on this? |
Oh my bad, typo. Yes I mean Visit encounter, not visit encounter observation
That is definitely possible, it would however be the responsibility of whoever is running the import to put in a new |
@dubdabasoduba I have imported the records to the preview instance, except for a few with issues
Please review when you have some time |
Context
Implementation
entityType
column on the CSV.flag_problem
- Means it's a product check flagbeneficiary_consultation
- Means it's a consult beneficiaries flagservice_point_check
- This means it's a service point or warehouse check flag.service_point_good_order == No
. Ignore the row if the value isYes
warehouse_required_action
is notnull
.warehouse_required_action == Yes
. Ignore the Row if the value isNo
locationId
column is used to create the Location reference on the Flag or Observation.encounter
property of the Flag.partOf
reference of the Form encounters.Acceptance Criteria
The text was updated successfully, but these errors were encountered: