/// <summary>
 /// 根据住院病人id获得入院记录
 /// </summary>
 /// <returns></returns>
 public string GetInfoByInpatientId()
 {
     return(base.ExecuteActionJsonResult("获取入院记录信息", () =>
     {
         CD_HospitalRecord info = service.GetInfoByInpatientId(Request["InpatientId"]);
         return new WebApi_Result()
         {
             data = info
         };
     }));
 }
Example #2
0
        /// <summary>
        /// 打开入院记录,如果以及有入院记录展示打印页面,如果没有入院记录展示编辑页面
        /// </summary>
        /// <returns></returns>
        public ActionResult HospitalRecordRoute()
        {
            HospitalRecordService service = new HospitalRecordService();
            CD_HospitalRecord     info    = service.GetInfoByInpatientId(Request["InpatientId"]);

            if (info != null)
            {
                return(View("HospitalRecord"));
            }
            else
            {
                return(View("HospitalRecordType"));
            }
        }
        /// <summary>
        /// 保存诊断数据
        /// </summary>
        /// <returns></returns>
        public string SaveInfo()
        {
            return(base.ExecuteActionJsonResult("诊断保存", () =>
            {
                CD_PatientDiagnosis entity = base.GetPageData <CD_PatientDiagnosis>(0);
                CD_HospitalRecord hospitalRecord = hospitalrecordservice.GetInfoByInpatientId(entity.InpatientId);
                if (hospitalRecord == null)
                {
                    return new WebApi_Result()
                    {
                        code = 0, msg = "请先保存入院记录"
                    };
                }

                entity.ICDCode = string.IsNullOrWhiteSpace(entity.ICDCode) ? null : entity.ICDCode;
                var DiagnosisIdList = (entity.DiagnosisId + "").Split(',');
                for (int i = 0; i < entity.ICDCode.Split(',').Length; i++)
                {
                    var cur_entity = base.GetPageData <CD_PatientDiagnosis>(0);
                    if (DiagnosisIdList.Length > i)
                    {
                        cur_entity.DiagnosisId = DiagnosisIdList[i];
                    }
                    else
                    {
                        cur_entity.DiagnosisId = "";
                    }
                    cur_entity.ParentId = string.IsNullOrWhiteSpace(cur_entity.ParentId) ? "0" : cur_entity.ParentId;
                    cur_entity.ICDCode = entity.ICDCode.Split(',')[i];
                    cur_entity.DiagnosisName = entity.DiagnosisName.Split(',')[i];
                    UserToken ut = UserTokenManager.GetUserToken(Request["token"]);
                    cur_entity.RecordUserId = cur_entity.Creator = ut.UserId;
                    cur_entity.RecordUserName = ut.USERNAME;
                    if (cur_entity.DiagnosisTime == null)
                    {
                        cur_entity.DiagnosisTime = DateTime.Now;
                    }


                    //病历记录id
                    cur_entity.RecordId = hospitalRecord.HospitalRecordId;

                    patientDiagnosisService.SaveInfo(cur_entity);
                }
                return new WebApi_Result();
            }));
        }