How to update result reference range and abnormal flag accordingly using HL7
In this article I will demonstrate the following :
- Update ReferencesRange(OBX:7) against ObservationIdentifier(OBX:3.1)[TestCode] from database by using custom utility function
- Update Abnormal Flag(OBX:8) against ObservationIdentifier(OBX:3.1)[TestCode] and ObservationValue(OBX:5)[Result] from database utility function
- Route Message based on Abnormal Flag(OBX:8)
Below is the primary and transformed HL7 2.5 ORU_R01 message:
Step 1: First of all we need to save reference ranges in database, for this I used TestRanges Persistent class:
Step 2 :We need to create a custom function to get reference range, for this I created GetReferenceRange() ClassMethod function in utility class. Please note this class should be Extends from EnsRule.FunctionSet
We need to create an other function to set Abnormal Flag, for this I created SetAbnormalFlag() ClassMethod function in utility class
Step 3: Now we will use these functions in Data Transformation (UpdateReferenceRangesDTL). We need to use foreach loop against the repeating segments:
Please note that in order to get Abnormal flag we have to pass OBX:ObservationValue (Result) along with OBX:ObservationIdentifier(TestCode)
Step 4: We will transform the message from "ResultsDTRule" Business rule and send message to "ResultsRule" Business rule again to send message to "ToCriticalResultsFile" operation in case of Abnormal flag is set otherwise if will send to "ToCriticalResultsFile" operation:
Following Visual Trace Below Visual Trace is for the message successfully send to "ToCriticalResultsFile" Operation
Thanks