1

I am using the latest version of HAPI to create an ORM message; the message seems to be generating fine. The specific question I have is on the location of the DG1 (diagnosis segment).

For example - in this output, the DG1 is part of the ORC/OBR segment -

Sample message (copied from another source)

MSH|^~\&|EPIC|EPIC|||20140418173314|1148|ORM^O01|497|D|2.3||
PID|1||20891312^^^^EPI||APPLESEED^JOHN^A^^MR.^||19661201|M||AfrAm|505 S. HAMILTON AVE^^MADISON^WI^53505^US^^^DN |DN|(608)123-4567|(608)123-5678||S|| 11480003|123-45-7890||||^^^WI^^
PD1|||FACILITY(EAST)^^12345|1173^MATTHEWS^JAMES^A^^^
PV1|||^^^CARE HEALTH SYSTEMS^^^^^||| |1173^MATTHEWS^JAMES^A^^^||||||||||||610613||||||||||||||||||||||||||||||||V
ORC|NW|987654^EPIC|76543^EPC||Final||^^^20140418170014^^^^||20140418173314|1148^PATTERSON^JAMES^^^^||1173^MATTHEWS^JAMES^A^^^|1133^^^222^^^^^|(618)222-1122||
OBR|1|363463^EPC|1858^EPC|73610^X-RAY ANKLE 3+ VW^^^X-RAY ANKLE ||||||||||||1173^MATTHEWS^JAMES^A^^^|(608)258-
8866||||||||Final||^^^20140418170014^^^^|||||6064^MANSFIELD^JEREMY^^^^||1148010^1A^EAST^X-RAY^^^|^|
**DG1||I10|S82^ANKLE FRACTURE^I10|ANKLE FRACTURE||**

But the desired output (from one of the leading labs) is to have the DG1 part of the PID group -

MSH|^~\&|EPIC|EPIC|||20140418173314|1148|ORM^O01|497|D|2.3||
PID|1||20891312^^^^EPI||APPLESEED^JOHN^A^^MR.^||19661201|M||AfrAm|505 S. HAMILTON AVE^^MADISON^WI^53505^US^^^DN |DN|(608)123-4567|(608)123-5678||S|| 11480003|123-45-7890||||^^^WI^^
PD1|||FACILITY(EAST)^^12345|1173^MATTHEWS^JAMES^A^^^
PV1|||^^^CARE HEALTH SYSTEMS^^^^^||| |1173^MATTHEWS^JAMES^A^^^||||||||||||610613||||||||||||||||||||||||||||||||V
**DG1||I10|S82^ANKLE FRACTURE^I10|ANKLE FRACTURE||**
ORC|NW|987654^EPIC|76543^EPC||Final||^^^20140418170014^^^^||20140418173314|1148^PATTERSON^JAMES^^^^||1173^MATTHEWS^JAMES^A^^^|1133^^^222^^^^^|(618)222-1122||
OBR|1|363463^EPC|1858^EPC|73610^X-RAY ANKLE 3+ VW^^^X-RAY ANKLE ||||||||||||1173^MATTHEWS^JAMES^A^^^|(608)258-
8866||||||||Final||^^^20140418170014^^^^|||||6064^MANSFIELD^JEREMY^^^^||1148010^1A^EAST^X-RAY^^^|^|

Any ideas - how to generate the DG1 as part of the PID segment?

Akhil S
  • 11
  • 2
  • Answering my question - you can add a custom segment order.getPATIENT().addNonstandardSegment("DG1"); and then cast that to a DG1 segment and populate the values. – Akhil S Oct 03 '16 at 16:33

1 Answers1

0

I think you misunderstood how this works and the desired output is defective. One segment can't be part of another segment. Rather a segment can be part of a segment group. In this case you need to put the DG1 segment in the ORDER_DETAIL group. So it would be after the OBR segment.

Nick Radov
  • 401
  • 2
  • 7