예제 #1
0
        private string OperationSequence(string registryID, string noteID)
        {
            XmlNode operations = null;

            ThisAddIn.OperationTime(registryID, ref operations);
            if (operations == null)
            {
                return(null);
            }

            XmlNodeList emrNotes  = emrDoc.DocumentElement.SelectNodes(ElementNames.EmrNote);
            XmlNode     congeners = ThisAddIn.GetCongener0(noteID, emrNotes);

            if (congeners.ChildNodes.Count == 0)
            {
                return(operations.FirstChild.Attributes[AttributeNames.Sequence].Value);
            }

            string sequence = null;

            foreach (XmlNode operation in operations.ChildNodes)
            {
                string commitT = "";
                sequence = operation.Attributes[AttributeNames.Sequence].Value;
                if (ThisAddIn.NoteExistsWithSequence(AttributeNames.Sequence, sequence, congeners, ref commitT)
                    != null && commitT != "")
                {
                    continue;
                }
                break;
            }
            return(sequence);
        }
예제 #2
0
        private bool SatisfiedCondition(string condition, string noteID, XmlNode emrdoc)
        {
            bool ret = false;

            switch (condition)
            {
            case Condition.Dead:
                DateTime deadtime = ThisAddIn.StartTime(noteID, StartTime.Dead, regID);
                if (deadtime == DateTime.MinValue)
                {
                    ret = false;
                }
                else
                {
                    ret = Absence(noteID, emrdoc);
                }
                break;

            case Condition.Operation:
                #region Operation
                XmlNode opetime = null;
                ThisAddIn.OperationTime(regID, ref opetime);
                if (opetime == null)
                {
                    ret = false;
                }
                else if (opetime.HasChildNodes)
                {
                    foreach (XmlNode item in opetime.ChildNodes)
                    {
                        string seq = item.Attributes[AttributeNames.Sequence].Value;
                        if (Absence(noteID, seq, emrdoc))
                        {
                            ret = true;
                            break;
                        }
                    }
                }
                #endregion
                break;

            case Condition.Hours48:
                if (StayInHospitalHours(noteID, regID).TotalHours > 48)
                {
                    ret = Absence(noteID, emrdoc);
                }
                break;

            case Condition.Hours72:
                if (StayInHospitalHours(noteID, regID).TotalHours > 72)
                {
                    ret = Absence(noteID, emrdoc);
                }
                break;
            }
            return(ret);
        }