diff --git a/examples/Test/Automated/001_Staging_ORM_O01_short_linked_to_002_ORU.hl7 b/examples/Test/Automated/001_Staging_ORM_O01_short_linked_to_002_ORU.hl7 index 45cbb04a6..789a99eb9 100644 --- a/examples/Test/Automated/001_Staging_ORM_O01_short_linked_to_002_ORU.hl7 +++ b/examples/Test/Automated/001_Staging_ORM_O01_short_linked_to_002_ORU.hl7 @@ -1,4 +1,4 @@ -MSH|^~\&|Sender Application^sender.test.com^DNS|Sender Facility^0.0.0.0.0.0.0.0^ISO|Receiver Application^0.0.0.0.0.0.0.0^ISO|Receiver Facility^automated-staging-test-receiver-id^DNS|20230101010000-0000||ORM^O01^ORM_O01|111111|T|2.5.1|||||||||| +MSH|^~\&|Sender Application^sender.test.com^DNS|Sender Facility^0.0.0.0.0.0.0.0^ISO|Receiver Application^0.0.0.0.0.0.0.0^ISO|Receiver Facility^automated-staging-test-receiver-id^DNS|20230101010000-0000||ORM^O01^ORM_O01|001|T|2.5.1|||||||||| PID|1||1300974^^^Baptist East^MR||ONE^TESTCASE||202402210152-0500|F^Female^HL70001||2106-3^White^HL70005|1234 GPCS WAY^^MONTGOMERY^Alabama^36117^USA^home^^Montgomery|||||||2227600015||||N^Not Hispanic or Latino^HL70189|||1||||| NK1|1|ONE^MOMFIRST|MTH^Mother^HL70063||^^^^^804^5693861||||||||||||||||||||||||||||123456789^^^Medicaid&2.16.840.1.113883.4.446&ISO^MD||||000-00-0000^^^ssn&2.16.840.1.113883.4.1&ISO^SS ORC|NW|4560411583^ORDERID||||||||||12345^^^^^^^^NPI&2.16.840.1.113883.4.6&ISO^L||||||||| diff --git a/examples/Test/Automated/002_Staging_ORU_O01_short_linked_to_001_ORM.hl7 b/examples/Test/Automated/002_Staging_ORU_O01_short_linked_to_001_ORM.hl7 index c52d356c9..18125721b 100644 --- a/examples/Test/Automated/002_Staging_ORU_O01_short_linked_to_001_ORM.hl7 +++ b/examples/Test/Automated/002_Staging_ORU_O01_short_linked_to_001_ORM.hl7 @@ -1,4 +1,4 @@ -MSH|^~\&|Sender Application^sender.test.com^DNS|Sender Facility^0.0.0.0.0.0.0.0^ISO|Receiver Application^0.0.0.0.0.0.0.0^ISO|Receiver Facility^automated-staging-test-receiver-id^DNS|20230101010000-0000||ORU^R01^ORU_R01|111111|T|2.5.1|||||||||| +MSH|^~\&|Sender Application^sender.test.com^DNS|Sender Facility^0.0.0.0.0.0.0.0^ISO|Receiver Application^0.0.0.0.0.0.0.0^ISO|Receiver Facility^automated-staging-test-receiver-id^DNS|20230101010000-0000||ORU^R01^ORU_R01|002|T|2.5.1|||||||||| PID|1||1300974^^^Baptist East^MR||ONE^TESTCASE||20230504131000|F^Female^HL70001||2106-3^White^HL70005|1234 GPCS WAY^^MONTGOMERY^Alabama^36117^USA^home^^Montgomery|||||||2227600015||||N^Not Hispanic or Latino^HL70189|||1|||||N| NK1|1|ONE^MOMFIRST|MTH^Mother^HL70063^^^^^^Mother||^^^^^804^5693861||||||||||||||||||||||||||||123456789^^^Medicaid&2.16.840.1.113883.4.446&ISO^MD||||000-00-0000^^^ssn&2.16.840.1.113883.4.1&ISO^SS||||||| ORC|RE|4560411583^ORDERID|20231561137^ALPHL|||||||||1174911127^SMITH^SAMANTHA^^^^^^NPI^L^^^NPI|||||||||BAPTIST EAST^L^^^^CMS^NPI^^^1043269798~BAPTIST EAST^L^^^^AL Public Health Lab^Submitter ID^^^739||||||||||54089-8^Newborn screening panel American Health Information Community (AHIC)^LN| diff --git a/examples/Test/Automated/003_CA_ORU_R01_CDPH_produced.hl7 b/examples/Test/Automated/003_CA_ORU_R01_CDPH_produced.hl7 index 9b141869f..2c4b787ac 100644 --- a/examples/Test/Automated/003_CA_ORU_R01_CDPH_produced.hl7 +++ b/examples/Test/Automated/003_CA_ORU_R01_CDPH_produced.hl7 @@ -1,4 +1,4 @@ -MSH|^~\&|SISGDSP|SISGDSP|SISHIERECEIVER^11903029^L,M,N|^automated-staging-test-receiver-id^L,M,N|20240226034304||ORU^R01^ORU_R01|AUTOMATEDTEST-243408836|T|2.5.1 +MSH|^~\&|SISGDSP|SISGDSP|SISHIERECEIVER^11903029^L,M,N|^automated-staging-test-receiver-id^L,M,N|20240226034304||ORU^R01^ORU_R01|AUTOMATEDTEST-003|T|2.5.1 PID|1||80008836^^^&NPI^MR||CDPHSIX^BOY MOMSIX^^^^^B|||M||2106-3^White||||||||||||2186-5^Not Hispanic or Latino||N|1 NK1|1|CDPHSIX|MTH^Mother|132 ST^^SAN DIEGO^CA^92126^USA ORC|RE|7181233072^FormNumber||189430284^HospOrdNumber||||||||^ROSEN^REBECCA|||||||||UCSD JACOBS MEDICAL CENTER^^^^^^^^^R797| 2961DR YLLUT^^SAN DIEGO^CA^99999-9999 diff --git a/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/AutomatedTest.groovy b/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/AutomatedTest.groovy index 054d6f7d4..219ab76b3 100644 --- a/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/AutomatedTest.groovy +++ b/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/AutomatedTest.groovy @@ -42,9 +42,6 @@ class AutomatedTest extends Specification { TestApplicationContext.register(AzureBlobFileFetcher, azureFileFetcher) TestApplicationContext.register(LocalFileFetcher, LocalFileFetcher.getInstance()) TestApplicationContext.injectRegisteredImplementations() - - // Figure out env vars (need Azure connection string) - // Also add unit tests for file matcher } diff --git a/shared/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiHL7FileMatcher.java b/shared/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiHL7FileMatcher.java index 549ccc333..819be11a0 100644 --- a/shared/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiHL7FileMatcher.java +++ b/shared/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiHL7FileMatcher.java @@ -69,20 +69,21 @@ public Map<String, Message> mapMessageByControlId(List<HL7FileStream> files) { try (HapiContext context = new DefaultHapiContext()) { Parser parser = context.getPipeParser(); - for (HL7FileStream inputFile : files) { - try (InputStream inputStream = inputFile.inputStream()) { + for (HL7FileStream hl7FileStream : files) { + try (InputStream inputStream = hl7FileStream.inputStream()) { String content = new String(inputStream.readAllBytes()); Message message = parser.parse(content); MSH mshSegment = (MSH) message.get("MSH"); String msh10 = mshSegment.getMessageControlID().getValue(); if (msh10 == null || msh10.isEmpty()) { - logger.logError("MSH-10 is empty for : " + inputFile.fileName()); + logger.logError("MSH-10 is empty for : " + hl7FileStream.fileName()); continue; } messageMap.put(msh10, message); } catch (IOException | HL7Exception e) { logger.logError( - "An error occurred while parsing the message: " + inputFile.fileName(), + "An error occurred while parsing the message: " + + hl7FileStream.fileName(), e); } }