Exemplo n.º 1
0
        public JsonResult CreateSuratBerbadanSehat()
        {
            var _model = new HealthBodyLetterModel {
            };

            if (Request.Form["forPatient"] != null)
            {
                _model.ForPatient = long.Parse(Request.Form["forPatient"].ToString());
            }

            if (Request.Form["FormMedicalID"] != null)
            {
                _model.FormMedicalID = long.Parse(Request.Form["FormMedicalID"].ToString());
            }
            if (Request.Form["TglPeriksa"] != null)
            {
                _model.Cekdate = DateTime.Parse(Request.Form["TglPeriksa"].ToString());
            }
            if (Session["UserLogon"] != null)
            {
                _model.Account = (AccountModel)Session["UserLogon"];
            }
            _model.CreatedDate = DateTime.Now;
            var request = new HealthBodyRequest
            {
                Data = _model
            };

            var response = new HealthBodyResponse {
            };

            response = new HealthBodyValidator(_unitOfWork, _context).Validate(request);
            return(Json(new
            {
                Status = response.Status,
                Message = response.Message,
                Nama = response.Entity.PatientData == null ? "" : response.Entity.PatientData.Name,
                TTL = response.Entity.PatientData == null ? "" : response.Entity.PatientData.BirthDateStr,
                Alamat = response.Entity.PatientData == null ? "" : response.Entity.PatientData.Address,
                NoBPJS = response.Entity.PatientData == null ? "" : response.Entity.PatientData.BPJSNumber,
                TB = response.Entity.PreExamineData == null ? 0 : response.Entity.PreExamineData.Height,
                BB = response.Entity.PreExamineData == null ? 0 : response.Entity.PreExamineData.Weight,
                GolDarah = response.Entity.PatientData == null ? "" : response.Entity.PatientData.BloodType,
                TD = response.Entity.PreExamineData == null ? "" : $"{ response.Entity.PreExamineData.Systolic}/{ response.Entity.PreExamineData.Diastolic}",
                HR = response.Entity.PreExamineData == null ? 0 : response.Entity.PreExamineData.Pulse,
                RR = response.Entity.PreExamineData == null ? 0 : response.Entity.PreExamineData.Respitory,
                Visus = response.Entity.PreExamineData == null ? "" : $"{response.Entity.PreExamineData.RightEye}/{response.Entity.PreExamineData.LeftEye}"
            }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public JsonResult SaveAndPreviewHealthBody()
        {
            var _model = new HealthBodyLetterModel();

            if (Request.Form["Keperluan"] != null)
            {
                _model.Keperluan = Request.Form["Keperluan"].ToString();
            }
            if (Request.Form["Pekerjaan"] != null)
            {
                _model.Pekerjaan = Request.Form["Pekerjaan"] == null ? "" : Request.Form["Pekerjaan"].ToString();
            }
            if (Request.Form["FormMedicalID"] != null)
            {
                _model.FormMedicalID = Convert.ToInt64(Request.Form["FormMedicalID"].ToString());
            }
            if (Request.Form["ForPatient"] != null)
            {
                _model.ForPatient = Request.Form["ForPatient"] == null ? 0 : long.Parse(Request.Form["ForPatient"].ToString());
            }
            if (Request.Form["Decision"] != null)
            {
                _model.Decision = Request.Form["Decision"] == null ? "" : Request.Form["Decision"].ToString();
            }
            if (Session["UserLogon"] != null)
            {
                _model.Account = (AccountModel)Session["UserLogon"];
            }

            var request = new HealthBodyRequest
            {
                Data = _model
            };

            var response = new HealthBodyResponse {
            };

            response = new HealthBodyValidator(_unitOfWork, _context).ValidateBeforePreview(request);

            return(Json(new { Status = response.Status, FormMedicalId = response.Entity.FormMedicalID }, JsonRequestBehavior.AllowGet));
        }