FHIR Chat · Forge Profile to Questionnair with .NET API · implementers

Stream: implementers

Topic: Forge Profile to Questionnair with .NET API


view this post on Zulip Jakob Lindblad (Aug 13 2018 at 08:04):

Hi, i have been looking around for an answer to this for a couple of days now with no success so i guess ill give it a shot here.

Just as an example lets say i made a Profile in Forge based on 'Device' and modify a couple of elements. I am using the Fhir .NET API to build a questionnair from this profile. I use methods from the API such as "IsPrimitive()" and "IsDataType()" to be able to handle primitive and complex elements from my profile. What im looking for is if there is a way using the api where i can determine if an complex element is modified or not? For example i loop through my elements and get to 'Identifier', can i with help of the api determine if this is a modified element?

/Jakob

view this post on Zulip Michel Rutten (Aug 13 2018 at 10:14):

Hi @Jakob Lindblad, I assume that with "modified" you mean that you want to determine programmatically if an element is constrained by a profile? Then you need to inspect the associated StructureDefinition.
@Ewout Kramer has been working on the implementation of a new intelligent element navigator in the .NET API library that "knows" about the associated StructureDefinition. The new navigator will allow you to easily navigate resource elements with all the associated rich type information. I think the new logic is in a separate feature branch:
https://github.com/ewoutkramer/fhir-net-api/tree/feature/nav-based-serialization-stu3/

view this post on Zulip Jakob Lindblad (Aug 13 2018 at 11:06):

That is correct, reason i used "modified" is that in Forge constrained elements is marked with the yellow "modified" marker. Thank you it appears to be exactly what im looking for.

view this post on Zulip Michel Rutten (Aug 13 2018 at 11:09):

Hi @Jakob Lindblad, FYI Ewout has almost finished the implementation of the new navigator. He is planning to merge the feature branch into develop and publish a new NuGet package of the .NET FHIR API by the end of this week.

view this post on Zulip Michel Rutten (Aug 13 2018 at 11:10):

Pretty cool stuff! Will also be quite useful in Forge.

view this post on Zulip Jakob Lindblad (Aug 13 2018 at 11:10):

Great news!

view this post on Zulip Michel Rutten (Aug 13 2018 at 11:11):

The navigators are completely independent of the source type, i.e. you can uniformly navigate PoCo/Xml/Json resources without worrying about the input format.

view this post on Zulip Jakob Lindblad (Aug 13 2018 at 11:18):

Seems im very lucky with the timing of this new features.

view this post on Zulip Brian Postlethwaite (Aug 13 2018 at 22:59):

Whats the link to Questionnaire here?

view this post on Zulip Brian Postlethwaite (Aug 13 2018 at 23:00):

If you're using the POCOs the metadata for all the properties is available already.
(I have a routine that converts a StructureDefinition into a draft Questionnaire format)

view this post on Zulip Jakob Lindblad (Aug 14 2018 at 12:18):

Not sure what you are asking for but basically what i want to do is to convert profiles i made in Forge into questionnairs in C#.
If there is any quides or examples for doing this out on the web i would really appreciate a link. I find reading the documentation on Hl7.org a bit confusing sometimes, might be because im quite fresh to fhir.


Last updated: Apr 12 2022 at 19:14 UTC