Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-14237

Missing patch body in FHIR Patch operation

    XMLWordPrintable

Details

    Description

      I have Webhook -> FHIR integration which should update the name for the Patient element on the FHIR server. On the FHIR server, I have one patient element.

      For the JSON patch, I use the example from the documentation ( https://access.redhat.com/documentation/en-us/red_hat_fuse/7.6/html/connecting_fuse_online_to_applications_and_services/connecting-to-fhir_connectors#adding-fhir-connection-patch_fhir )

      [{ "op":"replace", "path":"/name/0/given/0", "value": "John" }]
      

      However, when I run the integration and invoke webhook, the FHIR Patch operation fails on

      org.apache.camel.RuntimeCamelException: Error invoking patchById with {stringId=Patient/2, patchBody=[], extraParameters={}, preferReturn=null}: Unable to determine encoding of patch
      	at org.apache.camel.util.component.ApiMethodHelper.invokeMethod(ApiMethodHelper.java:514) ~[camel-core-2.23.2.fuse-770008-redhat-00001.jar!/:2.23.2.fuse-770008-redhat-00001]
      	at org.apache.camel.util.component.AbstractApiProducer.doInvokeMethod(AbstractApiProducer.java:120) ~[camel-core-2.23.2.fuse-770008-redhat-00001.jar!/:2.23.2.fuse-770008-redhat-00001]
      	at org.apache.camel.util.component.AbstractApiProducer$1.run(AbstractApiProducer.java:86) ~[camel-core-2.23.2.fuse-770008-redhat-00001.jar!/:2.23.2.fuse-770008-redhat-00001]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_252]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_252]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_252]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_252]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_252]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_252]
      	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_252]
      Caused by: java.lang.IllegalArgumentException: Unable to determine encoding of patch
      	at ca.uhn.fhir.rest.client.impl.GenericClient$PatchInternal.withBody(GenericClient.java:1469) ~[hapi-fhir-client-3.5.0.jar!/:na]
      	at org.apache.camel.component.fhir.api.FhirPatch.patchById(FhirPatch.java:95) ~[camel-fhir-api-2.23.2.fuse-770008-redhat-00001.jar!/:2.23.2.fuse-770008-redhat-00001]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_252]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_252]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_252]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_252]
      	at org.apache.camel.util.component.ApiMethodHelper.invokeMethod(ApiMethodHelper.java:506) ~[camel-core-2.23.2.fuse-770008-redhat-00001.jar!/:2.23.2.fuse-770008-redhat-00001]
      	... 9 common frames omitted
      

      I noticed in the log that patchBody is empty. It looks that the JSON patch, which is set in the UI,

      is not used in the connector.

      Attachments

        1. FHIR_patch-export.zip
          29 kB
        2. fhir.png
          fhir.png
          80 kB
        3. FHIRpatchWorkaround.png
          FHIRpatchWorkaround.png
          11 kB
        4. FHIRworkaroundDM.png
          FHIRworkaroundDM.png
          76 kB

        Activity

          People

            rkorytk@redhat.com Rafal Korytkowski (Inactive)
            mkralik@redhat.com Matej Kralik
            Matej Kralik Matej Kralik
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: