Stream: implementers
Topic: Search on _profile
Brendan Kowitz (Jan 21 2021 at 00:24):
I'm looking to ask a clarifying question when searching on _profile in R4, Given the Model type is Canonical and the Search Parameter type is Uri.
If I had: meta.profile=http://example.com|5#abc, should I be able to find this with _profile=http://example.com or _profile=http://example.com|5 or _profile=http://example.com#abc. Or should the Uri search type on Canonical just be treated like the same as where the Model Type is Uri/Url?
@Grahame Grieve ?
Brendan Kowitz (Jan 21 2021 at 00:52):
Playing around with other servers, if I use "http://example.com|5#abc" as the profile:
- HAPI I need to encode the string "http%3A%2F%2Fexample.com%7C5%23abc" exactly to find the resource
- Vonk seems to always ignore the Canonical parts (|5#abc) so will find the Uri portion "http://example.com" no matter what comes after in the search string
Grahame Grieve (Jan 21 2021 at 02:10):
I'm not sure
Gino Canessa (Jan 21 2021 at 20:53):
Well, this is annoying =)...
Starting with the _profile search parameter, it appears to be defined as a reference type parameter.
The References and Versions section specifies that references to canonicals can have versions specified with the |
.
Additional guidance can then be found in the versions section of the references page. Since the meta.profile
is a reference to a canonical of a Structure Definition
(which is in the list), I'd say this is the "most authoritative" section of the spec.
So, my (un-authoritative) reading would be that:
- versioned search should be allowed with the
|
character - generally the
|
character should be url encoded to%7C
- I cannot seem to find an RFC that lists it as a reserved character, but most url encode methods do the conversion (note that FHIR guidance for servers is to accept either encoded or not) - a query without a version should start with the highest version of the resource and work backwards to look for a match (note that partial versions are also allowed,
5
would match5.1
or5.0
) I can't find any guidance about mixing the|
and the#
segments (nor any examples)... so :shrug: on that piece
Edit: I did find:
<valueSet value="http://fhir.acme.com/Questionnaire/example|1.0#vs1"/>
: This is a reference to the value set with id "vs1" in version 1.0 of the identified questionnaire. The common case for this is internal references.
So, that looks valid too.
Brendan Kowitz (Jan 21 2021 at 22:01):
@Gino Canessa, yes, I didn't cover ModelType Canonical => Search Type Reference searches, the logic here is more complex for sure.
That same page (https://www.hl7.org/fhir/resource.html#search) also has _profile's search type being a uri.
Some relationships (QuestionnaireResponse.questionnaire) are defined where the search type is Reference
Gino Canessa (Jan 21 2021 at 22:37):
Yep, that's definitely a conflict. I'll file a ticket to bring up at FHIR-I, unless @Grahame Grieve , @Lloyd McKenzie , or anyone else wants to jump in with something.
Gino Canessa (Jan 21 2021 at 22:49):
As a note, I can see that it used to be listed on that page as a reference
type (e.g., in 3.5a.0). I'm not going to try and find the commit that changed it to sort it out now though.
Gino Canessa (Jan 21 2021 at 22:53):
Created FHIR#30514 .
Ruth berge (Jun 16 2021 at 21:38):
If my Account resource is defined with a meta.profile "http://hl7.org/fhir/us/xxx/StructureDefinition/specialgrouping" and I want to search for all resources with that profile? GET [base]/Account?_profile=http://hl7.org/fhir/us/xxx/StructureDefinition/specialgrouping
Should that be all I need to do? Is there some other set up? Do I need to define the profile in the structure definition?
Josh Mandel (Jun 16 2021 at 22:00):
That's it, according to the base specification. If your server supports search with this parameter, it should find all the accounts tagged in this way.
Ruth berge (Jun 17 2021 at 16:15):
Thanks @Josh Mandel , but this doesn't work on my server so if the community is telling me I've read it right, then I will report the issue to the vendor
Lloyd McKenzie (Jun 25 2021 at 21:40):
Servers aren't required to support _profile at all and may also have limitations on which profiles they support tracking and searching against.
Last updated: Apr 12 2022 at 19:14 UTC