Esempio n. 1
0
 public static AuditMessage createImport(
     EventTypeCode eventTypeCode,
     String submissionSetUID,
     String patID,
     String srcUserID,
     String altSrcUserID,
     String srcHostName,
     String destUserID,
     String altDestUserID,
     String destHostName,
     RetrieveDocumentSetRequestType docReq,
     Calendar timeStamp,
     String outcomeIndicator) {
   AuditMessage msg = new AuditMessage();
   msg.setEventIdentification(
       createEventIdentification(
           EventID.Import,
           EventActionCode.Create,
           timeStamp,
           outcomeIndicator,
           null,
           eventTypeCode));
   msg.getAuditSourceIdentification().add(logger.createAuditSourceIdentification());
   msg.getActiveParticipant()
       .add(
           AuditMessages.createActiveParticipant(
               srcUserID,
               altSrcUserID,
               null,
               true,
               srcHostName,
               machineOrIP(srcHostName),
               null,
               RoleIDCode.Source));
   msg.getActiveParticipant()
       .add(
           AuditMessages.createActiveParticipant(
               destUserID,
               altDestUserID,
               null,
               false,
               destHostName,
               machineOrIP(destHostName),
               null,
               RoleIDCode.Destination));
   if (patID != null)
     msg.getParticipantObjectIdentification().add(createPatient(null2unknown(patID)));
   if (submissionSetUID != null)
     msg.getParticipantObjectIdentification()
         .add(createSubmissionSet(null2unknown(submissionSetUID)));
   if (docReq != null) {
     addDocuments(
         msg.getParticipantObjectIdentification(),
         docReq,
         null,
         EventOutcomeIndicator.Success.equals(outcomeIndicator));
   }
   return msg;
 }
Esempio n. 2
0
 public static AuditMessage createQuery(
     EventTypeCode eventTypeCode,
     String queryUID,
     String patID,
     String homeCommunityID,
     byte[] adhocQuery,
     String srcUserID,
     String altSrcUserID,
     String srcHostName,
     String destUserID,
     String altDestUserID,
     String destHostName,
     Calendar timeStamp,
     String outcomeIndicator) {
   AuditMessage msg = new AuditMessage();
   msg.setEventIdentification(
       createEventIdentification(
           EventID.Query,
           EventActionCode.Execute,
           timeStamp,
           outcomeIndicator,
           null,
           eventTypeCode));
   msg.getAuditSourceIdentification().add(logger.createAuditSourceIdentification());
   String hostName = AuditLogger.localHost().getHostName();
   msg.getActiveParticipant()
       .add(
           AuditMessages.createActiveParticipant(
               srcUserID,
               altSrcUserID,
               null,
               true,
               srcHostName,
               machineOrIP(srcHostName),
               null,
               RoleIDCode.Source));
   msg.getActiveParticipant()
       .add(
           AuditMessages.createActiveParticipant(
               destUserID,
               AuditLogger.processID(),
               null,
               false,
               hostName,
               machineOrIP(hostName),
               null,
               RoleIDCode.Destination));
   if (patID != null) msg.getParticipantObjectIdentification().add(createPatient(patID));
   log.info("Query:\n" + new String(adhocQuery));
   msg.getParticipantObjectIdentification()
       .add(createQueryParticipantObjectIdentification(queryUID, homeCommunityID, adhocQuery));
   return msg;
 }
Esempio n. 3
0
 public static AuditMessage createPatientFeed(
     String patID,
     String eventActionCode,
     byte[] msh10,
     String srcUserID,
     String altSrcUserID,
     String srcHostName,
     String destUserID,
     Calendar timeStamp,
     String outcomeIndicator) {
   AuditMessage msg = new AuditMessage();
   msg.setEventIdentification(
       createEventIdentification(
           EventID.PatientRecord,
           eventActionCode,
           timeStamp,
           outcomeIndicator,
           null,
           EventTypeCode.ITI_8_PatientIdentityFeed));
   msg.getAuditSourceIdentification().add(logger.createAuditSourceIdentification());
   String hostName = AuditLogger.localHost().getHostName();
   msg.getActiveParticipant()
       .add(
           AuditMessages.createActiveParticipant(
               srcUserID,
               altSrcUserID,
               null,
               true,
               srcHostName,
               machineOrIP(srcHostName),
               null,
               RoleIDCode.Source));
   msg.getActiveParticipant()
       .add(
           AuditMessages.createActiveParticipant(
               destUserID,
               AuditLogger.processID(),
               null,
               false,
               hostName,
               machineOrIP(hostName),
               null,
               RoleIDCode.Destination));
   ParticipantObjectIdentification patPOI = createPatient(patID);
   patPOI
       .getParticipantObjectDetail()
       .add(AuditMessages.createParticipantObjectDetail("MSH-10", msh10));
   msg.getParticipantObjectIdentification().add(patPOI);
   return msg;
 }
Esempio n. 4
0
 private static AuditMessage createApplicationActivity(
     EventTypeCode eventType, Calendar timeStamp, String outcomeIndicator) {
   AuditMessage msg = new AuditMessage();
   msg.setEventIdentification(
       createEventIdentification(
           EventID.ApplicationActivity,
           EventActionCode.Execute,
           timeStamp,
           outcomeIndicator,
           null,
           eventType));
   msg.getAuditSourceIdentification().add(logger.createAuditSourceIdentification());
   msg.getActiveParticipant().add(logger.createActiveParticipant(true, RoleIDCode.Application));
   return msg;
 }
Esempio n. 5
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);
     }
   }
 }