Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version for FHIRCommon #81

Open
wants to merge 1 commit into
base: cleanup
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions input/cql/IMMZCommon.cql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using FHIR version '4.0.1'
include WHOCommon called WCom
include WHOConcepts called Wcon
include FHIRHelpers version '4.0.1'
include FHIRCommon called FC
include FHIRCommon version '4.0.1' called FC
include IMMZConcepts called IMMZc


Expand Down Expand Up @@ -243,7 +243,9 @@ define function ToDate(choice Choice<FHIR.date, FHIR.string>):
case
when choice is FHIR.date then
choice as FHIR.date
else
when choice is FHIR.string and ConvertsToDate(choice) then
FHIRHelpers.ToDate(choice)
else
Message(null as FHIR.date, true, '1', 'Error', 'Cannot compute a date from a String value')
end

Expand All @@ -254,7 +256,9 @@ define function ToDateTime(choice Choice<FHIR.dateTime, FHIR.string>):
case
when choice is FHIR.dateTime then
choice as FHIR.dateTime
else
when choice is FHIR.string and ConvertsToDateTime(choice) then
FHIRHelpers.ToDateTime(choice)
else
Message(null as FHIR.dateTime, true, '1', 'Error', 'Cannot compute a date from a String value')
end

Expand Down
2 changes: 1 addition & 1 deletion input/cql/IMMZConcepts.cql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ valueset "Positive Result": 'http://smart.who.int/ig/smart-immunizations/ValueSe
valueset "Immunocompromised": 'http://smart.who.int/ig/smart-immunizations/ValueSet/Immunocompromised-values'
valueset "Patient birth weight observation value": 'http://smart.who.int/ig/smart-immunizations/ValueSet/Birthweight-values'
valueset "PretermBirth": 'http://smart.who.int/ig/smart-immunizations/ValueSet/Preterm-values'
valueset "Live Attenuated": 'http://smart.who.int/ig/smart-immunizations/ValueSet/LiveAttenduatedVaccines'
valueset "Live Attenuated": 'http://smart.who.int/ig/smart-immunizations/ValueSet/LiveAttenuatedVaccines'

//valueset "Target Disease": 'http://hl7.org/fhir/ValueSet/immunization-target-disease'

Expand Down
20 changes: 12 additions & 8 deletions input/cql/IMMZD2DTMeasles.cql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include IMMZCommon called IMMZCom
include IMMZConcepts called IMMZc
include IMMZConfig called IMMZCon
include IMMZVaccineLibrary called IMMZvl
include FHIRCommon called FC
include FHIRCommon version '4.0.1' called FC

parameter "Individual is at high risk of contracting measles" Boolean default false
parameter "Individual is travelling to a country experiencing measles outbreaks" Boolean default false
Expand Down Expand Up @@ -74,6 +74,9 @@ define "MCV Next Dose Number":
define "Number of Required MCV Doses":
2

define "Period for MCV dose":
Interval [ "Schedule Due Date for MCV dose", "Expiration Date for MCV dose"]

define "Expiration Date for MCV dose":
//case
//when "Needs Zero MCV Dose"
Expand Down Expand Up @@ -192,28 +195,29 @@ define "Needs Supplementary MCV Dose":
*/
define "First MCV Dose Administered to Patient":
if "High Transmission Setting"
then Last("MCV Doses Administered to Patient" I where I.occurrence after Patient.birthDate + 9 months)
else Last("MCV Doses Administered to Patient" I where I.occurrence after Patient.birthDate + 12 months)
then First("MCV Doses Administered to Patient" I where I.occurrence after Patient.birthDate + 9 months sort by IMMZCom.ToDate(occurrence) desc)
else First("MCV Doses Administered to Patient" I where I.occurrence after Patient.birthDate + 12 months sort by IMMZCom.ToDate(occurrence) desc)
/**
* @dataElement Date first MCV dose administered
*/
define "Date First MCV Dose Administered to Patient":
date from ("First MCV Dose Administered to Patient".occurrence as FHIR.dateTime)
IMMZCom.ToDate("First MCV Dose Administered to Patient".occurrence)

/**
* @dataElement "Second MCV Dose Administered to Patient"
* only valid if 4 weeks after first dose
*/
define "Second MCV Dose Administered to Patient":
Last("MCV Doses Administered to Patient" I
where I.occurrence after "Date First MCV Dose Administered to Patient" + 4 weeks
and I.occurrence after Patient.birthDate + 15 months)
First("MCV Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) after "Date First MCV Dose Administered to Patient" + 4 weeks
and IMMZCom.ToDate(I.occurrence) after Patient.birthDate + 15 months
sort by IMMZCom.ToDate(occurrence) desc)

/**
* @dataElement Date second MCV dose administered
*/
define "Date Second MCV Dose Administered to Patient":
date from ("Second MCV Dose Administered to Patient".occurrence as FHIR.dateTime)
IMMZCom.ToDate("Second MCV Dose Administered to Patient".occurrence)

/**
* @dataElement "Second MCV Dose Administered to Patient"
Expand Down
2 changes: 1 addition & 1 deletion input/cql/IMMZINDMeasles.cql
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ include IMMZConcepts called IMMZc
include IMMZConfig called IMMZCon
include IMMZIndicatorCommon called IMMZIndCom
include IMMZVaccineLibrary called IMMZvl
include FHIRCommon called FC
include FHIRCommon version '4.0.1' called FC
include IMMZD2DTMeasles called Measles
// End Skeleton CQL
parameter "Measurement Period" Interval<Date>
Expand Down
2 changes: 1 addition & 1 deletion input/cql/IMMZIndicatorCommon.cql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ library IMMZIndicatorCommon
using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'
include FHIRCommon called FC
include FHIRCommon version '4.0.1' called FC
include IMMZCommon called IMMZCom
include IMMZConcepts called IMMZc
include WHOCommon called WCom
Expand Down
2 changes: 1 addition & 1 deletion input/cql/IMMZVaccineLibrary.cql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using FHIR version '4.0.1'
include WHOCommon called WCom
include WHOConcepts called Wcon
include FHIRHelpers version '4.0.1'
include FHIRCommon called FC
include FHIRCommon version '4.0.1' called FC
include IMMZConcepts called IMMZc
include IMMZCommon called IMMZcom

Expand Down
2 changes: 1 addition & 1 deletion input/cql/WHOCommon.cql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'

include FHIRCommon called FC
include FHIRCommon version '4.0.1' called FC

context Patient

Expand Down
7 changes: 7 additions & 0 deletions input/resources/library/FHIRCommon.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
"url": "http://smart.who.int/ig/smart-immunizations/Library/FHIRCommon",
"version": "4.0.1",
"name": "FHIRCommon",
"status": "active",
"type": {
"coding": [ {
"system": "http://hl7.org/fhir/ValueSet/library-type",
"code": "logic-library"
} ]
},
"relatedArtifact": [ {
"type": "depends-on",
"display": "FHIR model information",
Expand Down
7 changes: 7 additions & 0 deletions input/resources/library/FHIRHelpers.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
"url": "http://hl7.org/fhir/Library/FHIRHelpers",
"version": "4.0.1",
"name": "FHIRHelpers",
"status": "active",
"type": {
"coding": [ {
"system": "http://hl7.org/fhir/ValueSet/library-type",
"code": "logic-library"
} ]
},
"relatedArtifact": [ {
"type": "depends-on",
"display": "FHIR model information",
Expand Down
17 changes: 12 additions & 5 deletions input/resources/library/IMMZCommon.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions input/resources/library/IMMZCommonIzDataElements.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
} ],
"url": "http://smart.who.int/ig/smart-immunizations/Library/IMMZCommonIzDataElements",
"name": "IMMZCommonIzDataElements",
"status": "active",
"type": {
"coding": [ {
"system": "http://hl7.org/fhir/ValueSet/library-type",
"code": "logic-library"
} ]
},
"relatedArtifact": [ {
"type": "depends-on",
"display": "FHIR model information",
Expand Down
15 changes: 11 additions & 4 deletions input/resources/library/IMMZConcepts.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions input/resources/library/IMMZConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
} ],
"url": "http://smart.who.int/ig/smart-immunizations/Library/IMMZConfig",
"name": "IMMZConfig",
"status": "active",
"type": {
"coding": [ {
"system": "http://hl7.org/fhir/ValueSet/library-type",
"code": "logic-library"
} ]
},
"relatedArtifact": [ {
"type": "depends-on",
"display": "FHIR model information",
Expand Down
21 changes: 17 additions & 4 deletions input/resources/library/IMMZD2DTMeasles.json

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions input/resources/library/WHOConcepts.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
} ],
"url": "http://smart.who.int/ig/smart-immunizations/Library/WHOConcepts",
"name": "WHOConcepts",
"status": "active",
"type": {
"coding": [ {
"system": "http://hl7.org/fhir/ValueSet/library-type",
"code": "logic-library"
} ]
},
"relatedArtifact": [ {
"type": "depends-on",
"display": "Code system ICD-10",
Expand Down