Exemple #1
0
 public static void logPatientFeed(
     String patID,
     String eventActionCode,
     byte[] msh10,
     String srcUserID,
     String remoteHost,
     String destUserID,
     boolean success) {
   if (logger != null && logger.isInstalled()) {
     try {
       Calendar timeStamp = logger.timeStamp();
       AuditMessage msg =
           XDSAudit.createPatientFeed(
               patID,
               EventActionCode.Create,
               msh10,
               srcUserID,
               null,
               remoteHost,
               destUserID,
               timeStamp,
               success ? EventOutcomeIndicator.Success : EventOutcomeIndicator.MinorFailure);
       sendAuditMessage(timeStamp, msg);
     } catch (Exception e) {
       log.warn("Audit log of Patient Feed failed!");
       log.debug("AuditLog Exception:", e);
     }
   }
 }
Exemple #2
0
 public static void logImport(
     EventTypeCode eventTypeCode,
     String submissionSetUID,
     String patID,
     String srcUserID,
     String altSrcUserID,
     String srcHostName,
     String destUserID,
     String altDestUserID,
     String destHostName,
     RetrieveDocumentSetRequestType docReq,
     boolean success) {
   try {
     Calendar timeStamp = logger.timeStamp();
     AuditMessage msg =
         XDSAudit.createImport(
             eventTypeCode,
             submissionSetUID,
             patID,
             srcUserID,
             altSrcUserID,
             srcHostName,
             destUserID,
             altDestUserID,
             destHostName,
             docReq,
             timeStamp,
             success ? EventOutcomeIndicator.Success : EventOutcomeIndicator.MinorFailure);
     sendAuditMessage(timeStamp, msg);
   } catch (Exception e) {
     log.warn("Audit log of Import (" + eventTypeCode.getDisplayName() + ") failed!");
     log.debug("AuditLog Exception:", e);
   }
 }
Exemple #3
0
 public static void logStudyUsed(RetrieveDocumentSetResponseType rsp, AuditRequestInfo info) {
   if (logger == null || !logger.isInstalled()) return;
   try {
     Calendar timeStamp = logger.timeStamp();
     AuditMessage msg =
         createStudyUsedLogMessage(rsp, info.getRemoteHost(), info.getRemoteUser(), timeStamp);
     sendAuditMessage(timeStamp, msg);
   } catch (Exception e) {
     log.warn("Audit log of Study Used failed!");
     log.debug("AuditLog Exception:", e);
   }
 }
Exemple #4
0
 public static void logApplicationActivity(EventTypeCode eventType, boolean success) {
   if (logger != null && logger.isInstalled()) {
     try {
       Calendar timeStamp = logger.timeStamp();
       AuditMessage msg =
           createApplicationActivity(
               eventType,
               timeStamp,
               success ? EventOutcomeIndicator.Success : EventOutcomeIndicator.MajorFailure);
       sendAuditMessage(timeStamp, msg);
     } catch (Exception e) {
       log.warn("Audit log of ApplicationActivity failed!");
       log.debug("AuditLog Exception:", e);
     }
   }
 }
Exemple #5
0
  public static void logQuery(
      EventTypeCode eventTypeCode,
      AdhocQueryRequest req,
      String srcUserID,
      String altSrcUserID,
      String srcHostName,
      String destUserID,
      String altDestUserID,
      String destHostName,
      boolean success) {

    if (logger != null && logger.isInstalled()) {
      try {
        AdhocQueryType qry = req.getAdhocQuery();
        String patID = XDSUtil.getQueryPatID(qry.getSlot());
        String homeCommunityID =
            InfosetUtil.getSlotValue(qry.getSlot(), XDSConstants.QRY_HOME_COMMUNITY_ID, null);
        if (srcHostName == null) srcHostName = AuditLogger.localHost().getHostName();
        Calendar timeStamp = logger.timeStamp();
        AuditMessage msg =
            XDSAudit.createQuery(
                eventTypeCode,
                qry.getId(),
                patID,
                homeCommunityID,
                InfosetUtil.marshallObject(req, true).getBytes("UTF-8"),
                srcUserID,
                altSrcUserID,
                srcHostName,
                destUserID,
                altDestUserID,
                destHostName,
                timeStamp,
                success ? EventOutcomeIndicator.Success : EventOutcomeIndicator.MinorFailure);
        sendAuditMessage(timeStamp, msg);
      } catch (Exception e) {
        log.warn("Audit log of Stored Query failed!");
        log.debug("AuditLog Exception:", e);
      }
    }
  }
Exemple #6
0
 public static void logPixQuery(
     String patID,
     String sendingApp,
     String sendingFacility,
     String receivingApp,
     String receivingFacility,
     String remoteHost,
     byte[] query,
     byte[] msh10,
     boolean success) {
   if (logger != null && logger.isInstalled()) {
     try {
       Calendar timeStamp = logger.timeStamp();
       AuditMessage msg = new AuditMessage();
       msg.setEventIdentification(
           createEventIdentification(
               EventID.Query,
               EventActionCode.Execute,
               timeStamp,
               success ? EventOutcomeIndicator.Success : EventOutcomeIndicator.MinorFailure,
               null,
               EventTypeCode.ITI_9_PIXQuery));
       msg.getAuditSourceIdentification().add(logger.createAuditSourceIdentification());
       String hostName = AuditLogger.localHost().getHostName();
       msg.getActiveParticipant()
           .add(
               AuditMessages.createActiveParticipant(
                   sendingFacility + "|" + sendingApp,
                   AuditLogger.processID(),
                   null,
                   true,
                   hostName,
                   machineOrIP(hostName),
                   null,
                   RoleIDCode.Source));
       msg.getActiveParticipant()
           .add(
               AuditMessages.createActiveParticipant(
                   sendingFacility + "|" + sendingApp,
                   null,
                   null,
                   false,
                   remoteHost,
                   machineOrIP(remoteHost),
                   null,
                   RoleIDCode.Destination));
       msg.getParticipantObjectIdentification().add(createPatient(patID));
       msg.getParticipantObjectIdentification()
           .add(
               AuditMessages.createParticipantObjectIdentification(
                   null,
                   new ParticipantObjectIDTypeCode("ITI-9", "IHE Transactions", "PIX Query"),
                   null,
                   query,
                   AuditMessages.ParticipantObjectTypeCode.SystemObject,
                   AuditMessages.ParticipantObjectTypeCodeRole.Query,
                   null,
                   null,
                   null,
                   AuditMessages.createParticipantObjectDetail("MSH-10", msh10)));
       msg.getParticipantObjectIdentification()
           .add(
               AuditMessages.createParticipantObjectIdentification(
                   patID,
                   ParticipantObjectIDTypeCode.ITI_PatientNumber,
                   null,
                   (byte[]) null,
                   AuditMessages.ParticipantObjectTypeCode.Person,
                   AuditMessages.ParticipantObjectTypeCodeRole.Patient,
                   null,
                   null,
                   null));
       sendAuditMessage(timeStamp, msg);
     } catch (Exception e) {
       log.warn("Audit log of PIX query failed!");
       log.debug("AuditLog Exception:", e);
     }
   }
 }