Stream: dotnet
Topic: Code sample for Canonical Ref
Hugh Glover (Jan 06 2021 at 20:50):
Can someone give me a code snippet for using a canonical reference in Firely .NET SDK please. I want a PlanDefinition.ActionComponent.Definition that is an existing ActivityDefinition. I'm missing something somewhere ... :sad:
Mirjam Baltus (Jan 07 2021 at 07:43):
@Hugh Glover Could you clarify your question a bit more: do you have a PlanDefinition resource and want to get the url for the ActivityDefinition out of it, or do you want to create a PlanDefinition and set the url of the ActivityDefinition?
Hugh Glover (Jan 07 2021 at 09:52):
@Mirjam Baltus I have a set of ActivitiyDefinition resources created. I then want to create a PlanDefinition and this will have a set of actions each of which will be defined by one of the ActivityDefinitions I have already created. My understanding is that I use the Definition element of the Action to do this which has type canonical(ActivityDefinition | PlanDefinition | Questionnaire). I haven't done this before and I just don't know how to write the code to wire it up.
Mirjam Baltus (Jan 11 2021 at 15:32):
Adding a canonical to the PlanDefinition.action.definition field can be done like this:
var pd = new PlanDefinition();
var pda = new PlanDefinition.ActionComponent();
pda.Definition = new Canonical("http://myserver.org/ActivityDefinition/1234");
pd.Action.Add(pda);
Mallesh (Jan 19 2021 at 07:46):
Please anyone share patch method code
René Spronk (Jan 19 2021 at 07:51):
@mallesh Please create a new topic - your question is not related to the topic of this thread, which is "Code sample for canonical Ref".
Last updated: Apr 12 2022 at 19:14 UTC