private void DummyAddVisitPractitioner()
        {
            try
            {
                Platform.GetService <IExternalPractitionerAdminService>(
                    delegate(IExternalPractitionerAdminService service)
                {
                    ListExternalPractitionersResponse findResponse = service.ListExternalPractitioners(new ListExternalPractitionersRequest("Who", ""));
                    ExternalPractitionerSummary practitioner       = findResponse.Practitioners[0];

                    VisitPractitionerDetail vp = new VisitPractitionerDetail();

                    vp.Role = CollectionUtils.SelectFirst(_visitPractitionerRoleChoices,
                                                          delegate(EnumValueInfo e) { return(e.Code == "RF"); });
                    vp.Practitioner = practitioner;
                    vp.StartTime    = Platform.Time;

                    _visit.Practitioners.Add(vp);
                });
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, SR.ExceptionCannotAddVisitPractitioner, this.Host.DesktopWindow,
                                        delegate
                {
                    this.ExitCode = ApplicationComponentExitCode.Error;
                    this.Host.Exit();
                });
            }
        }
Exemplo n.º 2
0
        private static VisitPractitionerDetail CreateVisitPractitionerDetail(VisitPractitioner vp, IPersistenceContext context)
        {
            var detail = new VisitPractitionerDetail
            {
                Practitioner = new ExternalPractitionerAssembler().CreateExternalPractitionerSummary(vp.Practitioner, context),
                Role         = EnumUtils.GetEnumValueInfo(vp.Role, context),
                StartTime    = vp.StartTime,
                EndTime      = vp.EndTime
            };

            return(detail);
        }
        private void DummyUpdateVisitPractitioner()
        {
            try
            {
                VisitPractitionerDetail vp = _currentVisitPractitionerSelection;

                vp.Role = CollectionUtils.SelectFirst <EnumValueInfo>(_visitPractitionerRoleChoices,
                                                                      delegate(EnumValueInfo e) { return(e.Code == "CN"); });
                vp.EndTime = Platform.Time;
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, SR.ExceptionCannotAddVisitPractitioner, this.Host.DesktopWindow,
                                        delegate
                {
                    this.ExitCode = ApplicationComponentExitCode.Error;
                    this.Host.Exit();
                });
            }
        }
 public void SetSelectedVisitPractitioner(ISelection selection)
 {
     this.CurrentVisitPractitionerSelection = (VisitPractitionerDetail)selection.Item;
 }