Fhir Patient Resource with search with custom query

hi All,

I am trying to find a way to introduce a search method for a Patient Resource as follows using Hapi Fhir for CCRI
https:/x/y/z/domain/Patient?_query=ongoingAdmission&Identifier=34567.

couldn’t find the similar implementation here
https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations_search.html
please give your thoughts on this?

thanks
Tharma

It doesn’t support more complex queries by design.

It might be able to perform an equivalent query on Encounter resource. Something like

Encounter?patient.identifier=34567&status=in-progress

(I don’t think CCRI support chained parameters but it would be possible to extend it to do so)

Thanks Kevin,
does that mean it is not available / supported in CCRI ?

I am trying to find it in hapi reference implementation for this Search - FHIR v5.0.0
GET [base]/Patient?_query=name&parameters…

if not available in HAPI implentation, should we intercept the request & handle manually ? any idea ?

thanks
Tharma

It may be in the standard HAPI, ccri has a different data model.

However if your familiar with Hibernate, extending ccri would be possible. https://hibernate.org/
You would need to alter the patient provider and put in a Hibernate query in the patient Dao.

hi Kevin,

Thank you, I have issue with defining the search method in the PatientProvider not the back end.

@Search
public Bundle getBundleByPatient(/* the query Parameter */) {
read the _query parameter here and handle it.
}
what type of parameter I should define here ?
apologies I didn’t clearly explain the issue I am facing ?

thanks
Tharma

1 Like

hi,

I solved this problem

https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations_search.html#combining-multiple-parameters

@Search(queryName=“namedQuery1”)
public List searchByNamedQuery(@RequiredParam(name=“someparam”) StringParam theSomeParam) {
List retVal = new ArrayList();
// …populate…
return retVal;
}

thanks
Tharma