public string WsSecurityRegisterJson(string dato) { RegistryLogic mysqlGet = new RegistryLogic(); var datos = mysqlGet.SecurityUserRegisterJson(dato); var response = JsonConvert.SerializeObject(datos, Formatting.Indented); return(response); }
Message IDocumentRegistry.PatientRegistryRecordAdded(System.ServiceModel.Channels.Message input) { Message msgResult = null; XmlDocument xmlDocRequest = null; XmlDocument xmlDocResponse = null; XDSResponse xdsResponse = null; PatientIdentityFeedLogic patientFeedLogic = null; PatientIdentityFeedRecord patientIdentityFeedRecord = null; RegistryLogic objRegistryLogic = null; string eventOutcomeIndicator = "0"; string sourceUserID = string.Empty; string destinationUserID = string.Empty; try { //ATNA Event - Active Participant Source UserID sourceUserID = GetSourceUserID(); //ATNA Event - Active Participant Destination UserID destinationUserID = GetDestinationUserID(); xmlDocRequest = new XmlDocument(); xmlDocRequest.Load(input.GetReaderAtBodyContents()); objRegistryLogic = new RegistryLogic(); patientFeedLogic = new PatientIdentityFeedLogic(); xdsResponse = patientFeedLogic.PatientRegistryRecordAdded(xmlDocRequest); xmlDocResponse = xdsResponse.XDSResponseDocument; eventOutcomeIndicator = xdsResponse.AtnaParameters["$EventIdentification.EventOutcomeIndicator$"]; //ATNA patientIdentityFeedRecord = patientFeedLogic.GetPatient(xmlDocRequest); } catch (Exception) { //Log Error objRegistryLogic.CreateRegistryLogEntry(xmlDocRequest.InnerXml, GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, DateTime.Now); //ATNA Event Failure Indicator eventOutcomeIndicator = "8"; } //Log ATNA Event if (patientIdentityFeedRecord != null) { patientFeedLogic.ProcessPatientRecordAddATNAEvent(patientIdentityFeedRecord.PatientUID, sourceUserID, destinationUserID, eventOutcomeIndicator); } //Create Soap Message msgResult = Message.CreateMessage(input.Headers.MessageVersion, GlobalValues.CONST_ACTION_PatientIdentityFeedResponse, new XmlNodeReader(xmlDocResponse)); return(msgResult); }
Message IDocumentRegistry.RegisterDocumentSet(Message input) { XDSResponse xdsResponse = null; Message msgResponse = null; XmlDocument xmlDocRequest = null;; XmlDocument xmlDocResponse = null; XmlNode nodeRegistryError = null; RegistryLogic objRegistryLogic = null; DateTime dtStart = DateTime.Now; string eventOutcomeIndicator = "0"; string submissionSetUniqueID = string.Empty; string sourceUserID = string.Empty; string destinationUserID = string.Empty; try { //ATNA Event - Active Participant Source UserID sourceUserID = GetSourceUserID(); //ATNA Event - Active Participant Destination UserID destinationUserID = GetDestinationUserID(); //Request XmlDocument xmlDocRequest = new XmlDocument(); xmlDocRequest.Load(input.GetReaderAtBodyContents()); // objRegistryLogic = new RegistryLogic(); xdsResponse = objRegistryLogic.RegisterDocumentSet(xmlDocRequest); xmlDocResponse = xdsResponse.XDSResponseDocument; //Failure nodeRegistryError = xmlDocResponse.SelectSingleNode(@"//*[local-name()='RegistryError']"); if (nodeRegistryError != null) { eventOutcomeIndicator = "8"; objRegistryLogic.CreateRegistryLogEntry(xmlDocRequest.InnerXml, GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, dtStart); } ////Failure //if ((xdsResponse.XDSErrorList != null) && (xdsResponse.XDSErrorList.Count > 0)) //{ // eventOutcomeIndicator = "8"; //} //if ((xdsResponse.XDSErrorList == null) || (xdsResponse.XDSErrorList.Count == 0)) //{ //} //else //{ // xmlDocResponse = CommonUtility.ConstructRegistryErrorResponse(GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, string.Empty, "Internal Registry Error", "RegistryInternalError", GlobalValues.CONST_SEVERITY_TYPE_ERROR, "Registry"); // objRegistryLogic.CreateRegistryLogEntry(xmlDocRequest.InnerXml, GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, dtStart); // //ATNA Event Outcome Indicator // eventOutcomeIndicator = "8"; //} } catch (System.ServiceModel.ServerTooBusyException serverTooBusyException) { xmlDocResponse = CommonUtility.ConstructRegistryErrorResponse(GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, string.Empty, serverTooBusyException.Message, GlobalValues.CONST_REGISTRYERROR_CODE_XDSRegistryTooBusyException, GlobalValues.CONST_SEVERITY_TYPE_ERROR, string.Empty); objRegistryLogic.CreateRegistryLogEntry(xmlDocRequest.InnerXml, GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, dtStart); //ATNA Event Outcome Indicator eventOutcomeIndicator = "8"; } catch (TimeoutException timeoutException) { xmlDocResponse = CommonUtility.ConstructRegistryErrorResponse(GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, string.Empty, timeoutException.Message, GlobalValues.CONST_ERROR_CODE_TimeOut, GlobalValues.CONST_SEVERITY_TYPE_ERROR, string.Empty); objRegistryLogic.CreateRegistryLogEntry(xmlDocRequest.InnerXml, GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, dtStart); //ATNA Event Outcome Indicator eventOutcomeIndicator = "8"; } catch (System.ServiceModel.Security.SecurityAccessDeniedException AuthorizationException) { xmlDocResponse = CommonUtility.ConstructRegistryErrorResponse(GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, string.Empty, AuthorizationException.Message, GlobalValues.CONST_ERROR_CODE_XDSAuthorizationException, GlobalValues.CONST_SEVERITY_TYPE_ERROR, string.Empty); objRegistryLogic.CreateRegistryLogEntry(xmlDocRequest.InnerXml, GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, dtStart); //ATNA Event Outcome Indicator eventOutcomeIndicator = "8"; } catch (Exception) { //ATNA Event Outcome Indicator eventOutcomeIndicator = "8"; xmlDocResponse = CommonUtility.ConstructRegistryErrorResponse(GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, string.Empty, GlobalValues.CONST_REGISTRYERROR_CODE_XDSRegistryError, GlobalValues.CONST_REGISTRYERROR_CODE_XDSRegistryError, GlobalValues.CONST_SEVERITY_TYPE_ERROR, string.Empty); objRegistryLogic.CreateRegistryLogEntry(xmlDocRequest.InnerXml, GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, dtStart); } //------------------------------------------------------------------------------------ //ATNA Event if (xdsResponse.AtnaParameters.ContainsKey("$SubmissionSet.UniqueID$")) { submissionSetUniqueID = xdsResponse.AtnaParameters["$SubmissionSet.UniqueID$"]; } objRegistryLogic.ProcessRegisterDocumentSetATNAEvent(submissionSetUniqueID, sourceUserID, destinationUserID, eventOutcomeIndicator); //------------------------------------------------------------------------------------ msgResponse = Message.CreateMessage(input.Headers.MessageVersion, GlobalValues.CONST_ACTION_RegisterDocumentSetResponse, new XmlNodeReader(xmlDocResponse)); return(msgResponse); }
Message IDocumentRegistry.RegistryStoredQuery(System.ServiceModel.Channels.Message input) { Message msgResult = null; XmlDocument xmlDocRequest = null; XmlDocument xmlDocResponse = new XmlDocument(); XmlElement rootElement = xmlDocResponse.DocumentElement; RegistryStoredQueryLogic objStoredQueryLogic = null; RegistryLogic objRegistryLogic = null; StringDictionary atnaParameterValues = null; string eventOutcomeIndicator = "0"; string sourceUserID = string.Empty; string destinationUserID = string.Empty; string xdsPatientID = string.Empty; string adHocQueryElementXml = string.Empty; try { objRegistryLogic = new RegistryLogic(); objStoredQueryLogic = new RegistryStoredQueryLogic(); //ATNA Event - Active Participant Source UserID sourceUserID = GetSourceUserID(); //ATNA Event - Active Participant Destination UserID destinationUserID = GetDestinationUserID(); xmlDocRequest = new XmlDocument(); xmlDocRequest.Load(input.GetReaderAtBodyContents()); xmlDocResponse = objStoredQueryLogic.RegistryStoredQuery(xmlDocRequest, out atnaParameterValues); //ATNA eventOutcomeIndicator = atnaParameterValues["$EventIdentification.EventOutcomeIndicator$"]; xdsPatientID = atnaParameterValues["$XDSPatient$"]; adHocQueryElementXml = atnaParameterValues["$AdhocQuery$"]; } catch (System.ServiceModel.ServerTooBusyException serverTooBusyException) { objRegistryLogic.CreateRegistryLogEntry(xmlDocRequest.InnerXml, GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, DateTime.Now); xmlDocResponse = CommonUtility.ConstructRegistryErrorResponse(GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, string.Empty, serverTooBusyException.Message, GlobalValues.CONST_REGISTRYERROR_CODE_XDSRegistryTooBusyException, GlobalValues.CONST_SEVERITY_TYPE_ERROR, string.Empty); //ATNA Event Failure Indicator eventOutcomeIndicator = "8"; } catch (TimeoutException timeoutException) { objRegistryLogic.CreateRegistryLogEntry(xmlDocRequest.InnerXml, GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, DateTime.Now); xmlDocResponse = CommonUtility.ConstructRegistryErrorResponse(GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, string.Empty, timeoutException.Message, GlobalValues.CONST_ERROR_CODE_TimeOut, GlobalValues.CONST_SEVERITY_TYPE_ERROR, string.Empty); //ATNA Event Failure Indicator eventOutcomeIndicator = "8"; } catch (System.ServiceModel.Security.SecurityAccessDeniedException AuthorizationException) { objRegistryLogic.CreateRegistryLogEntry(xmlDocRequest.InnerXml, GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, DateTime.Now); xmlDocResponse = CommonUtility.ConstructRegistryErrorResponse(GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, string.Empty, AuthorizationException.Message, GlobalValues.CONST_ERROR_CODE_XDSAuthorizationException, GlobalValues.CONST_SEVERITY_TYPE_ERROR, string.Empty); //ATNA Event Failure Indicator eventOutcomeIndicator = "8"; } catch (Exception ex) { //Log Error Message objRegistryLogic.CreateRegistryLogEntry(xmlDocRequest.InnerXml, GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, DateTime.Now); //Generate Error Message xmlDocResponse = CommonUtility.ConstructRegistryErrorResponse(GlobalValues.CONST_RESPONSE_STATUS_TYPE_FAILURE, string.Empty, ex.Message, GlobalValues.CONST_REGISTRYERROR_CODE_XDSRegistryError, GlobalValues.CONST_SEVERITY_TYPE_ERROR, string.Empty); //ATNA Event Failure Indicator eventOutcomeIndicator = "8"; } //Record ATNA Event objStoredQueryLogic.ProcessRegistryStoredQueryATNAEvent(sourceUserID, destinationUserID, xdsPatientID, adHocQueryElementXml, eventOutcomeIndicator); //Create Soap Message msgResult = Message.CreateMessage(input.Headers.MessageVersion, GlobalValues.CONST_ACTION_RegistryStoredQueryResponse, new XmlNodeReader(xmlDocResponse)); return(msgResult); }