Esempio n. 1
0
        public int CreateDiagnosis(DiagnosisModel model)
        {
            var repo = new DiagnosisRepository();
            var dataModel = new HealthInformationProgram.Data.Tables.lkup_diag();

            dataModel.diag_id = Convert.ToDecimal(model.DiagnosisId);
            dataModel.diag_descn = model.DiagnosisDescription;
            dataModel.diag_stat = model.DiagnosisStatus;
            dataModel.diag_abrvn = model.DiagnosisAbbreviation;
            dataModel.icd_cd = model.IcdCode;
            dataModel.user_intrfc_sort_ord = Convert.ToDecimal(model.SortOrder);
            dataModel.diag_strt_eff_dt = Convert.ToDateTime(model.DiagnosisEffectiveStartDate);
            dataModel.diag_end_eff_dt = Convert.ToDateTime(model.DiagnosisEffectiveEndDate);
            dataModel.rec_creat_dt = DateTime.Now;
            dataModel.rec_creat_user_id_cd = model.CreatedBy;
            dataModel.rec_updt_dt = DateTime.Now;
            dataModel.rec_updt_user_id_cd = model.UpdatedBy;

            try
            {

                var returnCode = repo.CreateDiagnosis(dataModel);
                return returnCode;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public DiagnosisModel GetDiagnosis(decimal id)
        {
            var repo = new DiagnosisRepository();
            var item = repo.GetDiagnosis(id);

            var diagView = new DiagnosisModel();
            diagView.DiagnosisId = GetDataValue(item.diag_id);
            diagView.DiagnosisStatus = GetDataValue(item.diag_stat);
            diagView.DiagnosisAbbreviation = GetDataValue(item.diag_abrvn);
            diagView.DiagnosisDescription = GetDataValue(item.diag_descn);
            diagView.SortOrder = GetDataValue(item.user_intrfc_sort_ord);
            diagView.IcdCode = GetDataValue(item.icd_cd);
            diagView.DiagnosisEffectiveStartDate = GetDataValue(item.diag_strt_eff_dt);
            diagView.DiagnosisEffectiveEndDate = GetDataValue(item.diag_end_eff_dt);
            diagView.CreateDate = GetDataValue(item.rec_creat_dt);
            diagView.CreatedBy = GetDataValue(item.rec_creat_user_id_cd);
            diagView.UpdateDate = GetDataValue(item.rec_updt_dt);
            diagView.UpdatedBy = GetDataValue(item.rec_updt_user_id_cd);

            return diagView;
        }
Esempio n. 3
0
        public DiagnosisModel GetDiagnosis(string id)
        {
            var repo = new DiagnosisRepository();
            var item = repo.GetDiagnosis(Convert.ToDecimal(id));

            var diagView = new DiagnosisModel();
            diagView.DiagnosisId = item.diag_id.ToString();
            diagView.DiagnosisStatus = item.diag_stat.ToString();
            diagView.DiagnosisAbbreviation = item.diag_abrvn.ToString();
            diagView.SortOrder = item.user_intrfc_sort_ord.ToString();
            diagView.IcdCode = item.icd_cd.ToString();
            diagView.DiagnosisEffectiveStartDate = item.diag_strt_eff_dt.ToString();
            diagView.DiagnosisEffectiveEndDate = item.diag_end_eff_dt.ToString();
            diagView.CreateDate = item.rec_creat_dt.ToString();
            diagView.CreatedBy = item.rec_creat_user_id_cd.ToString();
            diagView.UpdateDate = item.rec_updt_dt.ToString();
            diagView.UpdatedBy = item.rec_updt_user_id_cd.ToString();

            return diagView;
        }
Esempio n. 4
0
        public List<DiagnosisModel> GetAllDiagnosis()
        {
            var diagnosisList = new List<DiagnosisModel>();
            var repo = new HealthInformationProgram.Data.Repositories.DiagnosisRepository();
            try
            {
                var dataList = repo.GetAll();
                foreach (var item in dataList)
                {
                    var diagView = new DiagnosisModel();
                    diagView.DiagnosisId = GetDataValue(item.diag_id);
                    diagView.DiagnosisDescription = GetDataValue(item.diag_descn);
                    diagView.DiagnosisStatus = GetDataValue(item.diag_stat);
                    diagView.DiagnosisAbbreviation = GetDataValue(item.diag_abrvn);
                    diagView.IcdCode = GetDataValue(item.icd_cd);
                    diagView.SortOrder = GetDataValue(item.user_intrfc_sort_ord);
                    diagView.DiagnosisEffectiveStartDate = item.diag_strt_eff_dt.ToString();
                    diagView.DiagnosisEffectiveEndDate = item.diag_end_eff_dt.ToString();
                    diagView.CreateDate = item.rec_creat_dt.ToString();
                    diagView.CreatedBy = GetDataValue(item.rec_creat_user_id_cd);
                    diagView.UpdateDate = item.rec_updt_dt.ToString();
                    diagView.UpdatedBy = GetDataValue(item.rec_updt_user_id_cd);

                    diagnosisList.Add(diagView);

                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return diagnosisList;
        }