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

Feature: Ignore Empty HL7 Segments #506

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

stueynz
Copy link

@stueynz stueynz commented Sep 7, 2023

Sometimes some segments are empty, and due to common templates populating Resource.meta field we need a way to ignore these empty segments, and not generate a partially filled in Resource.

This example message:

MSH|^~\\&|TestSystem||TestTransformationAgent||20150502090000||ADT^A09|controlID|P|2.6
EVN|A01|20150502090000|
PID|||1234^^^^MR||DOE^JANE^|||F||||||||||||||||||||||
PV1||I||||||||SUR||||||||S|VisitNumber^^^ACME|A||||||||||||||||||||||||20150502090000|
AL1|

with resource template setting of:

resources:
    - resourceName: AllergyIntolerance
      segment: AL1
      resourcePath: resource/AllergyIntolerance
      repeats: true
      ignoreEmpty: true      ## We want to test our new ignoreEmpty flag
      additionalSegments:
        - MSH

Should not generate an AllergyIntolerance resource if the ignoreEmpty field is set to true

Stuart McGrigor added 8 commits September 7, 2023 17:34
…etimes ignore weird empty HL7 Segments

Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
…y AL1 and ZAL segments; just for testing

Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
…arked as ignoreEmpty and is actually empty then don't attempt to make a matching Resource

Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
…alue doesn't qualify as empty

Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
Fixed camel case name of Builder.withIgnoreEmpty()
@LisaWellman
Copy link
Collaborator

@stueynz can you sign this one as well? I see there is a build failure as well.

@LisaWellman
Copy link
Collaborator

@stueynz I see no activity here; do you still want to pursue?

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 this pull request may close these issues.

2 participants