-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating an OBX.5 field with ED data type breaks on toString #102
Comments
Hello! Can you please give me a sample message, so that I can try it out? Please also share the expected and observed output for |
I'm building the ORM segments arrays based on data from a DB. This data was also consumed by HL7, using this library. The message I consumed was:
Note: I've edited because I've added the wrong HL7 string before. Just a important note, the message I've consumed did not have the repetition, but as my data mappings for the HL7 standart have them, when parsed into an array it also created the array of repetitions (containing a single element). In this case, I've added a repetition to maybe make it easier to debug on your side. The expected output is basically the same ingested message. The actual output was an Exception of type ErrorException:
|
Just to add on that, I think the issue is that when inside a repetition the library doesn't account for complex data types (such as an ED). But I may have built the array structure for the repetitions wrong. |
Can you try using HL7::from($msgString)
->doNotSplitRepetition()
->createMessage()
->toString(true); |
Hey, I've spent some time looking more deeply at the libs code, and I belive the issue here is having a simple array as the structure for rebuilding the message. It makes it very hard to distinguish betweeen repetitions and datatypes at the component/subcomponent level. I've tried to work arround that during the weekend, had it working for some cases and failing for some as well. After that I've decided to try out using So I belive the way to fix that would be creating data structures for repetitions, components and subcomponents. This way when rebuilding it would be easily distinguishible. |
Greetings!
I've been using the library to parse ORUs and ORMs, and have found out that when creating an OBX segment using the ED data type for OBX.5, it tries to
implode()
the segment array, but as ED.1 is also a complex data type (therefore an array), the implode fails causing an array to string conversion exception to be thrown.Here's how the OBX structure looks like.
From what I've gathered looking arround the conversion code, the implode happens at
HL7/Message.php:336
, and doesn't seem to support an complex data type inside a repetition.Am I doing something wrong or should I work on a fix for this?
The text was updated successfully, but these errors were encountered: