public void ProcessPatientRecordRevisedATNAEvent(string xdsPatientUID, string sourceUserID, string destinationUserID, string eventOutcomeIndicator) { try { //Log ATNA - Repository Event ATNALogic atnaLogic = new ATNALogic(); AuditMessageConfiguration auditMsgConfig = null; auditMsgConfig = atnaLogic.GetAuditMessageConfigurationDetails("REGISTRY-PATIENT-RECORD-REVISED-ITI-44"); if (auditMsgConfig != null) { auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$XDSPatientID$", xdsPatientUID); //$ActiveParticipant.UserID.Source$ auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$ActiveParticipant.UserID.Source$", sourceUserID); //$ActiveParticipant.UserID.Destination$ auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$ActiveParticipant.UserID.Destination$", destinationUserID); atnaLogic.ProcessEvent(auditMsgConfig, ATNAEvent.XDSREGISTRY_TYPE, eventOutcomeIndicator, ATNAEvent.UDP_TAG_APPNAME_REGISTRY); } } catch { //Oops...ATNA event failed...probably UDP failure....can't afford to stop XDSRepository service sorry :( } }
public void ProcessRetrieveDocumentSetATNAEvent(string documentEntryUUID, string sourceUserID, string destinationUserID, string eventOutcomeIndicator) { try { //Log ATNA - Repository Event ATNALogic atnaLogic = new ATNALogic(); AuditMessageConfiguration auditMsgConfig = null; auditMsgConfig = atnaLogic.GetAuditMessageConfigurationDetails("REPOSITORY-RDS-EXPORT-ITI-43"); if (auditMsgConfig != null) { auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$DocumentEntry.UUID$", documentEntryUUID); auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$Document.UUID$", ATNAEvent.XDSREPOSITORY_DOCUMENT_CLASSIFICATIONNODE_UUID); //$ActiveParticipant.UserID.Source$ auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$ActiveParticipant.UserID.Source$", sourceUserID); //$ActiveParticipant.UserID.Destination$ auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$ActiveParticipant.UserID.Destination$", destinationUserID); atnaLogic.ProcessEvent(auditMsgConfig, ATNAEvent.XDSREPOSITORY_TYPE, eventOutcomeIndicator, ATNAEvent.UDP_TAG_APPNAME_REPOSITORY); } } catch { //Oops...ATNA event failed...probably UDP failure....can't afford to stop XDSRepository service sorry :( } }
public void ProcessProvideAndRegisterATNAEvent(string submissionSetUniqueID, string sourceUserID, string destinationUserID, string eventOutcomeIndicator) { try { //Log ATNA - Repository Event ATNALogic atnaLogic = new ATNALogic(); AuditMessageConfiguration auditMsgConfig = null; auditMsgConfig = atnaLogic.GetAuditMessageConfigurationDetails("REPOSITORY-P-AND-R-IMPORT-ITI-41"); if (auditMsgConfig != null) { auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$SubmissionSet.UniqueID$", submissionSetUniqueID); auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$SubmissionSet.ClassificationNode.UUID$", ATNAEvent.XDSREPOSITORY_SUBMISSIONSET_CLASSIFICATIONNODE_UUID); //$ActiveParticipant.UserID.Source$ auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$ActiveParticipant.UserID.Source$", sourceUserID); //$ActiveParticipant.UserID.Destination$ auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$ActiveParticipant.UserID.Destination$", destinationUserID); atnaLogic.ProcessEvent(auditMsgConfig, ATNAEvent.XDSREPOSITORY_TYPE, eventOutcomeIndicator, ATNAEvent.UDP_TAG_APPNAME_REPOSITORY); } } catch { //Oops...ATNA event failed...probably UDP failure....can't afford to stop XDSRepository service sorry :( } }
public void ProcessEvent(AuditMessageConfiguration auditMsgConfig, string xdsType, string eventOutcomeIndicator, string appName) { string auditMessageXml = string.Empty; string pri = "13"; string timeStamp = string.Empty; string hostName = string.Empty; if (auditMsgConfig == null) { throw new ArgumentNullException("auditMsgConfig"); } if (auditMsgConfig.Parameters == null) { throw new Exception("Audit message parameters cannot be null!"); } auditMessageXml = auditMsgConfig.MessageValue; auditMessageXml = UpdateXMLWithDefaultParameterValues(auditMessageXml, xdsType, eventOutcomeIndicator); for (int count = 0; count < auditMsgConfig.Parameters.Count; count++) { auditMessageXml = auditMessageXml.Replace(auditMsgConfig.Parameters[count].ParameterName, auditMsgConfig.Parameters[count].ParameterValue); } timeStamp = GetTimeStamp(); hostName = System.Net.Dns.GetHostName(); auditMessageXml = String.Format(@"<{0}>{1} {2} {3}:{4}", pri, timeStamp, hostName, appName, auditMessageXml); BSDSysLogUDP.BSDSysLogAppend(auditMessageXml, SYSLOG_SERVER, SYSLOG_PORT); }
public void ProcessEvent(AuditMessageConfiguration auditMsgConfig, string xdsType, string eventOutcomeIndicator, string appName) { string atnaMessage = string.Empty; ATNA.ATNAEvent atnaEvent = null; atnaEvent = new ATNA.ATNAEvent(); atnaEvent.ProcessEvent(auditMsgConfig, xdsType, eventOutcomeIndicator, appName); }
public void ProcessEvent(string messageKey, string xdsType, string eventOutcomeIndicator, string appName) { string atnaMessage = string.Empty; ATNA.ATNAEvent atnaEvent = null; AuditMessageConfiguration auditMsgConfig = null; ATNADataAccess atnaDAL = null; atnaDAL = new ATNADataAccess(); auditMsgConfig = atnaDAL.GetAuditMessageConfigurationDetails(messageKey); atnaEvent = new ATNA.ATNAEvent(); atnaEvent.ProcessEvent(auditMsgConfig, xdsType, eventOutcomeIndicator, appName); }
public void ProcessRegistryStoredQueryATNAEvent(string sourceUserID, string destinationUserID, string xdsPatientID, string adhocQueryElementXml, string eventOutcomeIndicator) { //adHocQueryElementXml = atnaParameterValues["$AdhocQuery$"]; try { //Log ATNA - Repository Event ATNALogic atnaLogic = new ATNALogic(); AuditMessageConfiguration auditMsgConfig = null; auditMsgConfig = atnaLogic.GetAuditMessageConfigurationDetails("REGISTRY-QUERY-ITI-18"); if (auditMsgConfig != null) { auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$XDSPatient$", xdsPatientID); auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$SubmissionSet.ClassificationNode.UUID$", ATNAEvent.XDSREPOSITORY_SUBMISSIONSET_CLASSIFICATIONNODE_UUID); //$ActiveParticipant.UserID.Source$ auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$ActiveParticipant.UserID.Source$", sourceUserID); //$ActiveParticipant.UserID.Destination$ auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$ActiveParticipant.UserID.Destination$", destinationUserID); //Assigns attribute value for $AdhocQuery$ parameter //<ParticipantObjectIdentification ParticipantObjectID="$AdhocQuery$" ParticipantObjectTypeCode="2" ParticipantObjectTypeCodeRole="24"> XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(auditMsgConfig.MessageValue); XmlNode node = xmlDoc.SelectSingleNode(@"//*[local-name()='ParticipantObjectIdentification'][@ParticipantObjectID='$AdhocQuery$']"); if (node != null) { //Encoding encoding = Encoding.GetEncoding(adhocQueryElementXml); //node.Attributes["ParticipantObjectID"].Value = adhocQueryElementXml; node.Attributes["ParticipantObjectID"].Value = Convert.ToBase64String(Encoding.UTF8.GetBytes(adhocQueryElementXml)); auditMsgConfig.MessageValue = xmlDoc.OuterXml; } atnaLogic.ProcessEvent(auditMsgConfig, ATNAEvent.XDSREGISTRY_TYPE, eventOutcomeIndicator, ATNAEvent.UDP_TAG_APPNAME_REGISTRY); } } catch { //Oops...ATNA event failed...probably UDP failure....can't afford to stop XDSRepository service sorry :( } }
public static AuditMessageConfiguration SetParameterValue(AuditMessageConfiguration auditMsgConfig, string parameterName, string parameterValue) { AuditMessageParameterConfiguration paramConfig = auditMsgConfig.Parameters.Find( delegate(AuditMessageParameterConfiguration parameterConfig) { if (parameterConfig.ParameterName == parameterName) { return(true); } return(false); } ); if (paramConfig != null) { paramConfig.ParameterValue = parameterValue; } return(auditMsgConfig); }
public AuditMessageConfiguration GetAuditMessageConfigurationDetails(string messageKey) { IDataReader dbReader = null; AuditMessageConfiguration auditMessage = null; AuditMessageParameterConfiguration auditMsgParameter = null; Database dbIHEDB = DatabaseFactory.CreateDatabase(CONST_CONNECTIONSTRING_NAME); DbCommand dbCommand = dbIHEDB.GetStoredProcCommand("usp_get_auditMessageConfigurationDetails"); dbIHEDB.AddInParameter(dbCommand, "messageKey", DbType.String, messageKey); using (dbReader = dbIHEDB.ExecuteReader(dbCommand)) { while (dbReader.Read()) { if (auditMessage == null) { if (!dbReader.IsDBNull(dbReader.GetOrdinal("auditMessageID"))) { auditMessage = new AuditMessageConfiguration(dbReader.GetInt32(dbReader.GetOrdinal("auditMessageID"))); } if (!dbReader.IsDBNull(dbReader.GetOrdinal("messageKey"))) { auditMessage.MessageKey = dbReader.GetString(dbReader.GetOrdinal("messageKey")); } if (!dbReader.IsDBNull(dbReader.GetOrdinal("messageValue"))) { auditMessage.MessageValue = dbReader.GetString(dbReader.GetOrdinal("messageValue")); } } if (!dbReader.IsDBNull(dbReader.GetOrdinal("parameterID"))) { auditMsgParameter = new AuditMessageParameterConfiguration(dbReader.GetInt32(dbReader.GetOrdinal("parameterID"))); } if (!dbReader.IsDBNull(dbReader.GetOrdinal("parameterName"))) { auditMsgParameter.ParameterName = dbReader.GetString(dbReader.GetOrdinal("parameterName")); } if (!dbReader.IsDBNull(dbReader.GetOrdinal("parameterType"))) { auditMsgParameter.ParameterType = dbReader.GetString(dbReader.GetOrdinal("parameterType")); } if (!dbReader.IsDBNull(dbReader.GetOrdinal("parameterValue"))) { auditMsgParameter.ParameterValue = dbReader.GetString(dbReader.GetOrdinal("parameterValue")); } auditMessage.Parameters.Add(auditMsgParameter); } } return(auditMessage); }
public void ProcessPatientDuplicatesResolvedATNAEvent(PatientDuplicateEntry patientDuplicateEntry, string sourceUserID, string destinationUserID, string eventOutcomeIndicator) { try { //Log ATNA - Repository Event ATNALogic atnaLogic = new ATNALogic(); AuditMessageConfiguration auditMsgConfig = null; PatientIdentityFeedRecord patientNotFound = null; if (patientDuplicateEntry != null) { patientNotFound = patientDuplicateEntry.OldPatientList.Find( delegate(PatientIdentityFeedRecord patFeedRecord) { if (patFeedRecord.ResultCode == PatientIdentityFeedResultCode.PATIENT_NOT_FOUND) { return(true); } return(false); } ); if (patientNotFound != null) { eventOutcomeIndicator = "8"; } } //Patient Add/Update ATNA Event auditMsgConfig = atnaLogic.GetAuditMessageConfigurationDetails("REGISTRY-PATIENT-RECORD-DUPLICATES-RESOLVED-UPDATE-ITI-44"); if (auditMsgConfig != null) { auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$XDSPatientID$", patientDuplicateEntry.NewPatient.PatientUID); //$ActiveParticipant.UserID.Source$ auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$ActiveParticipant.UserID.Source$", sourceUserID); //$ActiveParticipant.UserID.Destination$ auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$ActiveParticipant.UserID.Destination$", destinationUserID); //New Patient Add Event atnaLogic.ProcessEvent(auditMsgConfig, ATNAEvent.XDSREGISTRY_TYPE, eventOutcomeIndicator, ATNAEvent.UDP_TAG_APPNAME_REGISTRY); } //Patient Delete ATNA Event auditMsgConfig = atnaLogic.GetAuditMessageConfigurationDetails("REGISTRY-PATIENT-RECORD-DUPLICATES-RESOLVED-DELETE-ITI-44"); if ((auditMsgConfig != null) && (patientNotFound == null)) { //ATNA Log for all the deleted patient uids for (int oldPatientCount = 0; oldPatientCount < patientDuplicateEntry.OldPatientList.Count; oldPatientCount++) { auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$XDSPatientID$", patientDuplicateEntry.OldPatientList[oldPatientCount].PatientUID); //$ActiveParticipant.UserID.Destination$ auditMsgConfig = ATNALogic.SetParameterValue(auditMsgConfig, "$ActiveParticipant.UserID.Destination$", ATNAEvent.XDSREGISTRY_SERVICE_ADDRESS); //Old Patient Delete Event atnaLogic.ProcessEvent(auditMsgConfig, ATNAEvent.XDSREGISTRY_TYPE, "0", ATNAEvent.UDP_TAG_APPNAME_REGISTRY); } } } catch { //Oops...ATNA event failed...probably UDP failure....can't afford to stop XDSRepository service sorry :( } }