Closed f-odhiambo closed 2 years ago
Here are the links to the ANC StructureMaps
Kindly verify if this is what is in use @dubdabasoduba @maimoonak
Relatedly this will be crucial for the Pregnancy Indicator to work efficiently https://github.com/opensrp/fhir-resources/blob/main/ecbis/measure_cql/pregnancy_measure_reporting.cql
In that CQL, couldn't we look for the pregnancy codable concept instead of looking for the condition?
@maimoonak @f-odhiambo This is the first time I work on StructureMap. I will need sometime to understand how it works. Let me know if there are some other links to quickly understand this.
@pld That's what's actually happening This is the query
define "All ANC": "All Patients" F where F.gender='female'
and [Condition: "Pregnancy code"] O
where O.clinicalStatus ~ "active"
This is the reference code
code "Pregnancy code": '77386006' from "SNOMED" display 'Pregnant'
and looking for the code '77386006' but the human-readable result will be 'Pregnant'
OK I see so the condition is the only way to attach the code to the patient, the code is embedded in the condition.
Then will we not add the Tag?
OK I see so the condition is the only way to attach the code to the patient, the code is embedded in the condition.
Then will we not add the Tag?
@pld I want to strongly say Yes but think that needs a discussion, I think we need to formalise what will/will not use Tags
Cool, yea I guess the question is do we have cases where we are using the Tags to do business logic, because we'll have to migrate those, which may included content that is looking at Tags and will break, but that won't show up in tests.
But just for the sake of argument, could we change that indicator to look for the tag instead of the condition?
Cool, yea I guess the question is do we have cases where we are using the Tags to do business logic, because we'll have to migrate those, which may include content that is looking at Tags and will break, but that won't show up in tests.
But just for the sake of argument, could we change that indicator to look for the tag instead of the condition?
I would argue NO based on
I had a chat w @maimoonak yesterday.
Basically she suggested to separate the current StructureMap and the Pregnancy Condition generation. Because Condition is not part of PlanDefinition.
Hence the Pregnancy Condition generation will be part of a new extraction StructureMap.
Also, I noticed the tag is currently not used in the provided StructureMap. I will add that as well in the new extraction StructureMap.
@dubdabasoduba @f-odhiambo I need a sample of QuestionnaireResponse related to this StructureMap https://github.com/opensrp/fhir-resources/blob/main/ecbis/structure_map/text/new_pregnancy_registration_and_visit.txt
https://github.com/opensrp/fhircore/tree/main/android/engine/src/test/resources/plans/anc-visit .. plz find this in samples dir
@maimoonak @f-odhiambo Let me know if this will work.
map "http://hl7.org/fhir/StructureMap/ANCPregnancy" = "ANCPregnancy"
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireReponse" as source
uses "http://hl7.org/fhir/StructureDefinition/Bundle" as target
group ANCPregnancy(source src : QuestionnaireResponse, target bundle: Bundle) {
src -> bundle.type = "collection" "r_bundle_type";
src -> src.subject as subject, subject.reference as refPatient then
ExtractPregnancyCondition(src, bundle, refPatient) "r_bundle_entries";
}
group ExtractPregnancyCondition(source src : QuestionnaireResponse, target bundle : Bundle, source refPatient : Reference) {
src.item as item_preg where(linkId = "da999955-2174-4219-825e-8ae2b948b7e7" and answer.count() > 0 and answer.value.code = "yes") then {
src -> bundle.entry as entry, entry.resource = create("Condition") as cnd then {
src -> cnd.id = uuid() "r_cnd_id";
src.item as item_lmp_date where(linkId = "245679f2-6172-456e-8ff3-425f5cea3243") then {
src -> cnd.onsetDateTime = evaluate(item_lmp_date, $this.answer.value) "r_cnd_onset_date_val";
} "r_cnd_onset_date";
src -> cnd.clinicalStatus = cc("http://terminology.hl7.org/CodeSystem/condition-clinical", "active") "r_cnd_clinical_st";
src -> cnd.verificationStatus = cc("http://terminology.hl7.org/CodeSystem/condition-ver-status", "confirmed") "r_cnd_verif_st";
src -> cnd.category = cc("http://terminology.hl7.org/CodeSystem/condition-category", "problem-list-item", "Problem List Item") "r_cnd_category";
src -> cnd.subject = refPatient "r_cnd_sub";
src -> cnd.code = create("CodeableConcept") as ccPreg then {
src -> ccPreg.coding = c("http://snomed.info/sct", "77386006", "Pregnancy") "r_cnd_code_coding";
src -> ccPreg.text = "Pregnant" "r_cnd_code_text";
} "r_cnd_code";
} "r_cnd";
} "r_cnd_preg";
}
@FikriMilano the linkid in questionnaire is
"linkId": "da999955-2174-4219-825e-8ae2b948b7e7",
"text": "Was the pregnancy confirmed in a health facility?"
I think we do not need any check for this. If questionnaire is submitted it means patient has to be enrolled into ANC care, irrespective of any other variables. @f-odhiambo
Okay, makes sense.
Other than that, Let me know your feedback as well @f-odhiambo
@f-odhiambo @maimoonak I added the final StructureMap to the server and fhir-resource repo as well https://fhir.labs.smartregister.org/fhir/StructureMap/133813 https://github.com/opensrp/fhir-resources/pull/97
Description Update ANC StructureMap to not only capture pregnancy as a Tag as is currently the case but also create a new Condition of Pregnancy.This will make it more efficient to query Prengnacies and also track its status as using tags will make a patient perpetually pregnant unless updated. We can also track the pregnancy from the Condition + Encounter resource. This is inline to the WHO SMART Guidelines for ANC https://build.fhir.org/ig/WorldHealthOrganization/smart-anc/index.html
This should also be defined as a codable concept using SNOMED i.e.
Sample Condition