I am using Hapi FHIR DSTU2 HL7Org. In my application, I need to create a MedicationOrder and provide the possibility of updating/ deleting erroneous entries. I have the id, patientId, etc of the created MedicationOrder, but writing a code with where clause is pretty problematic. In all the examples I have seen, entries like
where(Patient.FAMILY.matches().value("duck")
presents, but I get SP_PATIENT, SP_STATUS, etc.
FhirContext ctx = FhirContext.forDstu2Hl7Org();
IGenericClient client = ctx.newRestfulGenericClient("http://fhirtest.uhn.ca/baseDstu2");
Bundle bundle = client.search().forResource(MedicationOrder.class).where(MedicationOrder.SP_PATIENT.equals("patientId")).returnBundle(Bundle.class).encodedXml().prettyPrint().execute();
The above code does not compile saying "The method where(ICriterion) in the type IQuery is not applicable for the arguments (boolean)". I could not manage to create any IQuery object.
Can someone please instruct me how to proceed?