コード例 #1
0
        /// <summary>
        /// 签名
        /// </summary>
        /// <param name="fileID"></param>
        /// <returns></returns>
        public int SignEmrPage(string fileID)
        {
            Neusoft.HISFC.Models.EPR.QC obj = this.GetQCData(fileID);
            if (obj == null)
            {
                this.Err = "没有找到文件记录,请先保存病历页然后再签名操作!";
                return(-1);
            }
            string s    = "";
            string sTip = "文件已经{0},不能进行签名操作!";

            if (obj.QCData.State.ToString() == "0")           //新建立
            {
                return(this.UpdateQCDataState(fileID, 1));
            }
            else if (obj.QCData.State.ToString() == "1")
            {
                s = "签名";
            }
            else if (obj.QCData.State.ToString() == "2")
            {
                s = "封存";
            }
            else if (obj.QCData.State.ToString() == "3")
            {
                s = "删除";
            }
            sTip     = string.Format(sTip, s);
            this.Err = sTip;
            return(-1);
        }
コード例 #2
0
        private ArrayList myGetQCData(string sql)
        {
            if (this.ExecQuery(sql) == -1)
            {
                return(null);
            }
            ArrayList al = new ArrayList();

            while (this.Reader.Read())
            {
                Neusoft.HISFC.Models.EPR.QC qc = new Neusoft.HISFC.Models.EPR.QC();
                qc.ID               = this.Reader[0].ToString();
                qc.PatientInfo.ID   = this.Reader[1].ToString();
                qc.PatientInfo.Name = this.Reader[2].ToString();
                qc.PatientInfo.PVisit.PatientLocation.Dept.ID = this.Reader[3].ToString();
                qc.Index        = this.Reader[4].ToString();
                qc.Name         = this.Reader[5].ToString();
                qc.QCData.State = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[6].ToString());

                if (!this.Reader.IsDBNull(7))
                {
                    qc.QCData.Creater.Memo = this.Reader[7].ToString();
                }
                if (!this.Reader.IsDBNull(8))
                {
                    qc.QCData.Creater.ID = this.Reader[8].ToString();
                }
                if (!this.Reader.IsDBNull(9))
                {
                    qc.QCData.Saver.Memo = this.Reader[9].ToString();
                }

                if (!this.Reader.IsDBNull(10))
                {
                    qc.QCData.Saver.ID = this.Reader[10].ToString();
                }
                if (!this.Reader.IsDBNull(11))
                {
                    qc.QCData.Sealer.Memo = this.Reader[11].ToString();
                }
                if (!this.Reader.IsDBNull(12))
                {
                    qc.QCData.Sealer.ID = this.Reader[12].ToString();
                }
                if (!this.Reader.IsDBNull(13))
                {
                    qc.QCData.Deleter.Memo = this.Reader[13].ToString();
                }
                if (!this.Reader.IsDBNull(14))
                {
                    qc.QCData.Deleter.ID = this.Reader[14].ToString();
                }

                al.Add(qc);
            }
            this.Reader.Close();
            return(al);
        }
コード例 #3
0
        /// <summary>
        /// 签名更新
        /// 主要为病程记录
        /// 更新 签名人,签名日期,上级签名人
        /// </summary>
        /// <param name="id"></param>
        /// <param name="State"></param>
        /// <returns></returns>
        public int SignEmrPage(Neusoft.HISFC.Models.EPR.QC qc)
        {
            string strSql = "";

            if (this.Sql.GetSql("EPR.QC.UpdateQCData", ref strSql) == -1)
            {
                return(-1);
            }
            return(this.ExecNoQuery(strSql, qc.ID, qc.Index, qc.QCData.Saver.ID, qc.QCData.Saver.Memo, qc.QCData.Sealer.ID));
        }
コード例 #4
0
        /// <summary>
        /// 插入一条文件信息
        /// </summary>
        /// <returns></returns>
        public int InsertQCData(Neusoft.HISFC.Models.EPR.QC qc)
        {
            if (this.IsHaveSameEMRFile(qc.ID, qc.Index) == true)
            {
                return(0);
            }

            string strSql = "";

            if (this.Sql.GetSql("EPR.QC.InsertQCData", ref strSql) == -1)
            {
                return(-1);
            }
            return(this.ExecNoQuery(strSql, qc.ID, qc.PatientInfo.ID, qc.PatientInfo.Name, qc.PatientInfo.PVisit.PatientLocation.Dept.ID, qc.Index, qc.Name, this.Operator.ID));
        }
コード例 #5
0
 /// <summary>
 /// 是否签名
 /// </summary>
 /// <param name="fileID"></param>
 /// <returns></returns>
 public bool IsSign(string fileID)
 {
     Neusoft.HISFC.Models.EPR.QC obj = this.GetQCData(fileID);
     if (obj == null)
     {
         return(false);
     }
     if (obj.QCData.State.ToString() == "0") //新建立
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
コード例 #6
0
ファイル: EPRBase.cs プロジェクト: ewin66/Management-System
 public int InsertQCData(Neusoft.HISFC.Models.EPR.QC qc)
 {
     Neusoft.HISFC.BizLogic.EPR.QC manager = new Neusoft.HISFC.BizLogic.EPR.QC();
     this.SetDB(manager);
     if (manager.InsertQCData(qc) == -1)
     {
         return(-1);
     }
     else
     {
         if (qc.QCData.Saver.ID != "")        //签名更新
         {
             return(manager.SignEmrPage(qc)); //签名用及更新
         }
     }
     return(1);
 }
コード例 #7
0
        public List <Neusoft.HISFC.Models.EPR.QC> GetQcData(string id, string memo, string patientId, string patientName, string deptcode)
        {
            if (this.XmlStr == null || this.xmlStr == "")
            {
                return(new List <Neusoft.HISFC.Models.EPR.QC>());
            }

            System.Xml.XmlDocument doc = new XmlDocument();
            try
            {
                doc.LoadXml(this.XmlStr);
            }
            catch { return(new List <Neusoft.HISFC.Models.EPR.QC>()); }

            XmlNodeList nodeList = doc.SelectNodes(@"//病程记录//PatientInfo");
            List <Neusoft.HISFC.Models.EPR.QC> al = new List <Neusoft.HISFC.Models.EPR.QC>();

            foreach (XmlNode xNode in nodeList)
            {
                Neusoft.HISFC.Models.EPR.QC qc = new Neusoft.HISFC.Models.EPR.QC();
                qc.ID               = id;
                qc.PatientInfo.ID   = patientId;
                qc.PatientInfo.Name = patientName;
                qc.PatientInfo.PVisit.PatientLocation.Dept.ID = deptcode;
                qc.Memo = memo;

                qc.Name = xNode.Attributes["DocUpType"].Value;
                if (xNode.Attributes["IsUpSubMission"].Value == "1") //IsUpDocSign
                {
                    qc.QCData.Saver.ID   = xNode.Attributes["DocSign"].Value;
                    qc.QCData.Saver.Name = xNode.Attributes["DocSign"].Value;
                    qc.QCData.Saver.Memo = Neusoft.FrameWork.Function.NConvert.ToDateTime(xNode.Attributes["Date"].Value).ToString("yyyy-MM-dd HH:mm:ss");
                }
                if (xNode.Attributes["IsUpDocSign"].Value == "1") //上级医生签名了
                {
                    qc.QCData.Sealer.ID = xNode.Attributes["DocUpSign"].Value;
                }
                qc.QCData.Creater.ID   = xNode.Attributes["DocSign"].Value;
                qc.QCData.Creater.Name = xNode.Attributes["DocSign"].Value;
                qc.QCData.Creater.Memo = xNode.Attributes["Date"].Value;
                qc.Index = xNode.Attributes["Date"].Value;
                al.Add(qc);
            }
            return(al);
        }
コード例 #8
0
ファイル: QCInfo.cs プロジェクト: ewin66/Management-System
        QC QCManager = new QC();          //质控病历管理层
        //private ArrayList alConditions =null; //条件
        /// <summary>
        /// 执行质控信息 -
        /// </summary>
        /// <param name="inpatientNo"></param>
        /// <param name="iSql"></param>
        /// <param name="QC"></param>
        /// <returns></returns>
        public bool ExecQCInfo(string inpatientNo, Neusoft.FrameWork.Management.Interface iSql, Neusoft.HISFC.Models.EPR.QCConditions QC)
        {
            int i = 0;

            if (myInpatientNo != inpatientNo)           //没有变更患者不更新患者的信息
            {
                myInpatientNo = inpatientNo;
                //更新常用变量
                i = iSql.GetPosition("[HIS_INPATIENT_NO]");
                if (i == -1)
                {
                    this.Err = "没有找到[HIS_INPATIENT_NO]";
                    return(false);
                }
                iSql.SetValue("[HIS_INPATIENT_NO]", inpatientNo);
                iSql.RefreshVariant(Neusoft.FrameWork.Models.NeuInfo.infoType.Temp, i);
            }
            ArrayList alInputs = this.QCManager.GetQCInputCondition(inpatientNo);                                            //输入数值

            for (i = 0; i < QC.AlConditions.Count; i++)                                                                      //查找每条质控条件-编写
            {
                Neusoft.HISFC.Models.EPR.QCCondition condition = QC.AlConditions[i] as Neusoft.HISFC.Models.EPR.QCCondition; //条件

                if (condition == null || condition.InfoName == "" || condition.InfoCondition == "")
                {
                    this.Err = "质控基础数据有问题!";
                    this.WriteErr();
                    return(false);
                }
                //	"若输入 \'信息\',符合\'条件\'", 0
                //	"若HIS\'信息\',符合\'条件\'",  1
                //	"若病历 \'名称\',已经\'建立\'", 2
                //	"若病历-\'名称\',已经\'签名\'", 3
                //	"若病历+\'名称\',建立时间,不在\'时间\'内", 4
                //	"若控件 \'名称\',符合\'条件\'" 5
                string sTemp = condition.InfoName + " " + condition.InfoCondition;

                Neusoft.FrameWork.Management.Caculation caculation = new Neusoft.FrameWork.Management.Caculation();
                bool bResult = false;
                Neusoft.HISFC.Models.EPR.QC data = null;
                bool      bOld = false;
                bool      bNew = false;
                string    a = "", b = "";
                ArrayList al = null;
                switch (condition.ID)
                {
                case "0":                        //输入的控件结点
                                                 //a = EMRManager.GetNodeValue("datastore_emr",inpatientNo,condition.InfoName);
                    #region 输入控件节点
                    a = "-1";
                    foreach (Neusoft.FrameWork.Models.NeuObject obj in alInputs)
                    {
                        if (obj.Name.Trim() == condition.InfoName.Trim())
                        {
                            a = obj.User01;
                            break;
                        }
                    }
                    if (a == "-1" || a == "")
                    {
                        a = "";
                    }

                    sTemp = a + " " + condition.InfoCondition;

                    if (condition.InfoCondition.ToLower() == "true")                          //只是有数值
                    {
                        if (a.Trim() != "")
                        {
                            bResult = true;
                        }
                        else
                        {
                            bResult = false;
                        }
                    }
                    else
                    {
                        sTemp   = iSql.TransSql(sTemp);
                        bResult = caculation._condition(sTemp);
                    }
                    #endregion
                    break;

                case "1":                        //his
                    sTemp   = iSql.TransSql(sTemp);
                    bResult = caculation._condition(sTemp);
                    break;

                case "2":                        //病历 建立
                    al = QCManager.GetQCData(inpatientNo, condition.InfoName);
                    if (condition.InfoCondition == "建立" || condition.InfoCondition.ToUpper() == "TRUE")
                    {
                        bNew = true;
                    }
                    if (al != null && al.Count > 0)
                    {
                        data = al[0] as Neusoft.HISFC.Models.EPR.QC;
                        if (data != null)
                        {
                            if (data.QCData.Creater.ID == "")
                            {
                                bOld = false;
                            }
                            else
                            {
                                bOld = true;
                            }
                            sTemp = data.QCData.Saver.ID;
                        }
                        else
                        {
                            bOld = false;
                        }
                    }
                    else
                    {
                        bOld = false;
                    }
                    if (bNew == bOld)
                    {
                        bResult = true;
                    }
                    else
                    {
                        bResult = false;
                    }

                    sTemp = sTemp + bOld.ToString() + "&" + bNew.ToString();
                    break;

                case "3":                        //病历 签名
                    al = QCManager.GetQCData(inpatientNo, condition.InfoName);
                    if (condition.InfoCondition == "签名" || condition.InfoCondition.ToUpper() == "TRUE")
                    {
                        bNew = true;
                    }
                    if (al != null && al.Count > 0)
                    {
                        data = al[0] as Neusoft.HISFC.Models.EPR.QC;
                        if (data != null)
                        {
                            if (data.QCData.Saver.ID == "")
                            {
                                bOld = false;
                            }
                            else
                            {
                                bOld = true;
                            }

                            sTemp = data.QCData.Saver.ID;
                        }
                        else
                        {
                            bOld = false;
                        }
                    }
                    else
                    {
                        bOld = false;
                    }

                    if (bNew == bOld)
                    {
                        bResult = true;
                    }
                    else
                    {
                        bResult = false;
                    }

                    sTemp = sTemp + bOld.ToString() + "&" + bNew.ToString();
                    break;

                case "4":                        //病历建立时间
                    al    = QCManager.GetQCData(inpatientNo, condition.InfoName);
                    sTemp = "{0} - {1} <= {2}";
                    string[] sconditions = condition.InfoCondition.Split(',');
                    if (al == null)
                    {
                        return(false);
                    }
                    //病程记录等需要连续记录的
                    if (sconditions.Length > 1)
                    {
                        for (int iCondtitions = 0; iCondtitions < sconditions.Length; iCondtitions++)
                        {
                            foreach (Neusoft.HISFC.Models.EPR.QC data1 in al)
                            {
                                if (data1 != null)
                                {
                                    sTemp   = string.Format(sTemp, data1.QCData.Creater.Memo, caculation.f_cal(sconditions[iCondtitions]), 24);
                                    sTemp   = iSql.TransSql(sTemp);
                                    bResult = caculation._condition(sTemp);
                                    if (bResult)                                           //成功
                                    {
                                        break;
                                    }
                                }
                                else
                                {
                                    bResult = false;
                                }
                            }
                            if (bResult == false)
                            {
                                break;
                            }
                        }
                    }
                    else                             //时间在上一个条件内
                    {
                        if (i >= 1)
                        {
                            sTemp = "{0} - {1} <= {2}";
                            //a = EMRManager.GetNodeValue(DataStoreEMR, inpatientNo, ((Neusoft.HISFC.Models.EPR.QCCondition)QC.AlConditions[i - 1]).InfoName);
                            //b = EMRManager.GetNodeValue(DataStoreEMR, inpatientNo, condition.InfoName);
                            if (a == "-1")
                            {
                                a = "";
                            }
                            if (b == "-1")
                            {
                                b = "";
                            }
                            sTemp   = string.Format(sTemp, a, b, condition.InfoCondition);
                            bResult = caculation._condition(sTemp);
                        }
                        else
                        {
                            sTemp = "[NOW] - {0} <= {1}";
                            //a = EMRManager.GetNodeValue(DataStoreEMR, inpatientNo, condition.InfoName);
                            if (a == "-1")
                            {
                                a = "";
                            }
                            a       = a + condition.InfoCondition;
                            sTemp   = string.Format(sTemp, a, condition.InfoCondition);
                            bResult = caculation._condition(sTemp);
                        }
                    }
                    break;

                case "5":                        //控件结点符合
                    //a = EMRManager.GetNodeValue(DataStoreEMR, inpatientNo, condition.InfoName);
                    if (a == "-1")
                    {
                        a = "";
                    }
                    sTemp   = a + condition.InfoCondition;
                    bResult = caculation._condition(sTemp);
                    break;

                default:
                    break;
                }
                if (bResult == false)
                {
                    condition.Memo = sTemp + "结果:" + bResult;
                    return(false);
                }
                condition.Memo = sTemp + "结果:" + bResult;
            }
            return(true);
        }