Skip to content
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

Add supports for MSH.9.3 Message Structure #108

Closed
alexandre-le-borgne opened this issue Nov 7, 2023 · 5 comments · May be fixed by #109
Closed

Add supports for MSH.9.3 Message Structure #108

alexandre-le-borgne opened this issue Nov 7, 2023 · 5 comments · May be fixed by #109
Assignees

Comments

@alexandre-le-borgne
Copy link

alexandre-le-borgne commented Nov 7, 2023

Thank you for sharing this implementation

As described here : https://hl7-definition.caristix.com/v2/HL7v2.5/Fields/MSH.9

I expected to see the following 3 elements in the MSH :

  • MSH.9.1 - Message Code
  • MSH.9.2 - Trigger Event
  • MSH.9.3 - Message Structure

But apparently the lib only natively supports message code "aka messageType" and trigger event.

For now I'm using this workaround :

$req = HL7::from("my hprim")->createMessage();

/** @var HL7\Segments\MSH $msh */
$msh = $req->getSegmentByIndex(0);

$ack = new HL7\Messages\ACK(
    $req,
    $msh,
    [
        'HL7_VERSION' => '2.5',
    ]
);

/** @var HL7\Segments\MSH $ackMsh */
$ackMsh = $ack->getSegmentByIndex(0);

$ackMshMessageType = ['ACK', $msh->getTriggerEvent(), 'ACK'];
$ackMsh->setField(9, $ackMshMessageType);

echo $ack->toString(true);        
@senaranya senaranya self-assigned this Nov 11, 2023
@senaranya
Copy link
Owner

I'll work on this as soon as I can. Thanks for raising this issue

@senaranya senaranya linked a pull request Nov 11, 2023 that will close this issue
@senaranya
Copy link
Owner

I've added a PR #109 with the change. Can you check if that's going to work for you?

@alexandre-le-borgne
Copy link
Author

alexandre-le-borgne commented Nov 12, 2023

Oh thank you for being so efficient. I'll try and let you know

@alexandre-le-borgne
Copy link
Author

it works, except for the warning on the type of the argument

image

@senaranya
Copy link
Owner

Try again please, I've pushed a fix in the phpdoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants