Class FhirPatch


  • public class FhirPatch
    extends Object
    API for the "patch" operation, which performs a logical patch on a server resource
    • Constructor Detail

      • FhirPatch

        public FhirPatch​(ca.uhn.fhir.rest.client.api.IGenericClient client)
    • Method Detail

      • patchByUrl

        public ca.uhn.fhir.rest.api.MethodOutcome patchByUrl​(String patchBody,
                                                             String url,
                                                             ca.uhn.fhir.rest.api.PreferReturnEnum preferReturn,
                                                             Map<ExtraParameters,​Object> extraParameters)
        Specifies that the update should be performed as a conditional create against a given search URL.
        Parameters:
        url - The search URL to use. The format of this URL should be of the form [ResourceType]?[Parameters], for example: Patient?name=Smith&identifier=13.2.4.11.4%7C847366
        patchBody - The body of the patch document serialized in either XML or JSON which conforms to http://jsonpatch.com/ or http://tools.ietf.org/html/rfc5261
        preferReturn - Add a Prefer header to the request, which requests that the server include or suppress the resource body as a part of the result. If a resource is returned by the server it will be parsed an accessible to the client via MethodOutcome.getResource()
        extraParameters - see ExtraParameters for a full list of parameters that can be passed, may be NULL
        Returns:
        the MethodOutcome
      • patchById

        public ca.uhn.fhir.rest.api.MethodOutcome patchById​(String patchBody,
                                                            org.hl7.fhir.instance.model.api.IIdType id,
                                                            ca.uhn.fhir.rest.api.PreferReturnEnum preferReturn,
                                                            Map<ExtraParameters,​Object> extraParameters)
        Applies the patch to the given resource ID
        Parameters:
        patchBody - The body of the patch document serialized in either XML or JSON which conforms to http://jsonpatch.com/ or http://tools.ietf.org/html/rfc5261
        id - The resource ID to patch
        preferReturn - Add a Prefer header to the request, which requests that the server include or suppress the resource body as a part of the result. If a resource is returned by the server it will be parsed an accessible to the client via MethodOutcome.getResource()
        extraParameters - see ExtraParameters for a full list of parameters that can be passed, may be NULL
        Returns:
        the MethodOutcome
      • patchById

        public ca.uhn.fhir.rest.api.MethodOutcome patchById​(String patchBody,
                                                            String stringId,
                                                            ca.uhn.fhir.rest.api.PreferReturnEnum preferReturn,
                                                            Map<ExtraParameters,​Object> extraParameters)
        Applies the patch to the given resource ID
        Parameters:
        patchBody - The body of the patch document serialized in either XML or JSON which conforms to http://jsonpatch.com/ or http://tools.ietf.org/html/rfc5261
        stringId - The resource ID to patch
        preferReturn - Add a Prefer header to the request, which requests that the server include or suppress the resource body as a part of the result. If a resource is returned by the server it will be parsed an accessible to the client via MethodOutcome.getResource()
        extraParameters - see ExtraParameters for a full list of parameters that can be passed, may be NULL
        Returns:
        the MethodOutcome