From a4716d3f6628c74d86546f0919b615d748080ec5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Oct 2023 03:56:35 +0000 Subject: [PATCH 01/25] Update dependency com.azure:azure-security-keyvault-secrets to v4.7.1 --- shared/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/build.gradle b/shared/build.gradle index 2948437d2..857701893 100644 --- a/shared/build.gradle +++ b/shared/build.gradle @@ -43,7 +43,7 @@ dependencies { runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.3' // azure sdk - implementation 'com.azure:azure-security-keyvault-secrets:4.7.0' + implementation 'com.azure:azure-security-keyvault-secrets:4.7.1' implementation 'com.azure:azure-identity:1.10.4' testImplementation 'org.apache.groovy:groovy:4.0.15' From 0f158c74878c85c89508d37d6364609bbc087118 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 06:12:13 +0000 Subject: [PATCH 02/25] Update Terraform azurerm to v3.77.0 --- operations/environments/dev/main.tf | 2 +- operations/environments/internal/main.tf | 2 +- operations/environments/pr/main.tf | 2 +- operations/environments/staging/main.tf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/operations/environments/dev/main.tf b/operations/environments/dev/main.tf index f29eb000a..a4ec0dfed 100644 --- a/operations/environments/dev/main.tf +++ b/operations/environments/dev/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "3.76.0" + version = "3.77.0" } } diff --git a/operations/environments/internal/main.tf b/operations/environments/internal/main.tf index b41cb6a6d..4c9d80b02 100644 --- a/operations/environments/internal/main.tf +++ b/operations/environments/internal/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "3.76.0" + version = "3.77.0" } } diff --git a/operations/environments/pr/main.tf b/operations/environments/pr/main.tf index 15f2e12e4..10e1531f6 100644 --- a/operations/environments/pr/main.tf +++ b/operations/environments/pr/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "3.76.0" + version = "3.77.0" } } diff --git a/operations/environments/staging/main.tf b/operations/environments/staging/main.tf index fc29488f5..a7f8479c6 100644 --- a/operations/environments/staging/main.tf +++ b/operations/environments/staging/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "3.76.0" + version = "3.77.0" } } From 7f3bbe239284a39897908755c5615f3765c9f282 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:35:21 +0000 Subject: [PATCH 03/25] Update patch dependencies to v6.8.5 --- shared/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/build.gradle b/shared/build.gradle index 857701893..c2b274493 100644 --- a/shared/build.gradle +++ b/shared/build.gradle @@ -27,9 +27,9 @@ dependencies { implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.3' //fhir - api 'ca.uhn.hapi.fhir:hapi-fhir-base:6.8.4' + api 'ca.uhn.hapi.fhir:hapi-fhir-base:6.8.5' api 'ca.uhn.hapi.fhir:hapi-fhir-structures-r4:6.8.4' - implementation 'ca.uhn.hapi.fhir:hapi-fhir-caching-caffeine:6.8.4' + implementation 'ca.uhn.hapi.fhir:hapi-fhir-caching-caffeine:6.8.5' implementation 'ca.uhn.hapi.fhir:hapi-fhir-validation-resources-r4:6.8.4' api 'org.fhir:ucum:1.0.8' From cbb05f91c4d46ea969738f2c49265414bb64cd43 Mon Sep 17 00:00:00 2001 From: jcrichlake <145698165+jcrichlake@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:05:28 -0400 Subject: [PATCH 04/25] Adr for public and private keys (#583) * Pushing draft adr for public and private keys * Updating key names * Updating ADR file --- .pre-commit-config.yaml | 2 +- adr/014-keys.md | 33 +++++++++++++++++++ ...ation-report-stream-private-key-local.pem} | 0 ...zation-report-stream-public-key-local.pem} | 0 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 adr/014-keys.md rename mock_credentials/{organization-report-stream-private-key.pem => organization-report-stream-private-key-local.pem} (100%) rename mock_credentials/{organization-report-stream-public-key.pem => organization-report-stream-public-key-local.pem} (100%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6d98201ed..0d04138fb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: check-symlinks - id: check-yaml - id: detect-private-key - exclude: (mock_credentials|.+\/JjwtEngine.java|.+\/resources\/(organization-report-stream-public-key.pem|trusted-intermediary-private-key-local.pem)) + exclude: (mock_credentials|.+\/JjwtEngine.java|.+\/resources\/(organization-report-stream-public-key-local.pem|trusted-intermediary-private-key-local.pem)) - id: end-of-file-fixer - id: no-commit-to-branch - id: trailing-whitespace diff --git a/adr/014-keys.md b/adr/014-keys.md new file mode 100644 index 000000000..303b4523a --- /dev/null +++ b/adr/014-keys.md @@ -0,0 +1,33 @@ +# 14. Keys + +Date: 2023-10-23 + +## Decision + +### Internal Keys + +These keys are used for the intermediary's internal use. These keys will follow the following naming paradigm... + +`trusted-intermediary--key-`. + +For example, `trusted-intermediary-private-key-staging` or `trusted-intermediary-public-key-prod`. + +### Organization Keys + +These are keys for external orgs to authenticate with us. Currently, report stream is the only organization we have. The pattern for the name of these keys is + +`organization---key-`. + +For example, `organization-report-stream-public-key-staging` + +## Status + +Accepted. + +## Context + +This naming convention applies to all locations where our keys are stored. Previously, we didn't have a consistent naming convention across all our locations which caused confusion on which key was to be used in which context and environment. + +### Related Issues + +- #584 diff --git a/mock_credentials/organization-report-stream-private-key.pem b/mock_credentials/organization-report-stream-private-key-local.pem similarity index 100% rename from mock_credentials/organization-report-stream-private-key.pem rename to mock_credentials/organization-report-stream-private-key-local.pem diff --git a/mock_credentials/organization-report-stream-public-key.pem b/mock_credentials/organization-report-stream-public-key-local.pem similarity index 100% rename from mock_credentials/organization-report-stream-public-key.pem rename to mock_credentials/organization-report-stream-public-key-local.pem From 80d1063a2312da34423cd2ca0fe8354ceeb8c429 Mon Sep 17 00:00:00 2001 From: jcrichlake <145698165+jcrichlake@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:17:00 -0400 Subject: [PATCH 05/25] Adding Template for Spikes (#597) * Adding Template * Addin about template --- .github/ISSUE_TEMPLATE/spike.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/spike.md diff --git a/.github/ISSUE_TEMPLATE/spike.md b/.github/ISSUE_TEMPLATE/spike.md new file mode 100644 index 000000000..6c9df19fd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/spike.md @@ -0,0 +1,17 @@ +--- +name: Spike +about: Research related task, when all that is needed is information gathering. +title: '' +labels: spike +assignees: '' + +--- + +## Spike Goal +Goal for the Spike + +## Timebox +Time allocated (2 FTE days) + +## Notes +- *Optional: Any reference material or thoughts we may need for later reference* \ No newline at end of file From 3f1435794fc0b732fa8992b244108909f67c204a Mon Sep 17 00:00:00 2001 From: halprin Date: Mon, 23 Oct 2023 15:27:25 -0600 Subject: [PATCH 06/25] Create ADR on the project structure --- adr/015-project-structure.md | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 adr/015-project-structure.md diff --git a/adr/015-project-structure.md b/adr/015-project-structure.md new file mode 100644 index 000000000..083375123 --- /dev/null +++ b/adr/015-project-structure.md @@ -0,0 +1,57 @@ +# 15. Project Structure + +Date: 2023-10-23 + +## Decision + +The overall project will consist of 4+ subprojects. + +- `app` - The entry point, where our HTTP or calling library is used, and plugins are initialized. +- `shared` - A shared project that is imported to every plugin and contains all the helper classes that may be used by + a plugin. +- `etor` - The ETOR plugin. In the future there may be more plugins that will be new sub-projects in of themselves (or + completely different projects and repositories). +- `e2e` - Our end-to-end tests. + +## Status + +Accepted. + +## Context + +### `app` Subproject + +The `app` subproject contains the entry point into the code. This may be the `main` method or a special method if we're +plugging into a cloud service's function compute service. This means that it is directly connected to the HTTP library +or whatever library we use that handles the incoming requests. For example, Javalin or the Azure SDK. + +Second, `app` bootstraps the plugins that are available and hooks them into the aforementioned HTTP/request library. + +Lastly, `app` converts any live request into the form that the plugins accept. + +### `shared` Subproject + +The `shared` subproject specifies the interface for a plugin. Any plugin written needs to import this subproject, so it +can adhere to the plugin interface. + +Second, `shared` contains all the shared helper classes that may be used by a plugin. Perhaps most importantly is +the `ApplicationContext`. Other examples include the logger, JSON handling, and an HTTP client. `shared` does _not_ +contain anything specific to a plugin. + +### `etor` Subproject + +`etor` is a plugin subproject. As mentioned previously, `etor` depends on the `shared` subproject, so it can adhere to +the plugin interface. This subproject contains everything specific to the ETOR usecase such as parsing orders, +converting orders, sending orders, and handling results. + +### `e2e` Subproject + +The `e2e` subproject is all about end-to-end testing. It tests the external interface of the application instead of +testing individual classes and methods. + +This subproject must not depend on any of the other subprojects. It is kept isolated on purpose so that the tests can't +be "poisoned" by the implementation. + +### Related Issues + +_None_. From be10caddc77bf6d343931d9304e856bb19c4dca9 Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 24 Oct 2023 08:59:28 -0600 Subject: [PATCH 07/25] Update example OML FHIR message based on the latest that we do --- examples/fhir/oml_message.json | 322 ++++++++++++++++++++++----------- 1 file changed, 217 insertions(+), 105 deletions(-) diff --git a/examples/fhir/oml_message.json b/examples/fhir/oml_message.json index 76f3c7604..f54d5dbdd 100644 --- a/examples/fhir/oml_message.json +++ b/examples/fhir/oml_message.json @@ -1,8 +1,8 @@ { "resourceType": "Bundle", - "id": "1692819369140956000.18c99268-3529-451f-b319-adfcb231df49", + "id": "1698157593027936926.d501ef7a-0ae6-4e49-9fd7-307ba08af45a", "meta": { - "lastUpdated": "2023-08-23T19:36:09.150+00:00" + "lastUpdated": "2023-10-24T14:26:33.030+00:00" }, "identifier": { "system": "https://reportstream.cdc.gov/prime-router", @@ -108,7 +108,7 @@ "destination": [ { "target": { - "reference": "Device/1692819369287572000.cfcd10d6-7d8a-4380-b05e-09bb22f1c3c6" + "reference": "Device/1698157593135725694.1afe0103-2e01-4ae0-acaa-a48d2d245f49" }, "endpoint": "urn:dns:natus.health.state.mn.us", "receiver": { @@ -117,27 +117,19 @@ } ], "sender": { - "reference": "Organization/1692819371034655000.43ea9ebf-be48-4ff7-9be2-a8e853ab8938" + "reference": "Organization/1698157594430910518.bf348458-a7c5-43fc-b572-864da9a2e077" }, "source": { - "extension": [ - { - "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/software-vendor-org", - "valueReference": { - "reference": "Organization/1692819369322520000.b5f7ad86-bc28-486b-bd6a-8a47fd52123f" - } - } - ], "name": "Epic", "endpoint": "urn:oid:1.2.840.114350.1.13.145.2.7.2.695071" } } }, { - "fullUrl": "Device/1692819369287572000.cfcd10d6-7d8a-4380-b05e-09bb22f1c3c6", + "fullUrl": "Device/1698157593135725694.1afe0103-2e01-4ae0-acaa-a48d2d245f49", "resource": { "resourceType": "Device", - "id": "1692819369287572000.cfcd10d6-7d8a-4380-b05e-09bb22f1c3c6", + "id": "1698157593135725694.1afe0103-2e01-4ae0-acaa-a48d2d245f49", "meta": { "extension": [ { @@ -220,37 +212,10 @@ } }, { - "fullUrl": "Organization/1692819369322520000.b5f7ad86-bc28-486b-bd6a-8a47fd52123f", - "resource": { - "resourceType": "Organization", - "id": "1692819369322520000.b5f7ad86-bc28-486b-bd6a-8a47fd52123f", - "meta": { - "extension": [ - { - "url": "http://ibm.com/fhir/cdm/StructureDefinition/source-data-model-version", - "valueString": "2.5.1" - } - ], - "tag": [ - { - "extension": [ - { - "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/code-index-name", - "valueString": "identifier" - } - ], - "system": "http://terminology.hl7.org/CodeSystem/v2-0103", - "code": "P" - } - ] - } - } - }, - { - "fullUrl": "Organization/1692819371034655000.43ea9ebf-be48-4ff7-9be2-a8e853ab8938", + "fullUrl": "Organization/1698157594430910518.bf348458-a7c5-43fc-b572-864da9a2e077", "resource": { "resourceType": "Organization", - "id": "1692819371034655000.43ea9ebf-be48-4ff7-9be2-a8e853ab8938", + "id": "1698157594430910518.bf348458-a7c5-43fc-b572-864da9a2e077", "meta": { "extension": [ { @@ -273,9 +238,21 @@ }, "identifier": [ { + "extension": [ + { + "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/identifier-namespace-id", + "valueBoolean": true + } + ], "value": "Centracare" }, { + "extension": [ + { + "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/identifier-universal-id", + "valueBoolean": true + } + ], "type": { "coding": [ { @@ -290,16 +267,16 @@ } ] }, - "value": "urn:dns:centracare.com" + "value": "centracare.com" } ] } }, { - "fullUrl": "ServiceRequest/1692819371719804000.a2542d3e-3197-498e-aa20-4d3ecff73b0a", + "fullUrl": "ServiceRequest/1698157594541198359.4cf28fd3-2609-43da-be1e-1d4680feafd5", "resource": { "resourceType": "ServiceRequest", - "id": "1692819371719804000.a2542d3e-3197-498e-aa20-4d3ecff73b0a", + "id": "1698157594541198359.4cf28fd3-2609-43da-be1e-1d4680feafd5", "meta": { "extension": [ { @@ -321,10 +298,16 @@ ] }, "extension": [ + { + "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/entered-by", + "valueReference": { + "reference": "Practitioner/1698157594532276699.d2597689-4377-4d84-a460-672a1dab44cb" + } + }, { "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/collector-identifier", "valueReference": { - "reference": "Practitioner/1692819371717781000.82ff1860-f9f7-4642-a862-e4d374370598" + "reference": "Practitioner/1698157594537795337.82324f1a-446b-4954-8e54-d78827696e53" } }, { @@ -343,6 +326,12 @@ } ] } + }, + { + "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/enterers-location", + "valueReference": { + "reference": "Location/1698157594557505569.6e9cc591-1c23-47b0-8fb8-c2d559f37b8b" + } } ], "identifier": [ @@ -440,19 +429,19 @@ ] }, "subject": { - "reference": "Patient/1692819371697407000.0555ab57-b084-4b23-9aac-0c90580387be" + "reference": "Patient/1698157594517001497.32e7fea5-d900-47ee-be66-9257ae885a43" }, "authoredOn": "2023-05-06T05:29:13-05:00", "requester": { - "reference": "PractitionerRole/1692819371732427000.32bee8b0-a1d3-4bab-9317-3c1076470fb0" + "reference": "PractitionerRole/1698157594555001452.bf9d53b0-8c83-4c3f-9250-8fcadc54f863" } } }, { - "fullUrl": "Practitioner/1692819371717781000.82ff1860-f9f7-4642-a862-e4d374370598", + "fullUrl": "Practitioner/1698157594532276699.d2597689-4377-4d84-a460-672a1dab44cb", "resource": { "resourceType": "Practitioner", - "id": "1692819371717781000.82ff1860-f9f7-4642-a862-e4d374370598", + "id": "1698157594532276699.d2597689-4377-4d84-a460-672a1dab44cb", "meta": { "extension": [ { @@ -476,10 +465,37 @@ } }, { - "fullUrl": "Practitioner/1692819371724539000.ff20e343-97cf-428d-a5f3-586b092a5efa", + "fullUrl": "Practitioner/1698157594537795337.82324f1a-446b-4954-8e54-d78827696e53", "resource": { "resourceType": "Practitioner", - "id": "1692819371724539000.ff20e343-97cf-428d-a5f3-586b092a5efa", + "id": "1698157594537795337.82324f1a-446b-4954-8e54-d78827696e53", + "meta": { + "extension": [ + { + "url": "http://ibm.com/fhir/cdm/StructureDefinition/source-data-model-version", + "valueString": "2.5.1" + } + ], + "tag": [ + { + "extension": [ + { + "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/code-index-name", + "valueString": "identifier" + } + ], + "system": "http://terminology.hl7.org/CodeSystem/v2-0103", + "code": "P" + } + ] + } + } + }, + { + "fullUrl": "Practitioner/1698157594545205286.e6e3eff0-0d72-4c5b-9cc7-a0ce8e08008c", + "resource": { + "resourceType": "Practitioner", + "id": "1698157594545205286.e6e3eff0-0d72-4c5b-9cc7-a0ce8e08008c", "meta": { "extension": [ { @@ -553,10 +569,37 @@ } }, { - "fullUrl": "Organization/1692819371731987000.6f1834ee-7cbc-4024-b975-cd6d7d30b399", + "fullUrl": "Location/1698157594551206527.d061f48e-4e5c-434a-b560-73e427a3b00f", + "resource": { + "resourceType": "Location", + "id": "1698157594551206527.d061f48e-4e5c-434a-b560-73e427a3b00f", + "meta": { + "extension": [ + { + "url": "http://ibm.com/fhir/cdm/StructureDefinition/source-data-model-version", + "valueString": "2.5.1" + } + ], + "tag": [ + { + "extension": [ + { + "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/code-index-name", + "valueString": "identifier" + } + ], + "system": "http://terminology.hl7.org/CodeSystem/v2-0103", + "code": "P" + } + ] + } + } + }, + { + "fullUrl": "Organization/1698157594554708050.3046e5b7-8e1d-411b-aed0-ddf6a0382461", "resource": { "resourceType": "Organization", - "id": "1692819371731987000.6f1834ee-7cbc-4024-b975-cd6d7d30b399", + "id": "1698157594554708050.3046e5b7-8e1d-411b-aed0-ddf6a0382461", "meta": { "extension": [ { @@ -578,30 +621,40 @@ ] }, "extension": [ - { - "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id", - "valueString": "CMS" - }, { "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/organization-name-type", - "valueCodeableConcept": { - "coding": [ + "valueCoding": { + "extension": [ { - "extension": [ - { - "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/code-index-name", - "valueString": "identifier" - } - ], - "system": "http://terminology.hl7.org/CodeSystem/v2-0204", - "code": "L" + "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/code-index-name", + "valueString": "identifier" } - ] + ], + "system": "http://terminology.hl7.org/CodeSystem/v2-0204", + "code": "L", + "display": "Legal name" } } ], "identifier": [ { + "extension": [ + { + "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority", + "extension": [ + { + "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id", + "valueString": "CMS" + } + ] + }, + { + "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-facility", + "valueReference": { + "reference": "Location/1698157594551206527.d061f48e-4e5c-434a-b560-73e427a3b00f" + } + } + ], "type": { "coding": [ { @@ -611,37 +664,22 @@ "valueString": "identifier" } ], - "code": "CMS" + "system": "http://terminology.hl7.org/CodeSystem/v2-0203", + "code": "NPI" } ] }, "value": "1043269798" } ], - "type": [ - { - "coding": [ - { - "extension": [ - { - "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/code-index-name", - "valueString": "identifier" - } - ], - "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - "code": "NPI" - } - ] - } - ], "name": "ST. CLOUD HOSPITAL" } }, { - "fullUrl": "PractitionerRole/1692819371732427000.32bee8b0-a1d3-4bab-9317-3c1076470fb0", + "fullUrl": "PractitionerRole/1698157594555001452.bf9d53b0-8c83-4c3f-9250-8fcadc54f863", "resource": { "resourceType": "PractitionerRole", - "id": "1692819371732427000.32bee8b0-a1d3-4bab-9317-3c1076470fb0", + "id": "1698157594555001452.bf9d53b0-8c83-4c3f-9250-8fcadc54f863", "meta": { "extension": [ { @@ -663,18 +701,45 @@ ] }, "practitioner": { - "reference": "Practitioner/1692819371724539000.ff20e343-97cf-428d-a5f3-586b092a5efa" + "reference": "Practitioner/1698157594545205286.e6e3eff0-0d72-4c5b-9cc7-a0ce8e08008c" }, "organization": { - "reference": "Organization/1692819371731987000.6f1834ee-7cbc-4024-b975-cd6d7d30b399" + "reference": "Organization/1698157594554708050.3046e5b7-8e1d-411b-aed0-ddf6a0382461" } } }, { - "fullUrl": "Observation/1692819372136024000.110db3c8-de49-458e-8205-c096326503fb", + "fullUrl": "Location/1698157594557505569.6e9cc591-1c23-47b0-8fb8-c2d559f37b8b", + "resource": { + "resourceType": "Location", + "id": "1698157594557505569.6e9cc591-1c23-47b0-8fb8-c2d559f37b8b", + "meta": { + "extension": [ + { + "url": "http://ibm.com/fhir/cdm/StructureDefinition/source-data-model-version", + "valueString": "2.5.1" + } + ], + "tag": [ + { + "extension": [ + { + "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/code-index-name", + "valueString": "identifier" + } + ], + "system": "http://terminology.hl7.org/CodeSystem/v2-0103", + "code": "P" + } + ] + } + } + }, + { + "fullUrl": "Observation/1698157594714100223.ce3299ee-962a-4cd4-b7aa-ab741421ffbe", "resource": { "resourceType": "Observation", - "id": "1692819372136024000.110db3c8-de49-458e-8205-c096326503fb", + "id": "1698157594714100223.ce3299ee-962a-4cd4-b7aa-ab741421ffbe", "meta": { "extension": [ { @@ -754,7 +819,7 @@ ] }, "subject": { - "reference": "Patient/1692819371697407000.0555ab57-b084-4b23-9aac-0c90580387be" + "reference": "Patient/1698157594517001497.32e7fea5-d900-47ee-be66-9257ae885a43" }, "effectiveDateTime": "2023-05-06T05:00:00-05:00", "valueQuantity": { @@ -772,10 +837,10 @@ } }, { - "fullUrl": "Specimen/1692819372150657000.2f05a4a6-ed24-4798-ab0c-647dd778d3e0", + "fullUrl": "Specimen/1698157594725900002.ecd3c6fc-c81e-4286-8d1f-81124add6d48", "resource": { "resourceType": "Specimen", - "id": "1692819372150657000.2f05a4a6-ed24-4798-ab0c-647dd778d3e0", + "id": "1698157594725900002.ecd3c6fc-c81e-4286-8d1f-81124add6d48", "meta": { "extension": [ { @@ -818,7 +883,7 @@ ] }, "subject": { - "reference": "Patient/1692819371697407000.0555ab57-b084-4b23-9aac-0c90580387be" + "reference": "Patient/1698157594517001497.32e7fea5-d900-47ee-be66-9257ae885a43" }, "receivedTime": "2023-05-06T06:00:00-05:00", "collection": { @@ -827,10 +892,10 @@ } }, { - "fullUrl": "Patient/1692819371697407000.0555ab57-b084-4b23-9aac-0c90580387be", + "fullUrl": "Patient/1698157594517001497.32e7fea5-d900-47ee-be66-9257ae885a43", "resource": { "resourceType": "Patient", - "id": "1692819371697407000.0555ab57-b084-4b23-9aac-0c90580387be", + "id": "1698157594517001497.32e7fea5-d900-47ee-be66-9257ae885a43", "meta": { "extension": [ { @@ -885,7 +950,7 @@ } ] }, - "system": "urn:id:CRPMRN", + "system": "CRPMRN", "value": "11102779" } ], @@ -931,12 +996,59 @@ ], "city": "DEER CREEK", "district": "OTTER TAIL", - "state": "MN", + "state": "LA", "postalCode": "56527-9657", "country": "USA" } ], - "multipleBirthBoolean": false + "multipleBirthBoolean": false, + "contact": [ + { + "relationship": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode", + "code": "MTH", + "display": "mother" + } + ] + } + ], + "name": { + "text": "SADIE S SMITH", + "family": "SMITH", + "given": [ + "SADIE", + "S" + ] + }, + "telecom": [ + { + "extension": [ + { + "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/text", + "valueString": "(763)555-5555" + } + ], + "system": "phone", + "value": "(763) 555 555", + "use": "home" + } + ], + "address": { + "use": "home", + "line": [ + "555 STATE HIGHWAY 13" + ], + "city": "DEER CREEK", + "district": "OTTER TAIL", + "state": "LA", + "postalCode": "56527-9657", + "country": "USA" + } + } + ] } }, { @@ -944,16 +1056,16 @@ "resourceType": "Provenance", "target": [ { - "reference": "Endpoint/1692819373429977000.122ff257-8a61-4df9-ba20-0c96079eb64e" + "reference": "Endpoint/1698157609882434449.fc1e5299-2a9d-4844-a965-a9136933fbe0" } ] } }, { - "fullUrl": "Endpoint/1692819373429977000.122ff257-8a61-4df9-ba20-0c96079eb64e", + "fullUrl": "Endpoint/1698157609882434449.fc1e5299-2a9d-4844-a965-a9136933fbe0", "resource": { "resourceType": "Endpoint", - "id": "1692819373429977000.122ff257-8a61-4df9-ba20-0c96079eb64e", + "id": "1698157609882434449.fc1e5299-2a9d-4844-a965-a9136933fbe0", "identifier": [ { "system": "https://reportstream.cdc.gov/prime-router", From c3505953b1ec26c77b853aae7b84c9a31b7c83fd Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 24 Oct 2023 09:14:23 -0600 Subject: [PATCH 08/25] Add additional 5 to the phone number --- examples/fhir/oml_message.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/fhir/oml_message.json b/examples/fhir/oml_message.json index f54d5dbdd..481238494 100644 --- a/examples/fhir/oml_message.json +++ b/examples/fhir/oml_message.json @@ -973,7 +973,7 @@ } ], "system": "phone", - "value": "(763) 555 555", + "value": "(763) 555 5555", "use": "home" } ], From 91cd95fca5956a3e93f2d1c5d2432ab365d564df Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 24 Oct 2023 09:16:01 -0600 Subject: [PATCH 09/25] Update the other sample files that are missing an extra 5 in the HL7 --- examples/hl7/MN/MN NBS OML_O21 Lab Order Message.txt | 2 +- examples/hl7/MN/MN NBS ORM_O01 Lab Order Message Extended.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/hl7/MN/MN NBS OML_O21 Lab Order Message.txt b/examples/hl7/MN/MN NBS OML_O21 Lab Order Message.txt index 84c574288..7942fdb12 100644 --- a/examples/hl7/MN/MN NBS OML_O21 Lab Order Message.txt +++ b/examples/hl7/MN/MN NBS OML_O21 Lab Order Message.txt @@ -1,7 +1,7 @@ MSH|^~\&|Epic^1.2.840.114350.1.13.145.2.7.2.695071^ISO|Centracare^centracare.com^DNS|NATUS^natus.health.state.mn.us^DNS|MN Public Health Lab^2.16.840.1.114222.4.1.10080^ISO|20230506052916-0500||OML^O21^OML_O21|31808297|P|2.5.1|||AL|AL|||||LAB_PRU_COMPONENT^^2.16.840.1.113883.9.82^ISO~LAB_TO_COMPONENT^^2.16.840.1.113883.9.22^ISO PID|1||11102779^^^CRPMRN^MR||SMITH^BB SARAH^^^^^L||20230504131023-0500|M|||555 STATE HIGHWAY 13^^DEER CREEK^MN^56527-9657^USA^^^OTTER TAIL|||||||||||||N|1|||||N NK1|1|SMITH^SAMUAL^^^^^L|FTH^Father^HL70063^^^^^^Father|^^^^^USA^H^^|^^PH^^^507^5556666^^(507)555-6666 -NK1|2|SMITH^SADIE^S^^^^L|MTH^Mother^HL70063^^^^^^Mother|555 STATE HIGHWAY 13^^DEER CREEK^MN^56527-9657^USA^H^^OTTER TAIL|^^PH^^^763^555555^^(763)555-5555 +NK1|2|SMITH^SADIE^S^^^^L|MTH^Mother^HL70063^^^^^^Mother|555 STATE HIGHWAY 13^^DEER CREEK^MN^56527-9657^USA^H^^OTTER TAIL|^^PH^^^763^5555555^^(763)555-5555 ORC|NW|421832901^EPIC^1.2.840.114350.1.13.145.2.7.2.695071^ISO|||||||20230506052913-0500|||1265136360^JONES^JANE^^^^^^NPI^L^^^NPI|||||||||ST. CLOUD HOSPITAL^L^^^^CMS^NPI^^^1043269798~ST. CLOUD HOSPITAL^L^^^^MN Public Health Lab^Submitter ID^^^739 OBR|1|421832901^EPIC^1.2.840.114350.1.13.145.2.7.2.695071^ISO||54089-8^Newborn screening panel American Health Information Community (AHIC)^LN|||20230506050000 SPM|1|421832901&EPIC&1.2.840.114350.1.13.145.2.7.2.695071&ISO||440500007^Blood spot specimen^SCT|||||||||||||20230506060000-0500 diff --git a/examples/hl7/MN/MN NBS ORM_O01 Lab Order Message Extended.txt b/examples/hl7/MN/MN NBS ORM_O01 Lab Order Message Extended.txt index 06d88b147..3b0ff3a9e 100644 --- a/examples/hl7/MN/MN NBS ORM_O01 Lab Order Message Extended.txt +++ b/examples/hl7/MN/MN NBS ORM_O01 Lab Order Message Extended.txt @@ -1,7 +1,7 @@ MSH|^~\&|Epic^1.2.840.114350.1.13.145.2.7.2.695071^ISO|Centracare^centracare.com^DNS|NATUS^natus.health.state.mn.us^DNS|MN Public Health Lab^2.16.840.1.114222.4.1.10080^ISO|20230506052916-0500||ORM^O01^ORM_O01|31808297|P|2.5.1|||AL|AL|||||LAB_PRU_COMPONENT^^2.16.840.1.113883.9.82^ISO~LAB_TO_COMPONENT^^2.16.840.1.113883.9.22^ISO PID|1||11102779^^^CRPMRN^MR||SMITH^BB SARAH^^^^^L||20230504131023-0500|M|||555 STATE HIGHWAY 13^^DEER CREEK^MN^56527-9657^USA^^^OTTER TAIL|||||||||||||N|1|||||N NK1|1|SMITH^SAMUAL^^^^^L|FTH^Father^HL70063^^^^^^Father|^^^^^USA^H^^|^^PH^^^507^5556666^^(507)555-6666 -NK1|2|SMITH^SADIE^S^^^^L|MTH^Mother^HL70063^^^^^^Mother|555 STATE HIGHWAY 13^^DEER CREEK^MN^56527-9657^USA^H^^OTTER TAIL|^^PH^^^763^555555^^(763)555-5555 +NK1|2|SMITH^SADIE^S^^^^L|MTH^Mother^HL70063^^^^^^Mother|555 STATE HIGHWAY 13^^DEER CREEK^MN^56527-9657^USA^H^^OTTER TAIL|^^PH^^^763^5555555^^(763)555-5555 ORC|NW|421832901^EPIC^1.2.840.114350.1.13.145.2.7.2.695071^ISO|||||||20230506052913-0500|||1265136360^JONES^JANE^^^^^^NPI^L^^^NPI|||||||||ST. CLOUD HOSPITAL^L^^^^CMS^NPI^^^1043269798~ST. CLOUD HOSPITAL^L^^^^MN Public Health Lab^Submitter ID^^^739 OBR|1|421832901^EPIC^1.2.840.114350.1.13.145.2.7.2.695071^ISO||54089-8^Newborn screening panel American Health Information Community (AHIC)^LN|||20230506050000||||||||440500007&Blood spot specimen&SCT OBR|1|421832901^EPIC^1.2.840.114350.1.13.145.2.7.2.695071^ISO||57717-1^Newborn screen card data panel^LN|||20230506050000||||||||440500007&Blood spot specimen&SCT From 7d64da8eac2a501b2c3169c441a6493367075d7d Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 24 Oct 2023 09:16:53 -0600 Subject: [PATCH 10/25] Update the other phone number to have an additional 5 --- examples/fhir/oml_message.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/fhir/oml_message.json b/examples/fhir/oml_message.json index 481238494..7352a15ee 100644 --- a/examples/fhir/oml_message.json +++ b/examples/fhir/oml_message.json @@ -1032,7 +1032,7 @@ } ], "system": "phone", - "value": "(763) 555 555", + "value": "(763) 555 5555", "use": "home" } ], From d6a165e8f76b595c7e364160a6d9baa68aae3a7e Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 24 Oct 2023 15:39:25 -0600 Subject: [PATCH 11/25] Create a class field to ID our private key --- .../reportstream/ReportStreamOrderSender.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java index bc6e5d1a2..5cfec33ef 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java @@ -37,6 +37,9 @@ public class ReportStreamOrderSender implements OrderSender { .map(urlPrefix -> urlPrefix.replace("https://", "").replace("http://", "")) .orElse(""); + private static final String OUR_PRIVATE_KEY_ID = + "trusted-intermediary-private-key-" + ApplicationContext.getEnvironment(); + private static final String CLIENT_NAME = "flexion.etor-service-sender"; private String rsTokenCache; @@ -155,15 +158,13 @@ protected String requestToken() throws UnableToSendOrderException { } protected String retrievePrivateKey() throws SecretRetrievalException { - var senderPrivateKey = - "trusted-intermediary-private-key-" + ApplicationContext.getEnvironment(); - String key = this.keyCache.get(senderPrivateKey); + String key = this.keyCache.get(OUR_PRIVATE_KEY_ID); if (key != null) { return key; } - key = secrets.getKey(senderPrivateKey); - this.keyCache.put(senderPrivateKey, key); + key = secrets.getKey(OUR_PRIVATE_KEY_ID); + this.keyCache.put(OUR_PRIVATE_KEY_ID, key); return key; } From 98a3a822e0097d41d2c13ad7eed55c7622046047 Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 24 Oct 2023 15:42:36 -0600 Subject: [PATCH 12/25] Put our private key into a variable --- .../external/reportstream/ReportStreamOrderSender.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java index 5cfec33ef..56da1b23e 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java @@ -139,6 +139,7 @@ protected String requestToken() throws UnableToSendOrderException { String body; Map headers = Map.of("Content-Type", "application/x-www-form-urlencoded"); try { + var ourPrivateKey = retrievePrivateKey(); senderToken = jwt.generateToken( CLIENT_NAME, @@ -146,7 +147,7 @@ protected String requestToken() throws UnableToSendOrderException { CLIENT_NAME, RS_DOMAIN_NAME, 300, - retrievePrivateKey()); + ourPrivateKey); body = composeRequestBody(senderToken); String rsResponse = client.post(RS_AUTH_API_URL, headers, body); token = extractToken(rsResponse); From 0d73ec8d904d019a8cd1f5e27cba0873ea42a489 Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 24 Oct 2023 15:52:37 -0600 Subject: [PATCH 13/25] 600: Clean-up requestToken --- .../reportstream/ReportStreamOrderSender.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java index 56da1b23e..64eec3099 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java @@ -41,6 +41,8 @@ public class ReportStreamOrderSender implements OrderSender { "trusted-intermediary-private-key-" + ApplicationContext.getEnvironment(); private static final String CLIENT_NAME = "flexion.etor-service-sender"; + private static final Map RS_AUTH_API_HEADERS = + Map.of("Content-Type", "application/x-www-form-urlencoded"); private String rsTokenCache; @@ -134,13 +136,11 @@ protected String sendRequestBody(@Nonnull String json, @Nonnull String bearerTok protected String requestToken() throws UnableToSendOrderException { logger.logInfo("Requesting token from ReportStream"); - String senderToken = null; - String token = ""; - String body; - Map headers = Map.of("Content-Type", "application/x-www-form-urlencoded"); + String token; + try { - var ourPrivateKey = retrievePrivateKey(); - senderToken = + String ourPrivateKey = retrievePrivateKey(); + String senderToken = jwt.generateToken( CLIENT_NAME, CLIENT_NAME, @@ -148,24 +148,25 @@ protected String requestToken() throws UnableToSendOrderException { RS_DOMAIN_NAME, 300, ourPrivateKey); - body = composeRequestBody(senderToken); - String rsResponse = client.post(RS_AUTH_API_URL, headers, body); + String body = composeRequestBody(senderToken); + String rsResponse = client.post(RS_AUTH_API_URL, RS_AUTH_API_HEADERS, body); token = extractToken(rsResponse); } catch (Exception e) { throw new UnableToSendOrderException( "Error getting the API token from ReportStream", e); } + return token; } protected String retrievePrivateKey() throws SecretRetrievalException { - String key = this.keyCache.get(OUR_PRIVATE_KEY_ID); + String key = keyCache.get(OUR_PRIVATE_KEY_ID); if (key != null) { return key; } key = secrets.getKey(OUR_PRIVATE_KEY_ID); - this.keyCache.put(OUR_PRIVATE_KEY_ID, key); + keyCache.put(OUR_PRIVATE_KEY_ID, key); return key; } From 4e98e5113d348b3d2809e3643218c4173cdf417b Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 24 Oct 2023 15:58:35 -0600 Subject: [PATCH 14/25] 600: fix tests since we are now saving our private key only on success --- .../external/reportstream/ReportStreamOrderSender.java | 8 ++++++-- .../reportstream/ReportStreamOrderSenderTest.groovy | 5 +---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java index 64eec3099..6873fae02 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java @@ -136,10 +136,11 @@ protected String sendRequestBody(@Nonnull String json, @Nonnull String bearerTok protected String requestToken() throws UnableToSendOrderException { logger.logInfo("Requesting token from ReportStream"); + String ourPrivateKey; String token; try { - String ourPrivateKey = retrievePrivateKey(); + ourPrivateKey = retrievePrivateKey(); String senderToken = jwt.generateToken( CLIENT_NAME, @@ -156,6 +157,9 @@ protected String requestToken() throws UnableToSendOrderException { "Error getting the API token from ReportStream", e); } + // only cache our private key if we successfully authenticate to RS + keyCache.put(OUR_PRIVATE_KEY_ID, ourPrivateKey); + return token; } @@ -166,7 +170,7 @@ protected String retrievePrivateKey() throws SecretRetrievalException { } key = secrets.getKey(OUR_PRIVATE_KEY_ID); - keyCache.put(OUR_PRIVATE_KEY_ID, key); + return key; } diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy index d5ccfc9d7..72f037ebe 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy @@ -193,11 +193,9 @@ class ReportStreamOrderSenderTest extends Specification { given: def mockSecret = Mock(Secrets) def expected = "New Fake Azure Key" - def keyCache = KeyCache.getInstance() - def key = "trusted-intermediary-private-key-local" mockSecret.getKey(_ as String) >> expected TestApplicationContext.register(Secrets, mockSecret) - TestApplicationContext.register(Cache, keyCache) + TestApplicationContext.register(Cache, KeyCache.getInstance()) TestApplicationContext.injectRegisteredImplementations() def rsOrderSender = ReportStreamOrderSender.getInstance() when: @@ -205,7 +203,6 @@ class ReportStreamOrderSenderTest extends Specification { then: actual == expected - keyCache.get(key) == expected } def "retrievePrivateKey works when cache is not empty" () { From f12b8a95c8e9ab8404e2046333a855d963098433 Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 24 Oct 2023 16:19:42 -0600 Subject: [PATCH 15/25] 600: write a test for us only caching the private key when we successfully call RS --- .../ReportStreamOrderSenderTest.groovy | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy index 72f037ebe..7ca9c35d6 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy @@ -73,15 +73,44 @@ class ReportStreamOrderSenderTest extends Specification { TestApplicationContext.register(Secrets, mockSecrets) TestApplicationContext.register(Cache, mockCache) TestApplicationContext.injectRegisteredImplementations() + when: mockSecrets.getKey(_ as String) >> "Fake Azure Key" def actual = ReportStreamOrderSender.getInstance().requestToken() + then: 1 * mockAuthEngine.generateToken(_ as String, _ as String, _ as String, _ as String, 300, _ as String) >> "sender fake token" 1 * mockClient.post(_ as String, _ as Map, _ as String) >> """{"access_token":"${expected}", "token_type":"bearer"}""" actual == expected } + def "requestToken saves our private key only after successful call to RS"() { + given: + def mockAuthEngine = Mock(AuthEngine) + def mockClient = Mock(HttpClient) + def mockSecrets = Mock(Secrets) + def mockCache = Mock(Cache) + def mockFormatter = Mock(Formatter) + + def fakeOurPrivateKey = "DogCow" // pragma: allowlist secret + mockSecrets.getKey(_ as String) >> fakeOurPrivateKey + mockFormatter.convertJsonToObject(_ , _) >> [access_token: "Moof!"] + + TestApplicationContext.register(AuthEngine, mockAuthEngine) + TestApplicationContext.register(HttpClient, mockClient) + TestApplicationContext.register(Formatter, mockFormatter) + TestApplicationContext.register(Secrets, mockSecrets) + TestApplicationContext.register(Cache, mockCache) + + TestApplicationContext.injectRegisteredImplementations() + + when: + ReportStreamOrderSender.getInstance().requestToken() + + then: + 1 * mockCache.put(_ as String, fakeOurPrivateKey) + } + def "extractToken works"() { given: TestApplicationContext.register(Formatter, Jackson.getInstance()) From 00a674d9d62e87a6d98817d2dded75c88ac5ca18 Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 24 Oct 2023 16:23:41 -0600 Subject: [PATCH 16/25] 600: test that we do not cache our private key if we fail to auth to RS --- .../ReportStreamOrderSenderTest.groovy | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy index 7ca9c35d6..b9bda1a54 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy @@ -111,6 +111,36 @@ class ReportStreamOrderSenderTest extends Specification { 1 * mockCache.put(_ as String, fakeOurPrivateKey) } + def "requestToken doesn't cache our private key if RS auth call fails"() { + given: + def mockAuthEngine = Mock(AuthEngine) + def mockClient = Mock(HttpClient) + def mockSecrets = Mock(Secrets) + def mockCache = Mock(Cache) + def mockFormatter = Mock(Formatter) + + // def fakeOurPrivateKey = "DogCow" // pragma: allowlist secret + // mockSecrets.getKey(_ as String) >> fakeOurPrivateKey + mockClient.post(_, _, _) >> { throw new HttpClientException("Fake failure", new NullPointerException()) } + + mockFormatter.convertJsonToObject(_ , _) >> [access_token: "Moof!"] + + TestApplicationContext.register(AuthEngine, mockAuthEngine) + TestApplicationContext.register(HttpClient, mockClient) + TestApplicationContext.register(Formatter, mockFormatter) + TestApplicationContext.register(Secrets, mockSecrets) + TestApplicationContext.register(Cache, mockCache) + + TestApplicationContext.injectRegisteredImplementations() + + when: + ReportStreamOrderSender.getInstance().requestToken() + + then: + thrown(UnableToSendOrderException) + 0 * mockCache.put(_ , _) + } + def "extractToken works"() { given: TestApplicationContext.register(Formatter, Jackson.getInstance()) From 88b0d9d647868a0b9ac9bfe27357574911bd356d Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 24 Oct 2023 16:43:55 -0600 Subject: [PATCH 17/25] 600: only cache our private key if it was not already cached --- .../reportstream/ReportStreamOrderSender.java | 11 +++++- .../ReportStreamOrderSenderTest.groovy | 34 +++++++++++++++++-- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java index 6873fae02..5f99f82f9 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java @@ -158,7 +158,7 @@ protected String requestToken() throws UnableToSendOrderException { } // only cache our private key if we successfully authenticate to RS - keyCache.put(OUR_PRIVATE_KEY_ID, ourPrivateKey); + cachePrivateKeyIfNotCachedAlready(ourPrivateKey); return token; } @@ -174,6 +174,15 @@ protected String retrievePrivateKey() throws SecretRetrievalException { return key; } + protected void cachePrivateKeyIfNotCachedAlready(String privateKey) { + String key = keyCache.get(OUR_PRIVATE_KEY_ID); + if (key != null) { + return; + } + + keyCache.put(OUR_PRIVATE_KEY_ID, privateKey); + } + protected String extractToken(String responseBody) throws FormatterProcessingException { var value = formatter.convertJsonToObject( diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy index b9bda1a54..39092da74 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy @@ -119,8 +119,6 @@ class ReportStreamOrderSenderTest extends Specification { def mockCache = Mock(Cache) def mockFormatter = Mock(Formatter) - // def fakeOurPrivateKey = "DogCow" // pragma: allowlist secret - // mockSecrets.getKey(_ as String) >> fakeOurPrivateKey mockClient.post(_, _, _) >> { throw new HttpClientException("Fake failure", new NullPointerException()) } mockFormatter.convertJsonToObject(_ , _) >> [access_token: "Moof!"] @@ -141,6 +139,38 @@ class ReportStreamOrderSenderTest extends Specification { 0 * mockCache.put(_ , _) } + def "cachePrivateKeyIfNotCachedAlready doesn't cache when the key is already is cached"() { + given: + def mockCache = Mock(Cache) + mockCache.get(_ as String) >> "DogCow private key" + + TestApplicationContext.register(Cache, mockCache) + + TestApplicationContext.injectRegisteredImplementations() + + when: + ReportStreamOrderSender.getInstance().cachePrivateKeyIfNotCachedAlready("Moof!") + + then: + 0 * mockCache.put(_, _) + } + + def "cachePrivateKeyIfNotCachedAlready caches when the key isn't cached"() { + given: + def mockCache = Mock(Cache) + mockCache.get(_ as String) >> null + + TestApplicationContext.register(Cache, mockCache) + + TestApplicationContext.injectRegisteredImplementations() + + when: + ReportStreamOrderSender.getInstance().cachePrivateKeyIfNotCachedAlready("Moof!") + + then: + 1 * mockCache.put(_, _) + } + def "extractToken works"() { given: TestApplicationContext.register(Formatter, Jackson.getInstance()) From 26e9dc59edfec1c4c3ddc4a48ba08f4bfefd47d1 Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 24 Oct 2023 16:58:13 -0600 Subject: [PATCH 18/25] 600: Clean-up the new tests --- .../reportstream/ReportStreamOrderSenderTest.groovy | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy index 39092da74..02da4aa36 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy @@ -86,8 +86,6 @@ class ReportStreamOrderSenderTest extends Specification { def "requestToken saves our private key only after successful call to RS"() { given: - def mockAuthEngine = Mock(AuthEngine) - def mockClient = Mock(HttpClient) def mockSecrets = Mock(Secrets) def mockCache = Mock(Cache) def mockFormatter = Mock(Formatter) @@ -96,8 +94,8 @@ class ReportStreamOrderSenderTest extends Specification { mockSecrets.getKey(_ as String) >> fakeOurPrivateKey mockFormatter.convertJsonToObject(_ , _) >> [access_token: "Moof!"] - TestApplicationContext.register(AuthEngine, mockAuthEngine) - TestApplicationContext.register(HttpClient, mockClient) + TestApplicationContext.register(AuthEngine, Mock(AuthEngine)) + TestApplicationContext.register(HttpClient, Mock(HttpClient)) TestApplicationContext.register(Formatter, mockFormatter) TestApplicationContext.register(Secrets, mockSecrets) TestApplicationContext.register(Cache, mockCache) @@ -113,9 +111,7 @@ class ReportStreamOrderSenderTest extends Specification { def "requestToken doesn't cache our private key if RS auth call fails"() { given: - def mockAuthEngine = Mock(AuthEngine) def mockClient = Mock(HttpClient) - def mockSecrets = Mock(Secrets) def mockCache = Mock(Cache) def mockFormatter = Mock(Formatter) @@ -123,10 +119,10 @@ class ReportStreamOrderSenderTest extends Specification { mockFormatter.convertJsonToObject(_ , _) >> [access_token: "Moof!"] - TestApplicationContext.register(AuthEngine, mockAuthEngine) + TestApplicationContext.register(AuthEngine, Mock(AuthEngine)) TestApplicationContext.register(HttpClient, mockClient) TestApplicationContext.register(Formatter, mockFormatter) - TestApplicationContext.register(Secrets, mockSecrets) + TestApplicationContext.register(Secrets, Mock(Secrets)) TestApplicationContext.register(Cache, mockCache) TestApplicationContext.injectRegisteredImplementations() From b83b0990d52057931a12baf97ff23c821008cbc6 Mon Sep 17 00:00:00 2001 From: halprin Date: Wed, 25 Oct 2023 09:00:32 -0600 Subject: [PATCH 19/25] Add AL Baptist examples --- examples/hl7/AL/Baptist ORM 1.txt | 13 +++++++++++++ examples/hl7/AL/Baptist ORM 2.txt | 13 +++++++++++++ examples/hl7/AL/Baptist ORU.txt | 15 +++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 examples/hl7/AL/Baptist ORM 1.txt create mode 100644 examples/hl7/AL/Baptist ORM 2.txt create mode 100644 examples/hl7/AL/Baptist ORU.txt diff --git a/examples/hl7/AL/Baptist ORM 1.txt b/examples/hl7/AL/Baptist ORM 1.txt new file mode 100644 index 000000000..eeb14412e --- /dev/null +++ b/examples/hl7/AL/Baptist ORM 1.txt @@ -0,0 +1,13 @@ +MSH|^~\&||HNA|||20231023170230||ORM^O01|Q1283765463T1850878697||2.3||||||8859/1 +PID|1|1300964^^^MRN^CD:1079^CD:17598964|1300964^^^MRN^CD:10^CD:17598964|1300964^^^MRN^CD:660921|TEST^TEST, SCENERIO02, BB^^^^^CD:766||20230913|M||2106-3|2314 S 10TH STREET^^MCALLEN^TX^78504^US^Home^^""||(999)232-4395^Home^""||CD:151|CD:309239|Unknown|11052895^^^FIN^CD:1077^CD:17598964|000-00-0000|||H||""|0|""|""|""||CD:684730 +ORC|CD:2539|2801515645^HNAM_ORDERID|||CD:9324||||20231023165600|2013059-035^SYSTEM^SYSTEM^^^^^^External Id^CD:614387^^^CD:1086^CD:72218685~1^SYSTEM^SYSTEM^^^^^^PERSONNEL PRIMARY IDENTIFIER^CD:614387^^^CD:685806^""||6927439045004^HONRUBIA^DYNIO^^MD^^^^Surescripts Prescriber ID^CD:614387^^^CD:4045114^""~92543^HONRUBIA^DYNIO^^MD^^^^External Id^CD:614387^^^CD:1086^CD:17598964~0073868^HONRUBIA^DYNIO^^MD^^^^Liability - Insurance^CD:614387^^^CD:1089^""~1487614269^HONRUBIA^DYNIO^^MD^^^^National Provider Identifier^CD:614387^^^National Provider Identifier^CD:17598964~BH6076132^HONRUBIA^DYNIO^^MD^^^^DEA^CD:614387^^^CD:1084^CD:17598964~E0142028^HONRUBIA^DYNIO^^MD^^^^DPS^CD:614387^^^CD:1088^CD:17598964~H87466^HONRUBIA^DYNIO^^MD^^^^UPIN^CD:614387^^^CD:1085^CD:17598964~TXBM1765^HONRUBIA^DYNIO^^MD^^^^State^CD:614387^^^CD:1083^CD:17598964|""||20231023165615||||2013059-035^SYSTEM^SYSTEM^^^^^^External Id^CD:614387^^^CD:1086^CD:72218685~1^SYSTEM^SYSTEM^^^^^^PERSONNEL PRIMARY IDENTIFIER^CD:614387^^^CD:685806^"" +OBR|1|2801515645^HNAM_ORDERID||57128-1^Newborn Screening Panel|||20231023164950|||2010346-006^Lopez^Martha^^^^^^External Id^CD:614387^^^CD:1086^""||||20231023165500|440500007&Blood|6927439045004^HONRUBIA^DYNIO^^MD^^^^Surescripts Prescriber ID^CD:614387^^^CD:4045114^""~92543^HONRUBIA^DYNIO^^MD^^^^External Id^CD:614387^^^CD:1086^CD:17598964~0073868^HONRUBIA^DYNIO^^MD^^^^Liability - Insurance^CD:614387^^^CD:1089^""~1487614269^HONRUBIA^DYNIO^^MD^^^^National Provider Identifier^CD:614387^^^National Provider Identifier^CD:17598964~BH6076132^HONRUBIA^DYNIO^^MD^^^^DEA^CD:614387^^^CD:1084^CD:17598964~E0142028^HONRUBIA^DYNIO^^MD^^^^DPS^CD:614387^^^CD:1088^CD:17598964~H87466^HONRUBIA^DYNIO^^MD^^^^UPIN^CD:614387^^^CD:1085^CD:17598964~TXBM1765^HONRUBIA^DYNIO^^MD^^^^State^CD:614387^^^CD:1083^CD:17598964||||000002023296000002^HNA_ACCN~16720597^HNA_ACCNID||20231023165615||CD:692|||1^^0^20231023164300^^ST~^^^^^CD:1758|||||||||20231023164800||||||||||Laboratory^Laboratory^^Send Out^Send Out +OBX|1|CE|67704-7^Type of Feed||^Formula^CD:1220 +OBX|2|CE|57713-0^Sick/Premature?||^Yes, Sick/Premature^CD:1220 +OBX|3|CE|57713-0^On Medication?||^Yes, On Medications^CD:1220 +OBX|4|CE|57713-0^Transfused?||^No^CD:1220 +OBX|5|ST|57723-9^Current Sample Number||230036306 +OBX|6|NM|8339-4^Birth Weight (g)||3040 +OBX|7|NM|57714-8^Gestastional Age (wks)||38 +OBX|8|ST|62324-9^Provider Name Post Discharge (Last, Firs||TEST, MD +OBX|9|ST|62328-0^Provider Phone NumberPost Discharge||9568963214 diff --git a/examples/hl7/AL/Baptist ORM 2.txt b/examples/hl7/AL/Baptist ORM 2.txt new file mode 100644 index 000000000..59409bafa --- /dev/null +++ b/examples/hl7/AL/Baptist ORM 2.txt @@ -0,0 +1,13 @@ +MSH|^~\&||HNA|||20231017165042||ORM^O01|Q1283695599T1850810956||2.3||||||8859/1 +PID|1|1300962^^^MRN^CD:1079^CD:17598964|1300962^^^MRN^CD:10^CD:17598964|1300962^^^MRN^CD:660921|TEST^SCENERIO01, BG^^^^^CD:766||20230913|F||2106-3|8802 S MCCOLL RD^^EDINBURG^TX^78539^US^Home^^""||(999)999-9999^Home^""||CD:151|CD:309239|Unknown|11052893^^^FIN^CD:1077^CD:17598964|000-00-0000|||N||""|0|""|""|""||CD:684730 +ORC|CD:2539|2801432857^HNAM_ORDERID|||CD:9324||||20231016113400|2010346-006^Lopez^Martha^^^^^^External Id^CD:614387^^^CD:1086^""||6927439045004^HONRUBIA^DYNIO^^MD^^^^Surescripts Prescriber ID^CD:614387^^^CD:4045114^""~92543^HONRUBIA^DYNIO^^MD^^^^External Id^CD:614387^^^CD:1086^CD:17598964~0073868^HONRUBIA^DYNIO^^MD^^^^Liability - Insurance^CD:614387^^^CD:1089^""~1487614269^HONRUBIA^DYNIO^^MD^^^^National Provider Identifier^CD:614387^^^National Provider Identifier^CD:17598964~BH6076132^HONRUBIA^DYNIO^^MD^^^^DEA^CD:614387^^^CD:1084^CD:17598964~E0142028^HONRUBIA^DYNIO^^MD^^^^DPS^CD:614387^^^CD:1088^CD:17598964~H87466^HONRUBIA^DYNIO^^MD^^^^UPIN^CD:614387^^^CD:1085^CD:17598964~TXBM1765^HONRUBIA^DYNIO^^MD^^^^State^CD:614387^^^CD:1083^CD:17598964|""||20231016113457||||2010346-006^Lopez^Martha^^^^^^External Id^CD:614387^^^CD:1086^"" +OBR|1|2801432857^HNAM_ORDERID||57128-1^Newborn Screening Panel|||20231016113025|||2010346-006^Lopez^Martha^^^^^^External Id^CD:614387^^^CD:1086^""||||20231016113400|440500007&Blood|6927439045004^HONRUBIA^DYNIO^^MD^^^^Surescripts Prescriber ID^CD:614387^^^CD:4045114^""~92543^HONRUBIA^DYNIO^^MD^^^^External Id^CD:614387^^^CD:1086^CD:17598964~0073868^HONRUBIA^DYNIO^^MD^^^^Liability - Insurance^CD:614387^^^CD:1089^""~1487614269^HONRUBIA^DYNIO^^MD^^^^National Provider Identifier^CD:614387^^^National Provider Identifier^CD:17598964~BH6076132^HONRUBIA^DYNIO^^MD^^^^DEA^CD:614387^^^CD:1084^CD:17598964~E0142028^HONRUBIA^DYNIO^^MD^^^^DPS^CD:614387^^^CD:1088^CD:17598964~H87466^HONRUBIA^DYNIO^^MD^^^^UPIN^CD:614387^^^CD:1085^CD:17598964~TXBM1765^HONRUBIA^DYNIO^^MD^^^^State^CD:614387^^^CD:1083^CD:17598964||||000002023289000004^HNA_ACCN~16718602^HNA_ACCNID||20231016113457||CD:692|||1^^0^20231016112000^^ST~^^^^^CD:1758|||||||||20231016112800||||||||||Laboratory^Laboratory^^Send Out^Send Out +OBX|1|CE|67704-7^Type of Feed||^Breastmilk^CD:1220 +OBX|2|CE|57713-0^Sick/Premature?||^No^CD:1220 +OBX|3|CE|57713-0^On Medication?||^No^CD:1220 +OBX|4|CE|57713-0^Transfused?||^No^CD:1220 +OBX|5|ST|57723-9^Current Sample Number||230036305 +OBX|6|NM|8339-4^Birth Weight (g)||3040 +OBX|7|NM|57714-8^Gestastional Age (wks)||39 +OBX|8|ST|62324-9^Provider Name Post Discharge (Last, Firs||HONRUBIA, DYNIO +OBX|9|ST|62328-0^Provider Phone NumberPost Discharge||9567896352 diff --git a/examples/hl7/AL/Baptist ORU.txt b/examples/hl7/AL/Baptist ORU.txt new file mode 100644 index 000000000..57fbfa8b8 --- /dev/null +++ b/examples/hl7/AL/Baptist ORU.txt @@ -0,0 +1,15 @@ +MSH|^~\&|LABGEM|SONIC.RLN|UTMPMSE|UTMPMSE|202303171705||ORU^R01|20230317-29887.E.106214|P|2.3||OB_MS_MEM_Cerner_Methodist_Ambulatory_ORU +PID|1|557204|557204|557204|CPSI^DONNA||19651015|F|||12345 Main Street^^San Diego^CA^92121^CD:272668093||||CD:151|||62419135||||CD:312507|||0 +PV1|1|O|CD:116209255^^^MNGL^^^MNGL|||||||CD:272669551||||CD:309191||||O||CD:271975007|||||||||||||||||||MNGL|||||20230309095432 +ORC|RE|23075003068|335707581||CM||^^^202303160000^^R||202303171705|||^HOMMOS^NISREEN^A|||||||||MMG MULTI SPECIALTY - EASTMORELAND|1325 EASTMORELAND AVE STE 370^^MEMPHIS^TN^38104^9017587888 +OBR|1|9710754487|335707581|MACR^ALBUMIN/CREAT RATIO||202303160000|202303160908|||||||202303161838||1831485788^HOMMOS^NISREEN^A||||9710754487||202303171705|||F||^^^202303160000^^R +OBX|1|NM|20260^Albumin Urine^AEL^14957-5^Albumin Urine^LN|MACR|2.1|mg/dL|||||F|||202303171704|MEM +OBX|2|NM|10710^Creatinine-Random Urine^AEL^2161-8^Creatinine-Random Urine^LN|MACR|59|mg/dL|28-217||||F|||202303171704|MEM +OBX|3|NM|20281^Albumin/Creat Ratio^AEL^14959-1^Albumin/Creat Ratio^LN|MACR|36|mg/g crea|<30|H|||F|||202303171704|MEM +NTE|1|TX| +NTE|2|TX|UNLESS OTHERWISE INDICATED, ALL TESTING PERFORMED AT: +NTE|3|TX| +NTE|4|TX|AMERICAN ESOTERIC LABORATORIES-MEMPHIS +NTE|5|TX|1701 CENTURY CENTER COVE MEMPHIS, TN 38134 +NTE|6|TX|CLIA NUMBER 44D0889744 +NTE|7|TX|MEDICAL LABORATORY DIRECTOR, HOLLY H PIERCE, M.D. From 7f997fb92ed5be8067a43818d2615cba6d6b5c6a Mon Sep 17 00:00:00 2001 From: halprin Date: Wed, 25 Oct 2023 09:02:31 -0600 Subject: [PATCH 20/25] Updating the line endings to be LF --- examples/hl7/AL/Baptist ORM 1.txt | 26 +++++++++++++------------- examples/hl7/AL/Baptist ORM 2.txt | 26 +++++++++++++------------- examples/hl7/AL/Baptist ORU.txt | 30 +++++++++++++++--------------- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/examples/hl7/AL/Baptist ORM 1.txt b/examples/hl7/AL/Baptist ORM 1.txt index eeb14412e..f4f35dd76 100644 --- a/examples/hl7/AL/Baptist ORM 1.txt +++ b/examples/hl7/AL/Baptist ORM 1.txt @@ -1,13 +1,13 @@ -MSH|^~\&||HNA|||20231023170230||ORM^O01|Q1283765463T1850878697||2.3||||||8859/1 -PID|1|1300964^^^MRN^CD:1079^CD:17598964|1300964^^^MRN^CD:10^CD:17598964|1300964^^^MRN^CD:660921|TEST^TEST, SCENERIO02, BB^^^^^CD:766||20230913|M||2106-3|2314 S 10TH STREET^^MCALLEN^TX^78504^US^Home^^""||(999)232-4395^Home^""||CD:151|CD:309239|Unknown|11052895^^^FIN^CD:1077^CD:17598964|000-00-0000|||H||""|0|""|""|""||CD:684730 -ORC|CD:2539|2801515645^HNAM_ORDERID|||CD:9324||||20231023165600|2013059-035^SYSTEM^SYSTEM^^^^^^External Id^CD:614387^^^CD:1086^CD:72218685~1^SYSTEM^SYSTEM^^^^^^PERSONNEL PRIMARY IDENTIFIER^CD:614387^^^CD:685806^""||6927439045004^HONRUBIA^DYNIO^^MD^^^^Surescripts Prescriber ID^CD:614387^^^CD:4045114^""~92543^HONRUBIA^DYNIO^^MD^^^^External Id^CD:614387^^^CD:1086^CD:17598964~0073868^HONRUBIA^DYNIO^^MD^^^^Liability - Insurance^CD:614387^^^CD:1089^""~1487614269^HONRUBIA^DYNIO^^MD^^^^National Provider Identifier^CD:614387^^^National Provider Identifier^CD:17598964~BH6076132^HONRUBIA^DYNIO^^MD^^^^DEA^CD:614387^^^CD:1084^CD:17598964~E0142028^HONRUBIA^DYNIO^^MD^^^^DPS^CD:614387^^^CD:1088^CD:17598964~H87466^HONRUBIA^DYNIO^^MD^^^^UPIN^CD:614387^^^CD:1085^CD:17598964~TXBM1765^HONRUBIA^DYNIO^^MD^^^^State^CD:614387^^^CD:1083^CD:17598964|""||20231023165615||||2013059-035^SYSTEM^SYSTEM^^^^^^External Id^CD:614387^^^CD:1086^CD:72218685~1^SYSTEM^SYSTEM^^^^^^PERSONNEL PRIMARY IDENTIFIER^CD:614387^^^CD:685806^"" -OBR|1|2801515645^HNAM_ORDERID||57128-1^Newborn Screening Panel|||20231023164950|||2010346-006^Lopez^Martha^^^^^^External Id^CD:614387^^^CD:1086^""||||20231023165500|440500007&Blood|6927439045004^HONRUBIA^DYNIO^^MD^^^^Surescripts Prescriber ID^CD:614387^^^CD:4045114^""~92543^HONRUBIA^DYNIO^^MD^^^^External Id^CD:614387^^^CD:1086^CD:17598964~0073868^HONRUBIA^DYNIO^^MD^^^^Liability - Insurance^CD:614387^^^CD:1089^""~1487614269^HONRUBIA^DYNIO^^MD^^^^National Provider Identifier^CD:614387^^^National Provider Identifier^CD:17598964~BH6076132^HONRUBIA^DYNIO^^MD^^^^DEA^CD:614387^^^CD:1084^CD:17598964~E0142028^HONRUBIA^DYNIO^^MD^^^^DPS^CD:614387^^^CD:1088^CD:17598964~H87466^HONRUBIA^DYNIO^^MD^^^^UPIN^CD:614387^^^CD:1085^CD:17598964~TXBM1765^HONRUBIA^DYNIO^^MD^^^^State^CD:614387^^^CD:1083^CD:17598964||||000002023296000002^HNA_ACCN~16720597^HNA_ACCNID||20231023165615||CD:692|||1^^0^20231023164300^^ST~^^^^^CD:1758|||||||||20231023164800||||||||||Laboratory^Laboratory^^Send Out^Send Out -OBX|1|CE|67704-7^Type of Feed||^Formula^CD:1220 -OBX|2|CE|57713-0^Sick/Premature?||^Yes, Sick/Premature^CD:1220 -OBX|3|CE|57713-0^On Medication?||^Yes, On Medications^CD:1220 -OBX|4|CE|57713-0^Transfused?||^No^CD:1220 -OBX|5|ST|57723-9^Current Sample Number||230036306 -OBX|6|NM|8339-4^Birth Weight (g)||3040 -OBX|7|NM|57714-8^Gestastional Age (wks)||38 -OBX|8|ST|62324-9^Provider Name Post Discharge (Last, Firs||TEST, MD -OBX|9|ST|62328-0^Provider Phone NumberPost Discharge||9568963214 +MSH|^~\&||HNA|||20231023170230||ORM^O01|Q1283765463T1850878697||2.3||||||8859/1 +PID|1|1300964^^^MRN^CD:1079^CD:17598964|1300964^^^MRN^CD:10^CD:17598964|1300964^^^MRN^CD:660921|TEST^TEST, SCENERIO02, BB^^^^^CD:766||20230913|M||2106-3|2314 S 10TH STREET^^MCALLEN^TX^78504^US^Home^^""||(999)232-4395^Home^""||CD:151|CD:309239|Unknown|11052895^^^FIN^CD:1077^CD:17598964|000-00-0000|||H||""|0|""|""|""||CD:684730 +ORC|CD:2539|2801515645^HNAM_ORDERID|||CD:9324||||20231023165600|2013059-035^SYSTEM^SYSTEM^^^^^^External Id^CD:614387^^^CD:1086^CD:72218685~1^SYSTEM^SYSTEM^^^^^^PERSONNEL PRIMARY IDENTIFIER^CD:614387^^^CD:685806^""||6927439045004^HONRUBIA^DYNIO^^MD^^^^Surescripts Prescriber ID^CD:614387^^^CD:4045114^""~92543^HONRUBIA^DYNIO^^MD^^^^External Id^CD:614387^^^CD:1086^CD:17598964~0073868^HONRUBIA^DYNIO^^MD^^^^Liability - Insurance^CD:614387^^^CD:1089^""~1487614269^HONRUBIA^DYNIO^^MD^^^^National Provider Identifier^CD:614387^^^National Provider Identifier^CD:17598964~BH6076132^HONRUBIA^DYNIO^^MD^^^^DEA^CD:614387^^^CD:1084^CD:17598964~E0142028^HONRUBIA^DYNIO^^MD^^^^DPS^CD:614387^^^CD:1088^CD:17598964~H87466^HONRUBIA^DYNIO^^MD^^^^UPIN^CD:614387^^^CD:1085^CD:17598964~TXBM1765^HONRUBIA^DYNIO^^MD^^^^State^CD:614387^^^CD:1083^CD:17598964|""||20231023165615||||2013059-035^SYSTEM^SYSTEM^^^^^^External Id^CD:614387^^^CD:1086^CD:72218685~1^SYSTEM^SYSTEM^^^^^^PERSONNEL PRIMARY IDENTIFIER^CD:614387^^^CD:685806^"" +OBR|1|2801515645^HNAM_ORDERID||57128-1^Newborn Screening Panel|||20231023164950|||2010346-006^Lopez^Martha^^^^^^External Id^CD:614387^^^CD:1086^""||||20231023165500|440500007&Blood|6927439045004^HONRUBIA^DYNIO^^MD^^^^Surescripts Prescriber ID^CD:614387^^^CD:4045114^""~92543^HONRUBIA^DYNIO^^MD^^^^External Id^CD:614387^^^CD:1086^CD:17598964~0073868^HONRUBIA^DYNIO^^MD^^^^Liability - Insurance^CD:614387^^^CD:1089^""~1487614269^HONRUBIA^DYNIO^^MD^^^^National Provider Identifier^CD:614387^^^National Provider Identifier^CD:17598964~BH6076132^HONRUBIA^DYNIO^^MD^^^^DEA^CD:614387^^^CD:1084^CD:17598964~E0142028^HONRUBIA^DYNIO^^MD^^^^DPS^CD:614387^^^CD:1088^CD:17598964~H87466^HONRUBIA^DYNIO^^MD^^^^UPIN^CD:614387^^^CD:1085^CD:17598964~TXBM1765^HONRUBIA^DYNIO^^MD^^^^State^CD:614387^^^CD:1083^CD:17598964||||000002023296000002^HNA_ACCN~16720597^HNA_ACCNID||20231023165615||CD:692|||1^^0^20231023164300^^ST~^^^^^CD:1758|||||||||20231023164800||||||||||Laboratory^Laboratory^^Send Out^Send Out +OBX|1|CE|67704-7^Type of Feed||^Formula^CD:1220 +OBX|2|CE|57713-0^Sick/Premature?||^Yes, Sick/Premature^CD:1220 +OBX|3|CE|57713-0^On Medication?||^Yes, On Medications^CD:1220 +OBX|4|CE|57713-0^Transfused?||^No^CD:1220 +OBX|5|ST|57723-9^Current Sample Number||230036306 +OBX|6|NM|8339-4^Birth Weight (g)||3040 +OBX|7|NM|57714-8^Gestastional Age (wks)||38 +OBX|8|ST|62324-9^Provider Name Post Discharge (Last, Firs||TEST, MD +OBX|9|ST|62328-0^Provider Phone NumberPost Discharge||9568963214 diff --git a/examples/hl7/AL/Baptist ORM 2.txt b/examples/hl7/AL/Baptist ORM 2.txt index 59409bafa..cffae6c40 100644 --- a/examples/hl7/AL/Baptist ORM 2.txt +++ b/examples/hl7/AL/Baptist ORM 2.txt @@ -1,13 +1,13 @@ -MSH|^~\&||HNA|||20231017165042||ORM^O01|Q1283695599T1850810956||2.3||||||8859/1 -PID|1|1300962^^^MRN^CD:1079^CD:17598964|1300962^^^MRN^CD:10^CD:17598964|1300962^^^MRN^CD:660921|TEST^SCENERIO01, BG^^^^^CD:766||20230913|F||2106-3|8802 S MCCOLL RD^^EDINBURG^TX^78539^US^Home^^""||(999)999-9999^Home^""||CD:151|CD:309239|Unknown|11052893^^^FIN^CD:1077^CD:17598964|000-00-0000|||N||""|0|""|""|""||CD:684730 -ORC|CD:2539|2801432857^HNAM_ORDERID|||CD:9324||||20231016113400|2010346-006^Lopez^Martha^^^^^^External Id^CD:614387^^^CD:1086^""||6927439045004^HONRUBIA^DYNIO^^MD^^^^Surescripts Prescriber ID^CD:614387^^^CD:4045114^""~92543^HONRUBIA^DYNIO^^MD^^^^External Id^CD:614387^^^CD:1086^CD:17598964~0073868^HONRUBIA^DYNIO^^MD^^^^Liability - Insurance^CD:614387^^^CD:1089^""~1487614269^HONRUBIA^DYNIO^^MD^^^^National Provider Identifier^CD:614387^^^National Provider Identifier^CD:17598964~BH6076132^HONRUBIA^DYNIO^^MD^^^^DEA^CD:614387^^^CD:1084^CD:17598964~E0142028^HONRUBIA^DYNIO^^MD^^^^DPS^CD:614387^^^CD:1088^CD:17598964~H87466^HONRUBIA^DYNIO^^MD^^^^UPIN^CD:614387^^^CD:1085^CD:17598964~TXBM1765^HONRUBIA^DYNIO^^MD^^^^State^CD:614387^^^CD:1083^CD:17598964|""||20231016113457||||2010346-006^Lopez^Martha^^^^^^External Id^CD:614387^^^CD:1086^"" -OBR|1|2801432857^HNAM_ORDERID||57128-1^Newborn Screening Panel|||20231016113025|||2010346-006^Lopez^Martha^^^^^^External Id^CD:614387^^^CD:1086^""||||20231016113400|440500007&Blood|6927439045004^HONRUBIA^DYNIO^^MD^^^^Surescripts Prescriber ID^CD:614387^^^CD:4045114^""~92543^HONRUBIA^DYNIO^^MD^^^^External Id^CD:614387^^^CD:1086^CD:17598964~0073868^HONRUBIA^DYNIO^^MD^^^^Liability - Insurance^CD:614387^^^CD:1089^""~1487614269^HONRUBIA^DYNIO^^MD^^^^National Provider Identifier^CD:614387^^^National Provider Identifier^CD:17598964~BH6076132^HONRUBIA^DYNIO^^MD^^^^DEA^CD:614387^^^CD:1084^CD:17598964~E0142028^HONRUBIA^DYNIO^^MD^^^^DPS^CD:614387^^^CD:1088^CD:17598964~H87466^HONRUBIA^DYNIO^^MD^^^^UPIN^CD:614387^^^CD:1085^CD:17598964~TXBM1765^HONRUBIA^DYNIO^^MD^^^^State^CD:614387^^^CD:1083^CD:17598964||||000002023289000004^HNA_ACCN~16718602^HNA_ACCNID||20231016113457||CD:692|||1^^0^20231016112000^^ST~^^^^^CD:1758|||||||||20231016112800||||||||||Laboratory^Laboratory^^Send Out^Send Out -OBX|1|CE|67704-7^Type of Feed||^Breastmilk^CD:1220 -OBX|2|CE|57713-0^Sick/Premature?||^No^CD:1220 -OBX|3|CE|57713-0^On Medication?||^No^CD:1220 -OBX|4|CE|57713-0^Transfused?||^No^CD:1220 -OBX|5|ST|57723-9^Current Sample Number||230036305 -OBX|6|NM|8339-4^Birth Weight (g)||3040 -OBX|7|NM|57714-8^Gestastional Age (wks)||39 -OBX|8|ST|62324-9^Provider Name Post Discharge (Last, Firs||HONRUBIA, DYNIO -OBX|9|ST|62328-0^Provider Phone NumberPost Discharge||9567896352 +MSH|^~\&||HNA|||20231017165042||ORM^O01|Q1283695599T1850810956||2.3||||||8859/1 +PID|1|1300962^^^MRN^CD:1079^CD:17598964|1300962^^^MRN^CD:10^CD:17598964|1300962^^^MRN^CD:660921|TEST^SCENERIO01, BG^^^^^CD:766||20230913|F||2106-3|8802 S MCCOLL RD^^EDINBURG^TX^78539^US^Home^^""||(999)999-9999^Home^""||CD:151|CD:309239|Unknown|11052893^^^FIN^CD:1077^CD:17598964|000-00-0000|||N||""|0|""|""|""||CD:684730 +ORC|CD:2539|2801432857^HNAM_ORDERID|||CD:9324||||20231016113400|2010346-006^Lopez^Martha^^^^^^External Id^CD:614387^^^CD:1086^""||6927439045004^HONRUBIA^DYNIO^^MD^^^^Surescripts Prescriber ID^CD:614387^^^CD:4045114^""~92543^HONRUBIA^DYNIO^^MD^^^^External Id^CD:614387^^^CD:1086^CD:17598964~0073868^HONRUBIA^DYNIO^^MD^^^^Liability - Insurance^CD:614387^^^CD:1089^""~1487614269^HONRUBIA^DYNIO^^MD^^^^National Provider Identifier^CD:614387^^^National Provider Identifier^CD:17598964~BH6076132^HONRUBIA^DYNIO^^MD^^^^DEA^CD:614387^^^CD:1084^CD:17598964~E0142028^HONRUBIA^DYNIO^^MD^^^^DPS^CD:614387^^^CD:1088^CD:17598964~H87466^HONRUBIA^DYNIO^^MD^^^^UPIN^CD:614387^^^CD:1085^CD:17598964~TXBM1765^HONRUBIA^DYNIO^^MD^^^^State^CD:614387^^^CD:1083^CD:17598964|""||20231016113457||||2010346-006^Lopez^Martha^^^^^^External Id^CD:614387^^^CD:1086^"" +OBR|1|2801432857^HNAM_ORDERID||57128-1^Newborn Screening Panel|||20231016113025|||2010346-006^Lopez^Martha^^^^^^External Id^CD:614387^^^CD:1086^""||||20231016113400|440500007&Blood|6927439045004^HONRUBIA^DYNIO^^MD^^^^Surescripts Prescriber ID^CD:614387^^^CD:4045114^""~92543^HONRUBIA^DYNIO^^MD^^^^External Id^CD:614387^^^CD:1086^CD:17598964~0073868^HONRUBIA^DYNIO^^MD^^^^Liability - Insurance^CD:614387^^^CD:1089^""~1487614269^HONRUBIA^DYNIO^^MD^^^^National Provider Identifier^CD:614387^^^National Provider Identifier^CD:17598964~BH6076132^HONRUBIA^DYNIO^^MD^^^^DEA^CD:614387^^^CD:1084^CD:17598964~E0142028^HONRUBIA^DYNIO^^MD^^^^DPS^CD:614387^^^CD:1088^CD:17598964~H87466^HONRUBIA^DYNIO^^MD^^^^UPIN^CD:614387^^^CD:1085^CD:17598964~TXBM1765^HONRUBIA^DYNIO^^MD^^^^State^CD:614387^^^CD:1083^CD:17598964||||000002023289000004^HNA_ACCN~16718602^HNA_ACCNID||20231016113457||CD:692|||1^^0^20231016112000^^ST~^^^^^CD:1758|||||||||20231016112800||||||||||Laboratory^Laboratory^^Send Out^Send Out +OBX|1|CE|67704-7^Type of Feed||^Breastmilk^CD:1220 +OBX|2|CE|57713-0^Sick/Premature?||^No^CD:1220 +OBX|3|CE|57713-0^On Medication?||^No^CD:1220 +OBX|4|CE|57713-0^Transfused?||^No^CD:1220 +OBX|5|ST|57723-9^Current Sample Number||230036305 +OBX|6|NM|8339-4^Birth Weight (g)||3040 +OBX|7|NM|57714-8^Gestastional Age (wks)||39 +OBX|8|ST|62324-9^Provider Name Post Discharge (Last, Firs||HONRUBIA, DYNIO +OBX|9|ST|62328-0^Provider Phone NumberPost Discharge||9567896352 diff --git a/examples/hl7/AL/Baptist ORU.txt b/examples/hl7/AL/Baptist ORU.txt index 57fbfa8b8..45d65ed6d 100644 --- a/examples/hl7/AL/Baptist ORU.txt +++ b/examples/hl7/AL/Baptist ORU.txt @@ -1,15 +1,15 @@ -MSH|^~\&|LABGEM|SONIC.RLN|UTMPMSE|UTMPMSE|202303171705||ORU^R01|20230317-29887.E.106214|P|2.3||OB_MS_MEM_Cerner_Methodist_Ambulatory_ORU -PID|1|557204|557204|557204|CPSI^DONNA||19651015|F|||12345 Main Street^^San Diego^CA^92121^CD:272668093||||CD:151|||62419135||||CD:312507|||0 -PV1|1|O|CD:116209255^^^MNGL^^^MNGL|||||||CD:272669551||||CD:309191||||O||CD:271975007|||||||||||||||||||MNGL|||||20230309095432 -ORC|RE|23075003068|335707581||CM||^^^202303160000^^R||202303171705|||^HOMMOS^NISREEN^A|||||||||MMG MULTI SPECIALTY - EASTMORELAND|1325 EASTMORELAND AVE STE 370^^MEMPHIS^TN^38104^9017587888 -OBR|1|9710754487|335707581|MACR^ALBUMIN/CREAT RATIO||202303160000|202303160908|||||||202303161838||1831485788^HOMMOS^NISREEN^A||||9710754487||202303171705|||F||^^^202303160000^^R -OBX|1|NM|20260^Albumin Urine^AEL^14957-5^Albumin Urine^LN|MACR|2.1|mg/dL|||||F|||202303171704|MEM -OBX|2|NM|10710^Creatinine-Random Urine^AEL^2161-8^Creatinine-Random Urine^LN|MACR|59|mg/dL|28-217||||F|||202303171704|MEM -OBX|3|NM|20281^Albumin/Creat Ratio^AEL^14959-1^Albumin/Creat Ratio^LN|MACR|36|mg/g crea|<30|H|||F|||202303171704|MEM -NTE|1|TX| -NTE|2|TX|UNLESS OTHERWISE INDICATED, ALL TESTING PERFORMED AT: -NTE|3|TX| -NTE|4|TX|AMERICAN ESOTERIC LABORATORIES-MEMPHIS -NTE|5|TX|1701 CENTURY CENTER COVE MEMPHIS, TN 38134 -NTE|6|TX|CLIA NUMBER 44D0889744 -NTE|7|TX|MEDICAL LABORATORY DIRECTOR, HOLLY H PIERCE, M.D. +MSH|^~\&|LABGEM|SONIC.RLN|UTMPMSE|UTMPMSE|202303171705||ORU^R01|20230317-29887.E.106214|P|2.3||OB_MS_MEM_Cerner_Methodist_Ambulatory_ORU +PID|1|557204|557204|557204|CPSI^DONNA||19651015|F|||12345 Main Street^^San Diego^CA^92121^CD:272668093||||CD:151|||62419135||||CD:312507|||0 +PV1|1|O|CD:116209255^^^MNGL^^^MNGL|||||||CD:272669551||||CD:309191||||O||CD:271975007|||||||||||||||||||MNGL|||||20230309095432 +ORC|RE|23075003068|335707581||CM||^^^202303160000^^R||202303171705|||^HOMMOS^NISREEN^A|||||||||MMG MULTI SPECIALTY - EASTMORELAND|1325 EASTMORELAND AVE STE 370^^MEMPHIS^TN^38104^9017587888 +OBR|1|9710754487|335707581|MACR^ALBUMIN/CREAT RATIO||202303160000|202303160908|||||||202303161838||1831485788^HOMMOS^NISREEN^A||||9710754487||202303171705|||F||^^^202303160000^^R +OBX|1|NM|20260^Albumin Urine^AEL^14957-5^Albumin Urine^LN|MACR|2.1|mg/dL|||||F|||202303171704|MEM +OBX|2|NM|10710^Creatinine-Random Urine^AEL^2161-8^Creatinine-Random Urine^LN|MACR|59|mg/dL|28-217||||F|||202303171704|MEM +OBX|3|NM|20281^Albumin/Creat Ratio^AEL^14959-1^Albumin/Creat Ratio^LN|MACR|36|mg/g crea|<30|H|||F|||202303171704|MEM +NTE|1|TX| +NTE|2|TX|UNLESS OTHERWISE INDICATED, ALL TESTING PERFORMED AT: +NTE|3|TX| +NTE|4|TX|AMERICAN ESOTERIC LABORATORIES-MEMPHIS +NTE|5|TX|1701 CENTURY CENTER COVE MEMPHIS, TN 38134 +NTE|6|TX|CLIA NUMBER 44D0889744 +NTE|7|TX|MEDICAL LABORATORY DIRECTOR, HOLLY H PIERCE, M.D. From 9f9d288be403a050205d91dfc2dfc1c5d217ef40 Mon Sep 17 00:00:00 2001 From: tjohnson7021 <86614374+tjohnson7021@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:49:56 -0400 Subject: [PATCH 21/25] Fixed casing to match other segments in IG --- ig/input/fsh/nbs-msh-segment.fsh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/ig/input/fsh/nbs-msh-segment.fsh b/ig/input/fsh/nbs-msh-segment.fsh index 337490ded..84ecb6978 100644 --- a/ig/input/fsh/nbs-msh-segment.fsh +++ b/ig/input/fsh/nbs-msh-segment.fsh @@ -3,32 +3,32 @@ Id: segment-msh-logical-model Title: "MSH Segment" Description: "The MSH Segment" * segmentType 1..1 string "MSH" -* fieldSeparator 1..1 string "MSH-1 The field separator for the message" +* fieldSeparator 1..1 string "MSH-1 The Field Separator For The Message" * encodingCharacters 1..1 string "MSH-2 Encoding Characters" -* sendingApplication 1..1 code "MSH-3 The sending application" +* sendingApplication 1..1 code "MSH-3 The Sending Application" * sendingApplicationNamespaceId 1..1 code "MSH-3.1 Sending Application Namespace ID" * sendingApplicationUniversalId 1..1 string "MSH-3.2 Sending Application Universal ID" * sendingApplicationUniversalIdType 1..1 id "MSH-3.3 Sending Application Universal ID Type" -* sendingFacility 1..1 code "MSH-4 The sending facility" -* sendingFacilityNamespaceId 1..1 code "MSH-4.1 The sending facility namespace ID" -* sendingFacilityUniversalId 1..1 string "MSH-4.2 The sending facility universal ID" -* sendingFacilityUniversalIdType 1..1 id "MSH-4.3 The sending facility universal ID type" -* receivingApplication 1..1 code "MSH-5 The receiving application" -* receivingApplicationNamespaceId 1..1 code "MSH-5.1 The receiving application namespace ID" -* receivingApplicationUniversalId 1..1 string "MSH-5.2 The receiving application universal ID type" -* receivingApplicationUniversalIdType 1..1 id "MSH-5.3 The receiving application universal ID type" -* receivingFacility 1..1 code "MSH-6 The receiving facility" +* sendingFacility 1..1 code "MSH-4 The Sending Facility" +* sendingFacilityNamespaceId 1..1 code "MSH-4.1 The Sending Facility Namespace ID" +* sendingFacilityUniversalId 1..1 string "MSH-4.2 The Sending Facility Universal ID" +* sendingFacilityUniversalIdType 1..1 id "MSH-4.3 The Sending Facility Universal ID Type" +* receivingApplication 1..1 code "MSH-5 The Receiving Application" +* receivingApplicationNamespaceId 1..1 code "MSH-5.1 The Receiving Application Namespace ID" +* receivingApplicationUniversalId 1..1 string "MSH-5.2 The Receiving Application Universal ID Type" +* receivingApplicationUniversalIdType 1..1 id "MSH-5.3 The Receiving Application Universal ID Type" +* receivingFacility 1..1 code "MSH-6 The Receiving facility" * receivingFacilityNamespaceId 1..1 code "MSH-6.1 Receiving Facility Namespace ID" * receivingFacilityUniversalId 1..1 string "MSH-6.2 Receiving Facility Universal ID" * receivingFacilityUniversalIdType 1..1 id "MSH-6.3 Receiving Facility Universal ID Type" -* messageDateTime 1..1 dateTime "MSH-7 The date and time the message was created" -* messageType 1..1 Coding "MSH-9 The type of message" +* messageDateTime 1..1 dateTime "MSH-7 The Date And Time The Message Was Created" +* messageType 1..1 Coding "MSH-9 The Type Of Message" * messageTypeMessageCode 1..1 id "MSH-9.1 Message Code" * messageTypeTriggerEvent 1..1 id "MSH-9.2 Trigger Event" * messageTypeMessageStructure 1..1 id "MSH-9.3 Message Structure" -* messageControlId 1..1 string "MSH-10 a control id for the message" -* processingId 1..1 string "MSH-11 the processing id" -* versionId 1..1 string "MSH-12 the HL7 version of this message" +* messageControlId 1..1 string "MSH-10 A Control ID For The Message" +* processingId 1..1 string "MSH-11 The Processing ID" +* versionId 1..1 string "MSH-12 The HL7 Version of This Message" * acceptAcknowledgmentType 1..1 id "MSH-15 Accept Acknowledgment Type" * applicationAcknowledgementType 1..1 id "MSH-16 Application Acknowledgement Type" * messageProfileIdentifier 1..2 Identifier "MSH-21 Message Profile Identifier" From c2a7f3c700aa1fc791cb03db49ff4f969215be54 Mon Sep 17 00:00:00 2001 From: tjohnson7021 <86614374+tjohnson7021@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:52:29 -0400 Subject: [PATCH 22/25] Fixed to match the casing of the other segments --- ig/input/fsh/nbs-evn-segment.fsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ig/input/fsh/nbs-evn-segment.fsh b/ig/input/fsh/nbs-evn-segment.fsh index fa9946d59..f5b41b00e 100644 --- a/ig/input/fsh/nbs-evn-segment.fsh +++ b/ig/input/fsh/nbs-evn-segment.fsh @@ -4,7 +4,7 @@ Title: "EVN Segment" Description: "The EVN Segment" * segmentType 1..1 string "EVN" * eventTypeCode 1..1 string "A01" // this is apparently not in the spec anymore but retained for backward compatibility -* eventDateTime 1..1 string "Date and time of the event" +* eventDateTime 1..1 string "Date and Time of the Event" // there are other optional fields we might want to define From 1b470bf3ad61e9b24399093bbe75328053f8d566 Mon Sep 17 00:00:00 2001 From: tjohnson7021 <86614374+tjohnson7021@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:58:21 -0400 Subject: [PATCH 23/25] grammatical typos --- ig/input/fsh/nbs-msh-segment.fsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ig/input/fsh/nbs-msh-segment.fsh b/ig/input/fsh/nbs-msh-segment.fsh index 84ecb6978..e94e97645 100644 --- a/ig/input/fsh/nbs-msh-segment.fsh +++ b/ig/input/fsh/nbs-msh-segment.fsh @@ -3,7 +3,7 @@ Id: segment-msh-logical-model Title: "MSH Segment" Description: "The MSH Segment" * segmentType 1..1 string "MSH" -* fieldSeparator 1..1 string "MSH-1 The Field Separator For The Message" +* fieldSeparator 1..1 string "MSH-1 The Field Separator for the Message" * encodingCharacters 1..1 string "MSH-2 Encoding Characters" * sendingApplication 1..1 code "MSH-3 The Sending Application" * sendingApplicationNamespaceId 1..1 code "MSH-3.1 Sending Application Namespace ID" @@ -21,14 +21,14 @@ Description: "The MSH Segment" * receivingFacilityNamespaceId 1..1 code "MSH-6.1 Receiving Facility Namespace ID" * receivingFacilityUniversalId 1..1 string "MSH-6.2 Receiving Facility Universal ID" * receivingFacilityUniversalIdType 1..1 id "MSH-6.3 Receiving Facility Universal ID Type" -* messageDateTime 1..1 dateTime "MSH-7 The Date And Time The Message Was Created" +* messageDateTime 1..1 dateTime "MSH-7 The Date and Time the Message was Created" * messageType 1..1 Coding "MSH-9 The Type Of Message" * messageTypeMessageCode 1..1 id "MSH-9.1 Message Code" * messageTypeTriggerEvent 1..1 id "MSH-9.2 Trigger Event" * messageTypeMessageStructure 1..1 id "MSH-9.3 Message Structure" -* messageControlId 1..1 string "MSH-10 A Control ID For The Message" +* messageControlId 1..1 string "MSH-10 A Control ID for the Message" * processingId 1..1 string "MSH-11 The Processing ID" -* versionId 1..1 string "MSH-12 The HL7 Version of This Message" +* versionId 1..1 string "MSH-12 The HL7 Version of this Message" * acceptAcknowledgmentType 1..1 id "MSH-15 Accept Acknowledgment Type" * applicationAcknowledgementType 1..1 id "MSH-16 Application Acknowledgement Type" * messageProfileIdentifier 1..2 Identifier "MSH-21 Message Profile Identifier" From 775336d796da4d00729fac90c7867282e8bbc786 Mon Sep 17 00:00:00 2001 From: Tiffini Johnson <86614374+tjohnson7021@users.noreply.github.com> Date: Wed, 25 Oct 2023 15:17:40 -0400 Subject: [PATCH 24/25] Update nbs-msh-segment.fsh --- ig/input/fsh/nbs-msh-segment.fsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ig/input/fsh/nbs-msh-segment.fsh b/ig/input/fsh/nbs-msh-segment.fsh index e94e97645..593b8ac18 100644 --- a/ig/input/fsh/nbs-msh-segment.fsh +++ b/ig/input/fsh/nbs-msh-segment.fsh @@ -22,7 +22,7 @@ Description: "The MSH Segment" * receivingFacilityUniversalId 1..1 string "MSH-6.2 Receiving Facility Universal ID" * receivingFacilityUniversalIdType 1..1 id "MSH-6.3 Receiving Facility Universal ID Type" * messageDateTime 1..1 dateTime "MSH-7 The Date and Time the Message was Created" -* messageType 1..1 Coding "MSH-9 The Type Of Message" +* messageType 1..1 Coding "MSH-9 The Type of Message" * messageTypeMessageCode 1..1 id "MSH-9.1 Message Code" * messageTypeTriggerEvent 1..1 id "MSH-9.2 Trigger Event" * messageTypeMessageStructure 1..1 id "MSH-9.3 Message Structure" From 5f4c5982653ab5447994076150c4c4dddb2b2de8 Mon Sep 17 00:00:00 2001 From: halprin Date: Wed, 25 Oct 2023 14:14:08 -0600 Subject: [PATCH 25/25] 600: rename method that caches our private key to mention Our --- .../external/reportstream/ReportStreamOrderSender.java | 4 ++-- .../reportstream/ReportStreamOrderSenderTest.groovy | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java index 5f99f82f9..b0461fbdf 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java @@ -158,7 +158,7 @@ protected String requestToken() throws UnableToSendOrderException { } // only cache our private key if we successfully authenticate to RS - cachePrivateKeyIfNotCachedAlready(ourPrivateKey); + cacheOurPrivateKeyIfNotCachedAlready(ourPrivateKey); return token; } @@ -174,7 +174,7 @@ protected String retrievePrivateKey() throws SecretRetrievalException { return key; } - protected void cachePrivateKeyIfNotCachedAlready(String privateKey) { + void cacheOurPrivateKeyIfNotCachedAlready(String privateKey) { String key = keyCache.get(OUR_PRIVATE_KEY_ID); if (key != null) { return; diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy index 02da4aa36..38e6c47cd 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy @@ -135,7 +135,7 @@ class ReportStreamOrderSenderTest extends Specification { 0 * mockCache.put(_ , _) } - def "cachePrivateKeyIfNotCachedAlready doesn't cache when the key is already is cached"() { + def "cacheOurPrivateKeyIfNotCachedAlready doesn't cache when the key is already is cached"() { given: def mockCache = Mock(Cache) mockCache.get(_ as String) >> "DogCow private key" @@ -145,13 +145,13 @@ class ReportStreamOrderSenderTest extends Specification { TestApplicationContext.injectRegisteredImplementations() when: - ReportStreamOrderSender.getInstance().cachePrivateKeyIfNotCachedAlready("Moof!") + ReportStreamOrderSender.getInstance().cacheOurPrivateKeyIfNotCachedAlready("Moof!") then: 0 * mockCache.put(_, _) } - def "cachePrivateKeyIfNotCachedAlready caches when the key isn't cached"() { + def "cacheOurPrivateKeyIfNotCachedAlready caches when the key isn't cached"() { given: def mockCache = Mock(Cache) mockCache.get(_ as String) >> null @@ -161,7 +161,7 @@ class ReportStreamOrderSenderTest extends Specification { TestApplicationContext.injectRegisteredImplementations() when: - ReportStreamOrderSender.getInstance().cachePrivateKeyIfNotCachedAlready("Moof!") + ReportStreamOrderSender.getInstance().cacheOurPrivateKeyIfNotCachedAlready("Moof!") then: 1 * mockCache.put(_, _)