Skip to content

Commit

Permalink
Fixed issues with language type in measures and plandefs f9r CQL expr…
Browse files Browse the repository at this point in the history
…essions. Added indicator codesystem and valuesets to use those codes for stratifiers for measures.
  • Loading branch information
lukeaduncan committed Apr 1, 2024
1 parent ced13b3 commit adc1450
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 18 deletions.
36 changes: 36 additions & 0 deletions input/fsh/codesystems/IMMZ.I.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
CodeSystem: IMMZ.I
Title: "IMMZ.I CodeSystem for Data Elements"
Description: "CodeSystem for IMMZ.I Data Elements"

* ^experimental = false
* ^caseSensitive = false
* ^name = "IMMZ_I"
* ^status = #active

* #DE18 "Report subject area" "Location (vaccination location or place) for which the data in the report is being represented"
* #DE20 "Reporting period start date" "The start date of the reporting period for which data in the report has been included"
* #DE21 "Reporting period end date" "The end date of the reporting period for which data in the report has been included"
* #DE30 "Disaggregation group" "Indicates the overall strata or disaggregation which is being represented in the report (e.g. by gender, by region, by age group, etc.)"
* #DE31 "By-Sex" "A disaggregation grouped by the indicator population's sex values"
* #DE32 "By-Administrative Area" "A disaggregation grouped by the indicator population's administrative regions/ areas"
* #DE33 "By-Age group" "A disaggregation grouped by the indicator population's age groups"
* #DE34 "By-Dose number" "A disaggregation grouped by the indicator population's dose numbers for a specific vaccine"
* #DE35 "By-Vaccine type" "A disaggregation grouped by the indicator population's vaccine types"
* #DE36 "By-Vaccine manufacturer" "A disaggregation grouped by the indicator population's vaccine manufacturers for a specific vaccine"
* #DE37 "By-Reaction manifestation" "A disaggregation grouped by the indicator population's reaction manifestations for a specific vaccine"
* #DE39 "By-Type of reaction" "A disaggregation grouped by the indicator population's type of reaction for a specific vaccine"
* #DE54 "By-Risk & occupational group" "A disaggregation grouped by the indicator population's risk and occupational group"
* #DE40 "Number of doses per vial" "The number of doses contained within a vial"
* #DE41 "Initial balance" "The initial quantity of vials in stock at the beginning of a specific reporting period"
* #DE42 "Closing balance" "The quantity of vials in stock at the end of a specific reporting period"
* #DE43 "Administered doses" "The quantity of vials that have been administered to clients, during a specified time frame"
* #DE44 "Stock opened" "The quantity of vials that were opened, during a specific period"
* #DE45 "Stock received" "The quantity of vials that have been received from external sources, such as suppliers, during a specific period"
* #DE46 "Physical count adjustment" "An adjustment made to the stock level to correct discrepancies between the recorded inventory and the actual physical count. This may be necessary due to errors, theft, or other discrepancies."
* #DE47 "Closed stock discarded" "The quantity of vials that were not opened and have been wasted or discarded due to expiration or other reasons, during a specific period"
* #DE48 "Closed stock discarded type" "Specific reason for the disposal of vaccine"
* #DE49 "Broken/ Damaged" "The vaccine is physically damaged or broken, rendering it unsuitable for use."
* #DE50 "Expired product " "The vaccine has reached its expiration date and is no longer safe or effective for use."
* #DE51 "Cold storage malfunction" "There has been a malfunction or failure in the cold storage equipment, which has led to the degradation of the vaccine."
* #DE52 "Vaccine vial monitor status change" "The vaccine vial monitor has indicated a change in status, possibly indicating that the vaccines may no longer be viable."
* #DE53 "Frozen" "Vaccine has been exposed to freezing temperatures, making it unsuitable for use as freezing can affect the integrity and efficacy of certain immunization products."
19 changes: 10 additions & 9 deletions input/fsh/measures/IMMZINDrulesets.fsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
RuleSet: Stratifier( idprefix, count )
RuleSet: Stratifier( idprefix, count, code )
* stratifier[+]
* id = "{idprefix}.S{count}"
* criteria.language = #text/cql
* code = {code}
* criteria.language = #text/cql-identifier
* criteria.expression = "Stratification {count}"

RuleSet: MeasureProportion( description, library, version, date, idprefix)
Expand All @@ -21,23 +22,23 @@ RuleSet: MeasureProportion( description, library, version, date, idprefix)
* id = "{idprefix}.IP"
* description = "Initial Population"
* code = $measure-population#initial-population "Initial Population"
* criteria.language = #text/cql
* criteria.language = #text/cql-identifier
* criteria.expression = "Initial Population"
* population[denominator]
* extension[http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis].valueCode = #boolean
* id = "{idprefix}.D"
* description = "Denominator"
* code = $measure-population#denominator "Denominator"
* criteria.language = #text/cql
* criteria.language = #text/cql-identifier
* criteria.expression = "Denominator"
* population[numerator]
* extension[http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis].valueCode = #boolean
* id = "{idprefix}.N"
* description = "Numerator"
* code = $measure-population#numerator "Numerator"
* criteria.language = #text/cql
* criteria.language = #text/cql-identifier
* criteria.expression = "Numerator"
* insert Stratifier( {idprefix}, 1 )
* insert Stratifier( {idprefix}, 2 )
* insert Stratifier( {idprefix}, 3 )
* insert Stratifier( {idprefix}, 4 )
* insert Stratifier( {idprefix}, 1, IMMZ.I#DE32 "By-Administrative Area" )
* insert Stratifier( {idprefix}, 2, IMMZ.I#DE31 "By-Sex" )
* insert Stratifier( {idprefix}, 3, IMMZ.I#DE33 "By-Age group" )
* insert Stratifier( {idprefix}, 4, IMMZ.I#DE33 "By-Age group" )
14 changes: 7 additions & 7 deletions input/fsh/plandefinitions/IMMZPDrulesets.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ RuleSet: PlanDefMedicationRequestAction( title, description, condition, library
* dynamicValue[+]
* path = "status"
* expression
* language = #text/cql
* language = #text/cql-expression
* expression = "'draft'"
* dynamicValue[+]
* path = "intent"
* expression
* language = #text/cql
* language = #text/cql-expression
* expression = "'proposal'"

RuleSet: PlanDefMedicationRequestUpdate( title, description, condition, library, mrid )
Expand Down Expand Up @@ -66,7 +66,7 @@ RuleSet: PlanDefCommunicationRequestAction( title, description, condition, text
* dynamicValue[+]
* path = "status"
* expression
* language = #text/cql
* language = #text/cql-expression
* expression = "'active'"
* dynamicValue[+]
* path = "payload.contentAttachment.title"
Expand All @@ -76,22 +76,22 @@ RuleSet: PlanDefCommunicationRequestAction( title, description, condition, text
* dynamicValue[+]
* path = "payload.contentAttachment.language"
* expression
* language = #text/cql
* language = #text/cql-expression
* expression = "'en-US'"
* dynamicValue[+]
* path = "payload.contentAttachment.contentType"
* expression
* language = #text/cql
* language = #text/cql-expression
* expression = "'text/plain'"
* dynamicValue[+]
* path = "category.coding"
* expression
* description = "Category of communication"
* language = #text/cql
* language = #text/cql-expression
* expression = "Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }"
* dynamicValue[+]
* path = "priority"
* expression
* description = "Alert priority"
* language = #text/cql
* language = #text/cql-expression
* expression = "Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }"
16 changes: 16 additions & 0 deletions input/fsh/valuesets/IMMZ.I.DE30.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ValueSet: IMMZ.I.DE30
Title: "IMMZ.I.DE30 ValueSet for Disaggregation group"
Description: "ValueSet for Disaggregation group for IMMZ.I.DE30"

* ^status = #active
* ^name = "IMMZ_I_DE30"

* IMMZ.I#DE31 "By-Sex"
* IMMZ.I#DE32 "By-Administrative Area"
* IMMZ.I#DE33 "By-Age group"
* IMMZ.I#DE34 "By-Dose number"
* IMMZ.I#DE35 "By-Vaccine type"
* IMMZ.I#DE36 "By-Vaccine manufacturer"
* IMMZ.I#DE37 "By-Reaction manifestation"
* IMMZ.I#DE39 "By-Type of reaction"
* IMMZ.I#DE54 "By-Risk & occupational group"
12 changes: 12 additions & 0 deletions input/fsh/valuesets/IMMZ.I.DE48.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ValueSet: IMMZ.I.DE48
Title: "IMMZ.I.DE48 ValueSet for Closed stock discarded type"
Description: "ValueSet for Closed stock discarded type for IMMZ.I.DE48"

* ^status = #active
* ^name = "IMMZ_I_DE48"

* IMMZ.I#DE49 "Broken/ Damaged"
* IMMZ.I#DE50 "Expired product "
* IMMZ.I#DE51 "Cold storage malfunction"
* IMMZ.I#DE52 "Vaccine vial monitor status change"
* IMMZ.I#DE53 "Frozen"
5 changes: 3 additions & 2 deletions tools/node/makeCodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ const csv = require('@fast-csv/parse')
const fs = require('fs')

//const csvFile = 'Annex A IMZ DAK Data Dictionary 20230810.csv'
const csvFile = '01.Annex A_IMMZ DAK_Core Data Dictionary (20240116) D1.csv'
//const csvFile = '01.Annex A_IMMZ DAK_Core Data Dictionary (20240116) D1.csv'
const csvFile = '01 IMMZ.I.csv'

let codesystems = {}
let conceptmaps = {}
Expand Down Expand Up @@ -31,7 +32,7 @@ fs.createReadStream(csvFile)
let dataelement = info[4]
if ( !codesystems[codesystem] ) {
codesystems[codesystem] = "CodeSystem: "+codesystem+"\nTitle: \""+codesystem+" CodeSystem for Data Elements\"\nDescription: \"CodeSystem for "+codesystem
+" Data Elements\"\n\n* ^experimental = false\n* ^caseSensitive = false\n* ^name = \""+csName+"\"\n\n"
+" Data Elements\"\n\n* ^experimental = false\n* ^caseSensitive = false\n* ^name = \""+csName+"\"\n* ^status = #active\n\n"
conceptmaps[codesystem] = {}
conceptmaps[codesystem].header = "Instance: "+codesystem+".ConceptMap\nInstanceOf: ConceptMap\nDescription: \"Mapping to and from "+codesystem+" Data Dictionary to other codesystems.\"\nUsage: #definition\n\n"
conceptmaps[codesystem].header += "* name = \""+csName+"_ConceptMap\"\n* title = \"ConceptMap to and from "+codesystem+" DataElements\"\n* status = #active\n* experimental = false\n* date = \"2024-01-19\"\n\n"
Expand Down

0 comments on commit adc1450

Please sign in to comment.