HL7 icon indicating copy to clipboard operation
HL7 copied to clipboard

Array to string conversion when processing ADT message

Open maxxer opened this issue 2 years ago • 3 comments

Processing the following message (and calling toString()) throws Array to string conversion in src/HL7/Message.php:388:

MSH|^~\&|SAC|PIVA|DIP_SAC|Dipartimentale|20190531204652||ADT^A40|0d9834c0-6efa-4153-aa10-e349017057c9|P|2.5
EVN||20190531204652
PID|||D298B31F-53E2-4FCD-9246-240B61792023^55^^PK~9143224^^^ABC|| COGNOME^NOME||19310525|F|||&VIA   MEUCCI 3^^020066^^46019^^H~&VIA   MEUCCI 3^^020066^^46019^^L~&^^020035^^^^BDL||^^PH~^^CP|||||CF|7289721||||020035|||||100^Italia
MRG|936815CB-75C2-45BD-BBB7-F5BEACED3D63

maxxer avatar Apr 05 '22 09:04 maxxer

This can be avoided by setting doNotSplitRepetition to true.

maxxer avatar Apr 05 '22 10:04 maxxer

That's true. Let me know if doNotSplitRepetition is not giving you the desired output. If it's working for you, we can close the ticket

senaranya avatar Apr 07 '22 09:04 senaranya

Yes, using it is a solution to me, but I was wondering if that's a correct behavior. If the library splits the field into subcomponents, then why isn't it able to recompose it later on to build the string?

maxxer avatar Apr 07 '22 10:04 maxxer