| IMMZIND45 |
| IMMZIND45 |
| Draft |
| false |
IMMZ.IND.45 Immunization session completion rate
|
| WHO |
| WHO: http://who.int |
| 1.0.0 |
| Proportion |
ID: IMMZ.IND.45.IP
Description:
Initial Population
Logic Definition: Initial Population
|
ID: IMMZ.IND.45.D
Description:
Denominator
Logic Definition: Denominator
|
ID: IMMZ.IND.45.N
Description:
Numerator
Logic Definition: Numerator
|
ID: {idprefix}.S1
Code: By-Administrative Area
|
ID: {idprefix}.S2
Code: By-Administrative Area
|
| boolean |
| IMMZIND45Logic |
Description: FHIR model information
Resource: http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
Canonical URL: http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
|
Description: Library WC
Resource: WHOCommon
Canonical URL: http://smart.who.int/immunizations/Library/WHOCommon
|
Description: Library FHIRHelpers
Resource: http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1
Canonical URL: http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1
|
Description: Library Elements
Resource: http://smart.who.int/immunizations/Library/IMMZIndicatorElements
Canonical URL: http://smart.who.int/immunizations/Library/IMMZIndicatorElements
|
Name: Measurement Period
Use: In
Min Cardinality: 0
Max Cardinality: 1
Type: Period
|
Name: Numerator
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
|
Name: Stratification 2
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: string
|
Name: Stratification 1
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: string
|
Name: Denominator
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
|
Name: Initial Population
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
|
Type: Immunization
Profile(s):
Immunization
Must Support Elements: occurrence, status, location
|
Type: Patient
Profile(s):
Patient
Must Support Elements: birthDate
|
Type: Resource
Profile(s):
Resource
Must Support Elements: id
|
Type: Location
Profile(s):
Location
Must Support Elements: address, address.state, name
|
| Library Name: IMMZIND45Logic |
/*
* As defined by Member State
*/
define "Initial Population":
Immunization.occurrence is not null
and Immunization.occurrence.toInterval() starts during "Measurement Period"
|
| Library Name: IMMZIND45Logic |
/*
@denominator: Number of planned immunization sessions at the vaccination location during the reporting period
@pseudocode: COUNT number of planned sessions during the reporting period
*/
define "Denominator":
"Initial Population"
|
| Library Name: IMMZIND45Logic |
/*
@numerator: Number of immunization sessions completed at the vaccination location during the reporting period
@pseudocode: COUNT of immunization events WHERE "Immunization event status" = "Completed" during the reporting period
*/
define "Numerator":
"Denominator"
and Immunization.status = 'completed'
|
| Library Name: IMMZIND45Logic |
define "Stratification 2":
Elements.GetGeographicRegionForImmunization( Immunization )
|
| Library Name: IMMZIND45Logic |
/*
@disaggregation: Vaccination location
Administrative area
*/
define "Stratification 1":
Elements.GetLocationNameForImmunization( Immunization )
|
| Library Name: WHOCommon |
/*
From FHIRCommon 4.1.0:
*/
/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types
to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
representations for timing-valued elements in FHIR, allowing this function to be used across any resource.
The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.
The intent of this function is to provide a clear and concise mechanism to treat single
elements that have multiple possible representations as intervals so that logic doesn't have to account
for the variability. More complex calculations (such as medication request period or dispense period
calculation) need specific guidance and consideration. That guidance may make use of this function, but
the focus of this function is on single element calculations where the semantics are unambiguous.
If the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.
If the input is a Period, the result is a DateTime Interval.
If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.
If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.
If the input is a string, an error is raised indicating a single interval cannot be computed from a string.
If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,
and ending immediately prior to when the patient was the given Age plus one year.
If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given
by the low end of the Range, and ending immediately prior to when the patient was the Age given by the
high end of the Range plus one year.
NOTE: Due to the
complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
with a Timing or String.
*/
define fluent function toInterval(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):
case
when choice is FHIR.dateTime then
Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
when choice is FHIR.Period then
FHIRHelpers.ToInterval(choice as FHIR.Period)
when choice is FHIR.instant then
Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
when choice is FHIR.Age then
Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
when choice is FHIR.Range then
Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
when choice is FHIR.Timing then
Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')
when choice is FHIR.string then
Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
else
null as Interval<DateTime>
end
|
| Library Name: FHIRHelpers |
define function ToDateTime(value dateTime): value.value
|
| Library Name: FHIRHelpers |
define function ToInterval(period FHIR.Period):
if period is null then
null
else
if period."start" is null then
Interval(period."start".value, period."end".value]
else
Interval[period."start".value, period."end".value]
|
| Library Name: FHIRHelpers |
define function ToDateTime(value instant): value.value
|
| Library Name: FHIRHelpers |
define function ToDate(value date): value.value
|
| Library Name: FHIRHelpers |
define function ToQuantity(quantity FHIR.Quantity):
case
when quantity is null then null
when quantity.value is null then null
when quantity.comparator is not null then
Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
else
Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')
end
|
| Library Name: FHIRHelpers |
define function ToCalendarUnit(unit System.String):
case unit
when 'ms' then 'millisecond'
when 's' then 'second'
when 'min' then 'minute'
when 'h' then 'hour'
when 'd' then 'day'
when 'wk' then 'week'
when 'mo' then 'month'
when 'a' then 'year'
else unit
end
|
| Library Name: FHIRHelpers |
define function ToString(value ImmunizationStatus): value.value
|
| Library Name: IMMZIndicatorElements |
/**
* @function
* @param immunization The immunization record for which the location should be retrieved
* @return FHIR.address The location that the immunization event occurred
*/
define function GetGeographicRegionForImmunization(immunization Immunization):
(
[Location] L
where immunization.location.references(L)
).only().address.state
|
| Library Name: WHOCommon |
define fluent function only(locations List<Location>):
singleton from locations
|
| Library Name: WHOCommon |
/*
@description: Returns true if the given reference is to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(reference FHIR.Reference, resource FHIR.Resource):
resource.id = Last(Split(reference.reference, '/'))
|
| Library Name: FHIRHelpers |
define function ToString(value string): value.value
|
| Library Name: IMMZIndicatorElements |
/**
* @function
* @param immunization The immunization record for which the location should be retrieved
* @return FHIR.name The name of the location that the immunization event occurred
*/
define function GetLocationNameForImmunization(immunization Immunization):
(
[Location] L
where immunization.location.references(L)
).only().name
|