public VisitInfoForCancelVM Cancel_Get(int visitId) { var visit = _mapper.Map <VisitInfoForCancelVM>(_visitRepository.GetById(visitId)); visit.Patient = _mapper.Map <PatientBasicInfoVM>(_patientRepository.GetById(visit.PatientId)); return(visit); }
public void Handle(CompleteVisit message) { DomainEvents.Register <VisitCompletedDomainEvent>(VisitCompletedDomainEventHandler); var visit = _visitRepository.GetById(message.Id); visit.Complete(); _visitRepository.Flush(); _bus.Return(ReturnCode.OK); }
public VisitGetByIdDto GetById(int id) { var result = _visitRepository.GetById(id); var visit = new VisitGetByIdDto(); visit.Id = result.Id; visit.PatientName = result.Patient.Name; visit.PatientAge = result.Patient.Age; visit.PatientPhone = result.Patient.Phone; visit.VisitDate = result.VisitDate; return(visit); }