Skip to content

Commit

Permalink
Merge pull request #1 from I-TECH-UW/pmanko-server-update
Browse files Browse the repository at this point in the history
Updated templates for BW lab workflows
  • Loading branch information
pmanko authored Jan 18, 2023
2 parents 7658faa + 453a5fb commit 5492096
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 15 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /app
COPY ./package.json /app
COPY ./.eslintrc.js /app
COPY ./tsconfig.json /app
COPY ./yarn.lock /app

RUN yarn install --network-timeout 1000000

Expand Down
6 changes: 3 additions & 3 deletions data/templates/fhir/ADT_A04_TO_IPMS.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{#with msg.fhir}}
MSH|^~\&|DM||||{{date}}||ADT^A04|{{controlId}}|D|2.4|||AL|NE
MSH|^~\&|DM||||{{date}}||ADT^A04|{{controlId}}|D|2.4|||AL|NE|
EVN||{{date}}|||ZZHGGMMO^Healthpost^Mmopane|{{date}}|
PID|1||NEW||{{patientFamilyName}}^{{patientFirstName}}^^^^^F||{{patientDob}}|{{patientSex}}||CT|{{patientStreetAddress}}^^{{patientCity}}^{{patientProvince}}^{{patientPostalCode}}||{{patientHomePhoneNumber}}^^^{{patientEmail}}|{{patientBusinessPhoneNumber}}||{{patientMaritalStatus}}|AC||{{patientOmang}}|
V1|1|O|HGGMMO||||ZZHGGMMO^Healthpost^Mmopane^^^^^^^^^^XX|||||||||||POV||U|||||||||||||||||||GGC||REG|||{{date}}|
PV1|1|O|HGGMMO||||ZZHGGMMO^Healthpost^Mmopane^^^^^^^^^^XX|||||||||||POV||U|||||||||||||||||||GGC||REG|||{{date}}|
ROL|1|AD|AT|{{providerId}}^{{providerLastName}}^{{providerFirstName}}|
{{/with}}
{{/with}}
7 changes: 3 additions & 4 deletions data/templates/fhir/ORM_O01_TO_IPMS.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{{#with msg.fhir}}
MSH|^~&|PIMS||IPMS||{{date}}||ORM^O01|{{controlId}}|D|2.4|||AL|NE
PID|1||{{medicalRecordNumber}}^^^^MR^GGC~{{patientOmang}}^^^^SS^GGC~{{patientIdentifier}}^^^^PI^GGC~{{unknownIdentifier}}^^^^HUB^GGC||{{patientLastName}}^{{patientFirstName}}||{{patientDoB}}|{{sex}}||CT|{{patientStreetAddress}}^^{{patientCity}}^{{patientProvince}}^{{patientPostalCode}}||{{patientBusinessPhoneNumber}}|||S|||{{patientOmang}}|
MSH|^~\&|LAB||LAB||{{date}}||ORM^O01|{{controlId}}|D|2.4|||AL|NE|
PID|1||{{medicalRecordNumber}}^^^^MR^GGC~{{patientOmang}}^^^^SS^GGC~{{patientIdentifier}}^^^^PI^GGC~{{unknownIdentifier}}^^^^HUB^GGC||{{patientLastName}}^{{patientFirstName}}^^^^^L||{{patientDoB}}|{{sex}}||CT|{{patientStreetAddress}}^^{{patientCity}}^{{patientProvince}}^{{patientPostalCode}}||{{patientBusinessPhoneNumber}}|||{{maritalStatus}}||{{patientAccountNumber}}|
ORC|NW|{{labOrderId}}^LAB|{{medicalRecordNumber}}||||^^^^^R||{{labOrderDatetime}}|||
OBR|1|{{labOrderId}}^LAB||{{labOrderType}}|
{{/with}}

{{/with}}
3 changes: 2 additions & 1 deletion data/templates/fhir/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ PV1|1|O|HGGMMO||||ZZHGGMMO^Healthpost^Mmopane^^^^^^^^^^XX|||||||||||POV||U||||||
NK1|1|NAIDOO^HIEN|BR^Brother|Plot 92215^^Gaborone^B^0101|267 9008922|267 3203532|NOK
ROL|1|AD|AT|ZZHGGMMO^Healthpost^Mmopane
```

```
```
18 changes: 16 additions & 2 deletions data/templates/hl7v2/Resources/Patient.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,21 @@
"system": "http://hl7.org/fhir/sid/us-ssn",
"value": "{{PID-19}}"
},
{{/if}}
{{/if}},
{{#if PID-18}}
{
"type": {
"coding": [
{
"system": "http://moh.bw.org/ext/identifier/acc",
"code": "AC"
}
]
},
"system": "http://moh.bw.org/ext/identifier/acc",
"value": "{{PID-18}}"
},
{{/if}},
{
{{>DataType/DLN.hbs DLN=PID-20}},
},
Expand All @@ -43,7 +57,7 @@
{{>DataType/XPN.hbs XPN=PID-9}},
},
],
"birthDate":"",
"birthDate":"{{addHyphensDate PID-7}}",
"gender":{{>DataType/_string.hbs mapping="CodeSystem/Gender.hbs" inCode=PID-8 }},
"address":
[
Expand Down
6 changes: 3 additions & 3 deletions debug.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ services:
build: ./
ports:
- 2019:2019
- 9230:9229
- 9229:9229
volumes:
- ./config.json:/app/config.json
# - ./debug-service-templates:/app/data/service-templates
entrypoint: ./deploy/debug.sh
- ./data/templates:/app/data/service-templates
# entrypoint: ./deploy/debug.sh
networks:
- hie
# tty: true
Expand Down
15 changes: 13 additions & 2 deletions src/lib/fhir/fhir.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,19 @@ module.exports = class fhir extends dataHandler {

if(patient.identifier) {
q = patient.identifier.find(i => i.system == 'http://moh.bw.org/ext/identifier/omang');
res.patientOmang = q ? q.value : "";
res.patientOmang = q ? q.value : "";

q = patient.identifier.find(i => i.system == 'http://moh.bw.org/ext/identifier/mr');
res.medicalRecordNumber = q ? q.value : "";

q = patient.identifier.find(i => i.system == 'http://moh.bw.org/ext/identifier/acc');
res.patientAccountNumber = q ? q.value : "";

q = patient.identifier.find(i => i.system == 'http://moh.bw.org/ext/identifier/pi');
res.patientIdentifier = q ? q.value : "";

q = patient.identifier.find(i => i.system == 'http://moh.bw.org/ext/identifier/unknown' && i.value);
res.unknownIdentifier = q ? q.value : "";
}

if(patient.name) {
Expand All @@ -133,7 +145,6 @@ module.exports = class fhir extends dataHandler {
res.patientFamilyName = q ? q.family : "";
}

res.patientOmang = patient.identifier[0].value;
res.patientFirstName = patient.name[0].given[0];
res.patientLastName = patient.name[0].family;
res.patientDoB = patient.birthDate.split('-').join('');
Expand Down

0 comments on commit 5492096

Please sign in to comment.