Chained queries
# support
a
Hi guys, how are you!? I need help with some queries I'm developing for the API. Sorry for my lack of knowledge, but if you can help me, I'd appreciate it! For example, when I run the following query: http://fhir-homolog.hydra.saude-go.net/fhir/R4/ImmunizationRecommendation?recommendation.vaccineCode=55&_format=json I get the following result: "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "invalid", "details": { "text": "Invalid search parameter in chain: ImmunizationRecommendation?recommendation" } } ], And also when I try to do a chained query, such as: http://fhir-homolog.hydra.saude-go.net/fhir/R4/Immunization?_format=json&_count=10&_include=Immunization:patient&patient.address:city=521930 I also get the same error. Am I structuring something wrong in the query? Or do I have to do some configuration in Medplum? Thank you so much guys! I hope you have help.
r
Hi @Adriano Freitas - when doing this kind of search, you cannot search on arbitratry fields - You'll have to use the specified search paraeters
IN thsi case, I can see that the search parameter
vaccine-type
is mapped to
ImmunizationRecommendation.recommendation.vaccineCode
a
That's right @rahul1 , sorry for the mistake! Thank you very much for the clarification! I have another question regarding GraphQL, any query we run on the endpoint returns: "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "structure", "details": { "text": "Unknown resource type" } } ], Is this correct? Is there anything we can do differently? We tested all the examples available on the documentation page and were unsuccessful. We also tested by simply sending to the /$graphQL Endpoint and the return is always the same, regardless of what we send. Can you help us?
r
@Adriano Freitas could you share the exact graphql query you are running. It might be a simple syntax error
a
Any request I send returns this response. Can be anyone. Using POSTMAN, I access the GraphQL Tab and paste the following Medplum example expression: { PatientList(name: "Eve", address_city: "Philadelphia") { resourceType id name { family given } address { line city state postalCode } } } The return is the same. If I delete this query, and just call /$graphql, the return is the same. I don't know what could be wrong.
r
@Adriano Freitas make sure to wrap the text in a "query" entry. The raw POST request would look somethng like this > POST /fhir/R4/$graphql HTTP/2 > Host: api.medplum.com > content-type: application/json | {"query":"{\n PatientList(name: \"Eve\", address_city: \"Philadelphia\") {\n resourceType\n id\n name {\n family\n given\n }\n address {\n line\n city\n state\n postalCode\n }\n }\n}"}
a
Look at this test, apparently there is nothing wrong. (See the image)
Good afternoon @rahul1 ! We were able to help GraphQL in our environment, but we discovered something that we are unable to implement. When executing the query: query { ImmunizationRecommendationList(_id: "37b6695b-945f-5656-9842-dafb828a104a", vaccine_type: "34") { id patient { reference } recommendation { vaccineCode { coding { system code display } } forecastStatus { text } dateCriterion { code { coding { system code display } text } value } doseNumberString seriesDosesPositiveInt } } } We are unable to filter what only has vaccineCode = 34, but it returns the instance with all the values ​​that we stored inside the Recommendation. Can you help me filter these instance values? Attached I will leave the Print of the response and an example of an instance we have of Recommendation.
r
Hi @Adriano Freitas , Looking at the resource you attached contains the vaccine code "34"
Copy code
"system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRImunobiologico",
                            "code": "34"
There is not a FHIR search that allows you to search recommendations that only has a code, and has no other codes
I'm sorry that I couldn't be more handle
177 Views