Package com.ibm.fhir.server.util
Class FHIRRestBundleHelper
- java.lang.Object
-
- com.ibm.fhir.server.util.FHIRRestBundleHelper
-
public class FHIRRestBundleHelper extends Object
Helper for processing bundle entries. Does not perform any persistence operations, but instead helps to translate the request into aFHIRRestInteractionimplementation which can be executed at a later time.
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDO_VALIDATIONstatic DateTimeFormatterPARSER_FORMATTERstatic booleanSKIPPABLE_UPDATE
-
Constructor Summary
Constructors Constructor Description FHIRRestBundleHelper(FHIRResourceHelpers helpers)Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckResourceType(String type)Check that the resource type is a valid typeList<FHIRRestInteraction>translateBundleEntries(Bundle requestBundle, Map<Integer,Bundle.Entry> validationResponseEntries, boolean failFast, String bundleRequestCorrelationId, boolean skippableUpdates)Translate each bundle entry into a FHIRRestOperation implementation which can then be executed in a particular order.
-
-
-
Field Detail
-
DO_VALIDATION
public static final boolean DO_VALIDATION
- See Also:
- Constant Field Values
-
SKIPPABLE_UPDATE
public static final boolean SKIPPABLE_UPDATE
- See Also:
- Constant Field Values
-
PARSER_FORMATTER
public static final DateTimeFormatter PARSER_FORMATTER
-
-
Constructor Detail
-
FHIRRestBundleHelper
public FHIRRestBundleHelper(FHIRResourceHelpers helpers)
Public constructor- Parameters:
helpers-
-
-
Method Detail
-
translateBundleEntries
public List<FHIRRestInteraction> translateBundleEntries(Bundle requestBundle, Map<Integer,Bundle.Entry> validationResponseEntries, boolean failFast, String bundleRequestCorrelationId, boolean skippableUpdates) throws Exception
Translate each bundle entry into a FHIRRestOperation implementation which can then be executed in a particular order. No persistance operations are performed at this stage.- Parameters:
requestBundle- the bundle containing the request entriesvalidationResponseEntries- the response entries with errors/warnings constructed during validationfailFast- a boolean value indicating if processing should stop on first failurebundleRequestCorrelationId- the bundle request correlation IDskippableUpdates- if true, and the bundle contains an update for which the resource content in the update matches the existing resource on the server, then skip the update; if false, then always attempt the updates specified in the bundle- Returns:
- a list of FHIRRestInteraction objects to be processed in order
- Throws:
Exception
-
checkResourceType
public void checkResourceType(String type) throws FHIROperationException
Check that the resource type is a valid type- Parameters:
type- the resource type name- Throws:
FHIROperationException
-
-