Repository: CDCgov/prime-reportstream
Pull request #17692: Issue_14974_New_Mexico
Author: login: abiphilipnava
Labels: name: onboarding-ops
description: Work related to onboarding with a partner. Addressed by the Onboarding & Operations team in RS.
name: New Mexico
name: engineering
description: Work to be completed by an engineer
Created: 2025-03-28T21:25:08Z | Merged: 2025-03-31T19:17:20Z

This PR ...

Is to onboard New Mexico with their instructions.
This PR is to answer the ticket https://github.com/CDCgov/prime-reportstream/issues/14974

Make changes to : 

- ./prime-reportstream/prime-router/settings/STLTs/NM/nm-doh.yml
- ./prime-reportstream/prime-router/metadata/file_name_templates/file-name-templates.yml

Test Steps:
1.  Used postman with sample data for New Mexico  and ran locally to verify the filters and filenames are according to New Mexico
2.  Verified the message/file was created correctly 


## Changes
- Review the changes in the files mentionedabove

## Checklist

### Testing
- [x] Tested locally?
- [x] Ran `./prime test` or `./gradlew testSmoke` against local Docker ReportStream container?
- [ ] (For Changes to /frontend-react/...) Ran `npm run lint:write`?
- [ ] Added tests?

### Process
- [ ] Are there licensing issues with any new dependencies introduced?
- [ ] Includes a summary of what a code reviewer should test/verify?
- [ ] Updated the release notes?
- [ ] Database changes are submitted as a separate PR?
- [ ] DevOps team has been notified if PR requires ops support?

## Linked Issues
- Fixes #issue

## To Be Done
*Create GitHub issues to track the work remaining, if any*
- #issue

## Specific Security-related subjects a reviewer should pay specific attention to
- Does this PR introduce new endpoints?
    - new endpoint A
    - new endpoint B
- Does this PR include changes in authentication and/or authorization of existing endpoints?
- Does this change introduce new dependencies that need vetting?
- Does this change require changes to our infrastructure?
- Does logging contain sensitive data?
- Does this PR include or remove any sensitive information itself?

If you answered '_yes_' to any of the questions above, conduct a detailed Review that addresses at least:

- What are the potential security threats and mitigations? Please list the _STRIDE_ threats and how they are mitigated
    - **S**poofing (faking authenticity)
        - Threat _T_, which could be achieved by _A_, is mitigated by _M_
    - **T**ampering (influence or sabotage the integrity of information, data, or system)
    - **R**epudiation (the ability to dispute the origin or originator of an action)
    - **I**nformation disclosure (data made available to entities who should not have it)
    - **D**enial of service (make a resource unavailable)
    - **E**levation of Privilege (reduce restrictions that apply or gain privileges one should not have)
- Have you ensured logging does not contain sensitive data?
- Have you received any additional approvals needed for this change?



Diff:
diff --git a/prime-router/metadata/file_name_templates/file-name-templates.yml b/prime-router/metadata/file_name_templates/file-name-templates.yml
index 8388d9bc672..425be028c9b 100644
--- a/prime-router/metadata/file_name_templates/file-name-templates.yml
+++ b/prime-router/metadata/file_name_templates/file-name-templates.yml
@@ -126,4 +126,11 @@
 
 - name: uuid
   elements:
-    - uuid()
\ No newline at end of file
+    - uuid()
+
+
+- name: nm-filename
+  lowerCase: true
+  elements:
+    - cdcprime_ELR_TEST_
+    - createdDate(MMddyyyy-HHmmss)
diff --git a/prime-router/settings/STLTs/NM/nm-doh.yml b/prime-router/settings/STLTs/NM/nm-doh.yml
index 0fe6374ae6d..46108a3f9d0 100644
--- a/prime-router/settings/STLTs/NM/nm-doh.yml
+++ b/prime-router/settings/STLTs/NM/nm-doh.yml
@@ -13,7 +13,7 @@
       topic: "full-elr"
       customerStatus: "active"
       translation:
-        schemaName: "azure:/metadata/hl7_mapping/receivers/STLTs/NM/NM-receiver-transform.yml"
+        schemaName: "classpath:/metadata/hl7_mapping/receivers/STLTs/NM/NM-receiver-transform.yml"
         useTestProcessingMode: false
         useBatchHeaders: true
         receivingApplicationName: "NMDOH^2.16.840.1.113883.3.5364^ISO"
@@ -45,7 +45,7 @@
         applyOTCDefault: false
         useOrderingFacilityName: "STANDARD"
         valueSetOverrides: {}
-        nameFormat: "APHL_LIGHT"
+        nameFormat: "nm-filename"
         receivingOrganization: "elr"
         convertPositiveDateTimeOffsetToNegative: false
         stripInvalidCharsRegex: null
@@ -67,7 +67,9 @@
         - "Bundle.entry.resource.ofType(Patient).where(address.line[0].empty() and address.postalCode.empty() and telecom.where(system = 'phone').value.empty() and telecom.where(system = 'email').value.empty()).count() = 0"
         - "((Bundle.entry.resource.ofType(Specimen).collection.collectedPeriod.exists() or Bundle.entry.resource.ofType(Specimen).collection.collected.exists())
            or (Bundle.entry.resource.ofType(ServiceRequest).occurrence.exists() or Bundle.entry.resource.ofType(Observation).effective.exists()))"
-      routingFilter: [ ]
+      routingFilter:
+        - "Bundle.entry.resource.ofType(DiagnosticReport).where(status in 'final'|'corrected').exists()"
+        - "Bundle.entry.resource.ofType(MessageHeader).extension('https://reportstream.cdc.gov/fhir/StructureDefinition/sender-id').where(value in ('SimpleReport')).exists()"
       processingModeFilter: []
       reverseTheQualityFilter: false
       conditionFilter:
@@ -78,7 +80,7 @@
       deidentifiedValue: ""
       timing:
         operation: "MERGE"
-        numberPerDay: 12
+        numberPerDay: 1440
         initialTime: "01:25"
         timeZone: "EASTERN"
         maxReportCount: 100
@@ -86,7 +88,7 @@
           action: "NONE"
           onlyOncePerDay: false
       description: ""
-      transport:
+      transport: !<SFTP>
         type: SFTP
         host: sftp
         port: 22
@@ -95,4 +97,4 @@
       externalName: null
       enrichmentSchemaNames: []
       timeZone: null
-      dateTimeFormat: "OFFSET"
\ No newline at end of file
+      dateTimeFormat: "OFFSET"
diff --git a/prime-router/settings/STLTs/WI/wi-dph.yml b/prime-router/settings/STLTs/WI/wi-dph.yml
index dfc4ad02798..80745bd07d7 100644
--- a/prime-router/settings/STLTs/WI/wi-dph.yml
+++ b/prime-router/settings/STLTs/WI/wi-dph.yml
@@ -98,4 +98,89 @@
     externalName: null
     enrichmentSchemaNames: [ ]
     timeZone: null
-    dateTimeFormat: "OFFSET"
\ No newline at end of file
+    dateTimeFormat: "OFFSET"
+  - name: "elr-test"
+    organizationName: "wi-dph"
+    topic: "covid-19"
+    customerStatus: "testing"
+    translation:
+        schemaName: "covid-19"
+        useTestProcessingMode: false
+        useBatchHeaders: true
+        receivingApplicationName: null
+        receivingApplicationOID: null
+        receivingFacilityName: null
+        receivingFacilityOID: null
+        messageProfileId: null
+        replaceValue: {}
+        replaceValueAwithB: {}
+        reportingFacilityName: null
+        reportingFacilityId: null
+        reportingFacilityIdType: null
+        suppressQstForAoe: false
+        suppressHl7Fields: null
+        suppressAoe: false
+        defaultAoeToUnknown: false
+        replaceUnicodeWithAscii: false
+        useBlankInsteadOfUnknown: null
+        truncateHDNamespaceIds: false
+        truncateHl7Fields: null
+        usePid14ForPatientEmail: false
+        convertTimestampToDateTime: null
+        cliaForOutOfStateTesting: null
+        cliaForSender: {}
+        phoneNumberFormatting: "STANDARD"
+        suppressNonNPI: false
+        processingModeCode: null
+        replaceDiiWithOid: null
+        applyOTCDefault: false
+        useOrderingFacilityName: "STANDARD"
+        valueSetOverrides: {}
+        nameFormat: "STANDARD"
+        receivingOrganization: null
+        convertPositiveDateTimeOffsetToNegative: false
+        stripInvalidCharsRegex: null
+        convertDateTimesToReceiverLocalTime: false
+        useHighPrecisionHeaderDateTimeFormat: false
+        type: "HL7"
+        truncationConfig:
+          truncateHDNamespaceIds: false
+          truncateHl7Fields: []
+          customLengthHl7Fields: {}
+    jurisdictionalFilter:
+        - "matches(processing_mode_code, T)"
+        - "orEquals(ordering_facility_state, WI, patient_state, WI)"
+    qualityFilter: []
+    routingFilter:
+        - "DoesNotMatch(test_performed_code, 85478-6,76080-1,92141-1,80383-3,82170-2,85477-8,76078-5,77026-3,77028-9,77027-1,92142-9,80382-5,82166-0,82167-8,82169-4,82168-6,92809-3,92808-5,95423-0)"
+    processingModeFilter: []
+    reverseTheQualityFilter: false
+    conditionFilter: []
+    mappedConditionFilter: []
+    deidentify: false
+    deidentifiedValue: ""
+    timing:
+      operation: "MERGE"
+      numberPerDay: 1
+      initialTime: "09:50"
+      timeZone: "EASTERN"
+      maxReportCount: 100
+      whenEmpty:
+        action: "NONE"
+        onlyOncePerDay: false
+    description: ""
+    transport:
+        host: "sftp"
+        port: "22"
+        filePath: "./upload"
+        credentialName: "DEFAULT-SFTP"
+        type: "SFTP"
+    externalName: null
+    enrichmentSchemaNames:
+        - "classpath:/metadata/fhir_transforms/common/observation-end-datetime.yml"
+        - "classpath:/metadata/fhir_transforms/common/livd-lookup.yml"
+        - "classpath:/metadata/fhir_transforms/common/use-pid-14-for-email.yml"
+        - "classpath:/metadata/fhir_transforms/common/suppress-xtn-12.yml"
+        - "classpath:/metadata/fhir_transforms/common/suppress-device-information.yml"
+    timeZone: null
+    dateTimeFormat: "OFFSET"


Reviews:
user: login: oslynn
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-29T08:35:33Z
user: login: abiphilipnava
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-31T16:45:13Z
user: login: victor-chaparro
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-03-31T17:29:31Z

Review comments:
diff_hunk: @@ -1339,4 +1339,89 @@
       routingFilters:
         - filterName: "routing"
           filterDescription: "Doing fine things for great people."
-          filterExpressions: ["true"]
\ No newline at end of file
+          filterExpressions: ["true"]
path: prime-router/settings/organizations.yml
user: login: oslynn
body: You don't need to have your setting in organizations.yml.  We need to keep it as clean as possible.
created_at: 2025-03-29T08:35:33Z
author_association: COLLABORATOR
diff_hunk: @@ -1339,4 +1339,89 @@
       routingFilters:
         - filterName: "routing"
           filterDescription: "Doing fine things for great people."
-          filterExpressions: ["true"]
\ No newline at end of file
+          filterExpressions: ["true"]
path: prime-router/settings/organizations.yml
user: login: abiphilipnava
body: reverted to the original organizations.yml
created_at: 2025-03-31T16:45:13Z
author_association: CONTRIBUTOR

PR comments:
user: login: github-actions[bot]
created_at: 2025-03-28T21:25:23Z
body: <h1>Dependency Review</h1>
✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.<h2>OpenSSF Scorecard</h2>
<table><tr><th>Package</th><th>Version</th><th>Score</th><th>Details</th></tr>
</table><h2>Scanned Manifest Files</h2>


<!-- dependency-review-pr-comment-marker -->
author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-03-28T21:41:04Z
body: ## Test Results
1 304 tests  ±0   1 300 :white_check_mark: ±0   7m 37s :stopwatch: +2s
  170 suites ±0       4 :zzz: ±0 
  170 files   ±0       0 :x: ±0 

Results for commit e96749a0. ± Comparison against base commit c1bcb223.

[test-results]:data:application/gzip;base64,H4sIAJPg6mcC/12Myw7CIBBFf6Vh7WJ4CfgzBoEmxLYYHivjv0upCnF5zp05TzT7xSV0mbCA04RS8XlAW6LOPmxVMC6qqGNuMwX2xWsqxhwOurv7x/71E7P2SxX9wsUY4sfEsg3Vnf6ih+rNxkOy8Vg0YV19roCcOgumNGDAzDIpgNub5s5ISRWxikggGCtB0esNX6OhYA0BAAA=

:recycle: This comment has been updated with latest results.
author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-03-28T21:41:15Z
body: ## Integration Test Results
 60 files  ±0   60 suites  ±0   42m 20s :stopwatch: -32s
428 tests ±0  418 :white_check_mark: ±0  10 :zzz: ±0  0 :x: ±0 
431 runs  ±0  421 :white_check_mark: ±0  10 :zzz: ±0  0 :x: ±0 

Results for commit e96749a0. ± Comparison against base commit c1bcb223.

[test-results]:data:application/gzip;base64,H4sIAK3n6mcC/03MTQ6DIBCG4asY1l0wIyj0MoYCJqT+NAgr07sXiBWW7zOZ7ySzW+xBnt1AHx05ogu1TPQquH1LjZxlSceQzwzFv6Yjap0JGnq7TyK4X6ZZuSVJBev97i/xcSujPVxxb2KVZrJAs1i6HdT7urqQglg5jEwqChSYYWKk3LwUt1qIXqKRKCgCyLEn3x+mUuttCgEAAA==

:recycle: This comment has been updated with latest results.
author_association: CONTRIBUTOR
user: login: sonarqubecloud[bot]
created_at: 2025-03-31T18:47:25Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=CDCgov_prime-data-hub&pullRequest=17692) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=CDCgov_prime-data-hub&pullRequest=17692&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=CDCgov_prime-data-hub&pullRequest=17692&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=CDCgov_prime-data-hub&pullRequest=17692&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=CDCgov_prime-data-hub&pullRequest=17692&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=CDCgov_prime-data-hub&pullRequest=17692&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=CDCgov_prime-data-hub&pullRequest=17692)


author_association: NONE