Skip to content

Commit

Permalink
Allow alternate input on MSH for RADx_MARS (#16788)
Browse files Browse the repository at this point in the history
* Allow alternate input on MSH 5 and 6 for RADx_Mars

* Using sample hl7 from ticket description
  • Loading branch information
JFisk42 authored Dec 13, 2024
1 parent f4b4386 commit 986d6fb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,41 +584,19 @@
Text="ISO"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-5.2" Strength="SHALL">
<Description> MSH-5.2 (Universal ID) shall contain one of the values in the list: ['2.16.840.1.114222.4.3.15.2','2.16.840.1.114222.4.3.15.1']. </Description>
<Assertion>
<StringList CSV="2.16.840.1.114222.4.3.15.2,2.16.840.1.114222.4.3.15.1" IgnoreCase="false"
NotPresentBehavior="PASS"
Path="5[1].2[1]"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-6.3" Strength="SHALL">
<Description> MSH-6.3 (Universal ID Type) shall contain the value 'ISO'. </Description>
<Assertion>
<PlainText IgnoreCase="false" NotPresentBehavior="PASS" Path="6[1].3[1]" Text="ISO"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-6.2" Strength="SHALL">
<Description> MSH-6.2 (Universal ID) shall contain the value '2.16.840.1.114222.4.1.217446'. </Description>
<Assertion>
<PlainText IgnoreCase="false" NotPresentBehavior="PASS" Path="6[1].2[1]"
Text="2.16.840.1.114222.4.1.217446"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-7" Strength="SHALL">
<Description> MSH-7.1 (Time) shall match the regular expression '^(\d{14}\.\d{1,4}|\d{14})((\x2D|\x2B)\d{4})$'. </Description>
<Assertion>
<Format NotPresentBehavior="PASS" Path="7[1].1[1]"
Regex="^(\d{14}\.\d{1,4}|\d{14})((\x2D|\x2B)\d{4})$"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-6.1" Strength="SHALL">
<Description> MSH-6.1 (Namespace ID) shall contain the value 'AIMS.PLATFORM'. </Description>
<Assertion>
<PlainText IgnoreCase="false" NotPresentBehavior="PASS" Path="6[1].1[1]"
Text="AIMS.PLATFORM"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-1" Strength="SHALL">
<Description> MSH-1 (Field Separator) shall contain the value '|'. </Description>
<Assertion>
Expand Down Expand Up @@ -679,14 +657,6 @@
<PlainText IgnoreCase="false" NotPresentBehavior="PASS" Path="15[1]" Text="NE"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-5.1" Strength="SHALL">
<Description> MSH-5.1 (Namespace ID) shall contain one of the values in the list: ['AIMS.INTEGRATION.STG','AIMS.INTEGRATION.PRD']. </Description>
<Assertion>
<StringList CSV="AIMS.INTEGRATION.STG,AIMS.INTEGRATION.PRD" IgnoreCase="false"
NotPresentBehavior="PASS"
Path="5[1].1[1]"/>
</Assertion>
</Constraint>
</ByID>
<ByID ID="OBX_NIH_2-8-1">
<Constraint ID="OBX-19" Strength="SHALL">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,41 +684,19 @@
Text="ISO"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-5.2" Strength="SHALL">
<Description> MSH-5.2 (Universal ID) shall contain one of the values in the list: ['2.16.840.1.114222.4.3.15.2','2.16.840.1.114222.4.3.15.1']. </Description>
<Assertion>
<StringList CSV="2.16.840.1.114222.4.3.15.2,2.16.840.1.114222.4.3.15.1" IgnoreCase="false"
NotPresentBehavior="PASS"
Path="5[1].2[1]"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-6.3" Strength="SHALL">
<Description> MSH-6.3 (Universal ID Type) shall contain the value 'ISO'. </Description>
<Assertion>
<PlainText IgnoreCase="false" NotPresentBehavior="PASS" Path="6[1].3[1]" Text="ISO"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-6.2" Strength="SHALL">
<Description> MSH-6.2 (Universal ID) shall contain the value '2.16.840.1.114222.4.1.217446'. </Description>
<Assertion>
<PlainText IgnoreCase="false" NotPresentBehavior="PASS" Path="6[1].2[1]"
Text="2.16.840.1.114222.4.1.217446"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-7" Strength="SHALL">
<Description> MSH-7.1 (Time) shall match the regular expression '^(\d{14}\.\d{1,4}|\d{14})((\x2D|\x2B)\d{4})$'. </Description>
<Assertion>
<Format NotPresentBehavior="PASS" Path="7[1].1[1]"
Regex="^(\d{14}\.\d{1,4}|\d{14})((\x2D|\x2B)\d{4})$"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-6.1" Strength="SHALL">
<Description> MSH-6.1 (Namespace ID) shall contain the value 'AIMS.PLATFORM'. </Description>
<Assertion>
<PlainText IgnoreCase="false" NotPresentBehavior="PASS" Path="6[1].1[1]"
Text="AIMS.PLATFORM"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-1" Strength="SHALL">
<Description> MSH-1 (Field Separator) shall contain the value '|'. </Description>
<Assertion>
Expand Down Expand Up @@ -779,14 +757,6 @@
<PlainText IgnoreCase="false" NotPresentBehavior="PASS" Path="15[1]" Text="NE"/>
</Assertion>
</Constraint>
<Constraint ID="MSH-5.1" Strength="SHALL">
<Description> MSH-5.1 (Namespace ID) shall contain one of the values in the list: ['AIMS.INTEGRATION.STG','AIMS.INTEGRATION.PRD']. </Description>
<Assertion>
<StringList CSV="AIMS.INTEGRATION.STG,AIMS.INTEGRATION.PRD" IgnoreCase="false"
NotPresentBehavior="PASS"
Path="5[1].1[1]"/>
</Assertion>
</Constraint>
</ByID>
<ByID ID="OBR_NIH">
<Constraint ID="OBR-22.1" Strength="SHOULD">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,15 @@ class MarsOtcElrValidatorTests {
val report = validator.validate(messages[0])
assertThat(report.isValid()).isTrue()
}

@Test
fun `test valid RADxMARS message with NIST invalid MSH-5-1, MSH-5-2, MSH-6-1, MSH-6-2 `() {
val sampleMessageInputStream =
this.javaClass.classLoader.getResourceAsStream("validation/marsotcelr/valid_altered_msh.hl7")

val sampleMessage = sampleMessageInputStream!!.bufferedReader().use { it.readText() }
val messages = HL7Reader(ActionLogger()).getMessages(sampleMessage)
val report = validator.validate(messages[0])
assertThat(report.isValid()).isTrue()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MSH|^~\&|AbbottInformatics^2.16.840.1.113883.3.8589.4.1.22^ISO|AbbottInformatics^00Z0000002^CLIA|CDC PRIME^2.16.840.1.114222.4.1.237821^ISO|CDC PRIME^2.16.840.1.114222.4.1.237821^ISO|20241204094313+0100||ORU^R01^ORU_R01|20241204094313+0100_Your Test Kit ID|T|2.5.1|||NE|NE|||||PHLabReport-NoAck^ELR251R1_Rcvr_Prof^2.16.840.1.113883.9.11^ISO
SFT|Meadows Design, LLC|1.0.0|RADx MARS Hub API|1.0.0||
PID|1||c2sense079177^^^&2.16.840.1.113883.3.8589.4.1.22&ISO^PI||Smith^Rebecca^P||20241204|F||2076-8^Native Hawaiian or Other Pacific Islander^HL70005^^^^2.5.1|^^^^60013^^^^||^^PH^^^111^1111111|||||||||H^Hispanic or Latino^HL70189^^^^2.5.1
ORC|RE||Your Test Kit ID^^2.16.840.1.113883.3.8589.4.1.22^ISO|||||||||^^SA.Proctor|||||||||SA.Proctor|^^^^60013^^^^|^^PH^^^111^1111111|
OBR|1||Your Test Kit ID^^2.16.840.1.113883.3.8589.4.1.22^ISO|94558-4^SARS-CoV-2 (COVID-19) Ag [Presence] in Respiratory specimen by Rapid immunoassay^LN^^^^2.71|||20241204094313+0100|||||||||^^SA.Proctor||||||20241204094313+0100|||F
OBX|1|CWE|94558-4^SARS-CoV-2 (COVID-19) Ag [Presence] in Respiratory specimen by Rapid immunoassay^LN^^^^2.71||260415000^Not Detected^SCT^^^^20210301|||N^Normal^HL70078^^^^2.5.1|||F||||00Z0000016||10811877011337_DIT^^99ELR^^^^Vunknown||20241204094313+0100||||SA.Proctor^^^^^&2.16.840.1.113883.3.8589.4.1.152&ISO^XX^^^00Z0000016|13 Fake AtHome Test Street^^Fake City|
NTE|1|L|10811877011337_DIT
OBX|2|NM|35659-2^Age at specimen collection^LN^^^^2.71||28|a^year^UCUM^^^^2.1|||||F||||00Z0000016||||||||SA.Proctor^^^^^&2.16.840.1.113883.3.8589.4.1.152&ISO^XX^^^00Z0000016|13 Fake AtHome Test Street^^Fake City|||||QST
SPM|1|^Your Test Kit ID&&2.16.840.1.113883.3.8589.4.1.22&ISO||697989009^Anterior nares swab (specimen)^SCT^^^^20210301|||||||||||||20241204094313+0100|20241204094313+0100

0 comments on commit 986d6fb

Please sign in to comment.