コード例 #1
0
        public List<Models.OfficeVisitModel> GetOfficeVisits()
        {
            var officeVisits = new List<Models.OfficeVisitModel>();
            var visitDiag = new OfficeVisitDiagnosisData();
            var beneficiaryData = new BeneficiaryData();
            var dataList = _officeVisitRepo.GetAll();
            var genderData = new GenderData();
            var facilityHardwareData = new FacilityHardwareData();
            var facilityData = new FacilityData();
            var revisitData = new RevisitData();

            foreach (var item in dataList)
            {
                var visit = new Models.OfficeVisitModel();
                visit.OfficeVisitId = item.ov_id.Value;
                visit.OpdId = item.opd_id;
                visit.BeneficiaryId = item.bnfcry_id;
                visit.BeneficiaryName = beneficiaryData.Get(item.bnfcry_id).BeneficiaryType;
                visit.FacililtyName = facilityData.GetFacility(item.faclty_id).HealthCareFacility;
                visit.FacilityId = item.faclty_id;
                visit.GenderId = item.gndr_id;
                visit.GenderName = genderData.Get(item.gndr_id).GenderDescription;
                visit.OfficeVisitDiagnosis = visitDiag.GetByVisit(item.ov_id.Value);
                visit.Age = item.infnt_age_mos;
                visit.FacilityHardwareId = item.faclty_hw_invtry_id;
                visit.RevisitId = item.rvisit_id;
                visit.RevisitName = revisitData.GetRevisit(item.rvisit_id).Description;
                visit.StaffMemberName = item.staff_mbr_name;
                visit.VisitDate = item.dt_of_visit;
                visit.CreateDate = item.rec_creat_dt.ToShortDateString();
                visit.CreatedBy = item.rec_creat_user_id_cd;
                visit.UpdateDate = item.rec_updt_dt.ToShortDateString();
                visit.UpdatedBy = item.rec_updt_user_id_cd;

                officeVisits.Add(visit);
            }

            return officeVisits;
        }
コード例 #2
0
        public Models.OfficeVisitModel GetVisit(decimal id)
        {
            var beneficiaryData = new BeneficiaryData();
            var genderData = new GenderData();
            var visitDiag = new OfficeVisitDiagnosisData();
            var item = _officeVisitRepo.GetOfficeVisit(id);
            Models.OfficeVisitModel visit = null;
            var facilityHardwareData = new FacilityHardwareData();
            var facilityData = new FacilityData();
            var revisitData = new RevisitData();

            if (item != null)
            {
                visit = new Models.OfficeVisitModel();

                visit.OfficeVisitId = item.ov_id.Value;
                visit.OpdId = item.opd_id;
                visit.StaffMemberName = item.staff_mbr_name;
                visit.BeneficiaryId = item.bnfcry_id;
                visit.BeneficiaryName = beneficiaryData.Get(item.bnfcry_id).BeneficiaryType;
                visit.FacililtyName = facilityData.GetFacility(item.faclty_id).HealthCareFacility;
                visit.FacilityId = item.faclty_id;
                visit.GenderId = item.gndr_id;
                visit.GenderName = genderData.Get(item.gndr_id).GenderDescription;
                visit.OfficeVisitDiagnosis = visitDiag.GetByVisit(item.ov_id.Value);
                visit.Age = item.infnt_age_mos;
                visit.RevisitId = item.rvisit_id;
                visit.RevisitName = revisitData.GetRevisit(item.rvisit_id).Description;
                visit.VisitDate = item.dt_of_visit;
                visit.CreateDate = item.rec_creat_dt.ToShortDateString();
                visit.CreatedBy = item.rec_creat_user_id_cd;
                visit.UpdateDate = item.rec_updt_dt.ToShortDateString();
                visit.UpdatedBy = item.rec_updt_user_id_cd;
            }

            return visit;
        }
コード例 #3
0
        public OfficeVisitDiagnosisModel SaveOfficeVisitDiagnosis(OfficeVisitDiagnosisModel officeVisitDiagnosisModel)
        {
            OfficeVisitDiagnosisData officeVisitDiagnosisData = new OfficeVisitDiagnosisData();

            if (officeVisitDiagnosisModel.OfficeVisitDiagnosisId > 0)
            {
                officeVisitDiagnosisData.UpdateOfficeVisitDiagnosis(officeVisitDiagnosisModel);
            }
            else
            {
                officeVisitDiagnosisData.CreateOfficeVisitDiagnosis(officeVisitDiagnosisModel);
            }

            return officeVisitDiagnosisModel;
        }