This page is part of the Clinical Guidelines (v1.0.0: STU 1) based on FHIR R4. This is the current published version in it's permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions
Formats: Narrative, XML, JSON, Turtle
Raw ttl
@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
# - resource -------------------------------------------------------------------
a fhir:Library;
fhir:nodeRole fhir:treeRoot;
fhir:Resource.id [ fhir:value "CKDRiskLogic"];
fhir:Resource.meta [
fhir:Meta.profile [
fhir:value "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-computablelibrary";
fhir:index 0;
fhir:link <http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-computablelibrary> ]
];
fhir:DomainResource.text [
fhir:Narrative.status [ fhir:value "generated" ];
fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Contents</h2><p><code>text/cql</code></p><pre><code class=\"language-sql\">library CKDRiskLogic version '1.0'\n\nusing FHIR version '4.0.0'\n\ninclude FHIRHelpers version '4.0.0' called FHIRHelpers\n\ncodesystem \"SNOMEDCT\": 'http://snomed.info/sct'\ncodesystem \"LOINC\": 'http://loinc.org'\ncodesystem \"RxNorm\": 'http://www.nlm.nih.gov/research/umls/rxnorm'\n\nvalueset \"Chronic Kidney Disease\": 'ckd-valueset-ckd'\nvalueset \"Diabetes mellitus\": 'ckd-valueset-diabetes'\n\nvalueset \"eGFR Labs\": 'ckd-valueset-egfr'\nvalueset \"UACR Labs\": 'ckd-valueset-uacr'\nvalueset \"Creatinine Labs\": 'ckd-valueset-creatinine'\n\ncode \"Blood pressure systolic and diastolic\": '55284-4' from \"LOINC\"\n\ncontext Patient\n\n// Conditions\n//\ndefine \"Has CKD or Diabetes\":\n \"Has CKD\" or \"Has Diabetes\"\n\ndefine \"Has CKD\":\n exists( \"Chronic Kidney Disease Dx\" )\n\ndefine \"Has Diabetes\":\n exists( \"Diabetes Dx\" )\n\ndefine \"CKD or Diabetes Dx\":\n \"Chronic Kidney Disease Dx\" union \"Diabetes Dx\"\n\ndefine \"Chronic Kidney Disease Dx\":\n [Condition: code in \"Chronic Kidney Disease\"] condition\n where condition.clinicalStatus.value in { 'active', 'recurrence' }\n\ndefine \"Diabetes Dx\":\n [Condition: code in \"Diabetes mellitus\"] condition\n where condition.clinicalStatus.value in { 'active', 'recurrence' }\n\n// Laboratory observations\n//\ndefine \"Has eGFR or UACR Lab\":\n \"Last eGFR Lab Result\" is not null\n or \"Last UACR Lab Result\" is not null\n\ndefine \"Last eGFR Lab Result\":\n Last( [Observation: code in \"eGFR Labs\"] )\n\ndefine \"Last eGFR Quantity\":\n \"Last eGFR Lab Result\" Result\n return ToQuantity(Result.value as Quantity)\n\ndefine \"Has Abnormal eGFR\":\n \"Last eGFR Quantity\".value < 60\n\ndefine \"Last UACR Lab Result\":\n Last( [Observation: code in \"UACR Labs\"] )\n\ndefine \"Last UACR Quantity\":\n \"Last UACR Lab Result\" Result\n return ToQuantity(Result.value as Quantity)\n\ndefine \"Has Abnormal UACR\":\n \"Last UACR Quantity\" uacr\n return UACRtoMetric(uacr).value > 30\n\ndefine \"Last Creatinine Lab Result\":\n Last( [Observation: code in \"Creatinine Labs\"] )\n\ndefine \"Last Creatinine Quantity\":\n \"Last Creatinine Lab Result\" Result\n return ToQuantity(Result.value as Quantity)\n\ndefine \"Needs eGFR Lab\":\n \"eGFR Lab is Overdue\"\n or (\"eGFR Lab Frequency\" is not null and \"Last eGFR Lab Result\" is null)\n\ndefine \"eGFR Lab Frequency\":\n case\n when \"CKD Stage\" >= 4\n then 3 months\n when \"CKD Stage\" >= 3\n then 6 months\n when \"Has CKD or Diabetes\"\n then 12 months\n else null\n end\n\ndefine \"eGFR Lab is Overdue\":\n \"Last eGFR Lab Result\" Result\n return\n case\n when Result.effective is null\n then true\n when Result.effective is dateTime\n then (Result.effective.value + \"eGFR Lab Frequency\") < Today()\n when Result.effective is Period\n then (end of PeriodToInterval(Result.effective) + \"eGFR Lab Frequency\") < Today()\n else false\n end\n\ndefine NeedsGFRSummary: 'Order Renal Lab Panel'\n\ndefine NeedsGFRDetail:\n case\n when \"CKD Stage\" >= 1\n then 'eGFR lab recommended every ' + ToString(\"eGFR Lab Frequency\") + ' for Stage ' + ToString(\"CKD Stage\") + ' CKD.'\n when \"Has CKD or Diabetes\"\n then 'eGFR lab recommended every ' + ToString(\"eGFR Lab Frequency\") + ' for CKD or Diabetes.'\n else null\n end\n\ndefine NeedsGFRSeverity: 'info'\n\ndefine \"CKD Stage\":\n \"Last eGFR Quantity\" egfr\n return case\n when egfr.value < 15\n then 5\n when egfr.value < 30\n then 4\n when egfr.value < 60\n then 3\n when egfr.value < 90\n then 2\n when egfr.value >= 90\n // TODO this does not parse\n //case when UACRtoMetric(\"Get UACR Quantity\").value > 20\n // then 1\n //else 0\n //end\n then 0\n else 0\n end\n\n// Referrals\n//\ndefine \"Recommend Nephrology Referral\":\n \"5-Year Risk Level\" = 'High'\n\ndefine NephrologyReferralDetail: 'Referral to a nephrologist is recommended when 5-year risk is High'\n\ndefine NephrologyReferralSeverity: 'info'\n\n//\n// Tangri CKD risk model\n//\n// 4 variable\n// 1 – 0.9750 ^ exp (-0.2201 × (age/10 – 7.036) + 0.2467 × (male – 0.5642) – 0.5567 × (eGFR/5 – 7.222) + 0.4510 × (logACR – 5.137))\n// 5 year factor = 0.9240\n//\n// 8 variable\n// 1 – 0.9780 ^ exp (-0.1992 × (age/10 – 7.036) + 0.1602 × (male – 0.5642) – 0.4919 × (eGFR/5 – 7.222) + 0.3364 × (logACR – 5.137)\n// – 0.3441 × (albumin – 3.997) + 0.2604 × (phosphorous – 3.916) – 0.07354 × (bicarbonate – 25.57) – 0.2228 × (calcium – 9.355))\n// 5 year factor = 0.9301\n\ndefine \"2-YearRiskDetail\":\n '2-year kidney failure risk of ' + ToString(\"2-Year CKD Risk Percent\") + '% is considered to be ' + \"2-Year Risk Level\" + ' risk.'\n\ndefine \"5-YearRiskDetail\":\n '5-year kidney failure risk of ' + ToString(\"5-Year CKD Risk Percent\") + '% is considered to be ' + \"5-Year Risk Level\" + ' risk.'\n\ndefine \"2-YearRiskSeverity\": if \"2-Year Risk Level\" = 'High' then 'warning' else 'info'\n\ndefine \"5-YearRiskSeverity\": if \"5-Year Risk Level\" = 'High' then 'warning' else 'info'\n\ndefine \"2-Year CKD Risk Percent\":\n \"2-Year CKD Risk\" risk\n return Round(risk * 100, 2)\n\ndefine \"5-Year CKD Risk Percent\":\n \"5-Year CKD Risk\" risk\n return Round(risk * 100, 2)\n\ndefine \"2-Year CKD Risk\":\n \"Last eGFR Quantity\" egfr\n return calculateCkdRisk(0.9750, 0, AgeInYears(), egfr, UACRtoMetric(\"Last UACR Quantity\"))\n\ndefine \"5-Year CKD Risk\":\n \"Last eGFR Quantity\" egfr\n return calculateCkdRisk(0.9240, 0, AgeInYears(), egfr, UACRtoMetric(\"Last UACR Quantity\"))\n\n// The ckdFactor is a variable determined by (Non-) North American location and whether calculation is 2 or 5 year prediction\ndefine function calculateCkdRisk(ckdFactor Decimal, sex Integer, age Integer, egfr System.Quantity, acr System.Quantity):\n 1.0 - Power(ckdFactor, Exp(-0.2201 * (age / 10 - 7.036) + 0.2467 * (sex - 0.5642) - 0.5567 * (egfr.value / 5 - 7.222) + 0.4510 * (Ln(acr.value) - 5.137)))\n\ndefine \"2-Year Risk Level\":\n \"2-Year CKD Risk Percent\" riskPercent\n return case\n when riskPercent < 5\n then 'Low'\n when riskPercent < 15\n then 'Intermediate'\n when riskPercent > 15\n then 'High'\n else null\n end\n\ndefine \"5-Year Risk Level\":\n \"5-Year CKD Risk Percent\" riskPercent\n return case\n when riskPercent < 5\n then 'Low'\n when riskPercent < 15\n then 'Intermediate'\n when riskPercent > 15\n then 'High'\n else null\n end\n\n// Conversion functions\n\ndefine function PeriodToInterval(value FHIR.Period):\n Interval[value.\"start\".value, value.\"end\".value]\n\ndefine function CodingToCode(coding FHIR.Coding):\n System.Code {\n code: coding.code.value,\n system: coding.system.value,\n version: coding.version.value,\n display: coding.display.value\n }\n\ndefine function ToConcept(concept FHIR.CodeableConcept):\n System.Concept {\n codes: concept.coding C return CodingToCode(C),\n display: concept.text.value\n }\n\ndefine function ToQuantity(quantity FHIR.Quantity):\n System.Quantity {\n value: quantity.value.value,\n unit: quantity.unit.value\n }\n\ndefine function UACRtoMetric(qty System.Quantity):\n case when qty.unit = 'mg/mmol creatinine' then\n System.Quantity { value: qty.value * 8.84, unit: 'mg/g' }\n when qty.unit = 'mg/g' then\n qty\n else\n // unknown units, ignore this quantity in calculation\n null\n end\n\ndefine function ToMetric(qty System.Quantity):\n case when qty.unit = 'lb' then\n System.Quantity { value: qty.value * 0.454, unit: 'kg' }\n when qty.unit = 'in' then\n System.Quantity { value: qty.value * 0.0254, unit: 'm' }\n else\n qty\n end\n</code></pre></div>"
];
fhir:DomainResource.extension [
fhir:index 0;
fhir:Extension.url [ fhir:value "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability" ];
fhir:Extension.valueCode [ fhir:value "shareable" ]
], [
fhir:index 1;
fhir:Extension.url [ fhir:value "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability" ];
fhir:Extension.valueCode [ fhir:value "computable" ]
], [
fhir:index 2;
fhir:Extension.url [ fhir:value "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability" ];
fhir:Extension.valueCode [ fhir:value "publishable" ]
], [
fhir:index 3;
fhir:Extension.url [ fhir:value "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeRepresentationLevel" ];
fhir:Extension.valueCode [ fhir:value "structured" ]
];
fhir:Library.url [ fhir:value "http://hl7.org/fhir/uv/cpg/Library/CKDRiskLogic"];
fhir:Library.version [ fhir:value "1.0.0"];
fhir:Library.name [ fhir:value "CKDRiskLogic"];
fhir:Library.title [ fhir:value "Chronic Kidney Disease (CKD) risk screening logic"];
fhir:Library.status [ fhir:value "active"];
fhir:Library.experimental [ fhir:value "true"^^xsd:boolean];
fhir:Library.type [
fhir:CodeableConcept.coding [
fhir:index 0;
fhir:Coding.system [ fhir:value "http://terminology.hl7.org/CodeSystem/library-type" ];
fhir:Coding.code [ fhir:value "logic-library" ] ]
];
fhir:Library.date [ fhir:value "2021-02-11T20:30:11+00:00"^^xsd:dateTime];
fhir:Library.publisher [ fhir:value "HL7 FHIR Clinical Guidelines Example Artifact"];
fhir:Library.description [ fhir:value "Chronic Kidney Disease (CKD) risk screening logic"];
fhir:Library.jurisdiction [
fhir:index 0;
fhir:CodeableConcept.coding [
fhir:index 0;
fhir:Coding.system [ fhir:value "http://unstats.un.org/unsd/methods/m49/m49.htm" ];
fhir:Coding.code [ fhir:value "001" ];
fhir:Coding.display [ fhir:value "World" ] ]
];
fhir:Library.content [
fhir:index 0;
fhir:Attachment.contentType [ fhir:value "text/cql" ];
fhir:Attachment.data [ fhir:value "bGlicmFyeSBDS0RSaXNrTG9naWMgdmVyc2lvbiAnMS4wJwoKdXNpbmcgRkhJUiB2ZXJzaW9uICc0LjAuMCcKCmluY2x1ZGUgRkhJUkhlbHBlcnMgdmVyc2lvbiAnNC4wLjAnIGNhbGxlZCBGSElSSGVscGVycwoKY29kZXN5c3RlbSAiU05PTUVEQ1QiOiAnaHR0cDovL3Nub21lZC5pbmZvL3NjdCcKY29kZXN5c3RlbSAiTE9JTkMiOiAnaHR0cDovL2xvaW5jLm9yZycKY29kZXN5c3RlbSAiUnhOb3JtIjogJ2h0dHA6Ly93d3cubmxtLm5paC5nb3YvcmVzZWFyY2gvdW1scy9yeG5vcm0nCgp2YWx1ZXNldCAiQ2hyb25pYyBLaWRuZXkgRGlzZWFzZSI6ICdja2QtdmFsdWVzZXQtY2tkJwp2YWx1ZXNldCAiRGlhYmV0ZXMgbWVsbGl0dXMiOiAnY2tkLXZhbHVlc2V0LWRpYWJldGVzJwoKdmFsdWVzZXQgImVHRlIgTGFicyI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dHkpOgogICAgU3lzdGVtLlF1YW50aXR5IHsKICAgICAgICB2YWx1ZTogcXVhbnRpdHkudmFsdWUudmFsdWUsCiAgICAgICAgdW5pdDogcXVhbnRpdHkudW5pdC52YWx1ZQogICAgfQoKZGVmaW5lIGZ1bmN0aW9uIFVBQ1J0b01ldHJpYyhxdHkgU3lzdGVtLlF1YW50aXR5KToKCWNhc2Ugd2hlbiBxdHkudW5pdCA9ICdtZy9tbW9sIGNyZWF0aW5pbmUnIHRoZW4KCQlTeXN0ZW0uUXVhbnRpdHkgeyB2YWx1ZTogcXR5LnZhbHVlICogOC44NCwgdW5pdDogJ21nL2cnIH0KCXdoZW4gcXR5LnVuaXQgPSAnbWcvZycgdGhlbgogICAgcXR5CgllbHNlCiAgICAvLyB1bmtub3duIHVuaXRzLCBpZ25vcmUgdGhpcyBxdWFudGl0eSBpbiBjYWxjdWxhdGlvbgoJCW51bGwKCWVuZAoKZGVmaW5lIGZ1bmN0aW9uIFRvTWV0cmljKHF0eSBTeXN0ZW0uUXVhbnRpdHkpOgoJY2FzZSB3aGVuIHF0eS51bml0ID0gJ2xiJyB0aGVuCgkJU3lzdGVtLlF1YW50aXR5IHsgdmFsdWU6IHF0eS52YWx1ZSAqIDAuNDU0LCB1bml0OiAna2cnIH0KCXdoZW4gcXR5LnVuaXQgPSAnaW4nIHRoZW4KCQlTeXN0ZW0uUXVhbnRpdHkgeyB2YWx1ZTogcXR5LnZhbHVlICogMC4wMjU0LCB1bml0OiAnbScgfQoJZWxzZQoJCXF0eQoJZW5kCg=="^^xsd:base64Binary ]
].
# - ontology header ------------------------------------------------------------
a owl:Ontology;
owl:imports fhir:fhir.ttl.