Stream: dotnet
Topic: Finding search parameters of an element.
Muhammad Abubakar Ikram (Jan 19 2022 at 12:54):
Can we find the search parameter against an element? after fetching StructureDefinition of a resource from specification zip?
for example I got all the reference elements from the StructureDefinition of MedicationRequest resource. Now I want to take only those reference elements, that have search parameter linked to them.
MedicationRequest.reported[x] does not have search parameter linked to it, I want to skip
MedicationRequest.subject have a search parameter linked to it, I want to take
Brian Postlethwaite (Jan 19 2022 at 14:48):
They aren't in the structure definition, they are in the capability statement for the server.
Brian Postlethwaite (Jan 19 2022 at 14:48):
http://hl7.org/fhir/capabilitystatement-definitions.html#CapabilityStatement.rest.searchParam
Muhammad Abubakar Ikram (Jan 19 2022 at 17:46):
I want to see, if the specific element of a resource has search parameter linked to it. Can I get this done using fhir net api?
Gino Canessa (Jan 19 2022 at 17:59):
There is a search parameter registry, which lists all the Search Parameters defined by the core specs.
In the FHIR Net API, there should be a List<SearchParamDefinition>
named SearchParameters
in Hl7.Fhir.Model.ModelInfo
. It contains the search parameters from the core spec as well. You will need to parse the element path out of the Path
, XPath
, or Expression
properties, depending on what is easiest for you.
That said, Search Parameters can be either defined in the core specification or externally (e.g., US-Core defines man search parameters). Loading external search parameters would involve downloading and parsing the relevant package.
Brian Postlethwaite (Jan 19 2022 at 23:13):
And a specific server may not support it too.
Gino Canessa (Jan 19 2022 at 23:14):
(which is true for all search parameters =)
Muhammad Abubakar Ikram (Jan 24 2022 at 06:31):
This is how I done that, after getting element from StructureDefinition.
SearchParamDefinition spd = SearchParameters.FirstOrDefault(sp => sp.Expression == refElement.Path);
of course I am dealing only with implemented search parameters only.
Last updated: Apr 12 2022 at 19:14 UTC