Beispiel #1
0
        private TimeSpan StayInHospitalHours(string noteID, string regID)
        {
            DateTime regdate       = ThisAddIn.StartTime(noteID, StartTime.Registry, regID);
            DateTime dischagedDate = ThisAddIn.StartTime(noteID, StartTime.Discharged, regID);
            TimeSpan passHours     = dischagedDate.Subtract(regdate);

            return(passHours);
        }
Beispiel #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);
        }