Closed jtarvainen closed 3 months ago
@jtarvainen I have been out for a while, but I will take a look at this week and have an answer for you.
@jtarvainen Ok... So this is what I used as my reference:
On this page MSH9.1 through MSH9.3 are all required. For MSH9.3 it says:
Specifies the abstract message structure code. Refer to HL7 Table 0354 - Message Structure in section 2.17.3 for valid values.
Table 0354 shows that everything is 9.1 + 9.2 with the underscore as the value. I can see that just plain ACK is valid.
ooops.
It looks like it only started being valid for 2.4 and beyond. Let me correct that. I will also have to update the node-hl7-server package. I saw your comment there.
@jtarvainen Please review the branch created:
Made it so now msh_9_3 can be set during the build. It is optional.
If msh_9_3 is not passed over, it will do as it's been doing. Otherwise...
It can be overridden. I know I am working on the riddle of my node-hl7-server package since I use 2.7 as the default. Please confirm if this is what you are looking for.
@Bugs5382 Thanks, that seems to do what I need. But can you clarify how I would, as you say, set the field during the build? When I create a node-hl7-server
Server
instance like so:
new Server().createInbound({ port: 3000 }, async (req, res) => { ... })
then I currently have no control over how res
(specifically, its private field _message
) is constructed.
@jtarvainen Yep. Ok. Let me commit this here, so I can update the node-hl7-server package and update that documentation as well.
The node-hl7-server package uses this package to build it out.
Release in node-hl7-client@2.1.1-beta.1. I brought that over into the node-hl7-server to work on that issue.
@jtarvainen Check out https://github.com/Bugs5382/node-hl7-server/issues/76#issuecomment-2145819831
Looks good to me!
@jtarvainen This package has been released! Be sure to leave me a star!
For an acknowledgment message using the HL7 2.5.1 specification, the MSH.9.3 subfield is set to the values of MSH.9.1 and MSH.9.2, separated by an underscore:
https://github.com/Bugs5382/node-hl7-client/blob/eee724ed7d68d3f578a895a046e8302e96829ba4/src/specification/2.4.ts#L80
We have a device that uses HL7 2.5.1 but expects the MSH.9.3 subfield to contain only the MSH.9.1 value. For example, it expects the MSH.9 field to have the format "ACK^R22^ACK", but
node-hl7-client
sets the value to "ACK^R22^ACK_R22", which is not accepted.Could you please check if the formulation of the MSH.9.3 subfield in
node-hl7-client
is correct? If it is, then there would need to be some way to bypass the default field value when constructing the acknowledgment message.Thanks!