Skip to content

Commit

Permalink
add quantity
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen authored and Amy Chen committed Nov 13, 2024
1 parent 64264a3 commit 329b619
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/config/report_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ const reportConfig = [
id: `${MEDICATION_LIST_DATA_KEY}_table`,
headers: {
Drug_Description: "Name",
Quantity: "Quantity",
Dosage: "Dosage",
Written_Date: {
key: "Start",
Expand Down
1 change: 1 addition & 0 deletions src/cql/r4/Report_LogicLibrary.cql
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ define MedicationList:
Name: ConceptText(M.medication as FHIR.CodeableConcept),
Start: DateTimeText(M.authoredOn),
Dosage: M.dosageInstruction.text.value,
Quantity: if M.dispenseRequest is not null and M.dispenseRequest.quantity is not null then M.dispenseRequest.quantity.value.value else null,
Prescriber: M.requester.display.value,
Authored: M.authoredOn.value
}
Expand Down
57 changes: 57 additions & 0 deletions src/cql/r4/Report_LogicLibrary.json
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,63 @@
}
}
}
}, {
"name" : "Quantity",
"value" : {
"type" : "If",
"condition" : {
"type" : "And",
"operand" : [ {
"type" : "Not",
"operand" : {
"type" : "IsNull",
"operand" : {
"path" : "dispenseRequest",
"scope" : "M",
"type" : "Property"
}
}
}, {
"type" : "Not",
"operand" : {
"type" : "IsNull",
"operand" : {
"path" : "quantity",
"type" : "Property",
"source" : {
"path" : "dispenseRequest",
"scope" : "M",
"type" : "Property"
}
}
}
} ]
},
"then" : {
"path" : "value",
"type" : "Property",
"source" : {
"path" : "value",
"type" : "Property",
"source" : {
"path" : "quantity",
"type" : "Property",
"source" : {
"path" : "dispenseRequest",
"scope" : "M",
"type" : "Property"
}
}
}
},
"else" : {
"asType" : "{urn:hl7-org:elm-types:r1}Decimal",
"type" : "As",
"operand" : {
"type" : "Null"
}
}
}
}, {
"name" : "Prescriber",
"value" : {
Expand Down

0 comments on commit 329b619

Please sign in to comment.