Not directly a Mirth problem, but related....
I'm trying to use a HAPI Terser in a non-Mirth Java app to pull out a value that I can't retrieve using the normal methods. Room number - I think it's in the wrong location per the HL7 spec, so I need to "brute-force" it.
Message segment in question:
PV1||218-A|O
Terser terser = new Terser(priacn.getmsg());
String roomno = "";
try {
roomno = terser.get("/.PV1-3-1");
} catch (HL7Exception ex) {
ex.printStackTrace();
}
System.out.println(roomno);
...roomno returns null, instead of 218-A. (Not getting an exception.)
Just to make sure I'm looking at valid data,
PipeParser qp = new PipeParser();
String qs = "";
try {
qs = qp.encode(priacn.getmsg());
} catch (HL7Exception ex) {
ex.printStackTrace();
}
System.out.println(qs);
... dumps out a valid HL7 message, complete with the room number in PV1.3 as it is in the source message.
Any idea what I'm doing wrong? The HAPI examples are a little sparse...
Thanks - mike
I'm trying to use a HAPI Terser in a non-Mirth Java app to pull out a value that I can't retrieve using the normal methods. Room number - I think it's in the wrong location per the HL7 spec, so I need to "brute-force" it.
Message segment in question:
PV1||218-A|O
Terser terser = new Terser(priacn.getmsg());
String roomno = "";
try {
roomno = terser.get("/.PV1-3-1");
} catch (HL7Exception ex) {
ex.printStackTrace();
}
System.out.println(roomno);
...roomno returns null, instead of 218-A. (Not getting an exception.)
Just to make sure I'm looking at valid data,
PipeParser qp = new PipeParser();
String qs = "";
try {
qs = qp.encode(priacn.getmsg());
} catch (HL7Exception ex) {
ex.printStackTrace();
}
System.out.println(qs);
... dumps out a valid HL7 message, complete with the room number in PV1.3 as it is in the source message.
Any idea what I'm doing wrong? The HAPI examples are a little sparse...
Thanks - mike
Comment