Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust abnormal flag mapping #7903

Merged
merged 2 commits into from
Jul 12, 2024
Merged

Adjust abnormal flag mapping #7903

merged 2 commits into from
Jul 12, 2024

Conversation

emyl3
Copy link
Collaborator

@emyl3 emyl3 commented Jul 11, 2024

BACKEND PULL REQUEST

Related Issue

Changes Proposed

  • Set the Abnormal and Normal coding only when they match a defined list of SNOMED codes that we support
  • If the SNOMED code that is provided does not match, we will log it and return null instead of setting the code to Normal

Additional Information

{
  "id" : null,
  "submissionId" : 4261955,
  "overallStatus" : "Error",
  "timestamp" : "2024-07-11T20:43:28.954Z",
  "plannedCompletionAt" : null,
  "actualCompletionAt" : null,
  "sender" : "",
  "reportItemCount" : null,
  "errorCount" : 1,
  "warningCount" : 0,
  "httpStatus" : 400,
  "destinations" : [ ],
  "actionName" : "receive",
  "externalName" : "",
  "reportId" : null,
  "topic" : null,
  "bodyFormat" : "",
  "errors" : [ {
    "scope" : "item",
    "indices" : [ 1 ],
    "trackingIds" : [ "42daf9c8-9deb-4636-a040-380bde2b44cd+1+20240711" ],
    "field" : "test_result (test_result)",
    "message" : "The code '' for field test_result (test_result) is invalid. Reformat to HL7 specification.",
    "errorCode" : "INVALID_MSG_PARSE_CODE"
  } ],
  "warnings" : [ ],
  "destinationCount" : 0,
  "fileName" : ""
}

Testing

  • deployed to dev3
  • upload a bulk result with various SNOMED combinations
  • example with new SNOMEDs
    DEV3_EX.csv

abnormalFlag.setCode(ABNORMAL_FLAG_NORMAL.code());
abnormalFlag.setDisplay(ABNORMAL_FLAG_NORMAL.displayName());
} else {
log.info("Unsupported SNOMED result code: {}", resultCode);

Check failure

Code scanning / CodeQL

Log Injection High

This log entry depends on a user-provided value.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed to Encode.forJava(resultCode)) 😅

@emyl3 emyl3 force-pushed the elisa/7897-adjust-abnormal-flag branch 2 times, most recently from ec12f6f to 30aa28d Compare July 11, 2024 15:59
fzhao99
fzhao99 previously approved these changes Jul 12, 2024
Comment on lines +769 to +771
} else {
log.info("Unsupported SNOMED result code: {}", Encode.forJava(resultCode));
return null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it also makes sense to adjust this bit to not add the interpretation that the abnormal flag coding lives inside. (otherwise it will just be an empty interpretation)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 agree that makes sense to omit the interpretation if it'll be empty anyway

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OO good catch -- thank you!

mpbrown
mpbrown previously approved these changes Jul 12, 2024
Copy link
Collaborator

@mpbrown mpbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice work!

@emyl3 emyl3 force-pushed the elisa/7897-adjust-abnormal-flag branch from 8d3a944 to f1d0934 Compare July 12, 2024 16:23
Copy link

@emyl3 emyl3 requested review from DanielSass, fzhao99 and mpbrown July 12, 2024 16:45
@emyl3
Copy link
Collaborator Author

emyl3 commented Jul 12, 2024

@fzhao99 @DanielSass @mpbrown Ready for re-review!

@DanielSass
Copy link
Collaborator

⚠️ As part of #7898 we should make sure that any results being sent to the CSV pipeline should also map to values here: https://github.com/CDCgov/prime-reportstream/blob/1ffae4ca0b04cd0aa9f169e26813ecd86df71bb5/prime-router/src/main/kotlin/metadata/Mappers.kt#L768 otherwise you get the following error from ReportStream that is not obvious to users uploading their results:

about this bit - is this an issue with how we are handling the response (in other words, do we need to do work to convey info we're getting from RS back to the user)?

Definitely out of scope for this PR, just something to think about as we look at the next story for updating the bulk upload file validation

@emyl3
Copy link
Collaborator Author

emyl3 commented Jul 12, 2024

This is an example of a FHIR bundle with a nonsensical SNOMED (search "111") -- no abnormal/normal flag is added
hiv_bundle_with_nonsense_snomed.json

@emyl3 emyl3 added this pull request to the merge queue Jul 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 12, 2024
@emyl3 emyl3 added this pull request to the merge queue Jul 12, 2024
Merged via the queue into main with commit 38f5933 Jul 12, 2024
33 checks passed
@emyl3 emyl3 deleted the elisa/7897-adjust-abnormal-flag branch July 12, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants