From 21c2f3910ec146fd9f7d86e02c0bc8bb3816014f Mon Sep 17 00:00:00 2001
From: "James.Gilmore-A" <james.gilmore@agile6.com>
Date: Thu, 24 Oct 2024 15:42:59 -0700
Subject: [PATCH] added rs e2e test files and assertions for truncation logic

---
 .../004_CA_ORU_R01_leading_zeroes.hl7          |  6 ++++++
 .../005_CA_ORU_R01_no_leading_zeroes.hl7       |  6 ++++++
 .../main/resources/assertion_definitions.json  | 18 ++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 examples/Test/Automated/004_CA_ORU_R01_leading_zeroes.hl7
 create mode 100644 examples/Test/Automated/005_CA_ORU_R01_no_leading_zeroes.hl7

diff --git a/examples/Test/Automated/004_CA_ORU_R01_leading_zeroes.hl7 b/examples/Test/Automated/004_CA_ORU_R01_leading_zeroes.hl7
new file mode 100644
index 000000000..4a6ce65de
--- /dev/null
+++ b/examples/Test/Automated/004_CA_ORU_R01_leading_zeroes.hl7
@@ -0,0 +1,6 @@
+MSH|^~\&|SISGDSP|SISGDSP|SISHIERECEIVER^11903029^L,M,N|^automated-staging-test-receiver-id^L,M,N|20240226034304||ORU^R01^ORU_R01|004|N|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
+OBR|1|7181233072^FormNumber||54079-9^Galactosemia newborn screening panel|||202402131546|||||||||^JOHNSON^KATHRYN||||||20240226034304|||F
+OBX|1|NM|42906-8^Galactose 1 phosphate uridyl transferase^LN|1|05.100|enzyme units|>50|N|||F|||20240226034304
\ No newline at end of file
diff --git a/examples/Test/Automated/005_CA_ORU_R01_no_leading_zeroes.hl7 b/examples/Test/Automated/005_CA_ORU_R01_no_leading_zeroes.hl7
new file mode 100644
index 000000000..478b295fd
--- /dev/null
+++ b/examples/Test/Automated/005_CA_ORU_R01_no_leading_zeroes.hl7
@@ -0,0 +1,6 @@
+MSH|^~\&|SISGDSP|SISGDSP|SISHIERECEIVER^11903029^L,M,N|^automated-staging-test-receiver-id^L,M,N|20240226034304||ORU^R01^ORU_R01|005|N|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
+OBR|1|7181233072^FormNumber||54079-9^Galactosemia newborn screening panel|||202402131546|||||||||^JOHNSON^KATHRYN||||||20240226034304|||F
+OBX|1|NM|42906-8^Galactose 1 phosphate uridyl transferase^LN|1|0.6500|enzyme units|>50|N|||F|||20240226034304
\ No newline at end of file
diff --git a/rs-e2e/src/main/resources/assertion_definitions.json b/rs-e2e/src/main/resources/assertion_definitions.json
index ff38c7cbe..b528250e5 100644
--- a/rs-e2e/src/main/resources/assertion_definitions.json
+++ b/rs-e2e/src/main/resources/assertion_definitions.json
@@ -36,6 +36,24 @@
         "OBR-16 = ORC-12",
         "OBR.count() = 1"
       ]
+    },
+    {
+      "name": "CDPH leading zeros",
+      "conditions": [
+        "MSH-10 = '004'",
+      ],
+      "rules": [
+        "OBX-5 = '5.100'"
+      ]
+    },
+    {
+      "name": "CDPH no leading zeros",
+      "conditions": [
+        "MSH-10 = '005'",
+      ],
+      "rules": [
+        "OBX-5 = '0.6500'"
+      ]
     }
   ]
 }