Exemple #1
0
        protected override async Task OnInitializedAsync()
        {
            SchedulerService.Appointments = await AppointmentService.ListAsync();

            AppointmentTypes = await AppointmentTypeService.ListAsync();

            Clients = await ClientService.ListAsync();

            Rooms = await RoomService.ListAsync();

            // Patients belong to Clients - This should be driven by the selected client
            Patients = await PatientService.ListAsync(ClientId);

            Patient = Patients.FirstOrDefault(p => p.PatientId == PatientId);

            Today = await ConfigurationService.ReadAsync();

            StartDate = UpdateDateToToday(StartDate);
            DayStart  = UpdateDateToToday(DayStart);
            DayEnd    = UpdateDateToToday(DayEnd);

            Groups.Add("Rooms");

            IsLoaded = true;

            await AddPatientImages();

            await InitSignalR();
        }
        protected override async Task OnInitializedAsync()
        {
            Logger.LogInformation($"Initialize AppointmentEditor with appointment starting at {Appointment.Start}");
            Doctors = await DoctorService.ListAsync();

            if (IsAdd)
            {
                Appointment.DoctorId = Doctors[0].DoctorId;
            }

            AppointmentTypes = await AppointmentTypeService.ListAsync();

            if (IsAdd)
            {
                Appointment.AppointmentTypeId = AppointmentTypes[0].AppointmentTypeId;
            }

            // set appointment to current patient if not specified
            if (string.IsNullOrEmpty(Appointment.PatientName))
            {
                Appointment.PatientName = Patient.Name;
                Appointment.PatientId   = Patient.PatientId;
                Appointment.ClientId    = Patient.ClientId;
                Appointment.ClientName  = Patient.ClientName;
                Appointment.Title       = $"(WE) {Appointment.PatientName} - {Appointment.ClientName}";
                Logger.LogInformation("Setting new appointment up for " + Appointment.Title);
            }

            await LoadPicture();
        }
        protected override async Task OnInitializedAsync()
        {
            Doctors = await DoctorService.ListAsync();

            if (IsAdd)
            {
                Appointment.DoctorId = Doctors[0].DoctorId;
            }

            AppointmentTypes = await AppointmentTypeService.ListAsync();

            if (IsAdd)
            {
                Appointment.AppointmentTypeId = AppointmentTypes[0].AppointmentTypeId;
            }

            await LoadPicture();
        }