Skip to content

Commit

Permalink
Resulting testing updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pmanko committed May 3, 2024
1 parent 0778e99 commit 6438872
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
6 changes: 3 additions & 3 deletions data/templates/fhir/ORM_O01_TO_IPMS.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#with msg.fhir}}
MSH|^~\&|LAB||LAB||{{date}}||ORM^O01|{{controlId}}|D|2.4|||AL|NE|
MSH|^~\&|{{orderTypeFlag}}||{{orderTypeFlag}}||{{date}}||ORM^O01|{{controlId}}|D|2.4|||AL|NE|
PID|1||{{medicalRecordNumber}}^^^^MR^GGC~{{patientOmang}}^^^^SS^GGC~{{patientIdentifier}}^^^^PI^GGC~{{unknownIdentifier}}^^^^HUB^GGC||{{patientFamilyName}}^{{patientFirstName.[0]}}^^^^^L||{{patientDoB}}|{{sex}}||CT|{{patientStreetAddress}}^^{{patientCity}}^{{patientProvince}}^{{patientPostalCode}}||{{patientBusinessPhoneNumber}}|||{{maritalStatus}}||{{patientAccountNumber}}|
ORC|NW|{{labOrderId}}^LAB|{{medicalRecordNumber}}||FINAL||^^^^^R^||{{labOrderDatetime}}|||
OBR|1|{{labOrderId}}^LAB||{{labOrderMnemonic}}^{{labOrderName}}|R|{{labOrderDatetime}}|{{labOrderDatetime}}|||||||^^|{{providerId}}^{{providerLastName}}^{{providerFirstName.[0]}}^^^^^||
ORC|NW|{{labOrderId}}^{{orderTypeFlag}}|{{medicalRecordNumber}}||FINAL||^^^^^R^||{{labOrderDatetime}}|||
OBR|1|{{labOrderId}}^{{orderTypeFlag}}||{{labOrderMnemonic}}^{{labOrderName}}|R|{{labOrderDatetime}}|{{labOrderDatetime}}||||||||SPUTUM^^^SPUTUM|{{providerId}}^{{providerLastName}}^{{providerFirstName.[0]}}^^^^^||
{{/with}}
4 changes: 4 additions & 0 deletions data/templates/hl7v2/CodeSystem/IDType.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@
"code" : "IND",
"display" : "Indigenous/Aboriginal",
"system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
{{else if (eq inCode 'LAB')}},
"code" : "LAB",
"display" : "Laboratory Order ID",
"system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
{{else if (eq inCode 'LACSN')}},
"code" : "LACSN",
"display" : "Laboratory Accession ID",
Expand Down
14 changes: 12 additions & 2 deletions data/templates/hl7v2/Resources/DiagnosticReport.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,18 @@
],
},
},
{ {{>DataType/EIIdentifier.hbs EI=OBR-2}} },
{ {{>DataType/EIIdentifier.hbs EI=OBR-3}} },
{{#if OBR-2}},
{
"system":"http://moh.bw.org/ext/identifier/lab-order-id",
{{>DataType/EIIdentifier.hbs EI=OBR-2}},
},
{{/if}},
{{#if OBR-3}},
{
"system":"http://moh.bw.org/ext/identifier/pi",
{{>DataType/EIIdentifier.hbs EI=OBR-3}},
},
{{/if}},
],
"effectiveDateTime":"{{formatAsDateTime ORC-9}}",
{{#if (not OBR-8)}},
Expand Down
4 changes: 2 additions & 2 deletions debug.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
container_name: built-fhir-converter
hostname: fhir-converter
restart: unless-stopped
image: ghcr.io/b-techbw/openhim-mediator-fhir-converter:debug
image: itechuw/openhim-mediator-fhir-converter:debug
build: ./
ports:
- 2019:2019
Expand All @@ -32,4 +32,4 @@ services:
networks:
hie:
external: true
name: hie-botswana_hie
name: openhim_public
5 changes: 5 additions & 0 deletions src/lib/fhir/fhir.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,13 @@ module.exports = class fhir extends dataHandler {
let ipmsCode = serviceRequest.code.coding.find(e => e.system == "https://api.openconceptlab.org/orgs/I-TECH-UW/sources/IPMSLAB/")
res.labOrderMnemonic = ipmsCode && ipmsCode.code ? ipmsCode.code : "";
res.labOrderName = ipmsCode && ipmsCode.display ? ipmsCode.display : "";
if(ipmsCode && ipmsCode.extension && ipmsCode.extension.length > 0) {
let orderTypeFlag = ipmsCode.extension.find(e => e && e.url && e.url.includes("ipms-order-type") && e.valueString)
res.orderTypeFlag = orderTypeFlag ? orderTypeFlag.valueString : "LAB";
}
}


return res;
}

Expand Down

0 comments on commit 6438872

Please sign in to comment.