Skip to content

Commit

Permalink
Finished plandefinition and activity defintion for contraindications.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeaduncan committed Oct 16, 2023
1 parent 24cd625 commit 6f6efcc
Show file tree
Hide file tree
Showing 24 changed files with 379 additions and 33 deletions.
16 changes: 15 additions & 1 deletion input/cql/IMMZCommon.cql
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ define "Patient Has Active Sickle-cell disease":
define "Pregnant Condition":
[Condition] C
where (C.code as CodeableConcept) in Wcon."Pregnancy Status Pregnant"
where (C.code as CodeableConcept) in Wcon."Pregnancy Status Pregnant" or (C.code as CodeableConcept) ~ IMMZc."Currently Pregnant"
define "Pregnant":
exists
Expand Down Expand Up @@ -134,6 +134,20 @@ define "Doses Administered to Patient":
[Immunization] I
where I.status = 'completed'
sort by date from (occurrence as FHIR.dateTime) desc
/**
* Contraindications
*/
define "Severely Immunosuppressed Condition":
[Condition: IMMZc."Severely immunosuppressed"]

define "History of Anaphylactic Reactions Condition":
[Condition: IMMZc."History of anaphylactic reactions"]

define "Severe Allergic Reactions Condition":
[Condition: IMMZc."Severe allergic reactions"]

define "Symptomatic HIV Infection Condition":
[Condition: IMMZc."Symptomatic HIV infection"]


/******************************
Expand Down
9 changes: 9 additions & 0 deletions input/cql/IMMZConcepts.cql
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ codesystem "ICHI": 'https://mitel.dimi.uniud.it/ichi/#http://id.who.int/ichi'
codesystem "ICF": 'http://hl7.org/fhir/sid/icf-nl'
codesystem "Extended Codes CodeSystem codes": 'http://fhir.org/guides/who/anc-cds/CodeSystem/anc-custom-codes'

codesystem "IMMZ.C": 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.C'
codesystem "IMMZ.D1": 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1'
codesystem "IMMZ.D4": 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D4'

//WHO ATC IPS Valueset
valueset "WHO ATC": 'http://hl7.org/fhir/uv/ips/ValueSet/whoatc-uv-ips'

Expand Down Expand Up @@ -44,3 +48,8 @@ valueset "Cholera Vaccine": 'http://smart.who.int/ig/smart-immunizations/ValueSe
code "Adverse Event Severity": '246112005' from "SNOMED-CT" display 'Severity (attribute)'
code "Adverse Event Manifestation": '246112005' from "SNOMED-CT" display 'Severity (attribute)'

code "Currently Pregnant": 'DE161' from "IMMZ.D4" display 'Currently Pregnant'
code "Severely immunosuppressed": 'DE165' from "IMMZ.D4" display 'Severely immunosuppressed'
code "History of anaphylactic reactions": 'DE166' from "IMMZ.D4" display 'History of anaphylactic reactions'
code "Severe allergic reactions": 'DE167' from "IMMZ.D4" display 'Severe allergic reactions'
code "Symptomatic HIV infection": 'DE168' from "IMMZ.D4" display 'Symptomatic HIV infection'
17 changes: 15 additions & 2 deletions input/cql/IMMZD2DTMeasles.cql
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,15 @@ define "Should vaccinate patient for MCV":

define "MCV Dose Contraindicated":
IMMZCom."Pregnant"
or exists(IMMZCom."Severely Immunosuppressed Condition")

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

not("MCV Dose Contraindicated") and (
exists(IMMZCom."History of Anaphylactic Reactions Condition")
or exists(IMMZCom."Severe Allergic Reactions Condition")
or exists(IMMZCom."Symptomatic HIV Infection Condition")
)

/**
* @dataElement MCV containing Doses Administered to Patient
*/
Expand Down Expand Up @@ -221,6 +226,14 @@ define "Supplementary MCV Dose Administered to Patient":
define "Date Supplementary MCV Dose Administered to Patient":
date from ("Supplementary MCV Dose Administered to Patient".occurrence as FHIR.dateTime)


define "Draft Medication Request for MCV dose":
[MedicationRequest] MR where MR.status = 'draft' and MR.intent = 'proposal'
sort by date from (authoredOn as FHIR.dateTime) desc

define "Draft Medication Request ID for MCV dose":
First("Draft Medication Request for MCV dose").id

/*
* Rule: Should vaccinate patient for measles (Supplementary) because no doses
* Annotations:
Expand Down
12 changes: 9 additions & 3 deletions input/fsh/definitions/measles.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ Usage: #definition
* dynamicValue[+]
* path = "id"
* expression
* description = "Draft Medication Request for MCV dose"
* description = "Draft Medication Request ID for MCV dose"
* language = #text/cql-identifier
* expression = "Draft Medication Request for MCV dose"
* expression = "Draft Medication Request ID for MCV dose"

Instance: IMMZD2DTMeaslesEval
InstanceOf: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-servicerequestactivity
Expand All @@ -163,4 +163,10 @@ Usage: #definition
* value = "https://who.int"
* kind = #ServiceRequest
* intent = #proposal
* doNotPerform = false
* doNotPerform = false
* dynamicValue[+]
* path = "code.coding"
* expression
* description = "Measles Code"
* language = #text/cql
* expression = "Code { system: 'http://hl7.org/fhir/sid/icd-11', code: 'XM28X5' }"
1 change: 1 addition & 0 deletions input/maps/IMMZ-D4-LMToResources.fml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ group IMMZD4ToBundle (source immz : IMMZD4, target bundle: Bundle) {
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.clinicalStatus = 'active' "SetStatus";
ci -> condition.code as code then {
ci -> code.coding = ci "SetCoding";
} "SetCode";
Expand Down
4 changes: 2 additions & 2 deletions input/resources/library/FHIRCommon.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions input/resources/library/FHIRHelpers.json

Large diffs are not rendered by default.

82 changes: 79 additions & 3 deletions input/resources/library/IMMZCommon.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions input/resources/library/IMMZCommonIzDataElements.json

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions input/resources/library/IMMZConcepts.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions input/resources/library/IMMZConfig.json

Large diffs are not rendered by default.

80 changes: 77 additions & 3 deletions input/resources/library/IMMZD2DTMeasles.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions input/resources/library/IMMZINDMeasles.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions input/resources/library/IMMZIndicatorCommon.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions input/resources/library/IMMZVaccineLibrary.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions input/resources/library/WHOCommon.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions input/resources/library/WHOConcepts.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"resourceType": "Condition",
"id": "NoVaxeninfant-f-allergic",
"clinicalStatus": "active",
"code": {
"coding": [
{
"code": "DE167",
"system": "http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D4",
"display": "Severe allergic reactions"
}
]
},
"subject": {
"reference": "Patient/IMMZ-Patient-NoVaxeninfant-f-allergic"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"resourceType": "Observation",
"id": "birthweightnormal-NoVaxeninfant-f-allergic",
"status": "final",
"code": {
"coding": [
{
"code": "276610007",
"system": "http://snomed.info/sct",
"display": "Birthweight"
}
]
},
"subject": {
"reference": "Patient/IMMZ-Patient-NoVaxeninfant-f-allergic"
},
"effectiveDateTime": "2023-03-02",
"valueQuantity": {
"value": 2123,
"code": "g",
"system": "http://unitsofmeasure.org",
"unit": "gram"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"resourceType": "Patient",
"id": "IMMZ-Patient-NoVaxeninfant-f-allergic",
"meta": {
"profile": [
"http://worldhealthorganization.github.io/ddcc/StructureDefinition/Patient-uv-ips"
]
},
"name": [
{
"text": "NoVaxeninfant-f-allergic",
"use": "official"
}
],
"birthDate": "2023-03-02",
"gender": "female"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"resourceType": "Condition",
"id": "NoVaxeninfant-f-immunosuppressed",
"clinicalStatus": "active",
"code": {
"coding": [
{
"code": "DE165",
"system": "http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D4",
"display": "Severely immunosuppressed"
}
]
},
"subject": {
"reference": "Patient/IMMZ-Patient-NoVaxeninfant-f-immunosuppressed"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"resourceType": "MedicationRequest",
"id": "MRNoVaxeninfant-f-immunosuppressed",
"meta": {
"profile": [ "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-immunizationrequest" ]
},
"status": "draft",
"intent": "proposal",
"doNotPerform": false,
"medicationCodeableConcept": {
"coding": [ {
"system": "http://hl7.org/fhir/sid/icd-11",
"code": "XM28X5",
"display": "Measles vaccines"
} ]
},
"subject": {
"reference": "Patient/IMMZ-Patient-NoVaxeninfant-f-immunosuppressed"
},
"dispenseRequest": {
"validityPeriod": {
"start": "2024-03-02T00:00:00.000Z"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"resourceType": "Observation",
"id": "birthweightnormal-NoVaxeninfant-f-immunosuppressed",
"status": "final",
"code": {
"coding": [
{
"code": "276610007",
"system": "http://snomed.info/sct",
"display": "Birthweight"
}
]
},
"subject": {
"reference": "Patient/IMMZ-Patient-NoVaxeninfant-f-immunosuppressed"
},
"effectiveDateTime": "2023-03-02",
"valueQuantity": {
"value": 2123,
"code": "g",
"system": "http://unitsofmeasure.org",
"unit": "gram"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"resourceType": "Patient",
"id": "IMMZ-Patient-NoVaxeninfant-f-immunosuppressed",
"meta": {
"profile": [
"http://worldhealthorganization.github.io/ddcc/StructureDefinition/Patient-uv-ips"
]
},
"name": [
{
"text": "NoVaxeninfant-f-immunosuppressed",
"use": "official"
}
],
"birthDate": "2023-03-02",
"gender": "female"
}

0 comments on commit 6f6efcc

Please sign in to comment.