Skip to content

Commit

Permalink
Updated MSH-10 ids for sample messages + cleanup
Browse files Browse the repository at this point in the history
Co-authored-by: Sylvie <[email protected]>
  • Loading branch information
basiliskus and somesylvie committed Sep 26, 2024
1 parent a8b72ee commit 4d932db
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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|||||||||
Expand Down
Original file line number Diff line number Diff line change
@@ -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|
Expand Down
2 changes: 1 addition & 1 deletion examples/Test/Automated/003_CA_ORU_R01_CDPH_produced.hl7
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 4d932db

Please sign in to comment.