prime-reportstream icon indicating copy to clipboard operation
prime-reportstream copied to clipboard

Bug fix for truncateHl7Fields setting

Open lucero-v opened this issue 1 year ago • 5 comments

This PR fixes a bug where values for fields specified in the truncateHl7Fields setting were being completely removed instead of being truncated.

Test Steps:

  1. add fields to a receiver's truncateHl7Fields setting. For example:
translation: !<HL7>
    schemaName: "classpath:/metadata/hl7_mapping/ORU_R01/ORU_R01-base.yml"
    truncateHl7Fields: "ORC-12-3, OBR-16-3, ORC-12-1, OBX-15-2"
  1. Note each field's maximum length. Use https://hl7-definition.caristix.com/v2/HL7v2.5/Segments as a reference.
  2. Use a sample fhir bundle and replace values for the fields that were specified in the truncateHl7Fields setting with strings that are the size of each field's maximum length. Add "TRUNCATE THIS" at the end of each string.
  3. Use http://localhost:7071/api/reports to send a report to the receiver
  4. Verify that the HL7 file that was created contains the original values for the fields without the "TRUNCATE THIS" strings.

Changes

  • bug fix: remove index from path before sending to terser
  • added tests for truncation with different ways that an hl7FieldPath can be formed

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?
  • [x] Added tests?

Process

  • [ ] Are there licensing issues with any new dependencies introduced?
  • [x] 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 https://github.com/CDCgov/prime-reportstream/issues/14264

lucero-v avatar May 21 '24 00:05 lucero-v

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

github-actions[bot] avatar May 21 '24 00:05 github-actions[bot]

Test Results

1 197 tests  ±0   1 193 :white_check_mark: ±0   6m 39s :stopwatch: +9s   152 suites ±0       4 :zzz: ±0    152 files   ±0       0 :x: ±0 

Results for commit 54a725f6. ± Comparison against base commit a9e1df83.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 21 '24 00:05 github-actions[bot]

Integration Test Results

 62 files   62 suites   33m 43s :stopwatch: 395 tests 385 :white_check_mark: 10 :zzz: 0 :x: 398 runs  388 :white_check_mark: 10 :zzz: 0 :x:

Results for commit 54a725f6.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 21 '24 01:05 github-actions[bot]

Looking very good.

oslynn avatar May 22 '24 13:05 oslynn