Skip to content

Commit

Permalink
Added in logical model/questionnaire for check contraindications. Add…
Browse files Browse the repository at this point in the history
…ed template for plan and activity defs for contraindications, but the CQL still needs to be completed.
  • Loading branch information
lukeaduncan committed Oct 12, 2023
1 parent c77bad6 commit f6fe9a8
Show file tree
Hide file tree
Showing 12 changed files with 301 additions and 34 deletions.
3 changes: 3 additions & 0 deletions input/cql/IMMZD2DTMeasles.cql
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ define "Should vaccinate patient for MCV":
define "MCV Dose Contraindicated":
IMMZCom."Pregnant"

define "Contraindication Evaluation of the MCV dose":
IMMZCom."Pregnant"

/**
* @dataElement MCV containing Doses Administered to Patient
*/
Expand Down
97 changes: 95 additions & 2 deletions input/fsh/definitions/measles.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Usage: #definition
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* version = "0.1.0"
* name = "IMMZD2DTMeaslesMR"
* name = "IMMZD2DTMeaslesMedicationRequest"
* status = #draft
* experimental = false
* date = 2023-10-03
Expand Down Expand Up @@ -70,4 +70,97 @@ Usage: #definition
* expression
* description = "Expiration date for MCV dose"
* language = #text/cql-identifier
* expression = "Expiration Date for MCV dose"
* expression = "Expiration Date for MCV dose"


Instance: IMMZD2DTMeaslesCI
InstanceOf: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-recommendationdefinition
Title: "IMMZ.D2.DT.Measles.Contraindication"
Description: "Check contraindications for Measles vaccine"
Usage: #definition

* library = "http://fhir.org/guides/who/smart-immunization/Library/IMMZD2DTMeasles"
* extension[+]
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* version = "0.1.0"
* name = "IMMZD2DTMeaslesContraindication"
* status = #draft
* experimental = false
* publisher = "World Health Organization (WHO)"
* action[+]
* title = "Check Contraindication for Measles Immunization"
* description = "Contraindication for measles immunization"
* type = #update
* condition[+]
* kind = #applicability
* expression
* description = "MCV Dose Contraindicated"
* language = #text/cql-identifier
* expression = "MCV Dose Contraindicated"
* definitionCanonical = Canonical(IMMZD2DTMeaslesCIMR)
* action[+]
* title = "Evaluate Contraindication for Measles"
* description = "Provide further evaluation for measles contraindication"
* condition[+]
* kind = #applicability
* expression
* description = "Contraindication Evaluation of the MCV dose"
* language = #text/cql-identifier
* expression = "Contraindication Evaluation of the MCV dose"
* definitionCanonical = Canonical(IMMZD2DTMeaslesEval)

Instance: IMMZD2DTMeaslesCIMR
InstanceOf: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-immunizationactivity
Title: "IMMZ.D2.DT.Measles.Contraindication"
Description: "Provide measles immunization"
Usage: #definition

* library = "http://fhir.org/guides/who/smart-immunization/Library/IMMZD2DTMeasles"
* extension[+]
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* version = "0.1.0"
* name = "IMMZD2DTMeaslesContraindication"
* status = #draft
* experimental = false
* date = 2023-10-03
* publisher = "World Health Organization (WHO)"
* contact[+]
* telecom[+]
* system = #url
* value = "https://who.int"
* kind = #MedicationRequest
* intent = #proposal
* doNotPerform = true
* productCodeableConcept = $ICD11#XM28X5 "Measles vaccines"
* dynamicValue[+]
* path = "id"
* expression
* description = "Draft Medication Request for MCV dose"
* language = #text/cql-identifier
* expression = "Draft Medication Request for MCV dose"

Instance: IMMZD2DTMeaslesEval
InstanceOf: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-servicerequestactivity
Title: "IMMZ.D2.DT.Measles.Eval"
Description: "Provide measles immunization"
Usage: #definition

* library = "http://fhir.org/guides/who/smart-immunization/Library/IMMZD2DTMeasles"
* extension[+]
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* version = "0.1.0"
* name = "IMMZD2DTMeaslesContraindicationEvaluation"
* status = #draft
* experimental = false
* date = 2023-10-03
* publisher = "World Health Organization (WHO)"
* contact[+]
* telecom[+]
* system = #url
* value = "https://who.int"
* kind = #ServiceRequest
* intent = #proposal
* doNotPerform = false
64 changes: 64 additions & 0 deletions input/fsh/examples/IMMZ.D4.QuestionnaireResponse.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Instance: Example.IMMZ.D4.QuestionnaireResponse.1
InstanceOf: QuestionnaireResponse
Usage: #example
* status = #completed
* authored = "2023-10-11"
* questionnaire = Canonical(Questionnaire-IMMZD4CheckContraindications)
* subject = Reference(patient123456)

* item[+]
* linkId = "contraindications"
* text = "Contraindications"
* answer.valueCoding = IMMZ.D4#DE162 "Currently pregnant"


Instance: Example.IMMZ.D4.QuestionnaireResponse.2
InstanceOf: QuestionnaireResponse
Usage: #example
* status = #completed
* authored = "2023-10-11"
* questionnaire = Canonical(Questionnaire-IMMZD4CheckContraindications)
* subject = Reference(patient123456)

* item[+]
* linkId = "contraindications"
* text = "Contraindications"
* answer.valueCoding = IMMZ.D4#DE165 "Severely immunosuppressed"

Instance: Example.IMMZ.D4.QuestionnaireResponse.3
InstanceOf: QuestionnaireResponse
Usage: #example
* status = #completed
* authored = "2023-10-11"
* questionnaire = Canonical(Questionnaire-IMMZD4CheckContraindications)
* subject = Reference(patient123456)

* item[+]
* linkId = "contraindications"
* text = "Contraindications"
* answer.valueCoding = IMMZ.D4#DE167 "Severe allergic reactions"

Instance: Example.IMMZ.D4.QuestionnaireResponse.4
InstanceOf: QuestionnaireResponse
Usage: #example
* status = #completed
* authored = "2023-10-11"
* questionnaire = Canonical(Questionnaire-IMMZD4CheckContraindications)
* subject = Reference(patient123456)

* item[+]
* linkId = "contraindications"
* text = "Contraindications"
* answer.valueCoding = IMMZ.D4#DE162 "Currently pregnant"
* item[+]
* linkId = "contraindications"
* text = "Contraindications"
* answer.valueCoding = IMMZ.D4#DE167 "Severe allergic reactions"
* item[+]
* linkId = "contraindications"
* text = "Contraindications"
* answer.valueCoding = IMMZ.D4#DE168 "Symptomatic HIV infection"
* item[+]
* linkId = "contraindications"
* text = "Contraindications"
* answer.valueCoding = IMMZ.D4#DE165 "Severely immunosuppressed"
12 changes: 12 additions & 0 deletions input/fsh/examples/ex-patient.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Instance: patient123456
InstanceOf: Patient
Usage: #example

* id = "P123456"
* identifier.value = "123456"
* name[+]
* text = "Test Patient"
* family = "Patient"
* given = "Test"
* gender = #male
* birthDate = "1993-08-12"
2 changes: 1 addition & 1 deletion input/fsh/models/logical-IMMZ.D1.measles.fsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Logical: IMMZ-D1-client-history-measles
Logical: IMMZD1ClientHistoryMeasles
Title: "IMMZ.D1 Capture Client History for Measles"
Description: "Data elements for the IMMZ.D1 Capture Client History Data Dictionary for Measles."

Expand Down
5 changes: 3 additions & 2 deletions input/fsh/models/logical-IMMZ.D4.measles.fsh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Logical: IMMZ-D4-check-contraindications
Logical: IMMZD4CheckContraindications
Title: "IMMZ.D4 Check Contraindications for Measles"
Description: "Data elements for the IMMZ.D4 Check Contraindications Data Dictionary for Measles."

* ^name = "IMMZ_D4_Check_Contraindications_Measles"

* contraindications 0..* Coding "Potential contraindications" "Specific situations or medical conditions in which it is advised or recommended to avoid or delay administering a particular vaccine"
* patient 1..1 Reference "Patient" "The patient who is being checked for contraindications."
* contraindications 0..* Coding "Potential contraindications" "Specific situations or medical conditions in which it is advised or recommended to avoid or delay administering a particular vaccine."
* ^code[+] = IMMZ.D4#DE161
* contraindications from IMMZ.D4.DE161

18 changes: 18 additions & 0 deletions input/maps/IMMZ-D4-LMToResources.fml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
map "http://fhir.org/guides/who/smart-immunization/StructureMap/IMMZD4LMToResources" = "IMMZD4LMToResources"

uses "http://fhir.org/guides/who/smart-immunization/StructureDefinition/IMMZD4CheckContraindications" alias IMMZD4 as source
uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target

group IMMZD4ToBundle (source immz : IMMZD4, target bundle: Bundle) {
immz -> bundle.type = 'collection' "SetCollection";

immz.patient as patient then {
immz.contraindications as ci -> bundle.entry as entry, entry.resource = create('Condition') as condition then {
patient -> condition.subject = patient "SetPatient";
ci -> condition.code as code then {
ci -> code.coding = ci "SetCoding";
} "SetCode";
} "SetCondition";
} "GetPatient";

}
20 changes: 20 additions & 0 deletions input/maps/IMMZ-D4-QRToLM.fml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
map "http://fhir.org/guides/who/smart-immunization/StructureMap/IMMZD4QRToLM" = "IMMZD4QRToLM"

uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source
uses "http://fhir.org/guides/who/smart-immunization/StructureDefinition/IMMZD4CheckContraindications" alias IMMZD4 as target

group QRespToIMMZD4 ( source qr : QResp, target immz : IMMZD4) {

qr.subject as patient -> immz.patient = patient "SetPatient";

qr.item as item then {



item.answer as answer where item.linkId = 'contraindications' then {
answer.value as content -> immz.contraindications = content "SetContraindication";
} "SetContraindicationAnswer";

} "processItems";
}

19 changes: 19 additions & 0 deletions input/maps/IMMZ-D4-QRToResources.fml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
map "http://fhir.org/guides/who/smart-immunization/StructureMap/IMMZD4QRToResources" = "IMMZD4QRToResources"

uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source
uses "http://fhir.org/guides/who/smart-immunization/StructureDefinition/IMMZD4CheckContraindications" alias IMMZD4 as source
uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target

imports "http://fhir.org/guides/who/smart-immunization/StructureMap/IMMZD4QRToLM"
imports "http://fhir.org/guides/who/smart-immunization/StructureMap/IMMZD4LMToResources"

group QRespToBundle (
source qr : QResp,
target bundle: Bundle
) {
qr -> create("http://fhir.org/guides/who/smart-immunization/StructureDefinition/IMMZD4CheckContraindications") as model
then{
qr -> model then QRespToIMMZD4( qr, model) "QRtoLM";
qr -> bundle then IMMZD4ToBundle( model, bundle ) "LMtoBundle";
} "QRtoBundle";
}
50 changes: 25 additions & 25 deletions input/resources/library/IMMZD2DTMeasles.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions input/resources/library/IMMZINDMeasles.json

Large diffs are not rendered by default.

39 changes: 38 additions & 1 deletion tools/maps.http
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,41 @@ POST {{host}}/StructureMap/$transform?source=http://fhir.org/guides/who/smart-im
Accept: application/fhir+json;fhirVersion=4.0
Content-Type: application/fhir+json;fhirVersion=4.0

< ../output/QuestionnaireResponse-Example.IMMZ.C.QuestionnaireResponse.1.json
< ../output/QuestionnaireResponse-Example.IMMZ.C.QuestionnaireResponse.1.json



### Post the StructureMap for Contraindications with transform included
PUT {{host}}/StructureMap/IMMZD4QRToLM HTTP/1.1
Accept: application/fhir+json;fhirVersion=4.0
Content-Type: text/fhir-mapping

< ../input/maps/IMMZ-D4-QRToLM.fml

### Test Transform of QR to LM
POST {{host}}/StructureMap/$transform?source=http://fhir.org/guides/who/smart-immunization/StructureMap/IMMZD4QRToLM
Accept: application/fhir+json;fhirVersion=4.0
Content-Type: application/fhir+json;fhirVersion=4.0

< ../fsh-generated/resources/QuestionnaireResponse-Example.IMMZ.D4.QuestionnaireResponse.4.json

### Post the StructureMap for Contraindications with transform included
PUT {{host}}/StructureMap/IMMZD4LMToResources HTTP/1.1
Accept: application/fhir+json;fhirVersion=4.0
Content-Type: text/fhir-mapping

< ../input/maps/IMMZ-D4-LMToResources.fml

### Post the StructureMap for Contraindications with transform included
PUT {{host}}/StructureMap/IMMZD4QRToResources HTTP/1.1
Accept: application/fhir+json;fhirVersion=4.0
Content-Type: text/fhir-mapping

< ../input/maps/IMMZ-D4-QRToResources.fml

### Test Transform of QR to Bundle
POST {{host}}/StructureMap/$transform?source=http://fhir.org/guides/who/smart-immunization/StructureMap/IMMZD4QRToResources
Accept: application/fhir+json;fhirVersion=4.0
Content-Type: application/fhir+json;fhirVersion=4.0

< ../fsh-generated/resources/QuestionnaireResponse-Example.IMMZ.D4.QuestionnaireResponse.4.json

0 comments on commit f6fe9a8

Please sign in to comment.