-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
@@ -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, "~"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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("-----------------------------------------------------"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove system out
There was a problem hiding this comment.
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")); | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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")); | ||
|
There was a problem hiding this comment.
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.
Addressed code review comments
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: