Skip to content

Commit

Permalink
Add sender transform to remove leading zeros for CDPH NBS NM data type (
Browse files Browse the repository at this point in the history
#16296)

* add sender transform to remove leading zeros for CDPH NBS NM data type

* add integration tests for hl7 to fhir transform

* update tests for multiple Order groups

* fix integration test filenames

* update expected filepath to correctly identify output file
  • Loading branch information
GilmoreA6 authored Oct 22, 2024
1 parent 6e4e1ed commit 37370e9
Show file tree
Hide file tree
Showing 4 changed files with 3,428 additions and 0 deletions.
1 change: 1 addition & 0 deletions prime-router/settings/STLTs/CA/ca-phl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
organizationName: "ca-phl"
topic: "etor-ti"
customerStatus: "active"
schemaName: classpath:/metadata/fhir_transforms/senders/Flexion/cdph-nbs-sender-transform.yml
format: "HL7"
receivers: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# $schema: ../../../../../../../metadata/json_schema/fhir/fhir-to-fhir-transform.json
# Sender transform for CDPH NBS results
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+)?$")'
bundleProperty: '%resource.value'
value: [ '%resource.value.toString().replaceMatches("^0+(\\d*|0)(\\.\\d+)?$", "$1$2")' ]
Loading

0 comments on commit 37370e9

Please sign in to comment.