Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="patientId">patient id</param>
        /// <returns></returns>
        public static PatientAllergyBE GetPatientAllergy(int patientId)
        {
            GetPatientAllergyReq req = new GetPatientAllergyReq();

            req.BusinessData.PatientId = patientId;

            req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString();
            req.ContextInformation.AppId  = Controller.CurrentHealthInstitution.HealthInstitutionId.ToString();
            GetPatientAllergyRes res = req.ExecuteService <GetPatientAllergyReq, GetPatientAllergyRes>(req);

            if (res.Error != null)
            {
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);
            }
            res.BusinessData.PatientId = patientId;
            return(res.BusinessData);
        }
Ejemplo n.º 2
0
        public void GetPatientAllergyRes_SetXml()
        {
            string strErrorResut = string.Empty;
            string xml = Fwk.HelperFunctions.FileFunctions.OpenTextFile(@"D:\Projects\pelsofthealth\trunk\src\Health.Test\GetPatientAllergyRes.txt");

            GetPatientAllergyRes res = new GetPatientAllergyRes();
            PatientAllergyBE wPatientAllergyBE = new PatientAllergyBE();

            //res.BusinessData = new Back.BE.PatientAllergyBE();
            res.BusinessData = null;
            string x = res.GetXml(); 
            try
            {
                res = (GetPatientAllergyRes)Fwk.HelperFunctions.SerializationFunctions.DeserializeFromXml(typeof(GetPatientAllergyRes),xml);
                res.SetXml(x);
                res.SetXml(xml);
            }
            catch (Exception e)
            {
                strErrorResut = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(e);
            }
            Assert.AreEqual<String>(strErrorResut, String.Empty, strErrorResut);
        }
Ejemplo n.º 3
0
        public void GetPatientAllergyRes_SetXml()
        {
            string strErrorResut = string.Empty;
            string xml           = Fwk.HelperFunctions.FileFunctions.OpenTextFile(@"D:\Projects\pelsofthealth\trunk\src\Health.Test\GetPatientAllergyRes.txt");

            GetPatientAllergyRes res = new GetPatientAllergyRes();
            PatientAllergyBE     wPatientAllergyBE = new PatientAllergyBE();

            //res.BusinessData = new Back.BE.PatientAllergyBE();
            res.BusinessData = null;
            string x = res.GetXml();

            try
            {
                res = (GetPatientAllergyRes)Fwk.HelperFunctions.SerializationFunctions.DeserializeFromXml(typeof(GetPatientAllergyRes), xml);
                res.SetXml(x);
                res.SetXml(xml);
            }
            catch (Exception e)
            {
                strErrorResut = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(e);
            }
            Assert.AreEqual <String>(strErrorResut, String.Empty, strErrorResut);
        }