public int CreateSupplementalDiagnosisCat(lkup_splmtl_diag_cat entity)
        {
            try
            {

                using ( var ctx = new ClinicDataContext(connString) )
                {
                    IdentityInsertOn<lkup_splmtl_diag_cat>(ctx, entity);
                    ctx.Entry(entity).State = System.Data.Entity.EntityState.Added;
                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( DbEntityValidationException ex )
            {
                throw ex;
            }
            catch ( EntityException ex )
            {
                throw ex;
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #2
0
        public int Update(raw_visit entity)
        {
            try
            {
                using ( var ctx = new ClinicDataContext(connString) )
                {
                    var rawVisit = ctx.raw_visit.FirstOrDefault(x => x.visit_uuid == entity.visit_uuid);
                    if ( rawVisit == null )
                    {
                        throw new Exception("Record doesn't exist and cannot be updated");
                    }
                    rawVisit.visit_uuid = entity.visit_uuid;
                    rawVisit.visit_stat = entity.visit_stat;
                    rawVisit.visit_json = entity.visit_json;
                    rawVisit.err_cd = entity.err_cd;
                    rawVisit.rec_updt_user_id_cd = entity.rec_updt_user_id_cd;
                    rawVisit.rec_updt_dt = entity.rec_updt_dt;

                    ctx.Entry(rawVisit).State = System.Data.Entity.EntityState.Modified;

                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #3
0
        public int Update(lkup_bnfcry entity)
        {
            try
            {
                using ( var ctx = new ClinicDataContext(connString) )
                {
                    var lookupBeneficiary = ctx.lkup_bnfcry.FirstOrDefault(x => x.bnfcry_id == entity.bnfcry_id);
                    if (lookupBeneficiary == null )
                    {
                        throw new Exception("Record doesn't exist and cannot be updated");
                    }
                    lookupBeneficiary.bnfcry_id = entity.bnfcry_id;
                    lookupBeneficiary.rec_updt_dt = entity.rec_updt_dt;
                    lookupBeneficiary.rec_updt_user_id_cd = entity.rec_updt_user_id_cd;

                    ctx.Entry(lookupBeneficiary).State = System.Data.Entity.EntityState.Modified;

                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #4
0
        public int CreateFacility(lkup_faclty entity)
        {
            try
            {

                using ( var ctx = new ClinicDataContext(connString) )
                {
                    IdentityInsertOn<lkup_faclty>(ctx, entity);
                    ctx.Entry(entity).State = System.Data.Entity.EntityState.Added;
                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( DbEntityValidationException ex )
            {
                throw ex;
            }
            catch ( EntityException ex )
            {
                throw ex;
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #5
0
        public int CreateGender(lkup_gndr entity)
        {
            try
            {

                using ( var ctx = new ClinicDataContext(connString) )
                {
                    ctx.lkup_gndr.Add(entity);
                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #6
0
        public int CreateRevisitConstant(lkup_rvisit entity)
        {
            try
            {

                using ( var ctx = new ClinicDataContext(connString) )
                {
                    ctx.lkup_rvisit.Add(entity);
                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #7
0
        public decimal CreateOfficeDiagnosis(ov_diag entity)
        {
            try
            {

                using ( var ctx = new ClinicDataContext(connString) )
                {
                    ctx.ov_diag.Add(entity);
                    int result = ctx.SaveChanges();

                    return entity.ov_id;
                }
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #8
0
        public int CreateBeneficiaryType(lkup_bnfcry entity)
        {
            try
            {

                using ( var ctx = new ClinicDataContext(connString) )
                {
                    ctx.lkup_bnfcry.Add(entity);
                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #9
0
        public int CreateCurrentSystemInfo(curr_sys_info entity)
        {
            try
            {

                using ( var ctx = new ClinicDataContext(connString) )
                {
                    ctx.curr_sys_info.Add(entity);
                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #10
0
        public decimal? CreateOfficeVisit(ov entity)
        {
            try
            {

                using (var ctx = new ClinicDataContext(connString))
                {
                    ctx.ovs.Add(entity);
                    int result = ctx.SaveChanges();

                    return entity.ov_id;
                }
            }
            catch (DbEntityValidationException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #11
0
        public int CreateDiagnosis(lkup_diag entity)
        {
            try
            {

                using (var ctx = new ClinicDataContext(connString))
                {

                    IdentityInsertOn<lkup_diag>(ctx, entity);
                    ctx.Entry(entity).State = System.Data.Entity.EntityState.Added;
                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch (DbEntityValidationException ex)
            {
                string returnerror = string.Empty;
                foreach (var error in ex.EntityValidationErrors)
                {
                    foreach (var ve in error.ValidationErrors)
                    {
                        returnerror += string.Format("Error on property {0}, message {1}", ve.PropertyName, ve.ErrorMessage);
                    }
                }

                throw new DbEntityValidationException(returnerror);
            }
            catch (EntityException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #12
0
        public int Update(ov_diag entity)
        {
            try
            {
                using ( var ctx = new ClinicDataContext(connString) )
                {
                    var officeVisitDiagnonsis = ctx.ov_diag.FirstOrDefault(x => x.ov_diag_id == entity.ov_diag_id);
                    if (officeVisitDiagnonsis == null )
                    {
                        throw new Exception("Record doesn't exist and cannot be updated");
                    }
                    officeVisitDiagnonsis.ov_diag_id = entity.ov_diag_id;
                    officeVisitDiagnonsis.ov_id = entity.ov_id;
                    officeVisitDiagnonsis.splmtl_diag_id = entity.splmtl_diag_id;
                    officeVisitDiagnonsis.diag_id = entity.diag_id;
                    officeVisitDiagnonsis.cntct_trmnt_cnt = entity.cntct_trmnt_cnt;
                    officeVisitDiagnonsis.splmtl_diag_cat_id = entity.splmtl_diag_cat_id;
                    officeVisitDiagnonsis.oth_diag_descn = entity.oth_diag_descn;
                    officeVisitDiagnonsis.oth_splmtl_diag_descn = entity.oth_splmtl_diag_descn;

                    officeVisitDiagnonsis.rec_updt_dt = entity.rec_updt_dt;
                    officeVisitDiagnonsis.rec_updt_user_id_cd = entity.rec_updt_user_id_cd;

                    ctx.Entry(officeVisitDiagnonsis).State = System.Data.Entity.EntityState.Modified;

                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #13
0
        public int Update(ov entity)
        {
            try
            {
                using ( var ctx = new ClinicDataContext(connString) )
                {
                    var officeVisit = ctx.ovs.FirstOrDefault(x => x.ov_id == entity.ov_id);
                    if ( officeVisit == null )
                    {
                        throw new Exception("Record doesn't exist and cannot be updated");
                    }
                    officeVisit.faclty_id = entity.faclty_id;
                    officeVisit.gndr_id = entity.gndr_id;
                    officeVisit.bnfcry_id = entity.bnfcry_id;
                    officeVisit.opd_id = entity.opd_id;
                    officeVisit.infnt_age_mos = entity.infnt_age_mos;
                    officeVisit.faclty_hw_invtry_id = entity.faclty_hw_invtry_id;

                    officeVisit.dt_of_visit = entity.dt_of_visit;
                    officeVisit.staff_mbr_name = entity.staff_mbr_name;
                    officeVisit.refl_in_ind = entity.refl_in_ind;
                    officeVisit.refl_out_ind = entity.refl_out_ind;
                    officeVisit.refl_out_ind = entity.refl_out_ind;
                    officeVisit.rvisit_id = entity.rvisit_id;
                    officeVisit.rec_creat_dt = entity.rec_creat_dt;
                    officeVisit.refl_out_ind = entity.refl_out_ind;
                    officeVisit.rec_updt_dt = entity.rec_updt_dt;
                    officeVisit.rec_updt_user_id_cd = entity.rec_updt_user_id_cd;

                    ctx.Entry(officeVisit).State = System.Data.Entity.EntityState.Modified;

                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #14
0
        public int Update(lkup_faclty entity)
        {
            try
            {
                using ( var ctx = new ClinicDataContext(connString) )
                {
                    var currentFacility = ctx.lkup_faclty.FirstOrDefault(x => x.faclty_id == entity.faclty_id);
                    if ( currentFacility == null )
                    {
                        throw new Exception("Record doesn't exist and cannot be updated");
                    }
                    currentFacility.faclty_id = entity.faclty_id;
                    currentFacility.faclty_stat = entity.faclty_stat;
                    currentFacility.hlth_care_faclty = entity.hlth_care_faclty;
                    currentFacility.cntry = entity.cntry;
                    currentFacility.faclty_strt_eff_dt = entity.faclty_strt_eff_dt;
                    currentFacility.faclty_end_eff_dt = entity.faclty_end_eff_dt;
                    currentFacility.hlth_care_faclty_lvl = entity.hlth_care_faclty_lvl;
                    currentFacility.hlth_coordtr = entity.hlth_coordtr;
                    currentFacility.lattd = entity.lattd;
                    currentFacility.longtd = entity.longtd;
                    currentFacility.orgzn_id = entity.orgzn_id;
                    currentFacility.rec_updt_dt = entity.rec_updt_dt;
                    currentFacility.rec_updt_user_id_cd = entity.rec_updt_user_id_cd;
                    currentFacility.rgn = entity.rgn;
                    currentFacility.setlmt = entity.setlmt;
                    currentFacility.user_intrfc_sort_ord = entity.user_intrfc_sort_ord;

                    ctx.Entry(currentFacility).State = System.Data.Entity.EntityState.Modified;

                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( DbEntityValidationException ex )
            {
                throw ex;
            }
            catch ( EntityException ex )
            {
                throw ex;
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #15
0
        public int Update(lkup_rvisit entity)
        {
            try
            {
                using ( var ctx = new ClinicDataContext(connString) )
                {
                    var lookupRevisit = new lkup_rvisit();
                    lookupRevisit = ctx.lkup_rvisit.FirstOrDefault(x => x.rvisit_id == entity.rvisit_id);
                    if ( lookupRevisit == null )
                    {
                        throw new Exception("Record doesn't exist and cannot be updated");
                    }
                    // lookupRevisit.rvisit_id = entity.rvisit_id;
                    lookupRevisit.rvisit_descn = entity.rvisit_descn;
                    lookupRevisit.rec_updt_dt = entity.rec_updt_dt;
                    lookupRevisit.rec_updt_user_id_cd = entity.rec_updt_user_id_cd;
                    lookupRevisit.rvisit_ind = entity.rvisit_ind;

                    ctx.Entry(lookupRevisit).State = System.Data.Entity.EntityState.Modified;

                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( DbEntityValidationException ex )
            {
                throw ex;
            }
            catch ( EntityException ex )
            {
                throw ex;
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #16
0
        public int Update(lkup_orgzn entity)
        {
            try
            {
                using ( var ctx = new ClinicDataContext(connString) )
                {
                    var lookupOrganization = ctx.lkup_orgzn.FirstOrDefault(x => x.orgzn_id == entity.orgzn_id);
                    if ( lookupOrganization == null )
                    {
                        throw new Exception("Record doesn't exist and cannot be updated");
                    }
                    lookupOrganization.orgzn_id = entity.orgzn_id;
                    lookupOrganization.orgzn_stat = entity. orgzn_stat;
                    lookupOrganization.user_intrfc_sort_ord = entity.user_intrfc_sort_ord;
                    lookupOrganization.rec_updt_user_id_cd = entity.rec_updt_user_id_cd;
                    lookupOrganization.rec_updt_dt = entity.rec_updt_dt;
                    lookupOrganization.orgzn_strt_eff_dt = entity.orgzn_strt_eff_dt;
                    lookupOrganization.orgzn_end_eff_dt = entity.orgzn_end_eff_dt;

                    ctx.Entry(lookupOrganization).State = System.Data.Entity.EntityState.Modified;

                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( DbEntityValidationException ex )
            {
                throw ex;
            }
            catch ( EntityException ex )
            {
                throw ex;
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #17
0
        public int Update(lkup_diag entity)
        {
            try
            {
                using (var ctx = new ClinicDataContext(connString))
                {
                    var lookupDiagnosis = ctx.lkup_diag.FirstOrDefault(x => x.diag_id == entity.diag_id);
                    if (lookupDiagnosis == null)
                    {
                        throw new Exception("Record doesn't exist and cannot be updated");
                    }
                    lookupDiagnosis.diag_id = entity.diag_id;
                    lookupDiagnosis.diag_descn = entity.diag_descn;
                    lookupDiagnosis.diag_abrvn = entity.diag_abrvn;
                    lookupDiagnosis.rec_updt_user_id_cd = entity.rec_updt_user_id_cd;
                    lookupDiagnosis.rec_updt_dt = entity.rec_updt_dt;
                    lookupDiagnosis.user_intrfc_sort_ord = entity.user_intrfc_sort_ord;
                    lookupDiagnosis.diag_stat = entity.diag_stat;
                    lookupDiagnosis.diag_strt_eff_dt = entity.diag_strt_eff_dt;
                    lookupDiagnosis.diag_end_eff_dt = entity.diag_end_eff_dt;

                    ctx.Entry(lookupDiagnosis).State = System.Data.Entity.EntityState.Modified;

                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #18
0
        public int UpdateFacilityHardware(faclty_hw_invtry entity)
        {
            try
            {

                using ( var ctx = new ClinicDataContext(connString) )
                {
                    var currentEntity = ctx.faclty_hw_invtry.FirstOrDefault(f => f.faclty_hw_invtry_id == entity.faclty_hw_invtry_id);
                    if ( currentEntity == null )
                    {
                        throw new Exception("Record doesn't exist and cannot be updated");
                    }

                    currentEntity.faclty_id = entity.faclty_id;
                    currentEntity.aplctn_vrsn = entity.aplctn_vrsn;
                    currentEntity.hw_stat = entity.hw_stat;
                    currentEntity.itm_descn = entity.itm_descn;
                    currentEntity.mac_addr = entity.mac_addr;
                    currentEntity.rec_updt_dt = entity.rec_updt_dt;
                    currentEntity.rec_updt_user_id_cd = entity.rec_updt_user_id_cd;

                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( DbEntityValidationException ex )
            {
                throw ex;
            }
            catch ( EntityException ex )
            {
                throw ex;
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #19
0
        public int Update(lkup_splmtl_diag_cat entity)
        {
            try
            {
                using ( var ctx = new ClinicDataContext(connString) )
                {
                    var supplementalDiagnosisCategories = ctx.lkup_splmtl_diag_cat.FirstOrDefault(x => x.splmtl_diag_cat_id == entity.splmtl_diag_cat_id);
                    if ( supplementalDiagnosisCategories == null )
                    {
                        throw new Exception("Record doesn't exist and cannot be updated");
                    }
                    supplementalDiagnosisCategories.splmtl_diag_cat_id = entity.splmtl_diag_cat_id;
                    supplementalDiagnosisCategories.splmtl_diag_cat = entity.splmtl_diag_cat;
                    supplementalDiagnosisCategories.user_intrfc_sort_ord = entity.user_intrfc_sort_ord;
                    supplementalDiagnosisCategories.splmtl_diag_cat_stat = entity.splmtl_diag_cat_stat;
                    supplementalDiagnosisCategories.splmtl_diag_cat_strt_eff_dt = entity.splmtl_diag_cat_strt_eff_dt;
                    supplementalDiagnosisCategories.splmtl_diag_cat_end_eff_dt = entity.splmtl_diag_cat_end_eff_dt;

                    supplementalDiagnosisCategories.rec_updt_user_id_cd = entity.rec_updt_user_id_cd;
                    supplementalDiagnosisCategories.rec_updt_dt = entity.rec_updt_dt;

                    ctx.Entry(supplementalDiagnosisCategories).State = System.Data.Entity.EntityState.Modified;

                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( DbEntityValidationException ex )
            {
                throw ex;
            }
            catch ( EntityException ex )
            {
                throw ex;
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
コード例 #20
0
        public int Update(curr_sys_info entity)
        {
            try
            {
                using ( var ctx = new ClinicDataContext(connString) )
                {
                    var currentSystem = ctx.curr_sys_info.FirstOrDefault(x => x.curr_sys_id == entity.curr_sys_id);
                    if ( currentSystem == null )
                    {
                        throw new Exception("Record doesn't exist and cannot be updated");
                    }
                    currentSystem.curr_sys_id = entity.curr_sys_id;
                    currentSystem.itm_vrsn = entity.itm_vrsn;
                    currentSystem.itm_descn = entity.itm_descn;
                    currentSystem.dt_of_rlse = entity.dt_of_rlse;

                    ctx.Entry(currentSystem).State = System.Data.Entity.EntityState.Modified;

                    int result = ctx.SaveChanges();

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