mirror of
https://github.com/hapifhir/hapi-fhir.git
synced 2025-03-30 20:08:46 +00:00
31 lines
679 B
Java
31 lines
679 B
Java
package example;
|
|
|
|
import org.hl7.fhir.dstu3.model.IdType;
|
|
import org.hl7.fhir.dstu3.model.OperationOutcome;
|
|
|
|
import ca.uhn.fhir.rest.annotation.*;
|
|
import ca.uhn.fhir.rest.api.PatchTypeEnum;
|
|
|
|
|
|
public class PatchExamples {
|
|
|
|
//START SNIPPET: patch
|
|
@Patch
|
|
public OperationOutcome patientPatch(@IdParam IdType theId, PatchTypeEnum thePatchType, @ResourceParam String theBody) {
|
|
|
|
if (thePatchType == PatchTypeEnum.JSON_PATCH) {
|
|
// do something
|
|
}
|
|
if (thePatchType == PatchTypeEnum.XML_PATCH) {
|
|
// do something
|
|
}
|
|
|
|
OperationOutcome retVal = new OperationOutcome();
|
|
retVal.getText().setDivAsString("<div>OK</div>");
|
|
return retVal;
|
|
}
|
|
//END SNIPPET: patch
|
|
|
|
|
|
}
|