-
Notifications
You must be signed in to change notification settings - Fork 6
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
Extract extension contexts to keyword #244
Conversation
When processing an Extension definition, set the contexts directly on the ExportableExtension object. When doing so, convert paths back to FSH-style paths. When extracting caret value rules on an Extension definition, do not extract any rules for contexts. Add optimizer plugin to resolve URLs in contexts.
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.
The code here looks really good. I left one minor comment about test descriptions inline.
I ran this branch on US Core, which led me to two questions:
- This came up when I compared the round trip results from US Core and I saw differences that I wasn't expecting. However, this might actually be an issue with SUSHI, and not this branch. It came up in
USCoreEthnicityExtension
,USCoreRaceExtension
, andUSCoreTribalAffiliationExtension
. They all have a context like this:
{
"type": "element",
"expression": "FamilyMemberHistory"
}
This branch creates a Context: FamilyMemberHistory
in the FSH, but then when SUSHI outputs that context into JSON, it creates a context like this:
{
"expression": "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsFamilyMemberHistory",
"type": "extension"
}
Assuming the Context
keyword looks correct, maybe this is just a SUSHI issue.
- I wanted to double check that this was expected since there didn't seem to be a caret value rule created for the context before this branch, but
USCoreJurisdictionExtension
has a context array this like this:
"context": [
{
"type": "element",
"expression": "Element"
}
]
The released version of GoFSH didn't create any caret rules for this context, but this branch does create Context: Element
. I think that Context keyword is correct, but the missing caret value rule made me not sure, so I wanted to check.
@jafeltra Thank you for the review!
|
The optimizer now checks the extension's contexts array, rather than caret value rules. Fix some test descriptions for ResolveContextURLsOptimizer.
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.
Looks good to me! Thanks for updating that optimizer and answering my questions!
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.
This is fantastic, and quite clean. I like the way it turned out!
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.
Ooooh. This optimizer is way nicer now!
Completes #234 and task CIMPL-1163.
When processing an Extension definition, set the contexts directly on the ExportableExtension object. When doing so, convert paths back to FSH-style paths. When extracting caret value rules on an Extension definition, do not extract any rules for contexts.
Add optimizer plugin to resolve URLs in contexts.
This ended up being a bit simpler than I had anticipated in regards to differentiating between core and non-core resources. Since SUSHI does the hard work of actually resolving contexts, GoFSH gets to use the name of anything that it can fish up, no matter where it came from.