user2057882
user2057882

Reputation: 21

How to parse multiple DG1 segments in HAPI?

I would like to know if there is a standard way of using the terser for parsing hlv2 messages?

terse.get("/.DG1(i)-4") //Works
terser.get("/.PROCEDURE(i)/PR1-3-2") //Works
terser.get("/.PR1(i)-3-2") //Does not work.

What is the difference and is there documentation of how to use the terser with respect to the different segments?

Upvotes: 2

Views: 998

Answers (1)

Philipp
Philipp

Reputation: 4729

You need to specify the whole path of the segment, you can't leave anything out.

Like you said this works:

terser.get("/.PROCEDURE(i)/PR1-3-2") //Works

So this should work too:

terser.get("/.PROCEDURE(i)/PR1(1)-3-2")

But if you want to access all PR1 in any segments (not just PROCEDURE) you need to tell that with a *:

terser.get("/*(i)/PR1-3-2")

Documentation and samples you can find here http://hl7api.sourceforge.net/apidocs/ca/uhn/hl7v2/util/Terser.html

Upvotes: 1

Related Questions