Id: |
MNACInitialExpressions |
Version: |
0.1.0 |
Url: |
MNACInitialExpressions |
Status: |
draft |
Type: |
code: logic-library
|
Date: |
2024-11-18 00:51:22+0000 |
Publisher: |
Clinical Quality Framework |
Jurisdiction: |
840 |
Related Artifacts: |
Dependencies
|
Parameters: |
Name | Type | Min | Max | In/Out |
Patient | Resource | 0 | 1 | Out |
All ServiceRequests | ServiceRequest | 0 | * | Out |
Most Recent ServiceRequest | ServiceRequest | 0 | 1 | Out |
Date of Request | dateTime | 0 | 1 | Out |
SR Related Condition | Condition | 0 | * | Out |
Diagnosis | string | 0 | 1 | Out |
Item Requested | string | 0 | * | Out |
UTI Diagnostic Reports Last Year | DiagnosticReport | 0 | * | Out |
UTI in Last Year | boolean | 0 | 1 | Out |
Lab Reports UTIs | Attachment | 0 | * | Out |
Dates of UTIs | dateTime | 0 | * | Out |
Antibiotics Used | | 0 | * | Out |
Check Symptoms | string | 0 | 1 | Out |
Fever Temperature | string | 0 | 1 | Out |
Catheterization Frequency | string | 0 | 1 | Out |
Additional Comment | string | 0 | 1 | Out |
Requesting Physician | Resource | 0 | 1 | Out |
Physician Name | string | 0 | * | Out |
Physician Telephone | string | 0 | 1 | Out |
Physician Fax | string | 0 | 1 | Out |
Referring Physician Telephone | string | 0 | 1 | Out |
Date | date | 0 | 1 | Out |
|
Data Requirements: |
Type | Profile | MS | Code Filter |
Patient |
http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient |
|
|
ServiceRequest |
http://hl7.org/fhir/StructureDefinition/ServiceRequest |
|
|
Condition |
http://hl7.org/fhir/StructureDefinition/Condition |
;; |
|
Condition |
http://hl7.org/fhir/StructureDefinition/Condition |
;; |
|
DiagnosticReport |
http://hl7.org/fhir/StructureDefinition/DiagnosticReport |
;;;;; |
|
DiagnosticReport |
http://hl7.org/fhir/StructureDefinition/DiagnosticReport |
;;;;; |
|
DiagnosticReport |
http://hl7.org/fhir/StructureDefinition/DiagnosticReport |
;;;;; |
|
DiagnosticReport |
http://hl7.org/fhir/StructureDefinition/DiagnosticReport |
;;;;; |
|
|
http://hl7.org/fhir/StructureDefinition/MedicationStatement |
; |
|
DiagnosticReport |
http://hl7.org/fhir/StructureDefinition/DiagnosticReport |
;;;;; |
|
Practitioner |
http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner |
;;;; |
|
Practitioner |
http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner |
;;;; |
|
DiagnosticReport |
http://hl7.org/fhir/StructureDefinition/DiagnosticReport |
;;;;; |
|
|
Content: text/cql |
library MNACInitialExpressions version '0.1.0'
using USCore version '3.1.1'
using FHIR version '4.0.1'
include FHIRHelpers version '4.1.0'
include USCoreCommon version '0.1.0' called UC
include USCoreElements version '0.1.0' called UCE
codesystem "Identifier Type": 'http://terminology.hl7.org/CodeSystem/v2-0203'
codesystem "ICD10": 'http://hl7.org/fhir/sid/icd-10-cm'
codesystem "SNOMED CT": 'http://snomed.info/sct'
code "Member Number": 'MB' from "Identifier Type"
code "UTI": 'T83.5' from "ICD10"
code "Abnormal Urine Finding": '102866000' from "SNOMED CT"
context Patient
define "Date of Request":
"Most Recent ServiceRequest".authoredOn
//https://www.hca.wa.gov/assets/billers-and-providers/13-760.pdf
define "Diagnosis":
First("SR Related Condition".code).text.value
define "Item Requested":
"Most Recent ServiceRequest".code.coding.display.value
define "UTI in Last Year":
Exists("UTI Diagnostic Reports Last Year")
define "Lab Reports UTIs":
"UTI Diagnostic Reports Last Year".presentedForm
define "Dates of UTIs":
"UTI Diagnostic Reports Last Year".effective.value
//TODO: create example MedicationStatement
define "Antibiotics Used":
[FHIR.MedicationStatement] MS
where First(MS.reasonReference.reference) in "UTI Diagnostic Reports Last Year".id
define "Check Symptoms":
'TBD'
define "Fever Temperature":
'TBD'
define "Catheterization Frequency":
'TBD'
define "Additional Comment":
'TBD'
define "Physician Name":
"Requesting Physician".name.family
define "Physician Telephone":
UC.Mobile("Requesting Physician".telecom).value
define "Physician Fax":
Fax("Requesting Physician".telecom).value
define "Referring Physician Telephone":
'TBD'
define "Date":
Today()
//helper definitions
define "All ServiceRequests":
[FHIR.ServiceRequest]
define "Most Recent ServiceRequest":
UC.MostRecentSR("All ServiceRequests")
define "SR Related Condition":
[FHIR.Condition] C
where EndsWith(First("Most Recent ServiceRequest".reasonReference.reference.value), C.id)
define "UTI Diagnostic Reports Last Year":
[FHIR.DiagnosticReport] C
where "Abnormal Urine Finding".code in C.conclusionCode.coding.code
and C.effective > (Today() - 1 year)
define "Requesting Physician":
singleton from (
[USCore.PractitionerProfile] P
where EndsWith("Most Recent ServiceRequest".requester.reference, P.id))
define function Fax(contactPoints List<USCore.ContactPoint>):
singleton from (contactPoints P where P.system = 'fax')
|
|
Content: application/elm+xml |
Encoded data (68456 characters)
|
|
Content: application/elm+json |
Encoded data (119980 characters)
|
|