Bug fix for truncateHl7Fields setting
This PR fixes a bug where values for fields specified in the truncateHl7Fields setting were being completely removed instead of being truncated.
Test Steps:
- add fields to a receiver's
truncateHl7Fieldssetting. 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"
- Note each field's maximum length. Use https://hl7-definition.caristix.com/v2/HL7v2.5/Segments as a reference.
- Use a sample fhir bundle and replace values for the fields that were specified in the
truncateHl7Fieldssetting with strings that are the size of each field's maximum length. Add "TRUNCATE THIS" at the end of each string. - Use http://localhost:7071/api/reports to send a report to the receiver
- 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 testor./gradlew testSmokeagainst 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
Dependency Review
✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
| Package | Version | Score | Details |
|---|
Scanned Manifest Files
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.
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.
Looking very good.
Quality Gate passed
Issues
1 New issue
0 Accepted issues
Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code