CDCgov / prime-reportstream

ReportStream is a public intermediary tool for delivery of data between different parts of the healthcare ecosystem.
https://reportstream.cdc.gov
Creative Commons Zero v1.0 Universal
71 stars 40 forks source link

[internal bug] fhirdata command not working for hl7->fhir conversions #16066

Open JFisk42 opened 2 weeks ago

JFisk42 commented 2 weeks ago

Describe the bug

The fhirdata command produces an exception when attempting to convert from hl7->fhir. A check that requires fhir data to be present was introduced.

Impact on ReportStream

Any engineer trying to generate FHIR data from a HL7 file will encounter an exception causing the tool to fail. This has an impact on any developer trying to create or update large amounts of FHIR data as they will not be able to.

Steps to reproduce

Steps to reproduce the behavior:

  1. Run a fhirdata command to go from hl7 to fhir (ex: ./gradlew primeCLI --args="fhirdata --input-file src/testIntegration/resources/datatests/HL7_to_FHIR/sample_oml_20240319-001.hl7 --output-file src/testIntegration/resources/datatests/HL7_to_FHIR/sample_oml_20240319-001.fhir --output-format FHIR"
  2. See the DataFormatException

Expected behavior

The fhirdata command should successfully convert hl7 to fhir data.

Resources

Issue was introduced here: https://github.com/CDCgov/prime-reportstream/pull/15865

Logs

Current output when hl7->fhir conversion is attempted. Note that the root code issue is inaccessible in the stack trace. What happens is that it is taking hl7 files and attempting to parse them as fhir.

> Task :prime-router:primeCLI FAILED
Exception in thread "main" ca.uhn.fhir.parser.DataFormatException: HAPI-1861: Failed to parse JSON encoded FHIR content: HAPI-1859: Content does not appear to be FHIR JSON, first non-whitespace character was: 'M' (must be '{')
        at ca.uhn.fhir.parser.json.jackson.JacksonStructure.load(JacksonStructure.java:150)
        at ca.uhn.fhir.parser.json.jackson.JacksonStructure.load(JacksonStructure.java:79)
        at ca.uhn.fhir.parser.JsonParser.doParseResource(JsonParser.java:240)
        at ca.uhn.fhir.parser.BaseParser.parseResource(BaseParser.java:647)
        at ca.uhn.fhir.parser.BaseParser.parseResource(BaseParser.java:702)
        at gov.cdc.prime.router.fhirengine.utils.FhirTranscoder.decode(FhirTranscoder.kt:60)
        at gov.cdc.prime.router.fhirengine.utils.FhirTranscoder.decode$default(FhirTranscoder.kt:59)
        at gov.cdc.prime.router.cli.ProcessFhirCommands.run(ProcessFhirCommands.kt:142)
        at com.github.ajalt.clikt.parsers.Parser.finalizeAndRun(Parser.kt:348)
        at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:218)
        at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:245)
        at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:42)
        at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:457)
        at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:454)
        at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:474)
        at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:481)
        at gov.cdc.prime.router.cli.MainKt.main(main.kt:306)
Caused by: ca.uhn.fhir.parser.DataFormatException: HAPI-1859: Content does not appear to be FHIR JSON, first non-whitespace character was: 'M' (must be '{')
        at ca.uhn.fhir.parser.json.jackson.JacksonStructure.load(JacksonStructure.java:108)
        ... 16 more

Additional context

Add any other historical context about the problem here.

arnejduranovic commented 1 week ago

@JFisk42 what is the impact of this issue on our developers? In other words, what's the current work around? Please add this detail to ticket.

JFisk42 commented 1 week ago

@arnejduranovic I have updated the Impact section, let me know if that still isn't clear enough.

MichaelEsuruoso commented 1 day ago

Hey team! Please add your planning poker estimate with Zenhub @adegolier @arnejduranovic @david-navapbc @jack-h-wang @JFisk42 @kant777 @mkalish @thetaurean

MichaelEsuruoso commented 1 day ago

Please add your planning poker estimate with Zenhub @jalbinson

JFisk42 commented 1 day ago

@victor-chaparro Looking back at this ticket after I logged it, it's not entirely clear what functionality https://github.com/CDCgov/prime-reportstream/pull/15865 was implementing. Are you able to provide any guidance?