-
Notifications
You must be signed in to change notification settings - Fork 159
[Bug] search parameter "_include" doesn't include fields with type "Reference<any>" #449
Comments
Hi @Lin-002, I've successfully reproduced this behavior, and will add this to our team's backlog. Thanks for raising this issue; I will comment here when there is an update! |
Thanks very much ! |
Hi @Lin-002 , From what I can tell, this is not actually a bug. The thing is that on the FHIR spec, the
However, it is possible to extend the functionality of FHIR works via Implementation Guides to add a |
awesome. Thanks a lot @carvantes |
I created a SearchParameter for "about" field, and followed instruction https://github.com/awslabs/fhir-works-on-aws-deployment/blob/mainline/USING_IMPLEMENTATION_GUIDES.md. But, It still doesn't include "about" field. Could you help me out ?
|
I have successfully added custom SearchParameter for field "about". In order to do add SearchParameter, I had to provide "expression" and "xpath" both as well as ".index.json" file. I can search Communication Resource by "about", but I cannot include "about", "subject", "recipient" fields. Previously it can include "subject" and "recipient". But now I cannot include any of them. If I use wildcard "*", then I got HTTP 500 error.
|
Hi, which Implementation Guide package is this using? And is the modified Search Parameter similar to the one posted above? |
Hi @Lin-002 , The error occur because your search parameter is missing the The following will work: {
"resourceType": "SearchParameter",
"id": "CommunicationAboutSearchParameter",
"url": "http://fhir.company.com/SearchParameter/Communication/about",
"description": "This SearchParameter enables query of Communication by its about field.",
"name": "CommunicationAboutSearchParameter",
"status": "active",
"type": "reference",
"base": [
"Communication"
],
"code": "about",
"expression": "Communication.about",
"xpath": "f:Communication/f:about",
"target": [
"Patient",
"Group" // etc.
],
"modifier": [
"contains"
]
} Note that there's no shorthand to indicate that it targets "any" resource type. Such search params must list ALL resource types in the target array.
The IG support was designed primarily to consume published IGs, so it's true that making minor changes (such as adding a single search param) can be a bit cumbersome since you need to essentially create a mini IG package. This is an interesting use case and your feedback is much appreciated! We'll update the IG compiler to validate that reference search params have a target. @ssvegaraju, could you make this change? |
@carvantes Thanks a lot. After adding target, "_include" parameter works like a charm ! |
Sure, I will update the IG compiler to make sure that reference search params have the target defined, and will link that change here when done! |
Describe the bug
"_include" parameter works for most fields. However, It seems it doesn't include referenced Resource for Reference type field.
To Reproduce
Steps to reproduce the behavior:
1.
POST /Patient
{ "resourceType": "Patient", "gender": "male" }
2.
POST /Communication
{ "resourceType": "Communication", "status":"completed", "about": [ { "reference": "Patient/dfa6216e-10bf-4551-b19d-c9c3fd7d8952" } ] }
3.
GET /Communication?&_include=*
Expected behavior
The response includes Patient resource
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: