Class BulkAuditLogger


  • public class BulkAuditLogger
    extends Object
    This class provides convenience methods for FHIR Java Batch Jobs that access and manipulate FHIR Data, thus needing to write FHIR audit log entries.
    • Constructor Detail

      • BulkAuditLogger

        public BulkAuditLogger()
    • Method Detail

      • shouldLog

        public boolean shouldLog()
      • logCreateOnImport

        public void logCreateOnImport​(Resource newResource,
                                      Date startTime,
                                      Date endTime,
                                      javax.ws.rs.core.Response.Status responseStatus,
                                      String location,
                                      String users)
                               throws Exception
        Builds an audit log entry for a 'create' in a bulkdata service invocation.
        Parameters:
        newResource - The Resource object being created.
        startTime - The start time of the create request execution.
        endTime - The end time of the create request execution.
        responseStatus - The response status.
        location - the destination or source for the export or import
        users - the principals that initiated the request
        Throws:
        Exception
      • logValidateOnImport

        public void logValidateOnImport​(Resource newResource,
                                        Date startTime,
                                        Date endTime,
                                        javax.ws.rs.core.Response.Status responseStatus,
                                        String location,
                                        String users)
                                 throws Exception
        Builds an audit log entry for a 'validate' in a bulkdata service invocation.
        Parameters:
        newResource - The Resource object being created.
        startTime - The start time of the create request execution.
        endTime - The end time of the create request execution.
        responseStatus - The response status.
        location - the destination or source for the export or import
        users - the principals that initiated the request
        Throws:
        Exception
      • logUpdateOnImport

        public void logUpdateOnImport​(Resource oldResource,
                                      Resource updatedResource,
                                      Date startTime,
                                      Date endTime,
                                      javax.ws.rs.core.Response.Status responseStatus,
                                      String location,
                                      String users)
                               throws Exception
        Builds an audit log entry for an 'update' in a bulkdata service invocation.
        Parameters:
        oldResource - The previous version of the Resource, before it was updated.
        updatedResource - The updated version of the Resource.
        startTime - The start time of the update request execution.
        endTime - The end time of the update request execution.
        responseStatus - The response status.
        location - the destination or source for the export or import
        users - the principals that initiated the request
        Throws:
        Exception
      • logUpdateOnImportSkipped

        public void logUpdateOnImportSkipped​(Resource resource,
                                             Date startTime,
                                             Date endTime,
                                             javax.ws.rs.core.Response.Status responseStatus,
                                             String location,
                                             String users)
                                      throws Exception
        Builds an audit log entry for an 'update' skipped in a bulkdata service invocation.
        Parameters:
        resource - The updated version of the Resource.
        startTime - The start time of the update request execution.
        endTime - The end time of the update request execution.
        responseStatus - The response status.
        location - the destination or source for the export or import
        users - the principals that initiated the request
        Throws:
        Exception
      • logReadOnExport

        public void logReadOnExport​(Resource resource,
                                    Date startTime,
                                    Date endTime,
                                    javax.ws.rs.core.Response.Status responseStatus,
                                    String location,
                                    String users)
                             throws Exception
        Builds an audit log entry for a 'read' in a bulkdata service invocation.
        Parameters:
        resource - The Resource object being read.
        startTime - The start time of the read request execution.
        endTime - The end time of the read request execution.
        responseStatus - The response status.
        location - the destination or source for the export or import
        users - the principals that initiated the request
        Throws:
        Exception
      • logSearchOnExport

        public void logSearchOnExport​(String resource,
                                      Map<String,​List<String>> queryParms,
                                      int totalSearch,
                                      Date startTime,
                                      Date endTime,
                                      javax.ws.rs.core.Response.Status responseStatus,
                                      String location,
                                      String users)
                               throws Exception
        Builds an audit log entry for a 'search' in a bulkdata service invocation.
        Parameters:
        resource - the resource
        queryParms - The query parameters passed to the search service.
        totalSearch - The total retrieved
        startTime - The start time of the bundle request execution.
        endTime - The end time of the bundle request execution.
        responseStatus - The response status.
        location - the destination or source for the export or import
        users - the principals that initiated the request
        Throws:
        Exception
      • logFastOnExport

        public void logFastOnExport​(String resource,
                                    String queryParm,
                                    int totalSearch,
                                    Date startTime,
                                    Date endTime,
                                    javax.ws.rs.core.Response.Status responseStatus,
                                    String location,
                                    String users)
                             throws Exception
        Builds an audit log entry for a 'search' in a bulkdata service invocation.
        Parameters:
        resource - the resource
        queryParm - The query parameter passed to the search service.
        totalSearch - The total retrieved
        startTime - The start time of the bundle request execution.
        endTime - The end time of the bundle request execution.
        responseStatus - The response status.
        location - the destination or source for the export or import
        users - the principals that initiated the request
        Throws:
        Exception