Exemplo n.º 1
0
        public IEnumerable <PatientVM> GetPatientBCT(string search)
        {
            using (IDbConnection connection = mySqlConnection)
            {
                var data = new List <PatientVM>();
                var p    = new DynamicParameters();
                p.Add("@Search_Data", search);
                var patients = connection.QueryAsync <PatientData>("GetPatient", p, commandType: CommandType.StoredProcedure).Result.ToList();

                foreach (var pt in patients)
                {
                    var ptvm    = new PatientVM();
                    var patient = new BasePatientVM()
                    {
                        HN         = pt.HN,
                        TitleName  = pt.TitileName,
                        FirstName  = pt.FirstName,
                        MiddleName = pt.MiddleName,
                        LastName   = pt.LastName,
                        DOB        = pt.DOB,
                        SexCode    = pt.SexCode,
                        SexDesc    = pt.SexDesc,
                        IDCard     = pt.IDCard
                    };
                    ptvm.Patient = patient;
                    ptvm.SCT_HN  = pt.SCT_HN;

                    data.Add(ptvm);
                }

                return(data);
            }
        }
Exemplo n.º 2
0
        private PatientVM GetPatientBCTByHN(string hn)
        {
            try
            {
                using (IDbConnection connection = mySqlConnection)
                {
                    var p = new DynamicParameters();
                    p.Add("@Search_Data", hn);
                    var pt = connection.QueryAsync <PatientData>("GetPatient", p, commandType: CommandType.StoredProcedure).Result.FirstOrDefault();

                    var ptvm    = new PatientVM();
                    var patient = new BasePatientVM()
                    {
                        HN         = pt.HN,
                        TitleName  = pt.TitileName,
                        FirstName  = pt.FirstName,
                        MiddleName = pt.MiddleName,
                        LastName   = pt.LastName,
                        DOB        = pt.DOB,
                        SexCode    = pt.SexCode,
                        SexDesc    = pt.SexDesc,
                        IDCard     = pt.IDCard
                    };
                    ptvm.Patient = patient;
                    ptvm.SCT_HN  = pt.SCT_HN;

                    return(ptvm);
                }
            }
            catch (Exception)
            {
                return(new PatientVM());
            }
        }
Exemplo n.º 3
0
        public BasePatientVM GetPatientByHN(string hn)
        {
            var data = new BasePatientVM();

            using (IDbConnection connection = cacheConnection)
            {
                data = connection.QueryFirstOrDefaultAsync <BasePatientVM>(DBCacheQuery.GetPatientByHN(), new { PAPMI_No = hn }).Result;
            }

            return(data);
        }