Open tadgh opened 1 week ago
Note that this example uses doc status, but I imagine this may exist for any enum'ed field? Worth looking into.
This may be limited to DocumentReference.status
but I suspect it isn't.
The general case appears to be converting an unpopulated element of type code
—which is generally backed by an enum—that includes one or more extensions. The most common extension would likely be a data-absent-reason extension but it's perfectly valid to add any extension to an unpopulated element in this manner.
@dotasek I think we've discussed this before - it does need a sweeping fix for this, to check if the enum .getValue() is null before doing the switch. Is my memory correct?
@grahamegrieve I think what was done before was this: https://github.com/hapifhir/org.hl7.fhir.core/pull/1697/files, which is also involved null handling, but not what this fix is asking for.
I'll look into it.
theDocumentReference.docStatus = null
theDocumentReference.getDocStatusElement().addExtension(someExtension)
VersionConvertorFactory_30_40.convertResource(theDocumentReference);
Notice the NPE:
Note that this example uses doc status, but I imagine this may exist for any enum'ed field? Worth looking into.