senaranya / HL7

PHP library for Parsing, Generation and Sending HL7 v2 messages
MIT License
183 stars 86 forks source link

Field array not handling empty values #121

Closed creativehotspot closed 3 months ago

creativehotspot commented 3 months ago

When parsing an existing HL7 string and creating a new message instance, array values which are empty are not being properly cast in the fields object.

For example the PID segment 3 & 11, and ORC segment 7.

Thanks for any help and apologies if I'm making an obvious mistake!

Creating the message object: $message = HL7::from(Storage::disk('local')->get($filePath))->createMessage();

RAW message MSH|^~\&|XYZ|POL|EXTERNAL|HIS|202406051357||ORM^O01|XYZ20240605135736528|P|2.3.1|||AL|||8859/1 PID|||ABC123^^^HSO_Issuer||LASTNAME^FIRSTNAME||19900101|M|||STREET^^TOWN^^POSTCODE^COUNTRY ORC|XX|54321|54321||RI||^^^202406051415^^ROUTINE||||||||||1234567

image

creativehotspot commented 3 months ago

No issue, my mistake.

$message = new Message(Storage::disk('local')->get($filePath), null, true);