示例#1
0
        private void btnStoredQueryExecute_Click(object sender, EventArgs e)
        {
            XmlDocument storedQueryRequest = new XmlDocument();

            storedQueryRequest.Load(txtStoredQueryFileName.Text);

            try
            {
                WCF.Message msgInput, msgOutput;

                msgInput = WCF.Message.CreateMessage(MESSAGE_VERSION
                                                     , STOREDQUERY_WSAACTION
                                                     , new XmlNodeReader(storedQueryRequest));
                msgOutput = WCF.Message.CreateMessage(MESSAGE_VERSION, "");

                XDSRegistry.XDSRegistryClient client = new XDSRegistry.XDSRegistryClient(GetRegistryEndPointName());
                msgOutput = client.RegistryStoredQuery(msgInput);

                XmlDictionaryReader rdr = msgOutput.GetReaderAtBodyContents();

                XmlDocument result = new XmlDocument();
                result.Load(rdr);

                rtbStoredQueryResult.Text = result.OuterXml;

                lblStoredQueryResult.Text = "SUCCESS";
            }
            catch (Exception ex)
            {
                rtbStoredQueryResult.Text = ex.ToString();

                lblStoredQueryResult.Text = "Failed!!!";
            }
        }
示例#2
0
        private void btnRExecute_Click(object sender, EventArgs e)
        {
            RDocumentMetadata.DocumentElement.InnerXml = (String.IsNullOrEmpty(txtRPatientID.Text)) ?
                                                         RDocumentMetadata.DocumentElement.InnerXml:
                                                         RDocumentMetadata.DocumentElement.InnerXml.Replace("$PatientId", txtRPatientID.Text.Replace("&", "&"));

            WCF.Message msgInput, msgOutput;
            msgInput = WCF.Message.CreateMessage(MESSAGE_VERSION
                                                 , REGISTERDOCUMENTSETB_WSAACTION
                                                 , new XmlNodeReader(RDocumentMetadata));
            msgOutput = WCF.Message.CreateMessage(MESSAGE_VERSION, "");

            XDSRegistry.XDSRegistryClient client = new XDSRegistry.XDSRegistryClient(GetRegistryEndPointName());

            msgOutput = client.RegisterDocumentSet(msgInput);

            XmlDictionaryReader rdr = msgOutput.GetReaderAtBodyContents();

            XmlDocument result = new XmlDocument();

            result.Load(rdr);

            XmlNode fault     = result.SelectSingleNode(@"//*[local-name()='Fault']");
            XmlNode errorList = result.SelectSingleNode(@"//*[local-name()='RegistryErrorList']");

            if (fault != null)
            {
                lblRegisterResult.Text  = "Error occurred when executing web service.";
                rtfRMetadatContent.Text = fault.OuterXml;
            }
            else
            {
                if (errorList != null)
                {
                    lblRegisterResult.Text  = "Transaction resulted in Error!";
                    rtfRMetadatContent.Text = result.OuterXml;
                }
                else
                {
                    lblRegisterResult.Text  = "Transaction succeded!";
                    rtfRMetadatContent.Text = result.OuterXml;
                }
            }
        }
示例#3
0
        private void btnPRDuplicatesResolvedExecute_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtPRDuplicatesResolved.Text))
            {
                MessageBox.Show("Please provide/select input xml file.");
                return;
            }



            try
            {
                XmlDocument xmlDocPatientRequest = new XmlDocument();

                xmlDocPatientRequest.Load(txtPRDuplicatesResolved.Text);

                WCF.Message msgInput, msgOutput;

                msgInput = WCF.Message.CreateMessage(MESSAGE_VERSION
                                                     , PATIENT_DUPLICATES_WSAACTION
                                                     , new XmlNodeReader(xmlDocPatientRequest));
                msgOutput = WCF.Message.CreateMessage(MESSAGE_VERSION, "");

                XDSRegistry.XDSRegistryClient client = new XDSRegistry.XDSRegistryClient(GetRegistryEndPointName());
                msgOutput = client.PatientRegistryDuplicatesResolved(msgInput);

                XmlDictionaryReader rdr = msgOutput.GetReaderAtBodyContents();

                XmlDocument result = new XmlDocument();
                result.Load(rdr);

                XmlNode fault     = result.SelectSingleNode(@"//*[local-name()='Fault']");
                XmlNode errorList = result.SelectSingleNode(@"//*[local-name()='RegistryErrorList']");

                if (fault != null)
                {
                    lblPRDuplicatesResolved.Text = "Error occurred when executing web service.";
                    rtbPRDuplicatesResolved.Text = fault.OuterXml;
                }
                else
                {
                    if (errorList != null)
                    {
                        lblPRDuplicatesResolved.Text = "Transaction resulted in Error!";
                        rtbPRDuplicatesResolved.Text = result.OuterXml;
                    }
                    else
                    {
                        lblPRDuplicatesResolved.Text = "Transaction succeded!";
                        rtbPRDuplicatesResolved.Text = result.OuterXml;
                    }
                }

                rtbPRDuplicatesResolved.Text = result.OuterXml;
                lblPRDuplicatesResolved.Text = "SUCCESS";
            }
            catch (Exception ex)
            {
                rtbPRDuplicatesResolved.Text = ex.ToString();
                lblPRDuplicatesResolved.Text = "Failed!!!";
            }
        }