Beispiel #1
0
        public static string GetStatusDisplayString(CaseStatus status, CaseStatusReason reason)
        {
            switch (status)
            {
            case CaseStatus.ConsiderForDischarge:
                return("CFD");

            case CaseStatus.Good:
                return("Good");

            case CaseStatus.History:
                return("History");

            case CaseStatus.NotReady:

                string s = "";
                if (reason.HasFlag(CaseStatusReason.AuthExpired))
                {
                    s += ",Auth";
                }
                if (reason.HasFlag(CaseStatusReason.NoBCBA))
                {
                    s += ",BCBA";
                }
                if (reason.HasFlag(CaseStatusReason.NoIntake))
                {
                    s += ",Int";
                }
                if (reason.HasFlag(CaseStatusReason.NoPrescription))
                {
                    s += ",Rx";
                }

                if (s.Length > 0)
                {
                    s = "NG:" + s.Substring(1);
                }

                return(s);

            default:
                return("Unknown");
            }
        }
Beispiel #2
0
        public void CalculateStatus()
        {
            // if it's historic or CFD, don't calculate, return as is
            if (Status == CaseStatus.ConsiderForDischarge || Status == CaseStatus.History)
            {
                return;
            }

            CaseStatusReason reason = CaseStatusReason.NotSet;

            if (!HasSupervisor)
            {
                reason |= CaseStatusReason.NoBCBA;
            }

            if (!HasIntake)
            {
                reason |= CaseStatusReason.NoIntake;
            }

            if (!HasPrescription)
            {
                reason |= CaseStatusReason.NoPrescription;
            }

            if (!HasAuthorization)
            {
                reason |= CaseStatusReason.AuthExpired;
            }

            StatusReason = reason;

            if (reason > CaseStatusReason.NotSet)
            {
                Status = CaseStatus.NotReady;
            }
            else
            {
                Status = CaseStatus.Good;
            }
        }