num-codex / odm2fhir

This tool maps study/patient data in CDISC ODM based on the GECCO data dictionary to HL7 FHIR which adheres to the GECCO profiles, value sets and code systems.
MIT License
4 stars 1 forks source link

Add more information to "Error in Resource" messages #7

Closed noemide closed 3 years ago

noemide commented 3 years ago

Is your feature request related to a problem? Please describe. I recently tired the 0.1.0-alpha and got the following message: 2021-01-05 12:44:56.792 WARN 1 --- [nPool-worker-11] ca.uhn.fhir.parser.LenientErrorHandler : Resource is missing required element: value While this message is definetly better than none /crashing, it is not really helpful since nearly everything has a value. Is the error detected in the ODM or after transformation in the FHIR resources? In which resource or resource type?

Describe the solution you'd like I'd like the error message to output more information: If in FHIR, at least the resource type, maybe even the profile (to better distinguish between different variants of one resource) or even the resource Id(s) and relevant attributes. If in ODM, I'd like to see the XPath of the relevant element (or equivalent information).

Describe alternatives you've considered Finding the error myself, which is avoidable work since ODM2FHIR has already found the error and is just not telling me where exactly it is.

holger-stenzhorn commented 3 years ago

@noemide In this particular case it is actually a (minor) glitch in the mapping code causing this issue which is not related to the actual ODM input. You can actually enable a strict error handling by adding -e FHIR_ERRORHANDLING_STRICT=true to the Docker run command which shows - at least a bit - better the cause/location of the problem. But this is independent of the handling on invalid input item that currently gets improved as well.