Metadata Version 0.5.3 Status Draft Jurisdiction 001 from http://unstats.un.org/unsd/methods/m49/m49.htm Steward (Publisher) HL7 International - [Some] Work Group Type logic-library from http://terminology.hl7.org/CodeSystem/library-type Dependency Description: Library FHIRHelpers Resource: http://somewhere.org/fhir/uv/mycontentig/Library/FHIRHelpers|4.0.1 Canonical URL: http://somewhere.org/fhir/uv/mycontentig/Library/FHIRHelpers|4.0.1 Dependency Description: Code system LOINC Resource: Logical Observation Identifiers, Names and Codes (LOINC) Canonical URL: http://loinc.org Dependency Description: Code system SNOMEDCT Resource: SNOMED CT (all versions) Canonical URL: http://snomed.info/sct Dependency Description: Code system ActCode Resource: ActCode Canonical URL: http://terminology.hl7.org/CodeSystem/v3-ActCode Dependency Description: Code system RoleCode Resource: RoleCode Canonical URL: http://terminology.hl7.org/CodeSystem/v3-RoleCode Dependency Description: Code system Diagnosis Role Resource: Diagnosis Role Canonical URL: http://terminology.hl7.org/CodeSystem/diagnosis-role Dependency Description: Code system RequestIntent Resource: RequestIntent Canonical URL: http://hl7.org/fhir/request-intent Dependency Description: Code system MedicationRequestCategory Resource: MedicationRequest Category Codes Canonical URL: http://terminology.hl7.org/CodeSystem/medicationrequest-category Dependency Description: Code system ConditionClinicalStatusCodes Resource: Condition Clinical Status Codes Canonical URL: http://terminology.hl7.org/CodeSystem/condition-clinical Dependency Description: Code system ConditionVerificationStatusCodes Resource: ConditionVerificationStatus Canonical URL: http://terminology.hl7.org/CodeSystem/condition-ver-status Dependency Description: Code system AllergyIntoleranceClinicalStatusCodes Resource: AllergyIntolerance Clinical Status Codes Canonical URL: http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical Dependency Description: Code system AllergyIntoleranceVerificationStatusCodes Resource: AllergyIntolerance Verification Status Canonical URL: http://terminology.hl7.org/CodeSystem/allergyintolerance-verification Dependency Description: Code system ObservationCategoryCodes Resource: Observation Category Codes Canonical URL: http://terminology.hl7.org/CodeSystem/observation-category Dependency Description: Code system USCoreObservationCategoryExtensionCodes Resource: US Core Observation Category Extension Codes Canonical URL: http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category Dependency Description: Code system ConditionCategory Resource: Condition Category Codes Canonical URL: http://terminology.hl7.org/CodeSystem/condition-category Dependency Description: Code system USCoreConditionCategoryExtensionCodes Resource: US Core Condition Category Extension Codes Canonical URL: http://hl7.org/fhir/us/core/CodeSystem/condition-category Data Requirement Type: Patient Profile(s): QICore Patient Parameters Name Use Card. Type Documentation Patient Out 0..1 Resource Library Content CQL Content library QICoreCommonExample version '0.5.3-cibuild'#xD; #xD; using QICore version '4.1.1'#xD; #xD; include FHIRHelpers version '4.0.1'#xD; #xD; codesystem "LOINC": 'http://loinc.org'#xD; codesystem "SNOMEDCT": 'http://snomed.info/sct'#xD; codesystem "ActCode": 'http://terminology.hl7.org/CodeSystem/v3-ActCode'#xD; codesystem "RoleCode": 'http://terminology.hl7.org/CodeSystem/v3-RoleCode'#xD; codesystem "Diagnosis Role": 'http://terminology.hl7.org/CodeSystem/diagnosis-role'#xD; codesystem "RequestIntent": 'http://hl7.org/fhir/request-intent'#xD; codesystem "MedicationRequestCategory": 'http://terminology.hl7.org/CodeSystem/medicationrequest-category'#xD; codesystem "ConditionClinicalStatusCodes": 'http://terminology.hl7.org/CodeSystem/condition-clinical'#xD; codesystem "ConditionVerificationStatusCodes": 'http://terminology.hl7.org/CodeSystem/condition-ver-status'#xD; codesystem "AllergyIntoleranceClinicalStatusCodes": 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical'#xD; codesystem "AllergyIntoleranceVerificationStatusCodes": 'http://terminology.hl7.org/CodeSystem/allergyintolerance-verification'#xD; codesystem "ObservationCategoryCodes": 'http://terminology.hl7.org/CodeSystem/observation-category'#xD; codesystem "USCoreObservationCategoryExtensionCodes": 'http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category' #xD; codesystem "ConditionCategory": 'http://terminology.hl7.org/CodeSystem/condition-category'#xD; codesystem "USCoreConditionCategoryExtensionCodes": 'http://hl7.org/fhir/us/core/CodeSystem/condition-category'#xD; #xD; code "Birthdate": '21112-8' from "LOINC" display 'Birth date'#xD; code "Dead": '419099009' from "SNOMEDCT" display 'Dead'#xD; code "ER": 'ER' from "RoleCode" display 'Emergency room'#xD; code "ICU": 'ICU' from "RoleCode" display 'Intensive care unit'#xD; code "Billing": 'billing' from "Diagnosis Role" display 'Billing'#xD; #xD; // Encounter Class Codes#xD; code "ambulatory": 'AMB' from ActCode display 'ambulatory'#xD; code "emergency": 'EMER' from ActCode display 'emergency'#xD; code "field": 'FLD' from ActCode display 'field'#xD; code "home health": 'HH' from ActCode display 'home health'#xD; code "inpatient encounter": 'IMP' from ActCode display 'inpatient encounter'#xD; code "inpatient acute": 'ACUTE' from ActCode display 'inpatient acute'#xD; code "inpatient non-acute": 'NONAC' from ActCode display 'inpatient non-acute'#xD; code "observation encounter": 'OBSENC' from ActCode display 'observation encounter'#xD; code "pre-admission": 'PRENC' from ActCode display 'pre-admission'#xD; code "short stay": 'SS' from ActCode display 'short stay'#xD; code "virtual": 'VR' from ActCode display 'VR'#xD; #xD; // Condition Category Codes#xD; code "problem-list-item": 'problem-list-item' from "ConditionCategory" display 'Problem List Item'#xD; code "encounter-diagnosis": 'encounter-diagnosis' from "ConditionCategory" display 'Encounter Diagnosis'#xD; code "health-concern": 'health-concern' from "USCoreConditionCategoryExtensionCodes" display 'Health Concern'#xD; #xD; // Condition Clinical Status Codes - Consider value sets for these#xD; code "active": 'active' from "ConditionClinicalStatusCodes"#xD; code "recurrence": 'recurrence' from "ConditionClinicalStatusCodes"#xD; code "relapse": 'relapse' from "ConditionClinicalStatusCodes"#xD; code "inactive": 'inactive' from "ConditionClinicalStatusCodes"#xD; code "remission": 'remission' from "ConditionClinicalStatusCodes"#xD; code "resolved": 'resolved' from "ConditionClinicalStatusCodes"#xD; #xD; // Condition Verification Status Codes - Consider value sets for these#xD; code "unconfirmed": 'unconfirmed' from ConditionVerificationStatusCodes#xD; code "provisional": 'provisional' from ConditionVerificationStatusCodes#xD; code "differential": 'differential' from ConditionVerificationStatusCodes#xD; code "confirmed": 'confirmed' from ConditionVerificationStatusCodes#xD; code "refuted": 'refuted' from ConditionVerificationStatusCodes#xD; code "entered-in-error": 'entered-in-error' from ConditionVerificationStatusCodes#xD; #xD; code "allergy-active": 'active' from "AllergyIntoleranceClinicalStatusCodes"#xD; code "allergy-inactive": 'inactive' from "AllergyIntoleranceClinicalStatusCodes"#xD; code "allergy-resolved": 'resolved' from "AllergyIntoleranceClinicalStatusCodes"#xD; #xD; // Allergy/Intolerance Verification Status Codes - Consider value sets for these#xD; code "allergy-unconfirmed": 'unconfirmed' from AllergyIntoleranceVerificationStatusCodes#xD; code "allergy-confirmed": 'confirmed' from AllergyIntoleranceVerificationStatusCodes#xD; code "allergy-refuted": 'refuted' from AllergyIntoleranceVerificationStatusCodes#xD; #xD; // MedicationRequest Category Codes#xD; code "Inpatient": 'inpatient' from "MedicationRequestCategory" display 'Inpatient'#xD; code "Outpatient": 'outpatient' from "MedicationRequestCategory" display 'Outpatient'#xD; code "Community": 'community' from "MedicationRequestCategory" display 'Community'#xD; code "Discharge": 'discharge' from "MedicationRequestCategory" display 'Discharge'#xD; #xD; // Diagnosis Role Codes#xD; code "AD": 'AD' from "Diagnosis Role" display 'Admission diagnosis'#xD; code "DD": 'DD' from "Diagnosis Role" display 'Discharge diagnosis'#xD; code "CC": 'CC' from "Diagnosis Role" display 'Chief complaint'#xD; code "CM": 'CM' from "Diagnosis Role" display 'Comorbidity diagnosis'#xD; code "pre-op": 'pre-op' from "Diagnosis Role" display 'pre-op diagnosis'#xD; code "post-op": 'post-op' from "Diagnosis Role" display 'post-op diagnosis'#xD; code "billing": 'billing' from "Diagnosis Role" display 'billing diagnosis'#xD; #xD; // Observation Category Codes#xD; code "social-history": 'social-history' from "ObservationCategoryCodes" display 'Social History'#xD; code "vital-signs": 'vital-signs' from "ObservationCategoryCodes" display 'Vital Signs'#xD; code "imaging": 'imaging' from "ObservationCategoryCodes" display 'Imaging'#xD; code "laboratory": 'laboratory' from "ObservationCategoryCodes" display 'Laboratory'#xD; code "procedure": 'procedure' from "ObservationCategoryCodes" display 'Procedure'#xD; code "survey": 'survey' from "ObservationCategoryCodes" display 'Survey'#xD; code "exam": 'exam' from "ObservationCategoryCodes" display 'Exam'#xD; code "therapy": 'therapy' from "ObservationCategoryCodes" display 'Therapy'#xD; code "activity": 'activity' from "ObservationCategoryCodes" display 'Activity'#xD; code "clinical-test": 'clinical-test' from "USCoreObservationCategoryExtensionCodes" display 'Clinical Test'#xD; #xD; context Patient#xD; #xD; /* Candidates for FHIRCommon */#xD; #xD; /*#xD; @description: Returns true if the given condition has a clinical status of active, recurrence, or relapse#xD; */#xD; define fluent function isActive(condition Condition):#xD; condition.clinicalStatus ~ "active"#xD; or condition.clinicalStatus ~ "recurrence"#xD; or condition.clinicalStatus ~ "relapse"#xD; #xD; /*#xD; @description: Returns true if the given condition has the given category#xD; */#xD; define fluent function hasCategory(condition Condition, category Code):#xD; exists (condition.category C#xD; where C ~ category#xD; )#xD; #xD; /*#xD; @description: Returns true if the given condition is a problem list item.#xD; */#xD; define fluent function isProblemListItem(condition Condition):#xD; exists (condition.category C#xD; where C ~ "problem-list-item"#xD; )#xD; #xD; /*#xD; @description: Returns true if the given condition is an encounter diagnosis#xD; */#xD; define fluent function isEncounterDiagnosis(condition Condition):#xD; exists (condition.category C#xD; where C ~ "encounter-diagnosis"#xD; )#xD; #xD; /*#xD; @description: Returns true if the given condition is a health concern#xD; */#xD; define fluent function isHealthConcern(condition Condition):#xD; exists (condition.category C#xD; where C ~ "health-concern"#xD; )#xD; #xD; /*#xD; @description: Returns true if the given observation has the given category#xD; */#xD; define fluent function hasCategory(observation Observation, category Code):#xD; exists (observation.category C#xD; where C ~ category#xD; )#xD; #xD; /*#xD; @description: Returns true if the given observation is a social history observation#xD; */#xD; define fluent function isSocialHistory(observation Observation):#xD; exists (observation.category C#xD; where C ~ "social-history"#xD; )#xD; #xD; /*#xD; @description: Returns true if the given observation is a vital sign#xD; */#xD; define fluent function isVitalSign(observation Observation):#xD; exists (observation.category C#xD; where C ~ "vital-signs"#xD; )#xD; #xD; /*#xD; @description: Returns true if the given observation is an imaging observation#xD; */#xD; define fluent function isImaging(observation Observation):#xD; exists (observation.category C#xD; where C ~ "imaging"#xD; )#xD; #xD; /*#xD; @description: Returns true if the given observation is a laboratory observation#xD; */#xD; define fluent function isLaboratory(observation Observation):#xD; exists (observation.category C#xD; where C ~ "laboratory"#xD; )#xD; #xD; /*#xD; @description: REturns true if the given observation is a procedure observation#xD; */#xD; define fluent function isProcedure(observation Observation):#xD; exists (observation.category C#xD; where C ~ "procedure"#xD; )#xD; #xD; /*#xD; @description: Returns true if the given observation is a survey observation#xD; */#xD; define fluent function isSurvey(observation Observation):#xD; exists (observation.category C#xD; where C ~ "survey"#xD; )#xD; #xD; /*#xD; @description: Returns true if the given observation is an exam observation#xD; */#xD; define fluent function isExam(observation Observation):#xD; exists (observation.category C#xD; where C ~ "exam"#xD; )#xD; #xD; /*#xD; @description: Returns true if the given observation is a therapy observation#xD; */#xD; define fluent function isTherapy(observation Observation):#xD; exists (observation.category C#xD; where C ~ "therapy"#xD; )#xD; #xD; /*#xD; @description: Returns true if the given observation is an activity observation#xD; */#xD; define fluent function isActivity(observation Observation):#xD; exists (observation.category C#xD; where C ~ "activity"#xD; )#xD; #xD; /*#xD; @description: Returns true if the given observation is a clinical test result#xD; */#xD; define fluent function isClinicalTest(observation Observation):#xD; exists (observation.category C#xD; where C ~ "clinical-test"#xD; )#xD; #xD; /*#xD; @description: Returns true if the given MedicationRequest has a category of Community#xD; */#xD; define fluent function isCommunity(medicationRequest MedicationRequest):#xD; exists (medicationRequest.category C#xD; where C ~ Community#xD; )#xD; #xD; /*#xD; @description: Returns true if the given MedicationRequest has a category of Community#xD; */#xD; define fluent function isCommunity(medicationRequest MedicationNotRequested):#xD; exists (medicationRequest.category C#xD; where C ~ Community#xD; )#xD; #xD; /*#xD; @description: Returns true if the given MedicationRequest has a category of Discharge#xD; */#xD; define fluent function isDischarge(medicationRequest MedicationRequest):#xD; exists (medicationRequest.category C#xD; where C ~ Discharge#xD; )#xD; #xD; /*#xD; @description: Returns true if the given MedicationRequest has a category of Discharge#xD; */#xD; define fluent function isDischarge(medicationRequest MedicationNotRequested):#xD; exists (medicationRequest.category C#xD; where C ~ Discharge#xD; )#xD; #xD; /*#xD; @description: Returns true if the given DeviceRequest is a negation (i.e. do not perform this order)#xD; */#xD; define fluent function doNotPerform(deviceRequest DeviceRequest):#xD; singleton from (#xD; deviceRequest.modifierExtension E#xD; where E.url = 'http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-doNotPerform'#xD; return E.value as Boolean#xD; )#xD; #xD; /*#xD; @description: Normalizes a value that is a choice of timing-valued types to an equivalent interval#xD; @comment: Normalizes a choice type of DateTime, Quanitty, Interval<DateTime>, or Interval<Quantity> types#xD; to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible#xD; representations for timing-valued elements in QICore, allowing this function to be used across any resource.#xD; The input can be provided as a DateTime, Quantity, Interval<DateTime> or Interval<Quantity>.#xD; The intent of this function is to provide a clear and concise mechanism to treat single#xD; elements that have multiple possible representations as intervals so that logic doesn't have to account#xD; for the variability. More complex calculations (such as medication request period or dispense period#xD; calculation) need specific guidance and consideration. That guidance may make use of this function, but#xD; the focus of this function is on single element calculations where the semantics are unambiguous.#xD; If the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime.#xD; If the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,#xD; and the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.#xD; If the input is a DateTime Interval, the result is the input.#xD; If the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result#xD; is a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending#xD; immediately before one year later than the date the patient turned the age given as the end of the quantity interval.#xD; Any other input will reslt in a null DateTime Interval#xD; @deprecated: This function is deprecated. Use the fluent function `toInterval()` instead#xD; */#xD; define function ToInterval(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>>):#xD; case#xD; when choice is DateTime then#xD; Interval[choice as DateTime, choice as DateTime]#xD; when choice is Interval<DateTime> then#xD; choice as Interval<DateTime>#xD; when choice is Quantity then#xD; Interval[Patient.birthDate + (choice as Quantity),#xD; Patient.birthDate + (choice as Quantity) + 1 year)#xD; when choice is Interval<Quantity> then#xD; Interval[Patient.birthDate + (choice.low as Quantity),#xD; Patient.birthDate + (choice.high as Quantity) + 1 year)#xD; when choice is QICore.Timing then#xD; null as Interval<DateTime>#xD; else#xD; null as Interval<DateTime>#xD; end#xD; #xD; /*#xD; @description: Normalizes a value that is a choice of timing-valued types to an equivalent interval#xD; @comment: Normalizes a choice type of DateTime, Quanitty, Interval<DateTime>, or Interval<Quantity> types#xD; to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible#xD; representations for timing-valued elements in QICore, allowing this function to be used across any resource.#xD; The input can be provided as a DateTime, Quantity, Interval<DateTime> or Interval<Quantity>.#xD; The intent of this function is to provide a clear and concise mechanism to treat single#xD; elements that have multiple possible representations as intervals so that logic doesn't have to account#xD; for the variability. More complex calculations (such as medication request period or dispense period#xD; calculation) need specific guidance and consideration. That guidance may make use of this function, but#xD; the focus of this function is on single element calculations where the semantics are unambiguous.#xD; If the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime.#xD; If the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,#xD; and the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.#xD; If the input is a DateTime Interval, the result is the input.#xD; If the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result#xD; is a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending#xD; immediately before one year later than the date the patient turned the age given as the end of the quantity interval.#xD; Any other input will reslt in a null DateTime Interval#xD; */#xD; define fluent function toInterval(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>>):#xD; case#xD; when choice is DateTime then#xD; Interval[choice as DateTime, choice as DateTime]#xD; when choice is Interval<DateTime> then#xD; choice as Interval<DateTime>#xD; when choice is Quantity then#xD; Interval[Patient.birthDate + (choice as Quantity),#xD; Patient.birthDate + (choice as Quantity) + 1 year)#xD; when choice is Interval<Quantity> then#xD; Interval[Patient.birthDate + (choice.low as Quantity),#xD; Patient.birthDate + (choice.high as Quantity) + 1 year)#xD; else#xD; null as Interval<DateTime>#xD; end#xD; #xD; /*#xD; @description: Returns an interval representing the normalized abatement of a given Condition.#xD; @comment: If the abatement element of the Condition is represented as a DateTime, the result#xD; is an interval beginning and ending on that DateTime.#xD; If the abatement is represented as a Quantity, the quantity is expected to be a calendar-duration and is interpreted as the age of the patient. The#xD; result is an interval from the date the patient turned that age to immediately before one year later.#xD; If the abatement is represented as a Quantity Interval, the quantities are expected to be calendar-durations and are interpreted as an age range during#xD; which the abatement occurred. The result is an interval from the date the patient turned the starting age of the quantity interval, and ending immediately#xD; before one year later than the date the patient turned the ending age of the quantity interval.#xD; @deprecated: This function is deprecated. Use the fluent function `abatementInterval()` instead.#xD; */#xD; define function ToAbatementInterval(condition Condition):#xD; if condition.abatement is DateTime then#xD; Interval[condition.abatement as DateTime, condition.abatement as DateTime]#xD; else if condition.abatement is Quantity then#xD; Interval[Patient.birthDate + (condition.abatement as Quantity),#xD; Patient.birthDate + (condition.abatement as Quantity) + 1 year)#xD; else if condition.abatement is Interval<Quantity> then#xD; Interval[Patient.birthDate + (condition.abatement.low as Quantity),#xD; Patient.birthDate + (condition.abatement.high as Quantity) + 1 year)#xD; else if condition.abatement is Interval<DateTime> then#xD; Interval[condition.abatement.low, condition.abatement.high)#xD; else null as Interval<DateTime>#xD; #xD; /*#xD; @description: Returns an interval representing the normalized abatement of a given Condition.#xD; @comment: If the abatement element of the Condition is represented as a DateTime, the result#xD; is an interval beginning and ending on that DateTime.#xD; If the abatement is represented as a Quantity, the quantity is expected to be a calendar-duration and is interpreted as the age of the patient. The#xD; result is an interval from the date the patient turned that age to immediately before one year later.#xD; If the abatement is represented as a Quantity Interval, the quantities are expected to be calendar-durations and are interpreted as an age range during#xD; which the abatement occurred. The result is an interval from the date the patient turned the starting age of the quantity interval, and ending immediately#xD; before one year later than the date the patient turned the ending age of the quantity interval.#xD; */#xD; define fluent function abatementInterval(condition Condition):#xD; if condition.abatement is DateTime then#xD; Interval[condition.abatement as DateTime, condition.abatement as DateTime]#xD; else if condition.abatement is Quantity then#xD; Interval[Patient.birthDate + (condition.abatement as Quantity),#xD; Patient.birthDate + (condition.abatement as Quantity) + 1 year)#xD; else if condition.abatement is Interval<Quantity> then#xD; Interval[Patient.birthDate + (condition.abatement.low as Quantity),#xD; Patient.birthDate + (condition.abatement.high as Quantity) + 1 year)#xD; else if condition.abatement is Interval<DateTime> then#xD; Interval[condition.abatement.low, condition.abatement.high)#xD; else null as Interval<DateTime>#xD; #xD; /*#xD; @description: Returns an interval representing the normalized prevalence period of a given Condition.#xD; @comment: Uses the ToInterval and ToAbatementInterval functions to determine the widest potential interval from#xD; onset to abatement as specified in the given Condition. If the condition is active, the resulting interval will have#xD; a closed ending boundary. If the condition is not active, the resulting interval will have an open ending boundary.#xD; @deprecated: This function is deprecated. Use the `prevalenceInterval()` fluent function instead#xD; */#xD; define function ToPrevalenceInterval(condition Condition):#xD; if condition.clinicalStatus ~ "active"#xD; or condition.clinicalStatus ~ "recurrence"#xD; or condition.clinicalStatus ~ "relapse" then#xD; Interval[start of ToInterval(condition.onset), end of ToAbatementInterval(condition)]#xD; else#xD; Interval[start of ToInterval(condition.onset), end of ToAbatementInterval(condition))#xD; #xD; /*#xD; @description: Returns an interval representing the normalized prevalence period of a given Condition.#xD; @comment: Uses the ToInterval and ToAbatementInterval functions to determine the widest potential interval from#xD; onset to abatement as specified in the given Condition. If the condition is active, the resulting interval will have#xD; a closed ending boundary. If the condition is not active, the resulting interval will have an open ending boundary.#xD; */#xD; define fluent function prevalenceInterval(condition Condition):#xD; if condition.clinicalStatus ~ "active"#xD; or condition.clinicalStatus ~ "recurrence"#xD; or condition.clinicalStatus ~ "relapse" then#xD; Interval[start of condition.onset.toInterval(), end of condition.abatementInterval()]#xD; else#xD; Interval[start of condition.onset.toInterval(), end of condition.abatementInterval())#xD; #xD; /*#xD; @description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).#xD; @comment: This function can be used to determine the logical id of a given resource. It can be used in#xD; a single-server environment to trace references. However, this function does not attempt to resolve#xD; or distinguish the base of the given url, and so cannot be used safely in multi-server environments.#xD; @deprecated: This function is deprecated. Use the fluent function `getId()` instead#xD; */#xD; define function GetId(uri String ):#xD; Last(Split(uri, '/'))#xD; #xD; /*#xD; @description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).#xD; @comment: This function can be used to determine the logical id of a given resource. It can be used in#xD; a single-server environment to trace references. However, this function does not attempt to resolve#xD; or distinguish the base of the given url, and so cannot be used safely in multi-server environments.#xD; */#xD; define fluent function getId(uri String):#xD; Last(Split(uri, '/'))#xD; #xD; /*#xD; @description: Given an interval, return true if the interval has a starting boundary specified#xD; (i.e. the start of the interval is not null and not the minimum DateTime value)#xD; @deprecated: This function is deprecated. Uee the fluent function `hasStart()` instead#xD; */#xD; define function "HasStart"(period Interval<DateTime> ):#xD; not ( start of period is null#xD; or start of period = minimum DateTime#xD; )#xD; #xD; /*#xD; @description: Given an interval, return true if the interval has a starting boundary specified#xD; (i.e. the start of the interval is not null and not the minimum DateTime value)#xD; */#xD; define fluent function hasStart(period Interval<DateTime> ):#xD; not ( start of period is null#xD; or start of period = minimum DateTime#xD; )#xD; #xD; /*#xD; @description: Given an interval, returns true if the interval has an ending boundary specified#xD; (i.e. the end of the interval is not null and not the maximum DateTime value)#xD; @deprecated: This function is deprecated. Use the fluent function `hasEnd()` instead#xD; */#xD; define function "HasEnd"(period Interval<DateTime> ):#xD; not (#xD; end of period is null#xD; or end of period = maximum DateTime#xD; )#xD; #xD; /*#xD; @description: Given an interval, returns true if the interval has an ending boundary specified#xD; (i.e. the end of the interval is not null and not the maximum DateTime value)#xD; */#xD; define fluent function hasEnd(period Interval<DateTime> ):#xD; not (#xD; end of period is null#xD; or end of period = maximum DateTime#xD; )#xD; #xD; /*#xD; @description: Given an interval, returns the ending point if the interval has an ending boundary specified,#xD; otherwise, returns the starting point#xD; @deprecated: This function is deprecated. Use the fluent function `latest()` instead#xD; */#xD; define function "Latest"(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):#xD; (choice.toInterval()) period#xD; return#xD; if (HasEnd(period)) then end of period#xD; else start of period#xD; #xD; /*#xD; @description: Given an interval, returns the ending point if the interval has an ending boundary specified,#xD; otherwise, returns the starting point#xD; */#xD; define fluent function latest(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):#xD; (choice.toInterval()) period#xD; return#xD; if (period."hasEnd"()) then end of period#xD; else start of period#xD; #xD; /*#xD; @description: Given an interval, return the starting point if the interval has a starting boundary specified,#xD; otherwise, return the ending point#xD; @deprecated: This function is deprecated. Use the fluent function `earliest()` instead#xD; */#xD; define function "Earliest"(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):#xD; (choice.toInterval()) period#xD; return#xD; if (HasStart(period)) then start of period#xD; else end of period#xD; #xD; /*#xD; @description: Given an interval, return the starting point if the interval has a starting boundary specified,#xD; otherwise, return the ending point#xD; */#xD; define fluent function earliest(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):#xD; (choice.toInterval()) period#xD; return#xD; if (period."hasStart"()) then start of period#xD; else end of period#xD; #xD; /*#xD; @description: Creates a list of integers from 1 to how many days are in the interval. Note, this wont create an index for#xD; the final day if it is less than 24 hours. This also includes the first 24 hour period.#xD; @deprecated: This function is deprecated. Use the fluent function `toDayNumbers()` instead#xD; */#xD; define function "Interval To Day Numbers"(Period Interval<DateTime>):#xD; ( expand { Interval[1, duration in days between start of Period and end of Period]} ) DayNumber#xD; return end of DayNumber#xD; #xD; /*#xD; @description: Creates a list of integers from 1 to how many days are in the interval. Note, this wont create an index for#xD; the final day if it is less than 24 hours. This also includes the first 24 hour period.#xD; */#xD; define fluent function toDayNumbers(Period Interval<DateTime>):#xD; ( expand { Interval[1, duration in days between start of Period and end of Period]} ) DayNumber#xD; return end of DayNumber#xD; #xD; /*#xD; @description: Creates a list of 24 hour long intervals in an interval paired with the index (1 indexed) to which 24 hour interval it is.#xD; Note that the result will include intervals that are closed at the beginning and open at the end#xD; @deprecated: This function is deprecated. Use the fluent function `daysInPeriod()` instead#xD; */#xD; define function "Days In Period"(Period Interval<DateTime>):#xD; ( "Interval To Day Numbers"(Period)) DayIndex#xD; let startPeriod: start of Period + (24 hours * (DayIndex - 1)),#xD; endPeriod: if (hours between startPeriod and end of Period < 24) then startPeriod#xD; else start of Period + (24 hours * DayIndex)#xD; return Tuple {#xD; dayIndex: DayIndex,#xD; dayPeriod: Interval[startPeriod, endPeriod)#xD; }#xD; #xD; /*#xD; @description: Creates a list of 24 hour long intervals in an interval paired with the index (1 indexed) to which 24 hour interval it is.#xD; Note that the result will include intervals that are closed at the beginning and open at the end#xD; */#xD; define fluent function daysInPeriod(Period Interval<DateTime>):#xD; ( "Interval To Day Numbers"(Period)) DayIndex#xD; let startPeriod: start of Period + (24 hours * (DayIndex - 1)),#xD; endPeriod: if (hours between startPeriod and end of Period < 24) then startPeriod#xD; else start of Period + (24 hours * DayIndex)#xD; return Tuple {#xD; dayIndex: DayIndex,#xD; dayPeriod: Interval[startPeriod, endPeriod)#xD; } ELM XML Content Encoded data ELM JSON Content Encoded data Generated using version 0.5.3 of the sample-content-ig Liquid templates
Code system ConditionClinicalStatusCodes
Code system ConditionVerificationStatusCodes
Code system AllergyIntoleranceClinicalStatusCodes
Code system AllergyIntoleranceVerificationStatusCodes
Code system USCoreObservationCategoryExtensionCodes
Code system USCoreConditionCategoryExtensionCodes