diff --git a/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/hl7/HL7ExpressionEvaluatorTest.groovy b/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/hl7/HL7ExpressionEvaluatorTest.groovy index a611b2940..7bb72e42b 100644 --- a/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/hl7/HL7ExpressionEvaluatorTest.groovy +++ b/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/hl7/HL7ExpressionEvaluatorTest.groovy @@ -17,8 +17,7 @@ class HL7ExpressionEvaluatorTest extends Specification { TestApplicationContext.register(HL7ExpressionEvaluator, evaluator) messageContent = """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^simulated-lab-id^DNS|20230101010000-0000||ORM^O01^ORM_O01|111111|T|2.5.1 -PID|1||11102779^^^CR^MR||SMITH^BB SARAH^^^^^L -""" +PID|1||11102779^^^CR^MR||SMITH^BB SARAH^^^^^L""" hl7Message = HL7Parser.parse(messageContent) TestApplicationContext.injectRegisteredImplementations() diff --git a/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/hl7/HL7MessageTest.groovy b/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/hl7/HL7MessageTest.groovy index cdb837f74..8a272dae4 100644 --- a/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/hl7/HL7MessageTest.groovy +++ b/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/hl7/HL7MessageTest.groovy @@ -3,19 +3,11 @@ package gov.hhs.cdc.trustedintermediary.rse2e.hl7 import spock.lang.Specification class HL7MessageTest extends Specification { - def encodingChars = HL7Parser.getEncodingCharacters("|^~\\&") - def "getUnderlyingData should correctly return itself"() { given: - def segments = [ - MSH: [ - "MSH|^~\\&|Epic^1.2.840.114350.1.13.145.2.7.2.695071^ISO\n" - ], - PID: [ - "PID|1||11102779^^^CR^MR||SMITH^BB SARAH^^^^^L\n" - ] - ] - def hl7Message = new HL7Message(segments as Map>, encodingChars) + def messageContent = """MSH|^~\\&|Epic^1.2.840.114350.1.13.145.2.7.2.695071^ISO +PID|1||11102779^^^CR^MR||SMITH^BB SARAH^^^^^L""" + def hl7Message = HL7Parser.parse(messageContent) expect: hl7Message.getUnderlyingData() == hl7Message @@ -23,26 +15,9 @@ class HL7MessageTest extends Specification { def "getIdentifier should return the MSH-10 identifier of the underlying message"() { given: - def expectedIdentifier = "0001" - def segments = [ - MSH: [ - "|", - "^~\\&", - "SISGDSP", - "SISGDSP", - "SISHIERECEIVER^11223344^L,M,N", - "^^L,M,N", - "20230706093730", - "", - "ORU^R01^ORU_R01", - "0001", - "D", - "2.5.1" - ] - ] - - and: - def hl7Message = new HL7Message(segments, encodingChars) + def expectedIdentifier = "001" + def messageContent = "MSH|^~\\&|SISGDSP|SISGDSP|SISHIERECEIVER^11223344^L,M,N|^^L,M,N|20230706093730||ORU^R01^ORU_R01|" + expectedIdentifier + "|D|2.5.1" + def hl7Message = HL7Parser.parse(messageContent) when: def name = hl7Message.getIdentifier()