-
Notifications
You must be signed in to change notification settings - Fork 155
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
OBX-5 is valued, but OBX-2 is not. A datatype for OBX-5 must be specified using OBX-2. #63
Comments
I checked the Parser source code & there is a fixOBX5 method in the Varies.cs that appears to attempt to set the data type, however it is not working because the v.Data.Value != null, but the OBX-2 is.
In my case, my messageType had no OBX-2: With this code change -
It now pulls the value as String: If this is approved by @duaneedwards - I'll create a pull request. |
- This small patch fixes errors thrown in nHapiNET#63 as well as nHapiNET#84 Applying these fixes as per inbound HIE data found in a real use case. - taken from nHapiNET#108
Seems like this is still a problem in version 2.5.0.6 |
@AlexFJaxFL is this a feature request / enhancement to allow configuration or a defect with the current behaviour? |
it is both |
@AlexFJaxFL I understand the wish for to be able to configure the default type if |
agree, no defect here, my previous statement was incorrect |
it appears that HAPI has a valid solution for this exception
The HAPI Parser may be configured using a ParserConfiguration object.
The ParserConfiguration is a bean which sets and retrieves parser configuration properties and may be shared among multiple parser instances.
Default behaviour for OBX-2
In a normal OBX (Observation) segment, OBX-2 provides the datatype to be applied to OBX-5. So, for instance if an OBX repetition was conveying a timestamp (TS), it might look like:
OBX||TS|||200901011259
If the OBX-2 value is missing (which sometimes happens because of a misbehaving sending system), you may see an error such as "OBX-5 is valued, but OBX-2 is not. A datatype for OBX-5 must be specified using OBX-2".
In this case, you may specify that HAPI should use a default type when none is found by specifying a default OBX-2 type:
parser.getParserConfiguration().setDefaultObx2Type("ST");
ORU_R01 parsedMessage = (ORU_R01)parser.parse(someInvalidMessage);
If the OBX-2 value is invalid, meaning that it has a value but that value is not a valid HL7 datatype (e.g. "String" instead of "ST"), you may specify a default type to assume if the OBX-2 value can not be understood.
parser.getParserConfiguration().setInvalidObx2Type("ST");
ORU_R01 parsedMessage = (ORU_R01)parser.parse(someInvalidMessage);
See the JavaDoc for examples.
but can this be done in nHAPI ?
Regards,
-Alex
The text was updated successfully, but these errors were encountered: