-
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
Message::toString fails to detect repeated segments. #119
Comments
This is what |
Thanks for the response, and thanks for the project! |
With public function testfield_with_repetition_separator_can_be_split_into_array(): void
{
$messageStr = "MSH|^~\&|||||||ADT^A01||P|2.3.1|\nPID|||3^0~4^1|\n";
$message = new Message($messageStr, doNotSplitRepetition: false);
$field = $message->getSegmentByIndex(1)->getField(3);
self::assertIsArray($field);
self::assertSame([['3', '0'], ['4', '1']], $field);
} Alternatively, you can also use the method meant for the given segment's given field, since you're using PID: public function testfield_with_repetition_separator_can_be_split_into_array(): void
{
$messageStr = "MSH|^~\&|||||||ADT^A01||P|2.3.1|\nPID|||3^0~4^1|\n";
$message = new Message($messageStr, doNotSplitRepetition: false);
$patientIdentifierList = $message->getFirstSegmentInstance('PID')->getPatientIdentifierList();
self::assertIsArray($patientIdentifierList);
self::assertSame([['3', '0'], ['4', '1']], $patientIdentifierList);
} |
This test fails, as it returns
3&0^4&1
instead of3^0~4^1
. I don't think that doNotSplitRepetition: true is the correct solution here.The text was updated successfully, but these errors were encountered: