Ejemplo n.º 1
0
        /// <summary>
        /// 增加一个病人
        /// </summary>
        /// <param name="Patient"></param>
        public void AddNewPatient(RegPatient Patient)
        {
            Model.PatientInfo patientInfo = null;
            if (Patient.HisCardNo.Trim( ) != "")
            {
                string strWhere = Tables.patientinfo.MEDICARD + oleDb.EuqalTo( ) + "'" + Patient.HisCardNo + "'";
                patientInfo = BindEntity <Model.PatientInfo> .CreateInstanceDAL(oleDb).GetModel(strWhere);

                if (patientInfo != null)
                {
                    throw new OperatorException("就诊卡号重复!");
                }
            }
            patientInfo            = new HIS.Model.PatientInfo( );
            patientInfo.PatName    = Patient.PatientName;
            patientInfo.PatSex     = Patient.Sex;
            patientInfo.MediCard   = Patient.HisCardNo;
            patientInfo.PatBriDate = Patient.BornDate;
            patientInfo.PatGroup   = Patient.Folk;
            patientInfo.PatTEL     = Patient.Tel;
            patientInfo.PatAddress = Patient.Address;
            patientInfo.PATJOB     = Patient.Occupation;
            BindEntity <Model.PatientInfo> .CreateInstanceDAL(oleDb).Add(patientInfo);

            Patient.PatID = patientInfo.PatID;
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
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);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 得到病人过敏史
        /// </summary>
        /// <param name="PatId"></param>
        /// <returns></returns>
        private string GetAllergic(int PatId)
        {
            Model.PatientInfo patinfo = BindEntity <Model.PatientInfo> .CreateInstanceDAL(oleDb).GetModel(PatId);

            if (patinfo == null)
            {
                return("");
            }
            else
            {
                if (patinfo.ALLERGIC != null)
                {
                    return(patinfo.ALLERGIC);
                }
                else
                {
                    return("");
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 更新病人信息
        /// </summary>
        /// <param name="Patient">要更新的病人信息</param>
        public void UpdatePatient(RegPatient Patient)
        {
            Model.PatientInfo patientInfo = null;
            string            strWhere    = Tables.patientinfo.MEDICARD + oleDb.EuqalTo( ) + "'" + Patient.HisCardNo + "'" + oleDb.And() + Tables.patientinfo.PATID + oleDb.NotEqualTo() + Patient.PatID;

            patientInfo = BindEntity <Model.PatientInfo> .CreateInstanceDAL(oleDb).GetModel(strWhere);

            if (patientInfo != null)
            {
                throw new OperatorException("就诊卡号重复!");
            }
            BindEntity <Model.PatientInfo> .CreateInstanceDAL(oleDb).Update(Tables.patientinfo.PATID + oleDb.EuqalTo( ) + Patient.PatID,
                                                                            patientInfo.PatName + oleDb.EuqalTo( ) + "'" + Patient.PatientName + "'",
                                                                            patientInfo.PatSex + oleDb.EuqalTo( ) + "'" + Patient.Sex + "'",
                                                                            patientInfo.MediCard + oleDb.EuqalTo( ) + "'" + Patient.HisCardNo + "'",
                                                                            patientInfo.PatBriDate + oleDb.EuqalTo( ) + "'" + Patient.BornDate + "'",
                                                                            patientInfo.PatGroup + oleDb.EuqalTo( ) + "'" + Patient.Folk + "'",
                                                                            patientInfo.PatTEL + oleDb.EuqalTo( ) + "'" + Patient.Tel + "'",
                                                                            patientInfo.PatAddress + oleDb.EuqalTo( ) + "'" + Patient.Address + "'",
                                                                            patientInfo.PATJOB + oleDb.EuqalTo( ) + "'" + Patient.Occupation + "'");
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 更新本次就诊登记信息
        /// </summary>
        /// <returns>成功标识;true</returns>
        public bool UpdateRegister()
        {
            try
            {
                HIS.Model.MZ_PatList register = BindEntity <Model.MZ_PatList> .CreateInstanceDAL(oleDb).GetModel(this.PatListID);

                register.CureDeptCode = _cureDeptCode; //就诊科室
                register.CureEmpCode  = _cureEmpCode;  //就诊医生
                register.DiseaseCode  = _diseaseCode;  //疾病代码
                if (register.REG_DOC_CODE.Trim( ) == "")
                {
                    //如果挂号医生为空,则将挂号医生更改为当前就诊医生
                    register.REG_DOC_CODE  = _cureEmpCode;
                    register.REG_DOC_NAME  = BaseDataController.GetName(BaseDataCatalog.人员列表, Convert.ToInt32(_cureEmpCode));    //PublicDataReader.GetEmployeeNameById( Convert.ToInt32(_cureEmpCode) );
                    register.REG_DEPT_CODE = _cureDeptCode;
                    register.REG_DEPT_NAME = BaseDataController.GetName(BaseDataCatalog.科室列表, Convert.ToInt32(_cureDeptCode));   // PublicDataReader.GetDeptNameById( Convert.ToInt32( _cureDeptCode ) );
                }

                register.DiseaseName = _diseaseName.Replace("|", "") + "|" + _diseaseMemo.Replace("|", ""); //疾病名称
                register.HpCode      = _hpCode;                                                             //就医机构代码(病人单位代码)
                register.HpGrade     = _hpGrade;                                                            //就医机构级别
                register.MediCard    = _mediCard;                                                           //医疗证卡号
                register.MediType    = _mediType;                                                           //就诊类型
                register.PatCode     = "";                                                                  //病人代码????
                register.PatID       = this.PatID;                                                          //病人ID,如果是普通病人,则为0;否则参见PatientInfo.PatID;
                register.PatListID   = this.PatListID;                                                      //本次就诊号
                register.PatName     = this.PatientName;                                                    //病人姓名
                register.PatSex      = this.Sex;                                                            //性别
                register.PYM         = this.PYM;                                                            //拼音码
                register.WBM         = this.WBM;                                                            //五笔码
                register.Age         = this.Age;                                                            //年龄
                register.VisitNo     = this.VisitNo;                                                        //就诊号(门诊号)
                BindEntity <Model.MZ_PatList> .CreateInstanceDAL(oleDb).Update(register);

                Model.PatientInfo patientinfo = BindEntity <Model.PatientInfo> .CreateInstanceDAL(oleDb).GetModel(Convert.ToInt32(this.PatID));

                if (patientinfo != null)
                {
                    patientinfo.PatName  = register.PatName;
                    patientinfo.PatSex   = register.PatSex;
                    patientinfo.ALLERGIC = this.Allergic;
                    BindEntity <Model.PatientInfo> .CreateInstanceDAL(oleDb).Update(patientinfo);
                }

                //将处方表中挂号的记录改为处方医生
                string strWhere = Tables.mz_presmaster.PATLISTID + oleDb.EuqalTo() + this.PatListID + oleDb.And( ) +
                                  Tables.mz_presmaster.HAND_FLAG + oleDb.EuqalTo() + "0";
                Model.MZ_PresMaster mz_presmaster = BindEntity <Model.MZ_PresMaster> .CreateInstanceDAL(oleDb).GetModel(strWhere);

                if (mz_presmaster != null)
                {
                    if (mz_presmaster.PresDocCode == null || mz_presmaster.PresDocCode.Trim( ) == "")
                    {
                        strWhere += oleDb.And( ) + Tables.mz_presmaster.PRESMASTERID + oleDb.EuqalTo( ) + mz_presmaster.PresMasterID;
                        BindEntity <Model.MZ_PresMaster> .CreateInstanceDAL(oleDb).Update(strWhere,
                                                                                          Tables.mz_presmaster.PRESDOCCODE + oleDb.EuqalTo( ) + "'" + _cureEmpCode + "'",
                                                                                          Tables.mz_presmaster.PRESDEPTCODE + oleDb.EuqalTo( ) + "'" + _cureDeptCode + "'");
                    }
                }
                return(true);
            }
            catch (OperatorException operr)
            {
                throw operr;
            }
            catch (Exception err)
            {
                ErrorWriter.WriteLog(err.Message);
                throw new Exception("更新病人等级信息发生错误!");
            }
        }
Ejemplo n.º 7
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);
            }
        }
Ejemplo n.º 8
0
        private bool CardNoExists(string CardNo)
        {
            Model.PatientInfo mz_patient = BindEntity <Model.PatientInfo> .CreateInstanceDAL(oleDb).GetModel(Tables.patientinfo.MEDICARD + "='" + CardNo + "'");

            return(mz_patient == null ? false : true);
        }