Open janihur opened 1 month ago
I also tried to access OBR-segment but that fails too in the same way than accessing PID-segment fails.
If I run the code with debugger I can see in debugger's local variables section that:
inOrm.pid[0].pid5[0].xpn1 = "Lastname"
With the knowledge from the debugging I made several trials that all just failed in a one way or other.
I'm also very confused with all those record types that seems to make no sense (or I just don't understand Ballerina enough).
Looks like a bug in the hl7v23
parser.
Need to investigate further and comeup with a fix
[1]https://github.com/ballerina-platform/module-ballerinax-health.hl7v2/blob/main/hl7v23/hl7_parser.bal#L103 [2]https://github.com/ballerina-platform/module-ballerinax-health.hl7v2/blob/main/hl7v23/message_orm_o01.bal#L36 [3]https://github.com/ballerina-platform/module-ballerinax-health.hl7v2/blob/main/hl7v23/hl7_parser.bal#L109 [4]https://github.com/ballerina-platform/module-ballerinax-health.hl7v2/blob/main/hl7v23/hl7_parser.bal#L135
I also tried to access OBR-segment but that fails too in the same way than accessing PID-segment fails.
If I run the code with debugger I can see in debugger's local variables section that:
inOrm.pid[0].pid5[0].xpn1 = "Lastname"
With the knowledge from the debugging I made several trials that all just failed in a one way or other.
I'm also very confused with all those record types that seems to make no sense (or I just don't understand Ballerina enough). Hi @janihur this issue happens due to a parsing issue of the segment grouos. The mentioned segments in the issue "PID", "OBR" should reside on respective segment groups of the ORM message. Currently they are placed at the root level which is the errorneous behaviour. We are working on fixing this and release the packages soon. We'll update you on this ticket and the discord thread once done.
Hi @janihur,
This issue has been fixed in the latest patch release. you should be able to access these segments(PV1, OBR) with the segment groups such as following,
hl7v23:ORM_O01 inOrm = check parsedMsg.ensureType(hl7v23:ORM_O01);
io:println(inOrm.patient[0].pid.pid1);
io:println(inOrm.patient[0].orm_o01_patient_visit?.pv1?.pv11);
io:println(inOrm.'order[0].orm_o01_order_detail?.orm_o01_order_detail_segment?.obr?.obr1);
Please let us know if you need further assistance or encounter any other issues.
Thanks,
Description: Based on the ORM_O01 documentation, I can't figure out how to access the values of the PID segment. AFAICS the record access paths (e.g.
inOrm.patient[0].pid.pid5[0].xpn1
) are correct.The MSH segment works as documented.
Steps to reproduce:
The program below outputs:
When the following output is expected:
The program:
Affected Versions: