-
Notifications
You must be signed in to change notification settings - Fork 213
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
Parsing drops extensions on primitives #30
Comments
Yes, thanks! Also to have it documented: the Swift-FHIR framework now solves this by providing custom classes/structs for primitives. Those can handle extensions (and ids), as opposed to the native strings/numbers used by the Python client. |
Hi - I just ran into this trying to return back resources which are using string extensions for language translations and attempting to
Is being able to support this planned in the future? |
It is definitely something we ought to do. And as Pascal says above, one reasonable approach would be custom types. Something as simple as the following might work:
But... that's a big change, and a breaking one. There are also backwards-compatible options, like adding underscored fields that shadow all the primitives in the model classes. I dunno, I haven't thought about it much yet. But it's a direction we'd want to go and worth doing. Patches appreciated if folks have thoughts / time for it. But note that patches like that should be done in fhir-parser first, then ported here. |
This should be possible without changes to fhir-parser, just updates to the Python-specific templates like fhir-parser-resources/template-resource.py |
Yes it's possible for sure. But if we can keep the two repos in rough sync, that'd be nice - since this change isn't specific to |
We already do support extensions on primitive types in https://github.com/smart-on-fhir/Swift-FHIR (and https://github.com/apple/fhirmodels), with the current version of fhir-parser. We have a See https://github.com/smart-on-fhir/Swift-FHIR/blob/master/fhir-parser-resources/mappings.py |
Documenting a known issue: parsing FHIR resources with extensions on primitives silently drops the extensions. For example:
The text was updated successfully, but these errors were encountered: