1

I am creating FHIR MedicationOrder resources providing a unique identifier. When deleting those MedicationOrders, I want to perform a conditional delete by this identifier. Below is the code I used

getClient().delete().resourceConditionalByUrl("MedicationOrder?identifier=systemValue%7CuniqueId").encodedXml().execute();

But this returns a ClassCastException:

java.lang.ClassCastException: org.hl7.fhir.instance.model.OperationOutcome cannot be cast to ca.uhn.fhir.model.base.resource.BaseOperationOutcome

I tried explicitly use an HttpDelete, but then it sends a ClientProtocol exception saying that HttpDelete is not supported, even though it is used internally in FHIR.

Can somebody please help? Since our customer wants to go with DSTU2 HL7 version, I cannot mix with DSTU2 as well.

1 Answers1

0

Are you able to try this with the latest version of HAPI (2.1). The version you are using is quite old, it's quite possible that this is a bug which was already fixed in a later version.

James Agnew
  • 701
  • 4
  • 3