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

Support ORU messages with multi-line reports spanning across OBX #86

Merged
merged 31 commits into from
May 11, 2021

Conversation

lisadier
Copy link
Contributor

Hackathon content.

Handling ORU_R01 messages with multi line reports in separate OBX segments (type of 'TX' and with no observation id). Now we create an attachment on the DiagnosticReport in presentedForm field:

  1. Added support for * in expression variables
  2. Created additional syntax '&' for preserving white-space/blank OBX entries.
  3. Added support for attachment data type
  4. Added Data type BASE64_BINARY
  5. Documentation updates

@@ -127,5 +129,10 @@ public static String split(Object input, String delimitter, int index) {
return null;
}

public static String concatenateWithChar(Object input, String delimiterChar) {
String result = Hl7DataHandlerUtil.getStringValue(input, true, "~");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method takes delimiterChar but is not used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

valueOf: datatype/Attachment
expressionType: resource
# This merges all the OBX lines together when there is no id (obx3) and the type is TX (obx2)
condition: $obx2 EQUALS TX && $obx3 NULL
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with is that condition will be applied to the first instance of OBX, ideally want we want here is filtered list of OBXs that satisfy a condition. Which means applying filtering condition to specs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested with MSH|^~\&|WHI_Automation|IBM_Toronto_Lab|IMAGING_REPORT|Hartland|20200802124455||ORU^R01^ORU_R01|MSGID00231|T|2.6||||||||||||^4086::132:2A57:3C28^IPv6 PID|1||0d70c6c8^^^MRN||Patient^Autogenerated||19630306|M||Caucasian|^^^^L6G 1C7~^^^ON~^^Unionville~&Warden Av~8200~^^^^^^B||^^^^^^4042808~^^^^^905~^^^^001|||Married|Baptist|Account_0d70c6c8 NTE|1||Created for MRN: 0d70c6c8 PV1|1|I|^^^Toronto^^^8200 Warden Av|EM|||2905^Langa^Albert^J^IV||0007^SINGH^BALDEV||||||||5755^Kuczma^Sean^^Jr||Visit_0d70c6c8|||||||||||||||||||||||||20200802124455||||||||ABC OBR|1|PON_0d70c6c8^LAB|FON_0d70c6c8^LAB|1487^ECHO CARDIOGRAM COMPLETE||20200802124455|20200802124455|||||||||OP_0d70c6c8^SINGH^BALDEV||||||||CT|F|||COP_0d70c6c8^GARCIA^LUIS OBX|1|ST|||||||||F|||20200802124455 OBX|2|TX|||||||||F|||20200802124455 OBX|3|TX|||[PII] Emergency Department||||||F|||20200802124455 OBX|4|TX|||ED Encounter Arrival Date: [ADDRESS] [PERSONALNAME]:||||||F|||20200802124455

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it fails as OBX first repetition is not TX

Copy link
Contributor

@klwhaley klwhaley Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add an id to OBX1, we do correctly get a Observation. We do not get an attachment as you saw. Our original assumption for this pull request was that we did not see OBX 'TX' types mixed with other OBX types.

So we were addressing HL7 files with OBRs followed only by OBX with type 'TX' and no ids.

Have you seen mixed OBX data types with TX in real examples? Wondering if that is something we could address when we see real examples. We could add documentation that clearly states when the presentedForm(attachment) would be added.

Copy link
Contributor

@klwhaley klwhaley Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some clarifying comments to diagnosticreport.yml: clarifying that presentedForm will only be added to a DiagnosticReport when all OBX's in the message are of type TX and don't have an id.

@lisadier
Copy link
Contributor Author

Thanks for your review @pbhallam! We plan to look at these later this week.

HL7ToFHIRConverter ftv = new HL7ToFHIRConverter();
String json = ftv.convert(new File("../hl7v2-fhir-converter/src/test/resources/ORU-multiline-short.hl7"), OPTIONS_PRETTYPRINT);

System.out.println("-----------------------------------------------------");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove system out

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Attachment a = attachments.get(0);
Assert.assertTrue("Incorrect content type", a.getContentType().equalsIgnoreCase("text"));
Assert.assertTrue("Incorrect language", a.getLanguage().equalsIgnoreCase("en"));

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please complete the assertion of the data.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, now validating creation data persisted correctly and that the data field with the base64 binary data is correct after decoding.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the TODO's or create a issue to address the todo's . Also please remove the todo's and commented lines. Also please add additional tests when ORU does not have all TX OBX's.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pbhallam We believe we have addressed your comments. Thank you.

Attachment a = attachments.get(0);
Assert.assertTrue("Incorrect content type", a.getContentType().equalsIgnoreCase("text"));
Assert.assertTrue("Incorrect language", a.getLanguage().equalsIgnoreCase("en"));

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the TODO's or create a issue to address the todo's . Also please remove the todo's and commented lines. Also please add additional tests when ORU does not have all TX OBX's.

KATHRYN L WHALEY and others added 2 commits May 10, 2021 17:00
@pbhallam pbhallam merged commit c1988ac into LinuxForHealth:master May 11, 2021
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.

4 participants