-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support Referenced Resources in Message Parser Schema #1037
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1037 +/- ##
=======================================
Coverage 96.93% 96.93%
=======================================
Files 48 48
Lines 3037 3037
=======================================
Hits 2944 2944
Misses 93 93
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bamader thanks for getting started on this work so quickly! I like the changes you have introduced to the parsing schema config. I have also identified a few other tickets we'll need eventually, these have been added to our backlog and are not blocking for this PR. There are 2 areas that I still think we need a little work:
- See my comment about computing parsers for the reference lookup fhirpaths as part of
get_parsers
. - The additional unit tests are great, but I don't see any tests or modifications to existing tests that prove we are ensuring backwards compatibility. What happens in one of these new schemas is passed to
/parse_message
do things work correctly?
containers/message-parser/app/default_schemas/test_reference_schema.json
Show resolved
Hide resolved
* asdf * Move reference compilation to get util
@DanPaseltiner Ultimately it seemed like the best way to address your comments was to directly point to the places in my other PR where I'd implemented the logic, but that seemed like it'd be really clunky and ineffective. I ended up merging my other feature branch directly into this one because it was a direct work-off anyway, and I think this now clears things up a bit more effectively. Logic is correctly located, references are all compiled in The one big thing to note is that with the fully implementation of the separate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll finish reviewing later on, but here is one initial comment. Thanks for your continued work on this!
secondary_parsers[secondary_field] = fhirpathpy.compile( | ||
secondary_field_definition["reference_lookup"] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking about how this would work in practice and not quite sure I follow. We'll need the parser and the fhir path string to insert the reference into. What if we make the value of secondary_parsers[secondary_field]
a dict and set it equal to something like
{
"reference_parser": fhirpathpy.compile(
secondary_field_definition["reference_lookup"],
"secondary_fhir_path": FHIRPATH-TO-INSERT-REFERENCE-INTO
}
This way when we run through our parsers everything we need is available in one data structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize this will break /parse-message
in its current form if it receives a schema containing references. We should be able to address this though, potentially in another ticket.
@DanPaseltiner Everything we talked about yesterday during the review should now be in place! Major changes include:
I think this addresses everything that was outstanding, so feel free to review again when you have the chance! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for bearing with me on this as we figured out the right path forward here. 🚀
Co-authored-by: Daniel Paseltiner <[email protected]>
PULL REQUEST
Summary
This PR adds some basic support for the message parser service to accept referenced resources in its parsing schemas. These referenced resources will now use a special DIBBs placeholder token
#REF#
to denote when a resource must be located elsewhere in the bundle. Validation, unit testing, a new schema, and quality test data has also been developed according to the FHIR spec.Related Issue
Fixes #1021
Additional Information
Some of the code here is in a temporary location due to us wanting to add a separate
extract-phdc-from-fhir
endpoint, so don't worry that it and the validation code currently lives within the message parser. This change set is meant to cover the logic rather than the location, so that code will get moved once this lands and we begin work on the final endpoints.