bug: Fix a bug on multi-level arrays#135
Open
Xusifob wants to merge 1 commit intosenaranya:masterfrom
Open
Conversation
Contributor
Author
|
I need to add a new test and fix the existing test |
22e4a1f to
d02387d
Compare
Contributor
Author
|
I've added a bunch of new elements :
This allows to regenerate the same HL7 file in output that I had in input when there are single and multiple repeated fields |
Owner
|
Thanks for the PR. Since it touches core parts of the library, I need to look for any regression. It may take me a while before I can do the thorough checks. Meanwhile, are you certain the existing configurations can't be used to achieve what you're looking for? I didn't get a chance to go through the entire set of changes in the PR, but since it looks to be related to array/subarrays, may be this from the readme could be of some help? // Segment with separator character (~) creates sub-arrays containing each sub-segment
$message = new Message("MSH|^~\&|||||||ADT^A01||P|2.3.1|\nPID|||3^0~4^1"); // Creates [[3,0], [4,1]]
// To create a single array instead, pass 'true' as 6th argument. This may be used to retain behavior from previous releases
// Notice: Since this leads to a non-standard behavior, it may be removed in future
$message = new Message("MSH|^~\&|||||||ADT^A01||P|2.3.1|\nPID|||3^0~4^1", null, false, false, true, true); // Creates ['3', '0~4', '1']
// or
$message = new Message("MSH|^~\&|||||||ADT^A01||P|2.3.1|\nPID|||3^0~4^1", doNotSplitRepetition: true); // Creates ['3', '0~4', '1'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When passing a multi level array such as this one inside the
PID 2.3:It returned an error
Array to string conversionThis also fixes a bug in the separator for repeater fields :
Tried with the file :