FHIR Chat · Add Type for RelatedArtifact · dotnet

Stream: dotnet

Topic: Add Type for RelatedArtifact


view this post on Zulip Jefferson (Jun 06 2019 at 14:00):

How would I add a value to type when it also has a extension?
<type>
<extension url="http://ncbi.nlm.nih.gov/fhir/StructureDefinition/templateRelationship">
<valueCode value="precedes" />
</extension>
</type>

view this post on Zulip Jefferson (Jun 06 2019 at 14:09):

When I set the type it will remove the extension

view this post on Zulip Jefferson (Jun 06 2019 at 14:09):

relatedArtifact.Type = RelatedArtifact.RelatedArtifactType.DependsOn

view this post on Zulip Michel Rutten (Jun 06 2019 at 14:12):

Hi @Tom MCDEVITT, you can use the mirroring .TypeElement property to access/assign the full component.

view this post on Zulip Jefferson (Jun 06 2019 at 14:22):

@Michel Rutten that still removes the extension var relatedArtifact = new RelatedArtifact()
{
TypeElement = new Code<RelatedArtifact.RelatedArtifactType>()
{
Extension = new List<Extension>()
{
new Extension(GetExtensionUrl("templateRelationship"),
new Code(t.RelationTypeName.ToLowerInvariant()))
}
},
Url = $"PlanDefinition/{t.RelatedTemplateAcronym}",
Type = RelatedArtifact.RelatedArtifactType.DependsOn
};

view this post on Zulip Michel Rutten (Jun 06 2019 at 14:29):

Yes, because you are assigning a new component, fully replacing the original. Instead, try to modify the properties of the existing Type component.

view this post on Zulip Brian Postlethwaite (Jun 07 2019 at 00:25):

As long as you know what the extension is, and your new value doesn't effect it.

view this post on Zulip Brian Postlethwaite (Jun 07 2019 at 00:26):

Would be undesirable to have a value and a null flavour extension for example.
Or a translation value that isn't a translation of the value.

view this post on Zulip Brian Postlethwaite (Jun 07 2019 at 00:27):

Otherwise removing the extension is the appropriate action, hence what it is by default.


Last updated: Apr 12 2022 at 19:14 UTC