Metadata Version 0.1.0 Status Draft Jurisdiction 840 from http://unstats.un.org/unsd/methods/m49/m49.htm Steward (Publisher) Oregon Health and Science University Steward Contact Oregon Health and Science University Copyright Published by OHSU under an Apache 2.0 License Dependency 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 Dependency Description: Library FHIRHelpers Resource: http://fhir.org/guides/ohsuhypertensionig/Library/FHIRHelpers|4.0.1 Canonical URL: http://fhir.org/guides/ohsuhypertensionig/Library/FHIRHelpers|4.0.1 Dependency Description: Library Common Resource: Common Logic version: 0.1.0 Canonical URL: http://fhir.org/guides/ohsuhypertensionig/Library/OHSUHTNCommon|0.1 Dependency Description: Code system LOINC Resource: LOINC Canonical URL: http://loinc.org Dependency Description: Code system ConditionVerificationStatusCodes Resource: ConditionVerificationStatus Canonical URL: http://terminology.hl7.org/CodeSystem/condition-ver-status Dependency Description: Value set End Stage Renal Disease Resource: End Stage Renal Disease Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.2.590 Dependency Description: Value set Pregnancy Resource: Pregnancy Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.378 Dependency Description: Value set Systolic Blood Pressure Resource: Systolic blood pressure Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1104.2 Dependency Description: Value set Diastolic Blood Pressure Resource: Diastolic Blood Pressure Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.2.1045 Dependency Description: Value set Blood Pressure Measured Resource: Blood Pressure Measured Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.2012 Data Requirement Type: Patient Profile(s): Patient Data Requirement Type: Condition Profile(s): Condition Must Support Elements: code Data Requirement Type: Observation Profile(s): Observation Must Support Elements: code, status, effective, component Code Filter(s): Path: code Data Requirement Type: Observation Profile(s): Observation Must Support Elements: code Parameters Name Use Card. Type Documentation Measurement Period In 0..1 Period Systolic Target In 0..1 decimal Diastolic Target In 0..1 decimal Patient Out 0..1 Patient Info Out 0..1 string Warning Out 0..1 string Critical Out 0..1 string Errors Out 0..1 Resource Meets Inclusion Criteria Out 0..1 boolean Meets Exclusion Criteria Out 0..1 boolean In Population Out 0..1 boolean Provide Recommendation Out 0..1 boolean Recommendation Out 0..1 string Valid BP Observations Out 0..* Observation BP Readings Out 0..* Resource Total Readings Count Out 0..1 integer Readings In Range Out 0..* Resource In Range Count Out 0..1 integer Percentage Time In Range Out 0..1 decimal Rationale Out 0..1 string Suggestions Out 0..1 string Selection Behavior Out 0..1 string Links Out 0..1 string Rationale Combined Data Out 0..1 string Indicator Status Out 0..1 string Library Content CQL Content library BPTimeInRange version '1.0.0'#xD; #xD; using FHIR version '4.0.1'#xD; #xD; include FHIRHelpers version '4.0.1'#xD; include OHSUHTNCommon version '0.1' called Common#xD; #xD; codesystem "LOINC": 'http://loinc.org'#xD; #xD; // -- Panel Concepts --#xD; code "Office BP Panel": '85354-9' from "LOINC" display 'Blood pressure panel with all children optional'#xD; code "Home BP Panel": '55284-4' from "LOINC" display 'Blood pressure systolic & diastolic - cardiovascular device'#xD; #xD; concept "All BP Panels": { "Office BP Panel", "Home BP Panel" } display 'All Blood Pressure Panels'#xD; #xD; // -- Component Codes --#xD; code "Office Systolic": '8480-6' from "LOINC" display 'Systolic blood pressure'#xD; code "Home Systolic": '8459-0' from "LOINC" display 'Systolic blood pressure - Home'#xD; code "Office Diastolic": '8462-4' from "LOINC" display 'Diastolic blood pressure'#xD; code "Home Diastolic": '8453-3' from "LOINC" display 'Diastolic blood pressure - Home'#xD; #xD; concept "Systolic BP Components": { "Office Systolic", "Home Systolic" } display 'Systolic BP'#xD; concept "Diastolic BP Components": { "Office Diastolic", "Home Diastolic" } display 'Diastolic BP'#xD; #xD; // -- Parameters --#xD; parameter "Measurement Period" Interval<DateTime>#xD; default Interval[Now() - 3 months, Now()]#xD; #xD; // Target Thresholds (Customizable based on clinical guidelines)#xD; parameter "Systolic Target" Decimal default 130.0#xD; parameter "Diastolic Target" Decimal default 80.0#xD; #xD; context Patient#xD; #xD; // -- Logic --#xD; #xD; define "Info":#xD; 'info'#xD; #xD; define "Warning":#xD; 'warning'#xD; #xD; define "Critical":#xD; 'critical'#xD; #xD; define "Errors":#xD; null#xD; #xD; define "Meets Inclusion Criteria":#xD; true#xD; #xD; define "Meets Exclusion Criteria":#xD; Common."Patient Under Age 18"#xD; or Common."Patient Over Age 100"#xD; or exists Common."Condition Indicating End Stage Renal Disease"#xD; or exists Common."Condition Indicating Pregnancy"#xD; or Common."HTN Crisis"#xD; #xD; define "In Population":#xD; // Preserve this ordering so excluded patients fail fast#xD; not "Meets Exclusion Criteria" and "Meets Inclusion Criteria"#xD; #xD; define "Provide Recommendation":#xD; "In Population"#xD; #xD; define "Recommendation":#xD; if not "Provide Recommendation" then 'None'#xD; else 'Blood Pressure Time-in-Range'#xD; #xD; define "Rationale Combined Data":#xD; "Rationale" + '|' + "Suggestions" + '|' + "Selection Behavior" + '|' + "Links"#xD; #xD; define "Rationale":#xD; if not "Provide Recommendation" then ''#xD; else if "Total Readings Count" > 0 then#xD; '{{#patient}}Your blood pressure was in range for '#xD; + ToString(Round("Percentage Time In Range", 1))#xD; + '% of recorded readings during the measurement period (most recent 3 months).{{/patient}}'#xD; + '{{#careTeam}}Patient blood pressure was in range for '#xD; + ToString(Round("Percentage Time In Range", 1))#xD; + '% of recorded readings during the measurement period (most recent 3 months).{{/careTeam}}'#xD; else 'Consider obtaining additional blood pressure measurements.'#xD; #xD; define "Indicator Status":#xD; "Info"#xD; #xD; define "Suggestions":#xD; ''#xD; #xD; define "Selection Behavior":#xD; 'at-most-one'#xD; #xD; define "Links":#xD; ''#xD; #xD; // 1. Retrieve valid BP observations within the last 3 months#xD; define "Valid BP Observations":#xD; [Observation: "All BP Panels"] BP#xD; where BP.status in { 'final', 'amended', 'corrected' }#xD; and BP.effective as dateTime in "Measurement Period"#xD; #xD; // 2. Extract components and structure the data#xD; define "BP Readings":#xD; "Valid BP Observations" BP#xD; let#xD; SysComp: singleton from (BP.component C where FHIRHelpers.ToConcept(C.code) ~ "Systolic BP Components"),#xD; DiaComp: singleton from (BP.component C where FHIRHelpers.ToConcept(C.code) ~ "Diastolic BP Components"),#xD; SysValue: SysComp.value as Quantity,#xD; DiaValue: DiaComp.value as Quantity#xD; where SysValue is not null and DiaValue is not null#xD; return {#xD; Date: BP.effective as dateTime,#xD; Systolic: SysValue.value,#xD; Diastolic: DiaValue.value#xD; }#xD; #xD; // 3. Filter for readings within the target range#xD; define "Readings In Range":#xD; "BP Readings" R#xD; where R.Systolic < "Systolic Target"#xD; and R.Diastolic < "Diastolic Target"#xD; #xD; // 4. Calculate aggregates#xD; define "Total Readings Count":#xD; Count("BP Readings")#xD; #xD; define "In Range Count":#xD; Count("Readings In Range")#xD; #xD; // 5. Generate Time in Range percentage#xD; define "Percentage Time In Range":#xD; if "Total Readings Count" > 0 then#xD; ("In Range Count" * 100.0) / "Total Readings Count"#xD; else#xD; null ELM XML Content Encoded data ELM JSON Content Encoded data Generated using version 0.5.4 of the sample-content-ig Liquid templates
Published by OHSU under an Apache 2.0 License
Code system ConditionVerificationStatusCodes