Stream: dotnet
Topic: Activity Definition
Jefferson (Mar 03 2020 at 17:46):
I would like to replace the source.Value with a FHIR rule I created but I am unable to get the value to the new string. Is there another way to do this?
public override ActivityDefinition Convert(ResolutionContext context)
{
var source = context.SourceValue as CustomSentencePartModel;
var target = context.DestinationValue as ActivityDefinition;
var sourceCustomSentence = CreateFhirString(source.Value);
source.Value = sourceCustomSentence;
Michele Mottini (Mar 03 2020 at 18:29):
What are ResolutionContext? CustomSentencePartModel? They do not appear to be FHIR resources?
Jefferson (Mar 03 2020 at 19:04):
ResolutionContext is the AutoMapper object for the Model and ActivityDefinition
Michele Mottini (Mar 03 2020 at 19:09):
Sorry, don't know what that is
Christiaan Knaap (Mar 04 2020 at 07:21):
It looks like you put CustomSentencePartModel.source.Value into a FhirString, which suggests that it is of type string. But the result is of type FhirString so you cannot assign that back to the same property. You can get a string out again by using sourceCustomSentence.Value, but I fail to see the point of the code then.
Last updated: Apr 12 2022 at 19:14 UTC