private LoketResponse GetRegistrationPatientByPoliID(int poliID) { string _draw = Request.Form.Count > 0 ? Request.Form.GetValues("draw").FirstOrDefault() : string.Empty; string _start = Request.Form.Count > 0 ? Request.Form.GetValues("start").FirstOrDefault() : string.Empty; string _length = Request.Form.Count > 0 ? Request.Form.GetValues("length").FirstOrDefault() : string.Empty; string _sortColumn = Request.Form.Count > 0 ? Request.Form.GetValues("columns[" + Request.Form.GetValues("order[0][column]").FirstOrDefault() + "][name]").FirstOrDefault() : string.Empty; string _sortColumnDir = Request.Form.Count > 0 ? Request.Form.GetValues("order[0][dir]").FirstOrDefault() : string.Empty; string _searchValue = Request.Form.Count > 0 ? Request.Form.GetValues("search[value]").FirstOrDefault() : string.Empty; int _pageSize = string.IsNullOrEmpty(_length) ? 0 : Convert.ToInt32(_length); int _skip = string.IsNullOrEmpty(_start) ? 0 : Convert.ToInt32(_start); var request = new LoketRequest { Draw = _draw, SearchValue = _searchValue, SortColumn = _sortColumn, SortColumnDir = _sortColumnDir, PageSize = _pageSize, Skip = _skip }; var response = new LoketHandler(_unitOfWork).GetListData(request, poliID); return(response); }
public ActionResult GetRegistrationDataByPoliID(int poliId) { string _draw = Request.Form.Count > 0 ? Request.Form.GetValues("draw").FirstOrDefault() : string.Empty; string _start = Request.Form.Count > 0 ? Request.Form.GetValues("start").FirstOrDefault() : string.Empty; string _length = Request.Form.Count > 0 ? Request.Form.GetValues("length").FirstOrDefault() : string.Empty; string _sortColumn = Request.Form.Count > 0 ? Request.Form.GetValues("columns[" + Request.Form.GetValues("order[0][column]").FirstOrDefault() + "][name]").FirstOrDefault() : string.Empty; string _sortColumnDir = Request.Form.Count > 0 ? Request.Form.GetValues("order[0][dir]").FirstOrDefault() : string.Empty; string _searchValue = Request.Form.Count > 0 ? Request.Form.GetValues("search[value]").FirstOrDefault() : string.Empty; int _pageSize = string.IsNullOrEmpty(_length) ? 0 : Convert.ToInt32(_length); int _skip = string.IsNullOrEmpty(_start) ? 0 : Convert.ToInt32(_start); var request = new LoketRequest { Draw = _draw, SearchValue = _searchValue, SortColumn = _sortColumn, SortColumnDir = _sortColumnDir, PageSize = _pageSize, Skip = _skip }; var response = new LoketHandler(_unitOfWork).GetListData(request, poliId); return(Json(new { data = response.Data, recordsFiltered = response.RecordsFiltered, recordsTotal = response.RecordsTotal, draw = response.Draw, Status = response.Status }, JsonRequestBehavior.AllowGet)); }
public ActionResult Edit() { LoketResponse _response = new LoketResponse(); var request = new LoketRequest { Data = new LoketModel { Id = long.Parse(Request.QueryString["id"].ToString()) } }; LoketResponse resp = new LoketHandler(_unitOfWork).GetDetail(request); LoketModel _model = resp.Entity; _model.CurrentPoliID = GetUserPoliID(); ViewBag.Response = _response; ViewBag.PoliList = BindDropDownPoliList(_model.PoliFromID); ViewBag.PatientList = BindDropDownPatientList(); ViewBag.RegistrationTypeList = BindDropDownTypeList(); ViewBag.DoctorList = BindDropDownDoctorList(_model.PoliToID); ViewBag.PaymentTypeList = BindDropDownPaymentTypeList(); ViewBag.NecessityList = BindDropDownNecessityList(); return(View("Edit", _model)); }
private LoketResponse GetTodayRegistrationList() { var request = new LoketRequest(); var response = new LoketHandler(_unitOfWork).GetListData(request); return(response); }
public JsonResult SendForCalling(int id) { var response = new LoketResponse { Status = false }; var _loketModel = new LoketModel { Id = id }; var request = new LoketRequest { Data = _loketModel }; response = new LoketHandler(_unitOfWork).GetDetail(request); if (response != null) { var _callModel = new PanggilanPoliModel { PoliID = response.Entity.PoliToID, SortNumber = response.Entity.SortNumber, Status = CallStatusEnum.CallStatus.READY.ToString(), Account = Session["UserLogon"] == null ? new AccountModel() : (AccountModel)Session["UserLogon"], QueueCode = response.Entity.SortNumberCode }; var _requestCall = new LoketRequest { CallRequest = _callModel, }; response = new LoketResponse(); response = new LoketHandler(_unitOfWork).SendForCall(_requestCall); } return(Json(new { Status = response.Status, Message = response.Message }, JsonRequestBehavior.AllowGet)); }
public ActionResult FormExamine() { var id = Request.QueryString["id"]; if (id == null) { return(View("Index", "Home", null)); } var request = new LoketRequest { Data = new LoketModel { Id = long.Parse(id.ToString()) } }; LoketResponse resp = new LoketHandler(_unitOfWork).GetDetail(request); PoliExamineModel model = new PoliExamineModel(); try { model.LoketData = resp.Entity; model.PatientAge = CommonUtils.GetPatientAge(model.LoketData.PatientBirthDateStr); var necessityTypeList = GetGeneralMasterByType(Constants.MasterType.NECESSITY_TYPE); var paymentTypeList = GetGeneralMasterByType(Constants.MasterType.PAYMENT_TYPE); model.NecessityTypeStr = necessityTypeList.FirstOrDefault(x => x.Value == model.LoketData.NecessityType.ToString()).Text; model.PaymentTypeStr = paymentTypeList.FirstOrDefault(x => x.Value == model.LoketData.PaymentType.ToString()).Text; // get default services List <PoliService> poliServicelist = _unitOfWork.PoliServicesRepository.Get(x => x.PoliID == model.LoketData.PoliToID && x.RowStatus == 0).ToList(); foreach (var item in poliServicelist) { ServiceModel servModel = Mapper.Map <Service, ServiceModel>(item.Service); model.DefaultServiceList.Add(servModel); } // get form examine if any FormPreExamine formPreExamine = _unitOfWork.FormPreExamineRepository.GetFirstOrDefault(x => x.FormMedicalID == model.LoketData.FormMedicalID); if (formPreExamine != null) { model.PreExamineData = Mapper.Map <FormPreExamine, PreExamineModel>(formPreExamine); } // get form examine if any FormExamine formExamine = _unitOfWork.FormExamineRepository.GetFirstOrDefault(x => x.FormMedicalID == model.LoketData.FormMedicalID); if (formExamine != null) { model.ExamineData = Mapper.Map <FormExamine, FormExamineModel>(formExamine); if (model.ExamineData.ICDInformation != null) { string[] arrIcds = model.ExamineData.ICDInformation.Split('|'); if (arrIcds.Length > 0) { model.ICDInformation1 = arrIcds[0]; model.ICDInformation2 = arrIcds[1]; model.ICDInformation3 = arrIcds[2]; } } // get form examine medicine if any List <FormExamineMedicine> formExamineMedicines = _unitOfWork.FormExamineMedicineRepository.Get(x => x.FormExamineID == formExamine.ID); foreach (var formExamineMedicine in formExamineMedicines) { if (formExamineMedicine.TypeID == ((int)MedicineTypeEnum.Medicine).ToString() || formExamineMedicine.TypeID == ((int)MedicineTypeEnum.Concoction).ToString()) { model.MedicineDataList.Add(Mapper.Map <FormExamineMedicine, FormExamineMedicineModel>(formExamineMedicine)); } else if (formExamineMedicine.TypeID == ((int)MedicineTypeEnum.Injection).ToString()) { model.InjectionDataList.Add(Mapper.Map <FormExamineMedicine, FormExamineMedicineModel>(formExamineMedicine)); } //else if (formExamineMedicine.TypeID == ((int)MedicineTypeEnum.Concoction).ToString()) // model.ConcoctionMedicine = formExamineMedicine.ConcoctionMedicine; } // get form examine lab and radiology if any List <FormExamineLab> formExamineLabs = _unitOfWork.FormExamineLabRepository.Get(x => x.FormMedicalID == formExamine.FormMedicalID); foreach (var formExamineLab in formExamineLabs) { if (formExamineLab.LabType == ((int)LabTypeEnum.Laboratorium).ToString()) { model.LabDataList.Add(Mapper.Map <FormExamineLab, FormExamineLabModel>(formExamineLab)); } else if (formExamineLab.LabType == ((int)LabTypeEnum.Radiology).ToString()) { model.RadiologyDataList.Add(Mapper.Map <FormExamineLab, FormExamineLabModel>(formExamineLab)); } } // get form examine service if any List <FormExamineService> formExamineServices = _unitOfWork.FormExamineServiceRepository.Get(x => x.FormExamineID == formExamine.ID); foreach (var formExamineService in formExamineServices) { if (!model.DefaultServiceList.Any(x => x.Id == formExamineService.ServiceID)) { model.ServiceDataList.Add(Mapper.Map <FormExamineService, FormExamineServiceModel>(formExamineService)); } } } else { model.ExamineData.DoctorID = model.LoketData.DoctorID; model.ExamineData.PoliID = model.LoketData.PoliToID; } var tempPoliList = BindDropDownPoliList(model.LoketData.PoliToID); ViewBag.PoliList = tempPoliList; ViewBag.DoctorList = BindDropDownDoctorList(int.Parse(tempPoliList[0].Value)); ViewBag.FinalStateList = BindDropDownFinalStateList(); ViewBag.ICDInfo = BindDropDownICDInfo(); } catch { return(BadRequestResponse); } return(View(model)); }