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();