public void Test_GetMedicationProfile_Service_NotFound()
        {
            var caseNumber = "Any_CaseNumber";

            var httpStatusCode = HttpStatusCode.NotFound;

            var localParser     = new RestParserSvc(restUri + @"invalidurl/", "CLIENT_SECRET", "CLIENT_ID", "PATHOSPCODE");
            var actualException = Assert.ThrowsException <AMException>(() => localParser.GetMedicationProfile(caseNumber));

            Assert.AreEqual(actualException.HttpStatusCode, httpStatusCode);
        }
        public void Test_GetMedicationProfile_Service_Unavailable()
        {
            var caseNumber = "Any_CaseNumber";

            var httpStatusCode = HttpStatusCode.ServiceUnavailable;

            var localParser     = new RestParserSvc("http://localhost:3181/pms-asa/invalidurl/", "CLIENT_SECRET", "CLIENT_ID", "PATHOSPCODE");
            var actualException = Assert.ThrowsException <AMException>(() => localParser.GetMedicationProfile(caseNumber));

            Assert.AreEqual(actualException.HttpStatusCode, httpStatusCode);
        }
        public void Test_GetMedicationProfile_Invalid_PATHOSPCODE()
        {
            var caseNumber  = "Any_CaseNumber";
            var localParser = new RestParserSvc(restUri, "CLIENT_SECRET", "CLIENT_ID", "INVALID_PATHOSPCODE");

            var actualProfile = localParser.GetMedicationProfile(caseNumber);

            Assert.IsNotNull(actualProfile);
            Assert.IsNull(actualProfile.MedProfileId);
            Assert.IsNull(actualProfile.CaseNum);
            Assert.IsNull(actualProfile.MedProfileMoItems);
        }
        public void Test_GetAlertProfile_Service_Unavailable()
        {
            var alertInput = new AlertInputParm {
            };

            var httpStatusCode = HttpStatusCode.ServiceUnavailable;

            var localParser     = new RestParserSvc("http://localhost:3181/pms-asa/invalidurl/", "CLIENT_SECRET", "CLIENT_ID", "PATHOSPCODE");
            var actualException = Assert.ThrowsException <AMException>(() => localParser.GetAlertProfile(alertInput));

            Assert.AreEqual(actualException.HttpStatusCode, httpStatusCode);
        }
        public void Test_GetAlertProfile_Service_NotFound()
        {
            var alertInput = new AlertInputParm {
            };

            var httpStatusCode = HttpStatusCode.NotFound;

            var localParser     = new RestParserSvc(restUri + @"invalidurl/", "CLIENT_SECRET", "CLIENT_ID", "PATHOSPCODE");
            var actualException = Assert.ThrowsException <AMException>(() => localParser.GetAlertProfile(alertInput));

            Assert.AreEqual(actualException.HttpStatusCode, httpStatusCode);
        }
        public void Test_GetMedicationProfile_Invalid_Client_Secret()
        {
            var caseNumber = "INVALID_CLIENT_SECRET";

            var errorMessage   = "Unauthorized";
            var httpStatusCode = HttpStatusCode.Unauthorized;

            var localParser = new RestParserSvc(restUri, "INVALID_CLIENT_SECRET", "CLIENT_ID", "PATHOSPCODE");

            var actualException = Assert.ThrowsException <AMException>(() => localParser.GetMedicationProfile(caseNumber));

            Assert.AreEqual(actualException.HttpStatusCode, httpStatusCode);
            Assert.AreEqual(actualException.Message, errorMessage);
        }
        public void Test_GetAlertProfile_Invalid_Client_Secret()
        {
            var alertInput = new AlertInputParm {
                PatientInfo = new PatientInfo {
                    Hkid = "INVALID_CLIENT_SECRET"
                }
            };
            var errorMessage   = "Unauthorized";
            var httpStatusCode = HttpStatusCode.Unauthorized;

            var localParser = new RestParserSvc(restUri, "INVALID_CLIENT_SECRET", "CLIENT_ID", "PATHOSPCODE");

            var actualException = Assert.ThrowsException <AMException>(() => localParser.GetAlertProfile(alertInput));

            Assert.AreEqual(actualException.HttpStatusCode, httpStatusCode);
            Assert.AreEqual(actualException.Message, errorMessage);
        }
        private void Initialize()
        {
            var soapService = new SoapParserSvc(Global.DrugMasterSoapUrl, Global.PreParationSoapUrl, Global.HospitalCode);
            var soapWSEService = new SoapWSEParserSvc(Global.PatientEnquirySoapUrl, Global.UserName, Global.Password, Global.HospitalCode);
            var restService = new RestParserSvc(Global.ProfileRestUrl, Global.ClientSecret, Global.ClientId, Global.HospitalCode);

            parser = new HL7MessageParser_NTEC(soapService, soapWSEService, restService);

            scintillaPatient.FormatStyle(StyleType.Xml);
            scintillaProfiles.FormatJsonStyle();
            scintillaAlerts.FormatJsonStyle();

            scintillaMdsCheckRes.FormatJsonStyle();
            scintillaMdsCheckReq.FormatStyle(StyleType.Xml);

            scintillaDrugMdsPropertyHqReq.FormatStyle(StyleType.Xml);
            scintillaDrugMdsPropertyHqRes.FormatStyle(StyleType.Xml);

            scintillaDrugPreparationReq.FormatStyle(StyleType.Xml);
            scintillaDrugPreparationRes.FormatStyle(StyleType.Xml);
        }
Exemplo n.º 9
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            var soapWSEService = new SoapWSEParserSvc(Global.PatientEnquirySoapUrl, Global.UserName, Global.Password, Global.HospitalCode);

            var soapService = new SoapParserSvc(Global.DrugMasterSoapUrl, Global.PreParationSoapUrl, Global.HospitalCode);


            var restService = new RestParserSvc(Global.ProfileRestUrl, Global.ClientSecret, Global.ClientId, Global.HospitalCode);

            var hl7messageParser = new HL7MessageParser_NTEC(soapService, soapWSEService, restService);

            TabControl tc = new TabControl {
                Dock = DockStyle.Fill
            };

            tc.TabPages.Add(new TabPage {
                Name = "tbPatientDemographicControl", Text = "PatientDemographic"
            });
            tc.TabPages["tbPatientDemographicControl"].Controls.Add(new PatientDemographicControl {
                Dock = DockStyle.Fill
            });

            tc.TabPages.Add(new TabPage {
                Name = "tbMedicationProfileControl", Text = "MedicationProfile"
            });
            tc.TabPages["tbMedicationProfileControl"].Controls.Add(new MedicationProfileControl {
                Dock = DockStyle.Fill
            });

            tc.TabPages.Add(new TabPage {
                Name = "tbAlertProfileControl", Text = "AlertProfile"
            });
            tc.TabPages["tbAlertProfileControl"].Controls.Add(new AlertProfileParserControl {
                Dock = DockStyle.Fill
            });

            tc.TabPages.Add(new TabPage {
                Name = "tbDrugMasterControl", Text = "DrugMaster"
            });
            tc.TabPages["tbDrugMasterControl"].Controls.Add(new DrugMasterControl(this)
            {
                Dock = DockStyle.Fill
            });

            tc.TabPages.Add(new TabPage {
                Name = "tbMDSCheckControl", Text = "MDSChecker"
            });
            tc.TabPages["tbMDSCheckControl"].Controls.Add(new MDSCheckControl(this)
            {
                Dock = DockStyle.Fill
            });


            tc.TabPages.Add(new TabPage {
                Name = "tbFullWorkFlowControl", Text = "Full Work Flow"
            });
            tc.TabPages["tbFullWorkFlowControl"].Controls.Add(new FullWorkFlowControl(this)
            {
                Dock = DockStyle.Fill
            });

            this.Controls.Add(tc);
            this.Controls.Add(this.menuStrip1);

            Global.IsDirty = false;
        }