Here is a sample line of what I'm talking about in the HL7 where the OBX.5 has no value:
"OBX|1|ST|14151-5^HCO3 BldCo-sCnc^LN|TEST|||||||F|||20210311122016|||||20210311122153||||"
A nullPointer error will trigger when that happens so I made a change in the Hl7DataHandlerUtil.java file:
FROM returnvalue = local.toString(); TO returnvalue = local == null ? "" : local.toString();
I also added a unit test to check for this in DifferentObservationValueTest.java :
@Test
public void test_observation_ST_null_result() throws IOException {
I've updated this issue after finding where the problem in the code is, here is the line that errors out when OBX.5 has no value (being null): https://github.com/LinuxForHealth/hl7v2-fhir-converter/blob/4b281dd61782d92efe6b38f26e47257e80018f1f/src/main/java/io/github/linuxforhealth/hl7/data/Hl7DataHandlerUtil.java#L95
Here is a sample line of what I'm talking about in the HL7 where the OBX.5 has no value:
"OBX|1|ST|14151-5^HCO3 BldCo-sCnc^LN|TEST|||||||F|||20210311122016|||||20210311122153||||"
A nullPointer error will trigger when that happens so I made a change in the Hl7DataHandlerUtil.java file: FROM
returnvalue = local.toString();
TOreturnvalue = local == null ? "" : local.toString();
I also added a unit test to check for this in DifferentObservationValueTest.java : @Test public void test_observation_ST_null_result() throws IOException {
}