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

OBX-5 children with a name are not included in .to_er7() #144

Open
anewftw12 opened this issue Mar 5, 2025 · 0 comments
Open

OBX-5 children with a name are not included in .to_er7() #144

anewftw12 opened this issue Mar 5, 2025 · 0 comments

Comments

@anewftw12
Copy link

anewftw12 commented Mar 5, 2025

Hello,

I'm experiencing unexpected behavior when populating an OBX segment. Specifically, when I add data to an OBX segment like this:

from hl7apy.core import Message

m = Message()
m.obx.obx_5.datatype = 'ED'
m.obx.obx_5.ed_1 = ''
m.obx.obx_5.ed_2 = 'IM'
m.obx.obx_5.ed_3 = 'JPEG'
m.obx.obx_5.ed_4 = 'Base64'
m.obx.obx_5.ed_5 = 'SomeData'

The resulting OBX message is:

OBX|||||

However, when I remove the child names using the following code:

from hl7apy.core import Message

m = Message()
m.obx.obx_5.datatype = 'ED'
m.obx.obx_5.ed_1 = ''
m.obx.obx_5.ed_2 = 'IM'
m.obx.obx_5.ed_3 = 'JPEG'
m.obx.obx_5.ed_4 = 'Base64'
m.obx.obx_5.ed_5 = 'SomeData'
for child in m.obx.obx_5.children:
    child.name = None

I get the expected output:

OBX|||||^IM^JPEG^Base64^SomeData

This seems like a workaround that shouldn't be necessary.

Expected Behavior: The first example should produce the expected OBX message with the populated data, without needing to manually remove child names.

Could you please confirm if this is an unintended behavior or if there's something I'm overlooking? I'd appreciate any guidance on how to resolve this issue.

@anewftw12 anewftw12 changed the title OBX children with a name are not included in .to_er7() OBX-5 children with a name are not included in .to_er7() Mar 5, 2025
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

No branches or pull requests

1 participant