If we are going to persist it automatically then it should be in the
service and it should be called "startVisit" or something like that.

-Darius (by phone)
On Oct 26, 2013 12:29 PM, "Mark Goodrich" <notifications@github.com> wrote:

> In
> omod/src/main/java/org/openmrs/module/coreapps/fragment/controller/visit/QuickVisitFragmentController.java:
>
> >  		VisitDomainWrapper activeVisit = adtService.getActiveVisit(patient, visitLocation);
> >  		if (activeVisit != null) {
> >  			return new FailureResult(uiUtils.message("coreapps.activeVisits.alreadyExists"));
> >  		}
> > -		
> > -		VisitDomainWrapper visitWrapper = visitWrapperFactory.createNewVisit(patient, location, new Date());
> > -		visitWrapperRepository.persist(visitWrapper);
> > -		
> > +
> > +        Visit visit = new Visit();
> > +        visit.setPatient(patient);
> > +        visit.setLocation(visitLocation);
> > +        visit.setStartDatetime(new Date());
> > +        visit.setVisitType(emrApiProperties.getAtFacilityVisitType());
>
> Probably worth doing quickly. There was an old createNewVisit method that
> was used previously which I removed when I deleted the
> VisitDomainWrapperFactory... I can resurrect that.
>
> But, take a look at that method... it creates a new Visit but doesn't call
> a saveVisit... I assume that we will want to do that? Or is there a reason
> we'd want to separate the instantiate from the persisting?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/openmrs/openmrs-module-coreapps/pull/3/files#r7234762>
> .
>