Example #1
0
        //检查化验等信息
        public static DataTable GetOtherTable(DataConnection pclsCache, string UserId, string VisitId)
        {
            //输出表
            DataTable dt_Out = new System.Data.DataTable();

            dt_Out.Columns.Add(new DataColumn("精确时间", typeof(DateTime)));  //年月日时分秒
            dt_Out.Columns.Add(new DataColumn("类型", typeof(string)));      //早期排序,目前可能不需要了 那来干嘛?
            dt_Out.Columns.Add(new DataColumn("VisitId", typeof(string)));
            dt_Out.Columns.Add(new DataColumn("事件", typeof(string)));
            dt_Out.Columns.Add(new DataColumn("关键属性", typeof(string)));     //取当前标记时方便区分  类型+vid+时间-这样基本就能确定了  或者主键


            try
            {
                //诊断
                DataTable DiagnosisDT = new System.Data.DataTable();
                DiagnosisDT = PsDiagnosis.GetDiagnosisInfo(pclsCache, UserId, VisitId);
                for (int i = 0; i < DiagnosisDT.Rows.Count; i++)
                {
                    dt_Out.Rows.Add(Convert.ToDateTime(DiagnosisDT.Rows[i]["RecordDate"]), "诊断", VisitId, "诊断:" + DiagnosisDT.Rows[i]["TypeName"].ToString(), "DiagnosisInfo" + "|" + VisitId + "|" + Convert.ToDateTime(DiagnosisDT.Rows[i]["RecordDate"].ToString()).ToString("yyyy-MM-ddHH:mm:ss"));
                }

                //检查
                DataTable ExaminationDT = new System.Data.DataTable();
                ExaminationDT = PsExamination.GetExaminationList(pclsCache, UserId, VisitId);
                for (int i = 0; i < ExaminationDT.Rows.Count; i++)
                {
                    dt_Out.Rows.Add(Convert.ToDateTime(ExaminationDT.Rows[i]["ExamDate"]), "检查", VisitId, "检查:" + ExaminationDT.Rows[i]["ExamTypeName"].ToString(), "ExaminationInfo" + "|" + VisitId + "|" + Convert.ToDateTime(ExaminationDT.Rows[i]["ExamDate"].ToString()).ToString("yyyy-MM-ddHH:mm:ss"));
                }

                //化验
                DataTable LabTestDT = new System.Data.DataTable();
                LabTestDT = PsLabTest.GetLabTestList(pclsCache, UserId, VisitId);
                for (int i = 0; i < LabTestDT.Rows.Count; i++)
                {
                    dt_Out.Rows.Add(Convert.ToDateTime(LabTestDT.Rows[i]["LabTestDate"]), "化验", VisitId, "化验:" + LabTestDT.Rows[i]["LabItemName"].ToString(), "LabTestInfo" + "|" + VisitId + "|" + Convert.ToDateTime(LabTestDT.Rows[i]["LabTestDate"].ToString()).ToString("yyyy-MM-ddHH:mm:ss"));
                }

                //用药


                DataTable DrugRecordDT = new System.Data.DataTable();
                DrugRecordDT = PsDrugRecord.GetDrugRecord(pclsCache, UserId, VisitId);
                for (int i = 0; i < DrugRecordDT.Rows.Count; i++)
                {
                    dt_Out.Rows.Add(Convert.ToDateTime(DrugRecordDT.Rows[i]["StartDateTime"]), "用药", VisitId, "用药:" + DrugRecordDT.Rows[i]["HistoryContent"].ToString(), "DrugRecord" + "|" + VisitId + "|" + Convert.ToDateTime(DrugRecordDT.Rows[i]["StartDateTime"].ToString()).ToString("yyyy-MM-ddHH:mm:ss"));
                }

                return(dt_Out);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PsClinicalInfo.GetClinicalInfo", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
            }
        }
Example #2
0
        //检查化验详细信息查看
        public static DataTable GetClinicInfoDetail(DataConnection pclsCache, string UserId, string Type, string VisitId, string Date)
        {
            DataTable list      = new DataTable();
            string    condition = "";

            try
            {
                switch (Type)
                {
                //case "ClinicalInfo": list = _ServicesSoapClient.GetClinicalInfo(PatientId); //就诊表
                //break;
                case "DiagnosisInfo": list = PsDiagnosis.GetDiagnosisInfo(pclsCache, UserId, VisitId);    //诊断表
                    condition = "RecordDate = '" + Date + "'";
                    break;

                case "ExaminationInfo": list = PsExamination.GetExaminationList(pclsCache, UserId, VisitId);     //检查表(有子表)
                    condition = "ExamDate = '" + Date + "'";
                    break;

                case "LabTestInfo": list = PsLabTest.GetLabTestList(pclsCache, UserId, VisitId);     //化验表(有子表)
                    condition            = "LabTestDate = '" + Date + "'";
                    break;

                //case "DrugRecord": list = PsDrugRecord.GetDrugRecord(pclsCache, UserId, VisitId); //用药
                case "DrugRecord": list = PsDrugRecord.GetDrugRecordList(pclsCache, UserId, VisitId);     //用药
                    condition           = "StartDateTime = '" + Date + "'";
                    break;

                default: break;
                }

                //list肯定不为空

                DataTable newdt = new DataTable();
                newdt = list.Clone();
                DataRow[] rows = list.Select(condition);
                foreach (DataRow row in rows)
                {
                    newdt.Rows.Add(row.ItemArray);
                }
                return(newdt);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PsClinicalInfo.GetClinicInfoDetail", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
        }