Id: IMMZD5DTRotavirusContraindications Url: IMMZ.D5.DT.Rotavirus contraindications Version: 1.0.0 Title: IMMZ.D5.DT.Rotavirus contraindications Status: draft Type: system: http://terminology.hl7.org/CodeSystem/plan-definition-type code: eca-rule Date: 2026-03-31 13:54:17+0000 Publisher: WHO Description: IMMZ.D5.DT.Rotavirus contraindications IMMZ.D5.DT.Rotavirus contraindications Knowledge Capability: computable Related Artifacts: References WHO recommendations for routine immunization - summary tables (January 2025) Libraries: IMMZD5DTRotavirusContraindicationsLogic Actions: Check for contraindications before administering the vaccine(s) due: Contraindication for Rotavirus immunization If: Applicability: Rotavirus vaccination is contraindicated (Rotavirus vaccination is contraindicated) Then: Definition: IMMZD5DTMR Dynamic Values: id: (Draft Medication Request ID for Rotavirus dose) medication: (Concept { codes: { Code { system: 'http://smart.who.int/immunizations/CodeSystem/IMMZ.Z', code: 'DE16', display: 'Rotavirus vaccines' } }, display: 'Rotavirus vaccines' }) Check for Guidance for the patient regarding IMMZ.D5.DT.Rotavirus contraindications.: Show Guidance for the patient regarding IMMZ.D5.DT.Rotavirus contraindications. If: Applicability: Has Guidance (Has Guidance) Then: Definition: IMMZ.D2.DT.CR Dynamic Values: status: ('active') payload.contentString: (Guidance) category.coding: (Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }) priority: (Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' })
/* @internal: Potential contraindications observations */ define "Potential contraindications": ([Observation: Concepts."Potential contraindications"]).complete()
CI Prior history of intussusception Observation
/* @internal: Observation for Prior history of intussusception */ define "CI Prior history of intussusception Observation": "Potential contraindications" O where O.value ~ Concepts."CI-Prior history of intussusception"
/* @internal: Observation for Prior history of intussusception */ define "CI Prior history of intussusception Observation": Elements."CI Prior history of intussusception Observation".encounterOrOnBefore(EncounterId, Today)
CI Prior history of intussusception Condition
/* @internal: Condition for Prior history of intussusception */ define "CI Prior history of intussusception Condition": [Condition: Concepts."CI-Prior history of intussusception"]
/* @internal: Condition for Prior history of intussusception */ define "CI Prior history of intussusception Condition": Elements."CI Prior history of intussusception Condition" C where C.prevalenceInterval() includes Today
The client has prior history of intussusception
/* @input: The client has prior history of intussusception @pseudocode: "Potential contraindications" = "Prior history of intussusception" */ define "The client has prior history of intussusception": exists "CI Prior history of intussusception Observation" or exists "CI Prior history of intussusception Condition"
/* @input: The client has prior history of intussusception @pseudocode: "Potential contraindications" = "Prior history of intussusception" @code: The client has prior history of intussusception-66 @decision: IMMZ.D5.DT.Rotavirus contraindications */ define "The client has prior history of intussusception": Encounter."The client has prior history of intussusception"
Rotavirus vaccination is contraindicated Case 1
/* @output: Rotavirus vaccination is contraindicated Case 1 @pseudocode: "Immunization recommendation status" = "Contraindicated" */ define "Rotavirus vaccination is contraindicated Case 1": Encounter."The client has prior history of intussusception"
CI Immunodeficiency syndromes Observation
/* @internal: Observation for Immunodeficiency syndromes */ define "CI Immunodeficiency syndromes Observation": "Potential contraindications" O where O.value ~ Concepts."CI-Immunodeficiency syndromes"
/* @internal: Observation for Immunodeficiency syndromes */ define "CI Immunodeficiency syndromes Observation": Elements."CI Immunodeficiency syndromes Observation".encounterOrOnBefore(EncounterId, Today)
/* @internal: Condition for Immunodeficiency syndromes */ define "CI Immunodeficiency syndromes Condition": [Condition: Concepts."CI-Immunodeficiency syndromes"]
/* @internal: Condition for Immunodeficiency syndromes */ define "CI Immunodeficiency syndromes Condition": Elements."CI Immunodeficiency syndromes Condition" C where C.prevalenceInterval() includes Today
The client has immunodeficiency syndromes
/* @input: The client has immunodeficiency syndromes @pseudocode: "Potential contraindications" = "Immunodeficiency syndromes" */ define "The client has immunodeficiency syndromes": exists "CI Immunodeficiency syndromes Observation" or exists "CI Immunodeficiency syndromes Condition"
/* @input: The client has severe immunodeficiency @pseudocode: '"Potential contraindications" = "Immunodeficiency syndromes" @code: The client has severe immunodeficiency-61 @decision: IMMZ.D5.DT.Rotavirus contraindications */ define "The client has severe immunodeficiency": Encounter."The client has immunodeficiency syndromes"
Rotavirus vaccination is contraindicated Case 2
/* @output: Rotavirus vaccination is contraindicated Case 2 @pseudocode: "Immunization recommendation status" = "Contraindicated" */ define "Rotavirus vaccination is contraindicated Case 2": Encounter."The client has severe immunodeficiency"
Rotavirus vaccination is contraindicated
/* @output: Rotavirus vaccination is contraindicated @pseudocode: "Immunization recommendation status" = "Contraindicated" */ define "Rotavirus vaccination is contraindicated": "Rotavirus vaccination is contraindicated Case 1" or "Rotavirus vaccination is contraindicated Case 2"
Rotavirus vaccination is contraindicated Guidance
/* @output: Rotavirus vaccination is contraindicated Guidance @guidance = Do not vaccinate client with rotavirus as rotavirus vaccination is contraindicated for clients with prior history of intussusception. @guidance = Do not vaccinate client with rotavirus as rotavirus vaccincation is contraindicated for clients with severe immunodeficiency, including severe combined immunodeficiency. */ define "Rotavirus vaccination is contraindicated Guidance": case when "Rotavirus vaccination is contraindicated Case 1" then 'Do not vaccinate client with rotavirus as rotavirus vaccination is contraindicated for clients with prior history of intussusception.' when "Rotavirus vaccination is contraindicated Case 2" then 'Do not vaccinate client with rotavirus as rotavirus vaccincation is contraindicated for clients with severe immunodeficiency, including severe combined immunodeficiency.' else '' end
CI Severe allergic reactions Observation
/* @internal: Observation for Severe allergic reactions */ define "CI Severe allergic reactions Observation": "Potential contraindications" O where O.value ~ Concepts."CI-Severe allergic reactions"
/* @internal: Observation for Severe allergic reactions */ define "CI Severe allergic reactions Observation": Elements."CI Severe allergic reactions Observation".encounterOrOnBefore(EncounterId, Today)
/* @internal: Condition for Severe allergic reactions */ define "CI Severe allergic reactions Condition": [Condition: Concepts."CI-Severe allergic reactions"]
/* @internal: Condition for Severe allergic reactions */ define "CI Severe allergic reactions Condition": Elements."CI Severe allergic reactions Condition" C where C.prevalenceInterval() includes Today
The client has history of severe allergic reactions
/* @input: The client has history of severe allergic reactions @pseudocode: "Potential contraindications" = "Severe allergic reactions" */ define "The client has history of severe allergic reactions": exists "CI Severe allergic reactions Observation" or exists "CI Severe allergic reactions Condition"
The client has a history of severe allergic reactions
/* @input: The client has a history of severe allergic reactions @pseudocode: "Potential contraindications" = "Severe allergic reactions" @code: The client has a history of severe allergic reactions-59 @decision: IMMZ.D5.DT.Rotavirus contraindications */ define "The client has a history of severe allergic reactions": Encounter."The client has history of severe allergic reactions"
Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Case 1
/* @output: Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Case 1 @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Case 1": Encounter."The client has a history of severe allergic reactions"
CI History of anaphylactic reactions Observation
/* @internal: Observation for History of anaphylactic reactions */ define "CI History of anaphylactic reactions Observation": "Potential contraindications" O where O.value ~ Concepts."CI-History of anaphylactic reactions"
/* @internal: Observation for History of anaphylactic reactions */ define "CI History of anaphylactic reactions Observation": Elements."CI History of anaphylactic reactions Observation".encounterOrOnBefore(EncounterId, Today)
CI History of anaphylactic reactions Condition
/* @internal: Condition for History of anaphylactic reactions */ define "CI History of anaphylactic reactions Condition": [Condition: Concepts."CI-History of anaphylactic reactions"]
/* @internal: Condition for History of anaphylactic reactions */ define "CI History of anaphylactic reactions Condition": Elements."CI History of anaphylactic reactions Condition" C where C.prevalenceInterval() includes Today
The client has history of anaphylactic reactions
/* @input: The client has history of anaphylactic reactions @pseudocode: "Potential contraindications" = "History of anaphylactic reactions" */ define "The client has history of anaphylactic reactions": exists "CI History of anaphylactic reactions Observation" or exists "CI History of anaphylactic reactions Condition"
/* @input: The client has history of anaphylactic reactions @pseudocode: "Potential contraindications" = "History of anaphylactic reactions" @code: The client has history of anaphylactic reactions-67 @decision: IMMZ.D5.DT.Rotavirus contraindications */ define "The client has history of anaphylactic reactions": Encounter."The client has history of anaphylactic reactions"
Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Case 2
/* @output: Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Case 2 @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Case 2": Encounter."The client has history of anaphylactic reactions"
Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note
/* @output: Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note": "Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Case 1" or "Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Case 2"
Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance
/* @output: Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance @guidance = Do not vaccinate client with rotavirus if client had severe allergic reactions to a previous rotavirus vaccine dose or rotavirus vaccine components. Check if the client has no known severe hypersensitivity to rotavirus vaccines components. @guidance = Do not vaccinate client with rotavirus if client has history of anaphylactic reaction to a previous rotavirus vaccine dose or rotavirus vaccine components. */ define "Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance": case when "Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Case 1" then 'Do not vaccinate client with rotavirus if client had severe allergic reactions to a previous rotavirus vaccine dose or rotavirus vaccine components. Check if the client has no known severe hypersensitivity to rotavirus vaccines components.' when "Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Case 2" then 'Do not vaccinate client with rotavirus if client has history of anaphylactic reaction to a previous rotavirus vaccine dose or rotavirus vaccine components.' else '' end
/* @internal: Observation for Altered immunocompetence */ define "CI Altered immunocompetence Observation": "Potential contraindications" O where O.value ~ Concepts."CI-Altered immunocompetence"
/* @internal: Observation for Altered immunocompetence */ define "CI Altered immunocompetence Observation": Elements."CI Altered immunocompetence Observation".encounterOrOnBefore(EncounterId, Today)
/* @internal: Condition for Altered immunocompetence */ define "CI Altered immunocompetence Condition": [Condition: Concepts."CI-Altered immunocompetence"]
/* @internal: Condition for Altered immunocompetence */ define "CI Altered immunocompetence Condition": Elements."CI Altered immunocompetence Condition" C where C.prevalenceInterval() includes Today
/* @input: The client has altered immunocompetence @pseudocode: "Potential contraindications" = "Altered immunocompetence" */ define "The client has altered immunocompetence": exists "CI Altered immunocompetence Observation" or exists "CI Altered immunocompetence Condition"
/* @input: The client has altered immunocompetence @pseudocode: "Potential contraindications" = "Altered immunocompetence" @code: The client has altered immunocompetence-58 @decision: IMMZ.D5.DT.Rotavirus contraindications */ define "The client has altered immunocompetence": Encounter."The client has altered immunocompetence"
Clinical judgement is required. Create a clinical note Case 1
/* @output: Clinical judgement is required. Create a clinical note Case 1 @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Clinical judgement is required. Create a clinical note Case 1": Encounter."The client has altered immunocompetence"
/* @internal: Observation for Spina bifida */ define "CI Spina bifida Observation": "Potential contraindications" O where O.value ~ Concepts."CI-Spina bifida"
/* @internal: Observation for Spina bifida */ define "CI Spina bifida Observation": Elements."CI Spina bifida Observation".encounterOrOnBefore(EncounterId, Today)
/* @internal: Condition for Spina bifida */ define "CI Spina bifida Condition": [Condition: Concepts."CI-Spina bifida"]
/* @internal: Condition for Spina bifida */ define "CI Spina bifida Condition": Elements."CI Spina bifida Condition" C where C.prevalenceInterval() includes Today
/* @input: The client has spina bifida @pseudocode: "Potential contraindications" = "Spina bifida" */ define "The client has spina bifida": exists "CI Spina bifida Observation" or exists "CI Spina bifida Condition"
/* @input: The client has spina bifida @pseudocode: "Potential contraindications" = "Spina bifida" @code: The client has spina bifida-46 @decision: IMMZ.D5.DT.Rotavirus contraindications */ define "The client has spina bifida": Encounter."The client has spina bifida"
Clinical judgement is required. Create a clinical note Case 2
/* @output: Clinical judgement is required. Create a clinical note Case 2 @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Clinical judgement is required. Create a clinical note Case 2": Encounter."The client has spina bifida"
/* @internal: Observation for Bladder exstrophy */ define "CI Bladder exstrophy Observation": "Potential contraindications" O where O.value ~ Concepts."CI-Bladder exstrophy"
/* @internal: Observation for Bladder exstrophy */ define "CI Bladder exstrophy Observation": Elements."CI Bladder exstrophy Observation".encounterOrOnBefore(EncounterId, Today)
/* @internal: Condition for Bladder exstrophy */ define "CI Bladder exstrophy Condition": [Condition: Concepts."CI-Bladder exstrophy"]
/* @internal: Condition for Bladder exstrophy */ define "CI Bladder exstrophy Condition": Elements."CI Bladder exstrophy Condition" C where C.prevalenceInterval() includes Today
/* @input: The client has bladder exstrophy @pseudocode: "Potential contraindications" = "Bladder exstrophy" */ define "The client has bladder exstrophy": exists "CI Bladder exstrophy Observation" or exists "CI Bladder exstrophy Condition"
/* @input: The client has bladder exstrophy @pseudocode: "Potential contraindications" = "Bladder exstrophy" @code: The client has bladder exstrophy-51 @decision: IMMZ.D5.DT.Rotavirus contraindications */ define "The client has bladder exstrophy": Encounter."The client has bladder exstrophy"
Clinical judgement is required. Create a clinical note Case 3
/* @output: Clinical judgement is required. Create a clinical note Case 3 @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Clinical judgement is required. Create a clinical note Case 3": Encounter."The client has bladder exstrophy"
CI Chronic gastrointestinal disease Observation
/* @internal: Observation for Chronic gastrointestinal disease */ define "CI Chronic gastrointestinal disease Observation": "Potential contraindications" O where O.value ~ Concepts."CI-Chronic gastrointestinal disease"
/* @internal: Observation for Chronic gastrointestinal disease */ define "CI Chronic gastrointestinal disease Observation": Elements."CI Chronic gastrointestinal disease Observation".encounterOrOnBefore(EncounterId, Today)
CI Chronic gastrointestinal disease Condition
/* @internal: Condition for Chronic gastrointestinal disease */ define "CI Chronic gastrointestinal disease Condition": [Condition: Concepts."CI-Chronic gastrointestinal disease"]
/* @internal: Condition for Chronic gastrointestinal disease */ define "CI Chronic gastrointestinal disease Condition": Elements."CI Chronic gastrointestinal disease Condition" C where C.prevalenceInterval() includes Today
The client has chronic gastrointestinal disease
/* @input: The client has chronic gastrointestinal disease @pseudocode: "Potential contraindications" = "Chronic gastrointestinal disease" */ define "The client has chronic gastrointestinal disease": exists "CI Chronic gastrointestinal disease Observation" or exists "CI Chronic gastrointestinal disease Condition"
/* @input: The client has chronic gastrointestinal disease @pseudocode: "Potential contraindications" = "Chronic gastrointestinal disease" @code: The client has chronic gastrointestinal disease-66 @decision: IMMZ.D5.DT.Rotavirus contraindications */ define "The client has chronic gastrointestinal disease": Encounter."The client has chronic gastrointestinal disease"
Clinical judgement is required. Create a clinical note Case 4
/* @output: Clinical judgement is required. Create a clinical note Case 4 @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Clinical judgement is required. Create a clinical note Case 4": Encounter."The client has chronic gastrointestinal disease"
/* @internal: Observation for Acute gastroenteritis */ define "CI Acute gastroenteritis Observation": "Potential contraindications" O where O.value ~ Concepts."CI-Acute gastroenteritis"
/* @internal: Observation for Acute gastroenteritis */ define "CI Acute gastroenteritis Observation": Elements."CI Acute gastroenteritis Observation".encounterOrOnBefore(EncounterId, Today)
/* @internal: Condition for Acute gastroenteritis */ define "CI Acute gastroenteritis Condition": [Condition: Concepts."CI-Acute gastroenteritis"]
/* @internal: Condition for Acute gastroenteritis */ define "CI Acute gastroenteritis Condition": Elements."CI Acute gastroenteritis Condition" C where C.prevalenceInterval() includes Today
/* @input: The client has acute gastroenteritis @pseudocode: "Potential contraindications" = "Acute gastroenteritis" */ define "The client has acute gastroenteritis": exists "CI Acute gastroenteritis Observation" or exists "CI Acute gastroenteritis Condition"
/* @input: The client has acute gastroenteritis @pseudocode: "Potential contraindications" = "Acute gastroenteritis" @code: The client has acute gastroenteritis-55 @decision: IMMZ.D5.DT.Rotavirus contraindications */ define "The client has acute gastroenteritis": Encounter."The client has acute gastroenteritis"
Clinical judgement is required. Create a clinical note Case 5
/* @output: Clinical judgement is required. Create a clinical note Case 5 @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Clinical judgement is required. Create a clinical note Case 5": Encounter."The client has acute gastroenteritis"
/* @internal: Observation for Moderate to severe fever */ define "CI Moderate to severe fever Observation": "Potential contraindications" O where O.value ~ Concepts."CI-Moderate to severe fever"
/* @internal: Observation for Moderate to severe fever */ define "CI Moderate to severe fever Observation": Elements."CI Moderate to severe fever Observation".encounterOrOnBefore(EncounterId, Today)
/* @internal: Condition for Moderate to severe fever */ define "CI Moderate to severe fever Condition": [Condition: Concepts."CI-Moderate to severe fever"]
/* @internal: Condition for Moderate to severe fever */ define "CI Moderate to severe fever Condition": Elements."CI Moderate to severe fever Condition" C where C.prevalenceInterval() includes Today
/* @input: The client has moderate to severe fever @pseudocode: "Potential contraindications" = "Moderate to severe fever" */ define "The client has moderate to severe fever": exists "CI Moderate to severe fever Observation" or exists "CI Moderate to severe fever Condition"
/* @input: The client has moderate to severe fever @pseudocode: "Potential contraindications" = "Moderate to severe fever" @code: The client has moderate to severe fever-58 @decision: IMMZ.D5.DT.Rotavirus contraindications */ define "The client has moderate to severe fever": Encounter."The client has moderate to severe fever"
Clinical judgement is required. Create a clinical note Case 6
/* @output: Clinical judgement is required. Create a clinical note Case 6 @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Clinical judgement is required. Create a clinical note Case 6": Encounter."The client has moderate to severe fever"
Clinical judgement is required. Create a clinical note
/* @output: Clinical judgement is required. Create a clinical note @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Clinical judgement is required. Create a clinical note": "Clinical judgement is required. Create a clinical note Case 1" or "Clinical judgement is required. Create a clinical note Case 2" or "Clinical judgement is required. Create a clinical note Case 3" or "Clinical judgement is required. Create a clinical note Case 4" or "Clinical judgement is required. Create a clinical note Case 5" or "Clinical judgement is required. Create a clinical note Case 6"
Clinical judgement is required. Create a clinical note Guidance
/* @output: Clinical judgement is required. Create a clinical note Guidance @guidance = Client has altered immunocompetence other than severe combined immunodeficiency, consider risks of vaccination and make a judgement. @guidance = Client has spina bifida, consider risks of vaccination and make a judgement. @guidance = Client has bladder exstrophy, consider risks of vaccination and make a judgement. @guidance = Client has chronic gastrointestinal disease, consider risks of vaccination and make a judgement. @guidance = Client has acute gastroenteritis, consider risks of vaccination and make a judgement. Consider delaying rotavirus vaccination. @guidance = Client has moderate to severe fever, consider risks of vaccination and make a judgement. Consider delaying rotavirus vaccination. */ define "Clinical judgement is required. Create a clinical note Guidance": case when "Clinical judgement is required. Create a clinical note Case 1" then 'Client has altered immunocompetence other than severe combined immunodeficiency, consider risks of vaccination and make a judgement.' when "Clinical judgement is required. Create a clinical note Case 2" then 'Client has spina bifida, consider risks of vaccination and make a judgement.' when "Clinical judgement is required. Create a clinical note Case 3" then 'Client has bladder exstrophy, consider risks of vaccination and make a judgement.' when "Clinical judgement is required. Create a clinical note Case 4" then 'Client has chronic gastrointestinal disease, consider risks of vaccination and make a judgement.' when "Clinical judgement is required. Create a clinical note Case 5" then 'Client has acute gastroenteritis, consider risks of vaccination and make a judgement. Consider delaying rotavirus vaccination.' when "Clinical judgement is required. Create a clinical note Case 6" then 'Client has moderate to severe fever, consider risks of vaccination and make a judgement. Consider delaying rotavirus vaccination.' else '' end
/* @dynamicValue: Guidance */ define "Guidance": case when "Rotavirus vaccination is contraindicated" then "Rotavirus vaccination is contraindicated Guidance" when "Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note" then "Rotavirus vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance" when "Clinical judgement is required. Create a clinical note" then "Clinical judgement is required. Create a clinical note Guidance" else '' end
/* @dataElement: Draft Medication Request for Patient */ define "Draft Medication Request for Patient": [MedicationRequest] MR where MR.status = 'draft' and MR.intent = 'proposal' sort by date from (authoredOn as FHIR.dateTime) desc
/* @dataElement: Draft Medication Request for Patient */ define "Draft Medication Request for Patient": Elements."Draft Medication Request for Patient" MR where MR.encounter.references(EncounterId) or MR.authoredOn.toInterval() same day or before Today sort by date from (authoredOn as FHIR.dateTime) desc
Draft Medication Request for Rotavirus dose
/* @internal: Draft Medication Request for Rotavirus dose */ define "Draft Medication Request for Rotavirus dose": Encounter."Draft Medication Request for Patient" MR where MR.medication in Concepts."Rotavirus vaccines"
Draft Medication Request ID for Rotavirus dose
/* @dynamicValue: Draft Medication Request ID for Rotavirus dose */ define "Draft Medication Request ID for Rotavirus dose": First(Encounter."Draft Medication Request for Rotavirus dose").id
define "Has Guidance": "Guidance" is not null and "Guidance" != ''
/** * @description: Gets observation from an encounter or on or before a date */ define fluent function encounterOrOnBefore(observations List<Observation>, EncounterId String, beforeDate Date): observations O where (O.encounter.references(EncounterId) or O.effective.toInterval() starts same day or before beforeDate)
/* @description: Returns true if the given reference is to the given resourceId @comment: Returns true if the `resourceId` parameter 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, resourceId String): resourceId = Last(Split(reference.reference, '/'))
define function ToString(value string): value.value
/* 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
define function ToDateTime(value dateTime): value.value
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]
define function ToDateTime(value instant): value.value
define function ToDate(value date): value.value
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
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
define fluent function complete(observations List<Observation>): observations O where O.status in { 'final', 'amended', 'corrected' }
define function ToString(value ObservationStatus): value.value
define function ToConcept(concept FHIR.CodeableConcept): if concept is null then null else System.Concept { codes: concept.coding C return ToCode(C), display: concept.text.value }
define function ToCode(coding FHIR.Coding): if coding is null then null else System.Code { code: coding.code.value, system: coding.system.value, version: coding.version.value, display: coding.display.value }
/* @description: Returns an interval representing the normalized prevalence period of a given Condition resource. @comment: Uses the toInterval and toAbatementInterval functions to determine the widest potential interval from onset to abatement as specified in the given Condition. */ define fluent function prevalenceInterval(condition Condition): if condition.clinicalStatus ~ "active" or condition.clinicalStatus ~ "recurrence" or condition.clinicalStatus ~ "relapse" then Interval[start of condition.onset.toInterval(), end of condition.abatementInterval()] else (end of condition.abatementInterval()) abatementDate return if abatementDate is null then Interval[start of condition.onset.toInterval(), abatementDate) else Interval[start of condition.onset.toInterval(), abatementDate]
// Was getting error on this for this particular choice set not being found /* @description: Returns an interval representing the normalized Abatement of a given Condition resource. @comment: NOTE: Due to the complexity of determining an interval from a String, this function will throw a run-time exception if used with a Condition instance that has a String as the abatement value. */ define fluent function abatementInterval(condition Condition): if condition.abatement is FHIR.dateTime then Interval[FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime), FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime)] else if condition.abatement is FHIR.Period then FHIRHelpers.ToInterval(condition.abatement as FHIR.Period) else if condition.abatement 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 if condition.abatement is FHIR.Age then Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age), FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age) + 1 year) else if condition.abatement is FHIR.Range then Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).low), FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).high) + 1 year) else if condition.abatement is FHIR.boolean then Interval[end of condition.onset.toInterval(), condition.recordedDate) else null
define function ToString(value MedicationRequestStatus): value.value
define function ToString(value MedicationRequestIntent): value.value
Code system ConditionClinicalStatusCodes
IMMZ.D5.DT.Rotavirus contraindications IMMZ.D5.DT.Rotavirus contraindications
WHO recommendations for routine immunization - summary tables (January 2025)
Check for contraindications before administering the vaccine(s) due
Contraindication for Rotavirus immunization
Concept { codes: { Code { system: 'http://smart.who.int/immunizations/CodeSystem/IMMZ.Z', code: 'DE16', display: 'Rotavirus vaccines' } }, display: 'Rotavirus vaccines' }
Check for Guidance for the patient regarding IMMZ.D5.DT.Rotavirus contraindications.
Show Guidance for the patient regarding IMMZ.D5.DT.Rotavirus contraindications.
Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }
Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }