-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add initial FML generator based on the StructureComparison code #163
base: experimental
Are you sure you want to change the base?
Conversation
…lar to the ConceptMap generator)
{ | ||
group.Input[0].Type = srcResourceType + srcVersion.ToRLiteral(); | ||
group.Input[1].Type = tgtResourceType + tgtVersion.ToRLiteral(); | ||
group.Extends = "Resource"; |
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 couldn't spot the routine to retrieve the Base type (i.e. all the StructureDefinition content) for the structure being processed in the resource.
(searching for DomainResource or Resource, or the other datatypes where they are for complex types)
Should I just be using _source.TryResolveByCanonicalUri()
if (_source.TryResolveByCanonicalUri(c.Source.Url, out Resource? sd))
group.Extends = (sd as StructureDefinition)?.cgBaseTypeName();
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.
In the StructureComparison
object (c
, I believe at this point in the code), there are references to the Source
and Target
StructureDefinition
resources subject to comparison.
In each of the structures, there is the function to get the base type (cgBaseTypeName
).
In DefinitionCollection
, there are a few functions you could use - I would probably lean towards TryGetStructure
.
If we want a collapsed convenience function to do both, I would be fine with that (e.g., cgBaseTypeStructure
).
continue; | ||
|
||
// Filter out any backbone element props | ||
var backboneElementProps = new[] { "id", "extension", "modifierExtension" }; |
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.
There has to be a better way to locate if the property isn't from the differential (and thus not required at this level in the resource)
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.
Today there is a function in ElementDefinitionExtensions
, cgIsInherited
which tells you whether an element is inherited or not, based on the path.
The function will work well in this scenario (all core definitions), but I have a note to update it for profile detection.
…type for the Extends property.
…on't do that when it's us - yes its a hack still)
I tested this to generate the R5 to R6 initial maps