Add initial FML generator based on the StructureComparison code#163
Add initial FML generator based on the StructureComparison code#163brianpos wants to merge 4 commits intomicrosoft:experimentalfrom
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.
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.
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.
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.
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