コード例 #1
0
        /// <summary>
        /// 获取病人病案记录和病案内容
        /// </summary>
        /// <param name="patlistid">病人Id</param>
        /// <param name="patDeptID">科室Id</param>
        /// <param name="patDeptName">科室名称</param>
        /// <param name="empid">人员ID</param>
        /// <param name="empName">人员姓名</param>
        public void GetMedicalCase(int patlistid, int patDeptID, string patDeptName, int empid, string empName)
        {
            _currpatlistid = patlistid;
            _patdeptid     = patDeptID;
            _patdeptname   = patDeptName;
            _empid         = empid;
            _empname       = empName;
            StreamReader stream = controller.OpenFile(patlistid);

            if (stream != null)
            {
                writerControl1.ExecuteCommand("FileOpen", false, stream);
            }
            else
            {
                //从文件中打开病案首页
                string fileName = Path.Combine(Application.StartupPath, "HomePageTempLate\\CaseTemplate.xml");
                writerControl1.ExecuteCommand("FileOpen", false, fileName);
            }
            //获取病人信息绑定数据源
            MedicalCasePatient casePatInfo = controller.GetCasePatInfoDataSource(patlistid);

            writerControl1.SetDocumentParameterValue("MedicalCasePatient", casePatInfo);

            //获取病人诊断信息绑定数据源
            MedicalCaseDiagoInfo caseDiagInfo = controller.GetCaseDiagInfo(patlistid);

            writerControl1.SetDocumentParameterValue("MedicalCaseDiagoInfo", caseDiagInfo);
            writerControl1.WriteDataFromDataSourceToDocument();
        }
コード例 #2
0
        /// <summary>
        /// 获取病案首页病人信息
        /// </summary>
        /// <param name="patlistID">病人Id</param>
        /// <returns>病人对象</returns>
        public MedicalCasePatient GetCasePatient(int patlistID)
        {
            Action <ClientRequestData> requestAction = ((ClientRequestData request) =>
            {
                request.AddData(patlistID);
            });
            ServiceResponseData retdata = InvokeWcfService("EMRDocProject.Service", "HomePageController", "GetCasePatientInfo", requestAction);
            MedicalCasePatient  pat     = retdata.GetData <MedicalCasePatient>(0);

            return(pat);
        }
コード例 #3
0
        /// <summary>
        /// 获取绑定数据源信息
        /// </summary>
        /// <param name="patlistid">病人ID</param>
        /// <returns>病人信息数据</returns>
        public MedicalCasePatient GetCasePatInfoDataSource(int patlistid)
        {
            MedicalCaseDbHelper helper      = new MedicalCaseDbHelper();
            MedicalCasePatient  casePatInfo = helper.GetCasePatient(patlistid);
            AgeValue            ageValue    = AgeExtend.GetAgeValue(casePatInfo.Birthday, casePatInfo.EnterHDate);

            casePatInfo.Age = "0";
            if (ageValue.Y_num > 0)
            {
                casePatInfo.Age = ageValue.Y_num.ToString();
            }
            else
            {
                casePatInfo.BirthDays = (ageValue.M_num * 30 + ageValue.D_num) / 30;
            }
            return(casePatInfo);
        }
コード例 #4
0
        public ServiceResponseData GetCasePatientInfo()
        {
            int patlistid = requestData.GetData <int>(0);
            Action <ClientRequestData> requestAction = ((ClientRequestData request) =>
            {
                request.LoginRight = LoginUserInfo;
                request.AddData(patlistid);
            });
            ServiceResponseData retdata   = InvokeWcfService("EMRHISInterface.Service", "EmrHomePageDataSourceController", "GetCasePatientInfo", requestAction);
            DataTable           dtPatInfo = retdata.GetData <DataTable>(0);
            //病人基本信息
            MedicalCasePatient casePatientInfo = new MedicalCasePatient();

            if (dtPatInfo != null || dtPatInfo.Rows.Count > 0)
            {
                casePatientInfo = EFWCoreLib.CoreFrame.Common.ConvertExtend.ToObject <MedicalCasePatient>(dtPatInfo, 0);
                string age = casePatientInfo.Age;
                if (casePatientInfo.Status != 3 && casePatientInfo.Status != 4)
                {
                    casePatientInfo.LeaveHDate   = string.Empty;
                    casePatientInfo.CurrDeptName = string.Empty;
                    casePatientInfo.CurrwardName = string.Empty;
                }
                else
                {
                    casePatientInfo.LeaveHDate = dtPatInfo.Rows[0]["LeaveDate"].ToString();
                }

                //转科科室
                requestAction = ((ClientRequestData request) =>
                {
                    request.LoginRight = LoginUserInfo;
                    request.AddData(patlistid);
                });
                retdata = InvokeWcfService("EMRHISInterface.Service", "EmrHomePageDataSourceController", "GetCaseTransDeptInfo", requestAction);
                DataTable dtTransInfo = retdata.GetData <DataTable>(0);
                if (dtTransInfo != null && dtTransInfo.Rows.Count > 0)
                {
                    string strTrans = string.Empty;
                    strTrans = dtTransInfo.Rows[0]["newDeptName"].ToString();
                    for (int i = 1; i < dtTransInfo.Rows.Count; i++)
                    {
                        strTrans += "→" + dtTransInfo.Rows[i]["newDeptName"].ToString();
                    }

                    casePatientInfo.TransDeptName = strTrans;
                }

                //实际住院天数
                DateTime dt1 = casePatientInfo.Status == 4 || casePatientInfo.Status == 3 ? Convert.ToDateTime(dtPatInfo.Rows[0]["LeaveDate"].ToString()) : DateTime.Now;
                DateTime dt2 = casePatientInfo.EnterHDate;
                TimeSpan ts  = dt1 - dt2;
                if (ts.Days == 0)
                {
                    casePatientInfo.InHospDays = 1;
                }
                else
                {
                    casePatientInfo.InHospDays = ts.Days - 1;
                }
            }

            responseData.AddData(casePatientInfo);
            return(responseData);
        }