Does HAPI FHIR JPA-server supports compartments?

238 views
Skip to first unread message

Martin Benedict

unread,
Dec 12, 2017, 4:05:31 AM12/12/17
to HAPI FHIR
I'm relatively new to HAPI FHIR.
After setting up an own HAPI JPA server based on the jpa-example, i have tried to use compartments to get for MedicationStatements that are assigned to a patient. However I stucked when trying to use compartments.
The HAPI FHIR JPA Server tells me the following:

"Invalid request: The FHIR endpoint on this server does not know how to handle GET operation[Patient/35002/Condition] with parameters [[_pretty]]"

Does the HAPI FHIR JPA Server not support compartments?

In the following you wil find the code I used to test the compartment ability.

Condition condition = new Condition()
.setSubject(new Reference("Patient/" + testPatient.getIdElement().getIdPart() ));

Bundle bundle = new Bundle();

bundle
.addEntry().setResource(condition)
.getRequest()
.setUrl("Condition")
.setMethod(Bundle.HTTPVerb.POST);


client.transaction().withBundle(bundle).execute();

Bundle myResult = client
.search()
.forResource(Patient.class)
.withIdAndCompartment(testPatient.getId(), "Condition")
.returnBundle(Bundle.class)
.prettyPrint()
.execute();

Łukasz Dywicki

unread,
Feb 21, 2018, 8:09:33 AM2/21/18
to HAPI FHIR
I am around same topic and there are two things in your post - first is client part of the code you showed, which obviously does support compartments. Actual issue is that server side implementation of PatientResourceProvider does not implement any compartment operation. To get this supported JPA resource provider needs to be modified and implement necessary logic in order to construct proper search criteria.

Kind regards,
Lukasz

James Agnew

unread,
Feb 21, 2018, 10:18:38 AM2/21/18
to Łukasz Dywicki, HAPI FHIR
Yup, this is exactly correct.

Support is in there for the client currently, as well as some support in the Plain Server, but we have not yet implemented the server part in the JPA server.

Cheers,
James

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/f41f21f7-a840-4769-857d-78d9d00cc563%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages