Skip to content
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

Cross-version conversion doesn't check modifierExtension for future modifier elements #1914

Open
jwjahns opened this issue Feb 26, 2025 · 0 comments

Comments

@jwjahns
Copy link

jwjahns commented Feb 26, 2025

Cross-version converters like ActorDefinition40_50.java will check for any cross-version extensions when converting to a newer FHIR version.

However, they only check the extension element, not modifierExtension. Future modifier elements (like R5's ActorDefinition.status) are modifier extensions when expressed in previous versions, so won't be found by the converter.

if (src.hasExtension(STATUS_EXTENSION_URL)) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl(STATUS_EXTENSION_URL).getValue().primitiveValue()));
}


Validators and SUSHI will reject resources that incorrectly place a modifier extension within extension. So this issue is notable when trying to construct an ActorDefinition in an R4 IG, because the IG Publisher requires canonical resources like ActorDefinition to have a status, but SUSHI will refuse to generate the associated extension anywhere but modifierExtension.


Examples for converting R4 Basic to R5 ActorDefinition:

ex_Basic_modifierExtension.json

java -jar validator_cli.jar ./ex_Basic_modifierExtension.json -version 4.0 -to-version 5.0 -output ./result.json -do-native:
=>
{"resourceType":"ActorDefinition","id":"example","modifierExtension":[{"url":"http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.status","valueCode":"active"}],"type":"system"}

vs. throwing everything in extension:
ex_Basic_no_modifierExtension.json

java -jar validator_cli.jar ./ex_Basic_no_modifierExtension.json -version 4.0 -to-version 5.0 -output ./result.json -do-native
=>
{"resourceType":"ActorDefinition","id":"example","status":"active","type":"system"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant