コード例 #1
0
        /// <summary>
        /// 上传病程记录
        /// </summary>
        /// <param name="record">病历记录</param>
        public static void Upload_In_Hospital_Records(string dahId, EmrRecord record)
        {
            XmlDocument upateData = new XmlDocument();
            XmlDocument result    = new XmlDocument();

            upateData.LoadXml(Properties.Resources.InHospitalRecords);
            #region  入病历数据
            foreach (XmlNode node in upateData.SelectSingleNode("chs/table/row").ChildNodes)
            {
                foreach (XmlNode recordNode in record.RecordContentXml.SelectSingleNode("病程记录").ChildNodes)
                {
                    if (node.InnerText.Trim() == recordNode.Name.Trim())
                    {
                        node.InnerText = recordNode.InnerText;
                    }
                }
            }
            Model.PatientInfo patInfo = BindEntity <Model.PatientInfo> .CreateInstanceDAL(oleDb).GetModel(record.PatId);

            Model.ZY_PatList patList = BindEntity <Model.ZY_PatList> .CreateInstanceDAL(oleDb).GetModel(record.PatListId);

            upateData.SelectSingleNode("chs/table/row/zyid").InnerText  = (HIS.SYSTEM.Core.EntityConfig.WorkID * 10000000 + record.PatListId).ToString();                                                            //住院ID
            upateData.SelectSingleNode("chs/table/row/dahid").InnerText = dahId;                                                                                                                                     //档案号
            upateData.SelectSingleNode("chs/table/row/cf").InnerText    = "";                                                                                                                                        //处方
            upateData.SelectSingleNode("chs/table/row/qt").InnerText    = "";                                                                                                                                        //其他
            upateData.SelectSingleNode("chs/table/row/zdqt").InnerText  = "";                                                                                                                                        //其他诊断
            upateData.SelectSingleNode("chs/table/row/jcrq").InnerText  = record.RecordCreateDate.Year.ToString("0000") + record.RecordCreateDate.Month.ToString("00") + record.RecordCreateDate.Day.ToString("00"); //检查日期
            upateData.SelectSingleNode("chs/table/row/jcys").InnerText  = new GWMHIS.BussinessLogicLayer.Classes.Employee(Convert.ToInt64(record.RecordCreateEmp)).Name;                                             //检查医生
            upateData.SelectSingleNode("chs/table/row/jgdm").InnerText  = HIS.SYSTEM.Core.EntityConfig.WorkID.ToString();
            upateData.SelectSingleNode("chs/table/row/djr").InnerText   = new GWMHIS.BussinessLogicLayer.Classes.Employee(Convert.ToInt64(record.RecordCreateEmp)).Name;
            upateData.SelectSingleNode("chs/table/row/djrq").InnerText  = record.RecordCreateDate.Year.ToString("0000") + record.RecordCreateDate.Month.ToString("00") + record.RecordCreateDate.Day.ToString("00");
            #endregion

            CHIService service = new CHIService();
            result.LoadXml(service.upload_In_Hospital_Records(upateData.InnerXml));

            if (Convert.ToBoolean(result.SelectSingleNode("chs/status").InnerText))
            {
                record.UpdateFlag = 1;
                record.Update();
            }
            else
            {
                throw new Exception(result.SelectSingleNode("chs/message").InnerText);
            }
        }
コード例 #2
0
        /// <summary>
        /// 上传门诊病历记录
        /// </summary>
        /// <param name="record">病历记录</param>
        public static void Upload_Clinic_Medical_Records(string dahId, EmrRecord record)
        {
            XmlDocument upateData = new XmlDocument();
            XmlDocument result    = new XmlDocument();

            upateData.LoadXml(Properties.Resources.ClinicMedicalRecords);
            #region  入病历数据
            foreach (XmlNode node in upateData.SelectSingleNode("chs/table/row").ChildNodes)
            {
                foreach (XmlNode recordNode in record.RecordContentXml.SelectSingleNode("门急诊病历").ChildNodes)
                {
                    if (node.InnerText.Trim() == recordNode.Name.Trim())
                    {
                        node.InnerText = recordNode.InnerText;
                    }
                }
            }
            Model.PatientInfo patInfo = BindEntity <Model.PatientInfo> .CreateInstanceDAL(oleDb).GetModel(record.PatId);   //病人信息

            Model.MZ_PatList patList = BindEntity <Model.MZ_PatList> .CreateInstanceDAL(oleDb).GetModel(record.PatListId); //病人就诊信息

            upateData.SelectSingleNode("chs/table/row/dahid").InnerText    = dahId;                                        //健康档案号
            upateData.SelectSingleNode("chs/table/row/cf").InnerText       = "";
            upateData.SelectSingleNode("chs/table/row/jzrq").InnerText     = patList.CureDate.Year.ToString("0000") + patList.CureDate.Month.ToString("00") + patList.CureDate.Day.ToString("00");
            upateData.SelectSingleNode("chs/table/row/jzys").InnerText     = new GWMHIS.BussinessLogicLayer.Classes.Employee(Convert.ToInt64(patList.CureEmpCode)).Name;
            upateData.SelectSingleNode("chs/table/row/jzjg").InnerText     = HIS.SYSTEM.Core.EntityConfig.WorkName;
            upateData.SelectSingleNode("chs/table/row/jgdm").InnerText     = HIS.SYSTEM.Core.EntityConfig.WorkID.ToString();
            upateData.SelectSingleNode("chs/table/row/djr").InnerText      = new GWMHIS.BussinessLogicLayer.Classes.Employee(Convert.ToInt64(record.RecordCreateEmp)).Name;
            upateData.SelectSingleNode("chs/table/row/djrq").InnerText     = record.RecordCreateDate.Year.ToString("0000") + record.RecordCreateDate.Month.ToString("00") + record.RecordCreateDate.Day.ToString("00");
            upateData.SelectSingleNode("chs/table/row/his_blbh").InnerText = (record.RecordId).ToString();
            #endregion

            CHIService service = new CHIService();
            result.LoadXml(service.upload_Clinic_Medical_Records(upateData.InnerXml));

            if (Convert.ToBoolean(result.SelectSingleNode("chs/status").InnerText))
            {
                record.UpdateFlag = 1;
                record.Update();
                Upload_Mzcf_Records(record.PatListId, dahId, record.RecordId);
            }
            else
            {
                throw new Exception(result.SelectSingleNode("chs/message").InnerText);
            }
        }
コード例 #3
0
        /// <summary>
        /// 上传入院记录
        /// </summary>
        /// <param name="record">病历记录</param>
        public static void Upload_To_Hospital_Records(string dahId, EmrRecord record)
        {
            XmlDocument upateData = new XmlDocument();
            XmlDocument result    = new XmlDocument();

            upateData.LoadXml(Properties.Resources.ToHospitalRecords);
            #region  入病历数据
            foreach (XmlNode node in upateData.SelectSingleNode("chs/table/row").ChildNodes)
            {
                foreach (XmlNode recordNode in record.RecordContentXml.SelectSingleNode("入院记录").ChildNodes)
                {
                    if (node.InnerText.Trim() == recordNode.Name.Trim())
                    {
                        node.InnerText = recordNode.InnerText;
                    }
                }
            }

            Model.PatientInfo patInfo = BindEntity <Model.PatientInfo> .CreateInstanceDAL(oleDb).GetModel(record.PatId);

            Model.ZY_PatList patList = BindEntity <Model.ZY_PatList> .CreateInstanceDAL(oleDb).GetModel(record.PatListId);

            upateData.SelectSingleNode("chs/table/row/zyid").InnerText  = (HIS.SYSTEM.Core.EntityConfig.WorkID * 10000000 + record.PatListId).ToString(); //住院ID
            upateData.SelectSingleNode("chs/table/row/zyh").InnerText   = patInfo.CureNo;                                                                 //住院号
            upateData.SelectSingleNode("chs/table/row/dahid").InnerText = dahId;                                                                          //档案号
            upateData.SelectSingleNode("chs/table/row/zylx").InnerText  = "1";                                                                            //住院类型
            //付费方式
            switch (patInfo.ACCOUNTTYPE)
            {
            case "自费":
                upateData.SelectSingleNode("chs/table/row/fffs").InnerText = "8";
                break;

            case "农合":
                upateData.SelectSingleNode("chs/table/row/fffs").InnerText = "6";
                break;

            case "居民医保":
                upateData.SelectSingleNode("chs/table/row/fffs").InnerText = "4";
                break;

            case "职工医保":
                upateData.SelectSingleNode("chs/table/row/fffs").InnerText = "3";
                break;

            case "公费":
                upateData.SelectSingleNode("chs/table/row/fffs").InnerText = "1";
                break;

            default:
                upateData.SelectSingleNode("chs/table/row/fffs").InnerText = "9";
                break;
            }
            upateData.SelectSingleNode("chs/table/row/ryrq").InnerText     = patList.CureDate.Year.ToString("0000") + patList.CureDate.Month.ToString("00") + patList.CureDate.Day.ToString("00"); //入院时间
            upateData.SelectSingleNode("chs/table/row/ryks").InnerText     = new GWMHIS.BussinessLogicLayer.Classes.Employee(Convert.ToInt64(patList.CureDeptCode)).Name;                          //科室
            upateData.SelectSingleNode("chs/table/row/ch").InnerText       = patList.BedCode;                                                                                                      //床号
            upateData.SelectSingleNode("chs/table/row/zzys").InnerText     = new GWMHIS.BussinessLogicLayer.Classes.Employee(Convert.ToInt64(Convert.ToInt64(patList.CureDocCode))).Name;          //主治医生
            upateData.SelectSingleNode("chs/table/row/qt").InnerText       = "";                                                                                                                   //其他
            upateData.SelectSingleNode("chs/table/row/csd").InnerText      = "";                                                                                                                   //出生地
            upateData.SelectSingleNode("chs/table/row/gzdw").InnerText     = "";                                                                                                                   //工作单位
            upateData.SelectSingleNode("chs/table/row/zdqt").InnerText     = "";
            upateData.SelectSingleNode("chs/table/row/jzyy").InnerText     = HIS.SYSTEM.Core.EntityConfig.WorkName;
            upateData.SelectSingleNode("chs/table/row/jgdm").InnerText     = HIS.SYSTEM.Core.EntityConfig.WorkID.ToString();
            upateData.SelectSingleNode("chs/table/row/djr").InnerText      = new GWMHIS.BussinessLogicLayer.Classes.Employee(Convert.ToInt64(record.RecordCreateEmp)).Name;
            upateData.SelectSingleNode("chs/table/row/djrq").InnerText     = record.RecordCreateDate.Year.ToString("0000") + record.RecordCreateDate.Month.ToString("00") + record.RecordCreateDate.Day.ToString("00");
            upateData.SelectSingleNode("chs/table/row/his_blbh").InnerText = (record.RecordId).ToString();
            #endregion

            CHIService service = new CHIService();
            result.LoadXml(service.upload_To_Hospital_Records(upateData.InnerXml));

            if (Convert.ToBoolean(result.SelectSingleNode("chs/status").InnerText))
            {
                record.UpdateFlag = 1;
                record.Update();
                Upload_Zycf_Records(record.PatListId, dahId, record.RecordId);
            }
            else
            {
                throw new Exception(result.SelectSingleNode("chs/message").InnerText);
            }
        }