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

[SPIKE] Review FHIR Converter Logic with respect to the bulk upload API

Open DanielSass opened this issue 1 year ago • 1 comments

Related to #7897, #7898 and #7804

We've run into a couple issues now stemming from users of the bulk upload using SNOMED codes for test results that are different from what the single entry flow uses. The core issue here is that the FHIR converter logic does not appropriately handle the values that are possible in the bulk uploader (and thus have some bad default values that are causing issues downstream).

The request for this spike is to investigate all of the FHIR mappings specifically with respect to the inputs that are allowed / recommended by the bulk upload guide (and subsequently how we translate those values through the bulk result upload validation and mapping flow).

DanielSass avatar Jul 10 '24 16:07 DanielSass

I would also look out for whether the bulk upload guide accurately reflects the validations for each field because sometimes I think it's out of sync

mehansen avatar Jul 11 '24 20:07 mehansen

this work got deprioritized and then I forgot to officially close out this ticket! details are in the linked sheet but the main findings are:

  • I found nothing remaining that would cause parse errors since the ones that prompted the creation of this ticket
  • some of the issues found were resolved by https://github.com/CDCgov/prime-simplereport/pull/8627
  • none of the issues I found (with the exception of the one related to the deprecated gender field, which we already know about) would cause an outage or problems blocking users from using the app, and most would only be seen in corner case scenarios outside the happy path use of the uploader
  • consolidated my notes into the sheet I've linked below and grouped them into 4 main categories:
    • issues that could cause invalid FHIR,
    • issues that could cause us to send inaccurate data,
    • validation/usability issues, and
    • tech debt or improvement with no current known user impact

the two that are high priority (high is relative to other issues) are:

  • patient_gender is still a required field but upload guide does not say so
  • if a user inputs 'c' for test_result_status, it gets mapped to FINAL in the FHIR bundle when it should be CORRECTED ('C' however works as expected)

Doc: https://docs.google.com/spreadsheets/d/1uA6FI5r3eDZFi1KL0xtC8-Easpp4FWNPg-hvsxxNj9E/edit?usp=sharing

cc @DanielSass to take a look in case he has a different priority assessment of any of the issues

mehansen avatar Jun 10 '25 22:06 mehansen