resources = BundleUtil.toListOfResourcesOfType(ourFhirContext, payload, Resource.class);
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/BaseResourceMessage.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/BaseResourceMessage.java
index acb52bed436..9fe9c51606b 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/BaseResourceMessage.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/BaseResourceMessage.java
@@ -20,7 +20,7 @@
package ca.uhn.fhir.rest.server.messaging;
-
+import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.model.api.IModelJson;
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -146,7 +146,7 @@ public abstract class BaseResourceMessage implements IResourceMessage, IModelJso
/**
* Adds a transaction ID to this message. This ID can be used for many purposes. For example, performing tracing
* across asynchronous hooks, tying data together, or downstream logging purposes.
- *
+ *
* One current internal implementation uses this field to tie back MDM processing results (which are asynchronous)
* to the original transaction log that caused the MDM processing to occur.
*
@@ -195,7 +195,7 @@ public abstract class BaseResourceMessage implements IResourceMessage, IModelJso
* @return null by default
*/
@Nullable
- protected String getMessageKeyDefaultValue(){
+ protected String getMessageKeyDefaultValue() {
return null;
}
@@ -212,6 +212,19 @@ public abstract class BaseResourceMessage implements IResourceMessage, IModelJso
myRestOperationTypeEnum = theRestOperationTypeEnum;
}
+ public static OperationTypeEnum from(RestOperationTypeEnum theRestOperationType) {
+ switch (theRestOperationType) {
+ case CREATE:
+ return CREATE;
+ case UPDATE:
+ return UPDATE;
+ case DELETE:
+ return DELETE;
+ default:
+ throw new IllegalArgumentException(Msg.code(2348) + "Unsupported operation type: " + theRestOperationType);
+ }
+ }
+
public RestOperationTypeEnum asRestOperationType() {
return myRestOperationTypeEnum;
}