Class FHIRRestInteractionVisitorReferenceMapping

    • Field Detail

      • transaction

        final boolean transaction
    • Constructor Detail

      • FHIRRestInteractionVisitorReferenceMapping

        public FHIRRestInteractionVisitorReferenceMapping​(boolean transaction,
                                                          FHIRResourceHelpers helpers,
                                                          Map<String,​String> localRefMap,
                                                          Bundle.Entry[] responseBundleEntries)
        Public constructor
        Parameters:
        helpers -
    • Method Detail

      • doSearch

        public FHIRRestOperationResponse doSearch​(int entryIndex,
                                                  String requestDescription,
                                                  FHIRUrlParser requestURL,
                                                  long initialTime,
                                                  String type,
                                                  String compartment,
                                                  String compartmentId,
                                                  javax.ws.rs.core.MultivaluedMap<String,​String> queryParameters,
                                                  String requestUri,
                                                  Resource contextResource,
                                                  boolean checkInteractionAllowed)
                                           throws Exception
        Description copied from interface: FHIRRestInteractionVisitor
        Performs heavy lifting associated with a 'search' operation.
        type - the resource type associated with the search
        compartment - the compartment type to search in, or null if not a compartment search
        compartmentId - the specific compartment to search in, or null if not a compartment search
        queryParameters - a Map containing the query parameters from the request URL
        requestUri - the request URI
        contextResource - the resource context
        Returns:
        a FHIRRestOperationResponse containing the search result bundle
        Throws:
        Exception
      • doVRead

        public FHIRRestOperationResponse doVRead​(int entryIndex,
                                                 String requestDescription,
                                                 FHIRUrlParser requestURL,
                                                 long initialTime,
                                                 String type,
                                                 String id,
                                                 String versionId,
                                                 javax.ws.rs.core.MultivaluedMap<String,​String> queryParameters)
                                          throws Exception
        Description copied from interface: FHIRRestInteractionVisitor
        Performs a 'vread' operation by retrieving the specified version of a Resource with no query parameters
        type - the resource type associated with the Resource to be retrieved
        id - the id of the Resource to be retrieved
        versionId - the version id of the Resource to be retrieved
        Returns:
        the Resource
        Throws:
        Exception
      • doRead

        public FHIRRestOperationResponse doRead​(int entryIndex,
                                                String requestDescription,
                                                FHIRUrlParser requestURL,
                                                long initialTime,
                                                String type,
                                                String id,
                                                boolean throwExcOnNull,
                                                boolean includeDeleted,
                                                Resource contextResource,
                                                javax.ws.rs.core.MultivaluedMap<String,​String> queryParameters,
                                                boolean checkInteractionAllowed)
                                         throws Exception
        Description copied from interface: FHIRRestInteractionVisitor
        Performs a 'read' operation to retrieve a Resource.
        type - the resource type associated with the Resource to be retrieved
        id - the id of the Resource to be retrieved
        throwExcOnNull - whether to throw an exception on null
        includeDeleted - allow the read, even if the resource has been deleted
        contextResource - the resource
        queryParameters - for supporting _elements and _summary for resource read
        Returns:
        a SingleResourceResult wrapping the resource and including its deletion status
        Throws:
        Exception
      • doHistory

        public FHIRRestOperationResponse doHistory​(int entryIndex,
                                                   String requestDescription,
                                                   FHIRUrlParser requestURL,
                                                   long initialTime,
                                                   String type,
                                                   String id,
                                                   javax.ws.rs.core.MultivaluedMap<String,​String> queryParameters,
                                                   String requestUri)
                                            throws Exception
        Description copied from interface: FHIRRestInteractionVisitor
        Performs the work of retrieving versions of a Resource.
        type - the resource type associated with the Resource to be retrieved
        id - the id of the Resource to be retrieved
        queryParameters - a Map containing the query parameters from the request URL
        Returns:
        a Bundle containing the history of the specified Resource
        Throws:
        Exception
      • doUpdate

        public FHIRRestOperationResponse doUpdate​(int entryIndex,
                                                  FHIRPersistenceEvent event,
                                                  Bundle.Entry validationResponseEntry,
                                                  String requestDescription,
                                                  FHIRUrlParser requestURL,
                                                  long initialTime,
                                                  String type,
                                                  String id,
                                                  Resource resource,
                                                  Resource prevResource,
                                                  String ifMatchValue,
                                                  String searchQueryString,
                                                  boolean skippableUpdate,
                                                  String localIdentifier,
                                                  List<OperationOutcome.Issue> warnings,
                                                  boolean isDeleted,
                                                  Integer ifNoneMatch)
                                           throws Exception
        Description copied from interface: FHIRRestInteractionVisitor
        Performs an update operation (a new version of the Resource will be stored).
        event - the persistence event used for this resource interaction
        id - the id of the Resource being updated
        resource - the new resource to be stored
        prevResource - the old resource value if we have it
        ifMatchValue - an optional "If-Match" header value to request a version-aware update
        searchQueryString - an optional search query string to request a conditional update
        skippableUpdate - if true, and the resource content in the update matches the existing resource on the server, then skip the update; if false, then always attempt the update
        localIdentifier - if not null, represents the local identifier within the bundle used to support local references
        warnings - the accumulated list of warnings gathered while processing the interaction
        isDeleted - flag to indicate if the resource is currently deleted
        ifNoneMatch - conditional create-on-update
        Returns:
        a FHIRRestOperationResponse that contains the results of the operation
        Throws:
        Exception
      • doPatch

        public FHIRRestOperationResponse doPatch​(int entryIndex,
                                                 FHIRPersistenceEvent event,
                                                 Bundle.Entry validationResponseEntry,
                                                 String requestDescription,
                                                 FHIRUrlParser requestURL,
                                                 long initialTime,
                                                 String type,
                                                 String id,
                                                 Resource resource,
                                                 Resource prevResource,
                                                 FHIRPatch patch,
                                                 String ifMatchValue,
                                                 String searchQueryString,
                                                 boolean skippableUpdate,
                                                 List<OperationOutcome.Issue> warnings,
                                                 String localIdentifier)
                                          throws Exception
        Description copied from interface: FHIRRestInteractionVisitor
        Performs a patch operation (a new version of the Resource will be stored).
        event - the persistence event used for this resource interaction
        type - the type of the resource to be updated
        id - the id of the Resource being updated
        resource - the latest value of the resource
        prevResource - the value of the resource before any changes
        patch - the patch to apply
        ifMatchValue - an optional "If-Match" header value to request a version-aware update
        searchQueryString - an optional search query string to request a conditional update
        skippableUpdate - if true, and the result of the patch matches the existing resource on the server, then skip the update; if false, then always attempt the update
        Returns:
        a FHIRRestOperationResponse that contains the results of the operation
        Throws:
        Exception
      • doInvoke

        public FHIRRestOperationResponse doInvoke​(String method,
                                                  int entryIndex,
                                                  Bundle.Entry validationResponseEntry,
                                                  String requestDescription,
                                                  FHIRUrlParser requestURL,
                                                  long initialTime,
                                                  FHIROperationContext operationContext,
                                                  String resourceTypeName,
                                                  String logicalId,
                                                  String versionId,
                                                  Resource resource,
                                                  javax.ws.rs.core.MultivaluedMap<String,​String> queryParameters)
                                           throws Exception
        Description copied from interface: FHIRRestInteractionVisitor
        Helper method which invokes a custom operation.
        operationContext - the FHIROperationContext associated with the request
        resourceTypeName - the resource type associated with the request
        logicalId - the resource logical id associated with the request
        versionId - the resource version id associated with the request
        resource - the input resource associated with the custom operation to be invoked
        queryParameters - query parameters may be passed instead of a Parameters resource for certain custom operations invoked via GET
        Returns:
        a Resource that represents the response to the custom operation
        Throws:
        Exception
      • doDelete

        public FHIRRestOperationResponse doDelete​(int entryIndex,
                                                  String requestDescription,
                                                  FHIRUrlParser requestURL,
                                                  long initialTime,
                                                  String type,
                                                  String id,
                                                  String searchQueryString)
                                           throws Exception
        Description copied from interface: FHIRRestInteractionVisitor
        Performs a 'delete' operation on the specified resource.
        type - the resource type associated with the Resource to be deleted
        id - the id of the Resource to be deleted
        Returns:
        a FHIRRestOperationResponse that contains the results of the operation
        Throws:
        Exception
      • storePayload

        protected Future<PayloadKey> storePayload​(Resource resource,
                                                  String logicalId,
                                                  int newVersionNumber)
                                           throws Exception
        If payload offloading is supported by the persistence layer, store the given resource. This can be an async operation which we resolve at the end just prior to the transaction being committed. If offloading isn't supported, the persistence layer returns null and the operation is a NOP.
        Parameters:
        resource -
        logicalId -
        newVersionNumber -
        Returns:
        Throws:
        Exception