Skip to content

Commit

Permalink
First round of QA
Browse files Browse the repository at this point in the history
  • Loading branch information
brynrhodes committed Jun 6, 2024
1 parent cd0ec0f commit f48d943
Show file tree
Hide file tree
Showing 83 changed files with 224 additions and 91 deletions.
8 changes: 7 additions & 1 deletion input/cql/IMMZD2DTMeaslesDose0Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,16 @@ define "MCV0 Status":
else
'Complete'

define "MCV0 Schedule Date":
Patient.birthDate + 6 months

define "MCV0 Expiration Date":
Patient.birthDate + 9 months

define "MCV0 Due Date":
if "MCV0 Status" = 'Needed' then
WC.LatestOf({
Patient.birthDate + 6 months,
"MCV0 Schedule Date",
Logic."Date Last Live Vaccine Administered" + 4 weeks,
Today
})
Expand Down
7 changes: 7 additions & 0 deletions input/cql/IMMZD2DTMeaslesLTLogic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ define "MCV1 Status":
define "MCV1 Schedule Date":
Patient.birthDate + 12 months

define "MCV1 Expiration Date":
Patient.birthDate + 15 months

define "MCV1 Due Date":
if "MCV1 Status" = 'Needed' then
WC.LatestOf({
Expand All @@ -83,6 +86,9 @@ define "MCV2 Status":
define "MCV2 Schedule Date":
Patient.birthDate + 15 months

define "MCV2 Expiration Date":
null as Date

define "MCV2 Due Date":
if "MCV2 Status" = 'Needed' then
WC.LatestOf({
Expand All @@ -92,3 +98,4 @@ define "MCV2 Due Date":
})
else
null

2 changes: 2 additions & 0 deletions input/cql/IMMZD2DTMeaslesLogic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ define "Measles Routine Immunization Schedule Incomplete":
define "Number Of Supplementary Doses Administered":
Count(Elements."MCV Supplementary Dose")

define "Draft Medication Request ID for MCV dose":
Elements."Most Recent MCV Immunization Proposal".id
6 changes: 6 additions & 0 deletions input/cql/IMMZD2DTMeaslesOTLogic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ define "MCV1 Status":
define "MCV1 Schedule Date":
Patient.birthDate + 9 months

define "MCV1 Expiration Date":
Patient.birthDate + 15 months

define "MCV1 Due Date":
if "MCV1 Status" = 'Needed' then
WC.LatestOf({
Expand All @@ -82,6 +85,9 @@ define "MCV2 Status":
define "MCV2 Schedule Date":
Patient.birthDate + 15 months

define "MCV2 Expiration Date":
null as Date

define "MCV2 Due Date":
if "MCV2 Status" = 'Needed' then
WC.LatestOf({
Expand Down
6 changes: 6 additions & 0 deletions input/cql/IMMZD2DTMeaslesSupplementaryLogic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ define "MCV Supplementary Dose Status":
else
'Complete'

define "MCV Supplementary Schedule Date":
null as Date

define "MCV Supplementary Expiration Date":
null as Date

define "MCV Supplementary Dose Due Date":
if "MCV Supplementary Dose Status" = 'Eligible' then
WC.LatestOf({
Expand Down
4 changes: 4 additions & 0 deletions input/cql/IMMZElements.cql
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ define "MCV Dose 0 Dose":
where Protocol.series = 'dose 0'
)

define "MCV Immunization Proposal":
[MedicationRequest: medication in Concepts."MCV Vaccine"] MCV
where MCV.intent = 'proposal'

//TODO: Check patient is alive

// Givens:
Expand Down
7 changes: 7 additions & 0 deletions input/cql/IMMZEncounterElements.cql
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ define "MCV Dose 0 Dose":
Elements."MCV Dose 0 Dose" MCV
where MCV.occurrence.toInterval() on or before Today

define "MCV Immunization Proposal":
Elements."MCV Immunization Proposal" MCV
where MCV.authoredOn on or before Today

define "Most Recent MCV Immunization Proposal":
"MCV Immunization Proposal".mostRecent()

/*
* Contraindications
*/
Expand Down
6 changes: 4 additions & 2 deletions input/cql/IMMZVaccineLibrary.cql
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
library IMMZVaccineLibrary

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'
include fhir.cqf.common.FHIRCommon called FC

include WHOCommon called WCom
include WHOConcepts called Wcon
include FHIRHelpers version '4.0.1'
include FHIRCommon called FC
include IMMZConcepts called IMMZc
include IMMZCommon called IMMZcom

Expand Down
6 changes: 6 additions & 0 deletions input/cql/WHOCommon.cql
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ define fluent function mostRecent(immunizations List<Immunization>):
sort by start of occurrence.toInterval()
)

define fluent function mostRecent(medicationRequests List<MedicationRequest>):
Last(
medicationRequests MR
sort by authoredOn
)

define fluent function lowest(observations List<Observation>):
First(
observations O
Expand Down
4 changes: 2 additions & 2 deletions input/fsh/activitydefinitions/IMMZD2DTMeaslesCIMR.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Title: "IMMZ.D2.DT.Measles.Contraindication"
Description: "Provide measles immunization"
Usage: #definition

* library = "http://smart.who.int/immunizations-measles/Library/IMMZD2DTMeasles"
* library = "http://smart.who.int/immunizations-measles/Library/IMMZD2DTMeaslesLogic"
* extension[+]
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* name = "IMMZD2DTMeaslesContraindication"
* status = #draft
* experimental = false
* experimental = true
* date = 2023-10-03
* publisher = "World Health Organization (WHO)"
* contact[+]
Expand Down
4 changes: 2 additions & 2 deletions input/fsh/activitydefinitions/IMMZD2DTMeaslesEval.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Title: "IMMZ.D2.DT.Measles.Eval"
Description: "Provide measles immunization"
Usage: #definition

* library = "http://smart.who.int/immunizations-measles/Library/IMMZD2DTMeasles"
* library = "http://smart.who.int/immunizations-measles/Library/IMMZD2DTMeaslesLogic"
* extension[+]
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* name = "IMMZD2DTMeaslesContraindicationEvaluation"
* status = #draft
* experimental = false
* experimental = true
* date = 2023-10-03
* publisher = "World Health Organization (WHO)"
* contact[+]
Expand Down
16 changes: 2 additions & 14 deletions input/fsh/activitydefinitions/IMMZD2DTMeaslesMR.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Title: "IMMZ.D2.DT.Measles.MR"
Description: "Provide measles immunization"
Usage: #definition

* library = "http://smart.who.int/immunizations-measles/Library/IMMZD2DTMeasles"
* library = "http://smart.who.int/immunizations-measles/Library/IMMZD2DTMeaslesLogic"
* extension[+]
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* name = "IMMZD2DTMeaslesMedicationRequest"
* status = #draft
* experimental = false
* experimental = true
* date = 2023-10-03
* publisher = "World Health Organization (WHO)"
* contact[+]
Expand All @@ -31,15 +31,3 @@ Usage: #definition
* expression
* language = #text/cql
* expression = "'proposal'"
* dynamicValue[+]
* path = "dispenseRequest.validityPeriod.start"
* expression
* description = "Due date of the dose"
* language = #text/cql-identifier
* expression = "Schedule Due Date for MCV dose"
* dynamicValue[+]
* path = "dispenseRequest.validityPeriod.end"
* expression
* description = "Expiration date for MCV dose"
* language = #text/cql-identifier
* expression = "Expiration Date for MCV dose"
2 changes: 1 addition & 1 deletion input/fsh/actors/CommunityHealthWorker.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Usage: #example
* identifier.value = "CommunityHealthWorker"
* name = "CommunityHealthWorker"
* title = "Community Health Worker"
* experimental = false
* experimental = true
* description = "Community health workers provide health education, referral and follow-up; case management and basic preventive health care; and home visiting services to specific communities. They provide support and assistance to clients by reminding clients to take their vaccinations, responding to emergencies, and reporting births."
2 changes: 1 addition & 1 deletion input/fsh/actors/EPIManager.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Usage: #example
* identifier.value = "EPIM"
* name = "EPIManager"
* title = "Expanded Programme on Immunization (EPI) Manager"
* experimental = false
* experimental = true
* description = "Responsible for: developing annual and multi-annual plans; immunization communication and mobilization; management of logistics, the cold chain, and vaccines; monitoring, supervision and evaluation of immunization services; and coordination of EPI activities at the national and subnational levels."
2 changes: 1 addition & 1 deletion input/fsh/actors/HealthWorker.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Usage: #example
* identifier.value = "HW"
* name = "HealthcareWorker"
* title = "Healthcare Worker"
* experimental = false
* experimental = true
* description = "Health workers facilitate education sessions, administers immunizations, provide counselling when needed, record stock movements, and compiles/generates reports."
2 changes: 1 addition & 1 deletion input/fsh/codesystems/ICD11.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Description: "ICD-11."
* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablecodesystem"
* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablecodesystem"
* ^url = $ICD11
//* ^hierarchyMeaning = #is-a
* ^hierarchyMeaning = #is-a
* ^experimental = true
* ^caseSensitive = true

Expand Down
2 changes: 1 addition & 1 deletion input/fsh/codesystems/IMMZConcepts.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Title: "Immunizations Concepts CodeSystem"
Description: "This code system defines concepts used in SMART Immunizations"
* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablecodesystem"
* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablecodesystem"
* ^experimental = false
* ^experimental = true
* ^caseSensitive = false
* #C.DE1 "Unique identifier" "Unique identifier for the client, according to the policies applicable to each country. There can be more than one unique identifier used to link records (e.g. national ID, health ID, immunization information system ID, medical record ID)."
* #C.DE2 "Name" "The full name of the client"
Expand Down
18 changes: 9 additions & 9 deletions input/fsh/conceptmaps/IMMZConceptsToAdministrativeGender.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ Usage: #definition
* name = "IMMZConceptsToAdministrativeGender"
* title = "ConceptMap to and from Immunization Concepts to administrative gender"
* status = #active
* experimental = false
* experimental = true

* group[+]
* source = Canonical(IMMZConcepts)
* target = $GENDER
* insert ElementMap(DE6, male, equivalent)
* insert ElementMap(DE7, female, equivalent)
* insert ElementMap(DE8, unknown, equivalent)
* insert ElementMap(DE9, other, wider)
* insert ElementMap(C.DE6, male, equivalent)
* insert ElementMap(C.DE7, female, equivalent)
* insert ElementMap(C.DE8, unknown, equivalent)
* insert ElementMap(C.DE9, other, wider)

* group[+]
* source = $GENDER
* target = Canonical(IMMZConcepts)
* insert ElementMap(male, DE6, equivalent)
* insert ElementMap(female, DE7, equivalent)
* insert ElementMap(unknown, DE8, equivalent)
* insert ElementMap(other, DE9, narrower)
* insert ElementMap(male, C.DE6, equivalent)
* insert ElementMap(female, C.DE7, equivalent)
* insert ElementMap(unknown, C.DE8, equivalent)
* insert ElementMap(other, C.DE9, narrower)
* element[=].target[=].comment = "The source concept is more specific than the target"
2 changes: 1 addition & 1 deletion input/fsh/conceptmaps/IMMZConceptsToICD11.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Usage: #definition
* name = "IMMZConceptsToICD11"
* title = "ConceptMap to and from ICD-11"
* status = #active
* experimental = false
* experimental = true

* group[+]
* source = Canonical(IMMZConcepts)
Expand Down
2 changes: 1 addition & 1 deletion input/fsh/conceptmaps/IMMZConceptsToLOINC.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Usage: #definition
* name = "IMMZConceptsToLOINC"
* title = "ConceptMap to and from LOINC"
* status = #active
* experimental = false
* experimental = true

* group[+]
* source = Canonical(IMMZConcepts)
Expand Down
2 changes: 1 addition & 1 deletion input/fsh/conceptmaps/IMMZConceptsToSNOMED.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Usage: #definition
* name = "IMMZConceptsToSNOMED"
* title = "ConceptMap to and from SNOMED"
* status = #active
* experimental = false
* experimental = true

* group[+]
* source = Canonical(IMMZConcepts)
Expand Down
1 change: 1 addition & 0 deletions input/fsh/extensions/SGIMMAdministeredProduct.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Extension: SGIMMAdministeredProduct
Id: sg-ext-administeredProduct
Title: "SGAdministeredProduct"
Description: "The product administered"
* ^experimental = true
* value[x] only Reference(SGVaccineProduct) or CodeableConcept
2 changes: 1 addition & 1 deletion input/fsh/extensions/SGMedicationClassification.fsh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension: SGMedicationClassification
Description: "Medication Classification."
Context: Medication

* ^experimental = true
* value[x] only CodeableConcept
* value[x] from VaccineTypes (required)
2 changes: 1 addition & 1 deletion input/fsh/libraries/IMMZCommon.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Usage: #definition
* valueCode = #computable
* name = "IMMZCommon"
* status = #draft
* experimental = false
* experimental = true
* publisher = "World Health Organization (WHO)"
* type = $library-type#logic-library
* content.id = "ig-loader-IMMZCommon.cql"
2 changes: 1 addition & 1 deletion input/fsh/libraries/IMMZConcepts.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Usage: #definition
* valueCode = #computable
* name = "IMMZConcepts"
* status = #draft
* experimental = false
* experimental = true
* publisher = "World Health Organization (WHO)"
* type = $library-type#logic-library
* content.id = "ig-loader-IMMZConcepts.cql"
2 changes: 1 addition & 1 deletion input/fsh/libraries/IMMZConfig.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Usage: #definition
* valueCode = #computable
* name = "IMMZConfig"
* status = #draft
* experimental = false
* experimental = true
* publisher = "World Health Organization (WHO)"
* type = $library-type#logic-library
* content.id = "ig-loader-IMMZConfig.cql"
2 changes: 1 addition & 1 deletion input/fsh/libraries/IMMZD2DTMeaslesDose0Logic.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Usage: #definition
* valueCode = #computable
* name = "IMMZD2DTMeaslesDose0Logic"
* status = #draft
* experimental = false
* experimental = true
* publisher = "World Health Organization (WHO)"
* type = $library-type#logic-library
* content.id = "ig-loader-IMMZD2DTMeaslesDose0Logic.cql"
2 changes: 1 addition & 1 deletion input/fsh/libraries/IMMZD2DTMeaslesLTLogic.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Usage: #definition
* valueCode = #computable
* name = "IMMZD2DTMeaslesLTLogic"
* status = #draft
* experimental = false
* experimental = true
* publisher = "World Health Organization (WHO)"
* type = $library-type#logic-library
* content.id = "ig-loader-IMMZD2DTMeaslesLTLogic.cql"
2 changes: 1 addition & 1 deletion input/fsh/libraries/IMMZD2DTMeaslesLogic.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Usage: #definition
* valueCode = #computable
* name = "IMMZD2DTMeaslesLogic"
* status = #draft
* experimental = false
* experimental = true
* publisher = "World Health Organization (WHO)"
* type = $library-type#logic-library
* content.id = "ig-loader-IMMZD2DTMeaslesLogic.cql"
2 changes: 1 addition & 1 deletion input/fsh/libraries/IMMZD2DTMeaslesOTLogic.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Usage: #definition
* valueCode = #computable
* name = "IMMZD2DTMeaslesOTLogic"
* status = #draft
* experimental = false
* experimental = true
* publisher = "World Health Organization (WHO)"
* type = $library-type#logic-library
* content.id = "ig-loader-IMMZD2DTMeaslesOTLogic.cql"
2 changes: 1 addition & 1 deletion input/fsh/libraries/IMMZD2DTMeaslesSupplementaryLogic.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Usage: #definition
* valueCode = #computable
* name = "IMMZD2DTMeaslesSupplementaryLogic"
* status = #draft
* experimental = false
* experimental = true
* publisher = "World Health Organization (WHO)"
* type = $library-type#logic-library
* content.id = "ig-loader-IMMZD2DTMeaslesSupplementaryLogic.cql"
Loading

0 comments on commit f48d943

Please sign in to comment.