Exemplo n.º 1
0
        public void IsSecondCancelByPatient_ReturnsFalse_WhenPatientCancelsTheSecondTimeAndHospitalOnce()
        {
            // Arrange
            var rttPeriod = new Non18WeekPeriod {
                Pathway = new Pathway {
                    Patient = new Patient {
                        Name = "John Doe", DateOfBirth = new DateTime(1990, 2, 2)
                    }
                }
            };

            rttPeriod.Add(new ClockTickingCompletedEvent {
                Name = new EventName {
                    Code = EventCode.PatientCancelEvent
                }
            });
            rttPeriod.Add(new ClockTickingCompletedEvent {
                Name = new EventName {
                    Code = EventCode.HospitalCancelEvent
                }
            });

            // Act
            var result = rttPeriod.IsSecondCancelByPatient(EventCode.PatientCancelEvent);

            // Assert
            Assert.IsFalse(result);
        }
Exemplo n.º 2
0
        public void MapEventMilestoneToCompletedEvent_DoesNotRaiseValidationFailedEvent_WhenCurrentEventHasTargetReferenceEvent()
        {
            //Arrange
            var non18WeekPeriod = new Non18WeekPeriod {
                Pathway = new Pathway {
                    Patient = new Patient {
                        Name = "John Doe", DateOfBirth = new DateTime(1990, 2, 2)
                    }, PPINumber = "ppi"
                }, Name = "period 1"
            };
            var completedEvent = new ClockTickingCompletedEvent {
                Name = new EventName {
                    Code = EventCode.AttendedOutpatientFirstAppointment
                }, EventDate = new DateTime(2014, 5, 20), Period = non18WeekPeriod
            };

            non18WeekPeriod.Add(new ClockStartingCompletedEvent {
                Name = new EventName {
                    Code = EventCode.ReferralReceived
                }, EventDate = new DateTime(2014, 5, 6)
            });
            non18WeekPeriod.Add(new ClockTickingCompletedEvent {
                Name = new EventName {
                    Code = EventCode.ReferralReview
                }, EventDate = new DateTime(2014, 5, 10)
            });
            non18WeekPeriod.Add(new ClockTickingCompletedEvent {
                Name = new EventName {
                    Code = EventCode.BookedOutpatientFirstAppointment
                }, EventDate = new DateTime(2014, 5, 12)
            });
            non18WeekPeriod.Add(new ClockTickingCompletedEvent {
                Name = new EventName {
                    Code = EventCode.OutpatientFirstAppointment
                }, EventDate = new DateTime(2014, 5, 14)
            });
            non18WeekPeriod.Add(completedEvent);

            var eventMilestone = new EventMilestone {
                Name = new EventName {
                    Code = EventCode.OutcomedOutpatientFirstAppointment
                }
            };

            RuleViolation eventRaised = null;

            non18WeekPeriod.ValidationFailed += delegate { eventRaised = new RuleViolation(); };

            //Act
            non18WeekPeriod.MapEventMilestoneToCompletedEvent(completedEvent, eventMilestone, new EventName {
                Code = EventCode.AttendedOutpatientFirstAppointment, Description = "Attended Outpatient First Appointment"
            });

            //Assert
            Assert.IsNull(eventRaised);
        }
Exemplo n.º 3
0
        private Period GetNon18WeekPeriod()
        {
            var period = new Non18WeekPeriod {
                Pathway = new Pathway {
                    Patient = new Patient {
                        Name = "John Doe", DateOfBirth = new DateTime(1990, 2, 2)
                    }, PPINumber = "ppi"
                }, Name = "period 1"
            };

            period.Add(new ClockTickingCompletedEvent {
                EventDate = new DateTime(2000, 12, 25), TargetDate = new DateTime(2000, 12, 25)
            });
            period.Add(new ClockTickingCompletedEvent {
                EventDate = new DateTime(2000, 12, 27)
            });

            return(period);
        }
Exemplo n.º 4
0
        public void IsSecondDidNotAttend_ReturnsTrue_WhenPatientDoesNotAttendSecondTime()
        {
            // Arrange
            var rttPeriod = new Non18WeekPeriod {
                Pathway = new Pathway {
                    Patient = new Patient {
                        Name = "John Doe", DateOfBirth = new DateTime(1990, 2, 2)
                    }
                }
            };

            rttPeriod.Add(new ClockTickingCompletedEvent {
                Name = new EventName {
                    Code = EventCode.DidNotAttend
                }
            });

            // Act
            var result = rttPeriod.IsSecondDidNotAttend(EventCode.DidNotAttend);

            // Assert
            Assert.IsTrue(result);
        }