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

Repeating messages do not completely reset internal variables. #348

Open
cragun47 opened this issue Nov 23, 2021 · 1 comment
Open

Repeating messages do not completely reset internal variables. #348

cragun47 opened this issue Nov 23, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@cragun47
Copy link
Contributor

Describe the bug
When creating multiple Immunization resources from multiple ORC/RXA segments in a VXU message, messages interfere with each other. In this case, references and reference objects are not created when they should be. By changing the order or removing some segments, other segment references and reference objects are created correctly.

To Reproduce
A workaround was found, and a test was created to test the workaround. The original problem is easily reproduced by using the test, and removing the workaround.

The test is Hl7ImmunizationFHIRConversionTest.testMultipleImmunizationsNoInterference. In this test, there are three ORC/RXA segments. The first and the third have RXA.17 which should create a manufacturer reference and Organization objects. The second ORC/RXA does not have RXA.17.

The test works successfully now because this workaround, condition: rxa17 NOT_NULL was to added to Immunization.yml:

manufacturer:
   condition: rxa17 NOT_NULL
   valueOf: resource/Organization
   expressionType: reference
   specs: RXA.17
   vars: 
      rxa17: RXA.17

The condition prevents the reference code from even starting if there is no RXA.17.

To reproduce the problem, remove condition: rxa17 NOT_NULL. This will cause the test to fail because the third ORC/RXA will create an Immunization, but not the manufacturer reference and Organization.

Expected behavior
The specs: RXA.17 in the yaml should be sufficient to prevent resource/Organization code from being created when RXA.17 is missing. The additional condition condition: rxa17 NOT_NULL should not be needed, and the test should run cleanly without it.

Additional context

@cragun47 cragun47 added the bug Something isn't working label Nov 23, 2021
@cragun47
Copy link
Contributor Author

@pbhallam tagging you. Please let me know if you have questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants