From 787b61a6d2f28bde5e74f993dbcbeadfd423f9c6 Mon Sep 17 00:00:00 2001 From: James Gilmore <109554461+GilmoreA6@users.noreply.github.com> Date: Wed, 30 Oct 2024 08:51:23 -0700 Subject: [PATCH] add automated-sender-testing transform (#16392) * add automated-sender-testing transform * add automated-sender-testing transform --- .../senders/Flexion/automated-testing-etor.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 prime-router/src/main/resources/metadata/fhir_transforms/senders/Flexion/automated-testing-etor.yml diff --git a/prime-router/src/main/resources/metadata/fhir_transforms/senders/Flexion/automated-testing-etor.yml b/prime-router/src/main/resources/metadata/fhir_transforms/senders/Flexion/automated-testing-etor.yml new file mode 100644 index 00000000000..fd762c40254 --- /dev/null +++ b/prime-router/src/main/resources/metadata/fhir_transforms/senders/Flexion/automated-testing-etor.yml @@ -0,0 +1,15 @@ +# $schema: ../../../../../../../metadata/json_schema/fhir/fhir-to-fhir-transform.json +# Sender transform for ETOR simulated-sender automated testing. Will be used only for automated tests in staging environment to apply any sender transforms for ETOR-NBS senders. +constants: + cdphSender: 'Bundle.entry.resource.ofType(MessageHeader).source.name = "SISGDSP"' + +elements: + + # REGEX removes leading zeroes from left of decimal point unless there is only a single zero + - name: remove-leading-zeros-from-nm-data-type + resource: 'Bundle.entry.resource.ofType(Observation).value.ofType(Quantity)' + condition: > + %resource.value.toString().matches("^0\\d+(\\.\\d+)?$") and + %cdphSender + bundleProperty: '%resource.value' + value: [ '%resource.value.toString().replaceMatches("^0+(\\d*|0)(\\.\\d+)?$", "$1$2")' ] \ No newline at end of file