-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix: Field repetitions have incorrect key assigend #181
Comments
On it! |
I am writing unit tests to solve this issue first, but I will get there. |
So this is a confirmed bug. I have to dig into why. If you want to help, create your own PR and suggest changes or work on my branch. |
@jotafilaj Ok. This was a weird one, but let me explain. I hadn't for the longest time to get 3 unit tests work work by creating a way for writing/building the full path. For example: message.set("PV1.7").set(0).set("PV1.7.2", "Jones").set("PV1.7.3", "John");
message.set("PV1.7").set(1).set("PV1.7.2", "Smith").set("PV1.7.3", "Bob");
expect(message.toString()).toContain("PV1|||||||^Jones^John~^Smith^Bob"); Should be the equivalent of node-hl7-client/__tests__/hl7.build.test.ts Lines 402 to 422 in 5926cf2
I went ahead and wrote out the full chain using "set": node-hl7-client/__tests__/hl7.build.test.ts Lines 409 to 410 in 5926cf2
So the keys are being set correctly in your example: node-hl7-client/__tests__/hl7.sanity.test.ts Lines 364 to 373 in 5926cf2
passes getting the key/child as parent. I would need to see more of your code, but that's the only thing I find that maybe your passing code is the way that is not working fully. |
In the original code that I used as a base, it works, I think. The code is so old it doesn't work and comparing my code to theirs there is no difference. So I can't say for sure it ever worked. The idea of being able to set the "full" path in build and read should be possible. As I said, it eludes me still. |
@Bugs5382 Basically what I'm trying to do is parse the hl7 message to a JSON, using a JSON mapper, I was trying to access the protected segment prop |
@jotafilaj I beeing trying to do that kinda for #69 so that someone could lookup "what" has been parsed. Maybe if we can combine your code, we can do it in there. I tinkerd around using JSON than then breaking it down nicely visually to the end user. It would be for debugging purposes only and not really used for production at least for #69 but I could create another modify called Could also be a little application CLI wise that someone could run to input tests in. 👍 |
Ref #149 into this field. |
Basically, I need help solving this issue. I traced this sucker through and through and I can't figure out how to get the "paths" to be set using the String path method. So any ideas on how to fix this, would be helpful! |
Search terms
Environment
Description
While accessing fields of an HL7 segment with field repetitions, the field repetition key is the same as the parent key.
Expected Behavior
Field repetition key to be assigned correctly.
Actual Behavior
Field repetition has the same key as their parent.
Steps to reproduce the bug
The problem relies on the
CHART^^^CID~MEDICAL^^^MRN
children. This field has the correct key according to the HL7 standards.While its children:
CHART^^^CID
, andMEDICAL^^^MRN
have the same key as the parent.Sub-children
CHART
,CID
andMEDICAL
,MRN
are set correctly.The text was updated successfully, but these errors were encountered: