I am having the following Demo HL7 script which I need to retrieve using Terser.
MSH||||||||||||||||||||||||||||||
EVN||||||||||||||||||||||||||||||
PID|||3214^^^^|||||||||||||||||||
PV1||||||||||||||||||||||||||||||
PV2||||||||||||||||||||||||||||||
IN1|1|^Test IN1(1)|||||||||||||||
IN2|||^Test IN2^^^|||||||||||||||
IN1|2|^Test IN1(2)|||||||||||||||
IN2|||^Test IN2^^^|||||||||||||||
ROL|||^Test ROL^^^|||||||||||||||
DG1|||^Test DG1^^^|||||||||||||||
OBX||CWE|||||||||||||||||||||||||
GT1||123456^^^90XXXX^SS^^||||||||
NK1||^Test NK1^^^||||||||||||||||
ACC||^Test ACC^^^||||||||||||||||
ZAR|Test Z1||||||||||||||||||||||
ZSH|Test Z|||||||||||||||||||||||
ZAR|Test Z2||||||||||||||||||||||
ZSH|Test Z|||||||||||||||||||||||
I am having following issues. Please help.
When I am retrieving the following - terser.get("/PID-3-1") - I am getting the expected result i.e. 3214.
But the following result is giving NULL - terser.get("/ROL-3-2"), terser.get("/DG1-3-1"), terser.get("/OBX-2"), terser.get("/GT1-2-1"), terser.get("/NK1-2-2"), terser.get("/ACC-2-2").
Please help me to retrieve ROL, DG1, OBX, GT1, NK1 and ACC segments.
Also if I retrieve terser.get("/IN1-2-2"), I am having the expected result. But I am not able to retrieve the repetition of IN1. I have tried ("/IN1(1)-2-2"), ("/.INSURANCE(1)/.IN1-2-2") but didn't help.
When I am retrieving external segment ("/ZAR-1"), it is returning my result. But I am not able to retrieve ("/ZAR(1)-1"), it's giving NULL. However if the 2nd ZAR segment comes after the 1st ZAR without any ZSH segment then I can retrieve the repetition of ZAR using ("/ZAR(1)-1").
I am waiting for your responses.
Please provide details about the MSH segment. The Terser paths depend on the event type and the HL7 version.
Segment - MSH|^~\&|||||||ADT^A01|P|2.8.1||1
Event Type is A01 and HL7 version is 2.8.1.
Last edit: Supratim Paul 2020-01-24
Here is a working example (should also work with 2.8.1):
And the output is
Thanks for your input. Can you specify the exact Hapi JAR name?