Пример #1
0
        /// <summary>
        /// Creates the visit.
        /// </summary>
        /// <param name="staff">The staff.</param>
        /// <param name="appointmentDateTimeRange">The appointment date time range.</param>
        /// <param name="clinicalCase">The clinical case.</param>
        /// <param name="visitTemplate">The visit template.</param>
        /// <param name="serviceLocation">The service location.</param>
        /// <returns>
        /// A Visit.
        /// </returns>
        public Visit CreateVisit(Staff staff, 
            DateTimeRange appointmentDateTimeRange,
            ClinicalCase clinicalCase,
            VisitTemplate visitTemplate,
            Location serviceLocation )
        {
            var visitStatus = _visitStatusRepository.GetByWellKnownName ( WellKnownNames.VisitModule.VisitStatus.Scheduled );
            var visit = new Visit (staff, appointmentDateTimeRange, clinicalCase, visitStatus, serviceLocation, visitTemplate.Name, visitTemplate.CptCode );

            _visitRepository.MakePersistent ( visit );
            return visit;
        }
Пример #2
0
        /// <summary>
        /// Creates the visit.
        /// </summary>
        /// <param name="staff">The staff.</param>
        /// <param name="appointmentDateTimeRange">The appointment date time range.</param>
        /// <param name="clinicalCase">The clinical case.</param>
        /// <param name="visitTemplate">The visit template.</param>
        /// <param name="serviceLocation">The service location.</param>
        /// <returns>
        /// A Visit.
        /// </returns>
        public Visit CreateVisit(Staff staff,
                                 DateTimeRange appointmentDateTimeRange,
                                 ClinicalCase clinicalCase,
                                 VisitTemplate visitTemplate,
                                 Location serviceLocation)
        {
            var visitStatus = _visitStatusRepository.GetByWellKnownName(WellKnownNames.VisitModule.VisitStatus.Scheduled);
            var visit       = new Visit(staff, appointmentDateTimeRange, clinicalCase, visitStatus, serviceLocation, visitTemplate.Name, visitTemplate.CptCode);

            _visitRepository.MakePersistent(visit);
            return(visit);
        }
Пример #3
0
        public void CreateVisit_GivenValidArguments_VisitIsEditable()
        {
            using ( var serviceLocatorFixture = new ServiceLocatorFixture () )
            {
                // Setup
                var visitRepository = new Mock<IVisitRepository> ();
                var visitStatus = new Mock<VisitStatus> ();
                visitStatus.SetupProperty ( v => v.WellKnownName, WellKnownNames.VisitModule.VisitStatus.Scheduled );
                var visitStatusRepository = new Mock<IVisitStatusRepository> ();
                visitStatusRepository
                    .Setup ( v => v.GetByWellKnownName ( WellKnownNames.VisitModule.VisitStatus.Scheduled ) )
                    .Returns ( visitStatus.Object );

                var visitFactory = new VisitFactory (
                    visitRepository.Object,
                    visitStatusRepository.Object );

                var patient = new Mock<Patient> ();

                var clinicalCase = new Mock<ClinicalCase> ();
                clinicalCase.Setup ( c => c.Patient ).Returns ( patient.Object );

                var agency = new Mock<Agency>();
                var visitTemplate = new VisitTemplate(agency.Object, "Initial Behavioral Health - Adult", "99204" );

                var initialLocation = new Mock<Location> ();

                var staff = new Mock<Staff> ();
                var appointmentDateTimeRange = new DateTimeRange ( new DateTime (), new DateTime () );

                var visit = visitFactory.CreateVisit (
                    staff.Object,
                    appointmentDateTimeRange,
                    clinicalCase.Object,
                    visitTemplate,
                    initialLocation.Object );

                visit.ReviseNote ( "note" );
            }
        }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VisitTemplateActivityType"/> class.
 /// </summary>
 /// <param name="vistTemplate">The vist template.</param>
 protected internal VisitTemplateActivityType( VisitTemplate vistTemplate )
 {
     _visitTemplate = vistTemplate;
 }
        private Visit BuildScheduledVisit( Staff staff, DateTimeRange appointmentDateTimeRange, ClinicalCase clinicalCase, Problem problem = null )
        {
            var visitTemplate = new VisitTemplate ( SafeHarborAgency, "Initial Behavioral Health - Adult", "99204" );
            Session.SaveOrUpdate ( visitTemplate );

            var visit = new Visit ( staff, appointmentDateTimeRange, clinicalCase, ScheduledVisitStatus, SafeHarborLocation, visitTemplate.Name, visitTemplate.CptCode );

            if ( problem != null )
            {
                visit.AddProblem ( problem );
            }

            Session.SaveOrUpdate ( visit );

            return visit;
        }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VisitTemplateActivityType"/> class.
 /// </summary>
 /// <param name="vistTemplate">The vist template.</param>
 protected internal VisitTemplateActivityType(VisitTemplate vistTemplate)
 {
     _visitTemplate = vistTemplate;
 }