WinUI Scheduler: 병원 예약 처리를 위한 지능형 도구

32307 단어 csharpdotnetwinui
오늘 우리는 의료 체계의 거대한 성장을 보았다.다전공의는 어디에나 있고 각종 질병 치료에 필요한 시설을 갖췄다.그러나 병원의 모든 자원인 의사와 의료 설비를 관리하는 것은 쉽지 않다.이런 상황에서 당신은 환자를 빨리 치료하기 위해 전면적인 예약 관리 시스템이 필요합니다.
Syncfusion WinUI Scheduler을 사용하면 각 리소스에 대한 계획 프로그램을 쉽게 작성하고 가용성에 따라 예약을 관리할 수 있습니다.자원 보기를 사용하면 예약한 자원이나 날짜에 따라 예약을 그룹으로 나눌 수 있습니다.스케줄러는 여러 자원 사이에서 이벤트나 데이트를 공유할 수 있습니다.또한 내장된 데이트 편집기를 사용하여 자원 데이트의 상세한 정보를 편집할 수 있습니다.
이 블로그에서는 의사들의 가용성에 따라 병원 의사들의 예약을 쉽게 분배하고 관리할 수 있는 WinUI 스케줄러 컨트롤을 사용하는 방법을 볼 수 있습니다.
주의: 저희 스케줄러 컨트롤에 익숙하지 않으시다면, 계속하기 전에 Getting Started with WinUI Scheduler 문서를 읽으십시오.

스케줄러에 리소스 추가


우선 WinUI 스케줄러에 리소스를 추가합니다.ResourceGroupType 속성 값을 Resource으로 변경하고 ResourceCollection 속성에 자원 집합을 추가합니다.
그리고 Id 클래스에 Name, Foreground, BackgroundSchedulerResource 속성을 설정하여 의사에게 자원 보기를 만들어 줍니다.아래의 코드 예시를 참고하시오.
<scheduler:SfScheduler ViewType="Week">
    <scheduler:SfScheduler.ResourceCollection>
        <local:SchedulerResourceCollection>
            // Creates instance of scheduler resource.
            <scheduler:SchedulerResource 
                Name="Dr.Sophia" 
                Id="1000" 
                Foreground="White" 
                Background="#9d65c9" />
        </local:SchedulerResourceCollection>
    </scheduler:SfScheduler.ResourceCollection>
</scheduler:SfScheduler>
주의: ResourceCollection은 IEnumerable 형식이기 때문에, XAML 코드에 직접 자원을 추가하는 데 사용되는 로컬 클래스인 Scheduler ResourceCollection을 유지합니다.

각 리소스에 대한 스케줄러 작성


WinUI 스케줄러를 사용하면 각 자원(의사)에 대해 별도의 스케줄러를 만들고 Date 속성을 사용하여 Resource 또는 ResourceGroupType으로 예약을 그룹화할 수 있습니다.
아래의 코드 예시를 참고하시오.
xmlns:scheduler="using:Syncfusion.UI.Xaml.Scheduler"

<scheduler:SfScheduler x:Name="Schedule"  
                ViewType="Week"
                ResourceGroupType="Resource">
</scheduler:SfScheduler>
WinUI 스케줄러의 리소스별 그룹
WinUI 스케줄러의 날짜별 그룹

자원 예약 스케줄 지정


ScheduleAppointment 속성을 사용하여 ResourceIdCollection 클래스에 일정 자원 Id를 설정하여 각자의 의사를 쉽게 예약할 수 있도록 합니다.
아래의 코드 예시를 참고하시오.
// Creating an instance for the schedule appointment collection.
var scheduleAppointmentCollection = new ScheduleAppointmentCollection();
//Adding schedule appointment in the schedule appointment collection. 
var appointment = new ScheduleAppointment()
{
    StartTime = DateTime.Now,
    EndTime = DateTime.Now.AddHours(2),
    Subject = "General Checkup",
    // Allocate Scheduler ResourceCollection Id to the appointment.
    ResourceIdCollection = new ObservableCollection<object>() { "1000", "1001" }
};
//Adding the schedule appointment to the schedule appointment collection.
scheduleAppointmentCollection.Add(appointment);
//Adding the schedule appointment collection to the ItemsSource of SfScheduler.
this.Scheduler.ItemsSource = scheduleAppointmentCollection;
WinUI Scheduler에서 리소스 예약 일정 지정

여러 자원 공유 예약


또한 여러 의사와 같은 행사나 예약을 공유할 수 있습니다.데이트 상세 정보가 편집되거나 업데이트되면 변경 사항은 다른 모든 공유 실례에 반영됩니다.
이를 위해 필요한 스케줄러의 ResourceCollection Id를 ResourceIdCollection – 작성된 객체의 ScheduleAppointment 속성으로 설정합니다.
아래의 코드 예시를 참고하시오.
// Creating an instance for schedule appointment collection.
var scheduleAppointmentCollection = new ScheduleAppointmentCollection();
//Adding schedule appointment in the schedule appointment collection. 
var appointment = new ScheduleAppointment()
{
    StartTime = DateTime.Now,
    EndTime = DateTime.Now.AddHours(2),
    Subject = "Surgery",
    // Allocate Scheduler ResourceCollection Id to the appointment. 
    ResourceIdCollection = new ObservableCollection<object>() { "1000", "1001", "1002" },
    AppointmentBackground = new SolidColorBrush(Color.FromArgb(255, 133, 81, 242)),
};
//Adding the schedule appointment to the schedule appointment collection.
scheduleAppointmentCollection.Add(appointment);
//Adding the schedule appointment collection to the ItemsSource of SfScheduler.
this.Scheduler.ItemsSource = scheduleAppointmentCollection;
WinUI Scheduler에서 여러 리소스를 공유하기 위한 사전 예약

데이터 바인딩


스케줄러는 모든 종류의 대상을 ResourceCollection으로 연결할 수 있는 완전한 데이터 귀속 지원을 제공합니다.필요한 필드 Id, 이름 및 기타 선택적 필드(예: 배경 및 전경)를 사용하여 사용자 정의 리소스 모델을 작성합니다.그런 다음 스케줄러 클래스의 ResourceMapping API에 해당 속성을 매핑합니다.
아래의 코드 예시를 참고하시오.Name, Id,ForegroundColor, BackgroundColor 필드를 포함하는 사용자 정의 클래스 의사를 만들었습니다.
public class Doctor
{
    /// <summary>
    /// Gets or sets the resource name.
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// Gets or sets the resource id.
    /// </summary>
    public object Id { get; set; }

    /// <summary>
    /// Gets or sets the resource background brush.
    /// </summary>
    public Brush BackgroundBrush { get; set; }

    /// <summary>
    /// Gets or sets the foreground brush.
    /// </summary>
    public Brush ForegroundBrush { get; set; }

}
다음 코드 예제와 같이 ResourceMapping 속성을 사용하여 Doctor 클래스의 속성을 Scheduler 컨트롤에 매핑합니다.
<scheduler:SfScheduler.ResourceMapping>
    <scheduler:ResourceMapping 
        Id="Id" 
        Name="Name" 
        Background="BackgroundBrush" 
        Foreground="ForegroundBrush"/>
</scheduler:SfScheduler.ResourceMapping>
그런 다음 스케줄러의 ResourceCollection 속성에 사용자 정의 에셋을 추가합니다.
<scheduler:SfScheduler.ResourceCollection>
   <local:SchedulerResourceCollection>
       <local:Doctor Name="Dr.Sophia" Id="1" ForegroundBrush="White" BackgroundBrush="#9d65c9" />
       <local:Doctor Name="Dr.Kinsley Elena" Id="2" ForegroundBrush="White" BackgroundBrush="#f08a5d" />
       <local:Doctor Name="Dr.Adeline Ruby" Id="3" ForegroundBrush="White" BackgroundBrush="#679b9b" />
   </local:SchedulerResourceCollection>
</scheduler:SfScheduler.ResourceCollection>
WinUI 스케줄러에서 사용자 지정 리소스 만들기
참고: 자세한 내용은 GitHub의 Manage Resources with the Resource View in WinUI Scheduler demo을 참조하십시오.

예약 재배치


의사 예약을 취소하거나 재배치해야 할 경우 내장된 editor을 사용하여 동적 예약을 만들거나 편집하거나 삭제하십시오.drag-and-drop과 데이트 resizing 기능을 사용하면 데이트를 재분배하고 재배치하기만 하면 됩니다.
WinUI 스케줄러의 내장 편집기

자원 가용성


당신은 special time regions을 사용하여 의사의 결근과 사용할 수 없는 상황을 관리하고 추적할 수 있습니다.이 기능은 모든 의사의 가용성을 지시할 수 있습니다.ResourceIdCollectionSpecialTimeRegions API의 DaysViewSettings 속성에서 days 보기에 자원 Id를 추가하고, TimelineViewSettings에서timeline 보기에 자원 Id를 추가합니다.
아래의 코드 예시를 참고하시오.
var currentDate = DateTime.Now;
var casualLeave = new SpecialTimeRegion();
casualLeave.Text = "Casual leave";
casualLeave.StartTime = new DateTime(currentDate.Year, currentDate.Month, currentDate.AddDays(-2).Day, 0, 0, 0);
casualLeave.EndTime = new DateTime(currentDate.Year, currentDate.Month, currentDate.AddDays(-2).Day, 23, 59, 0);
casualLeave.Background = new SolidColorBrush(Colors.DarkGray);
casualLeave.Foreground = new SolidColorBrush(Colors.Black);
casualLeave.RecurrenceRule = "FREQ=DAILY;INTERVAL=1;COUNT=1";
casualLeave.ResourceIdCollection = new ObservableCollection<object>() { "2" };

var lunch = new SpecialTimeRegion();
lunch.Text = "Lunch";
lunch.Foreground = new SolidColorBrush(Colors.Black);
lunch.StartTime = new DateTime(currentDate.Year, currentDate.Month, currentDate.AddDays(-1).Day, 12, 0, 0);
lunch.EndTime = new DateTime(currentDate.Year, currentDate.Month, currentDate.AddDays(-1).Day, 13, 0, 0);
lunch.Background = new SolidColorBrush(Colors.DarkGray);
lunch.Foreground = new SolidColorBrush(Colors.Black);
lunch.ResourceIdCollection = new ObservableCollection<object>() { "3" };
lunch.RecurrenceRule = "FREQ=DAILY;INTERVAL=1;COUNT=1";

Scheduler.DaysViewSettings.SpecialTimeRegions = new ObservableCollection<SpecialTimeRegion>() { casualLeave, lunch };
WinUI 스케줄러의 자원 가용성 추적

맞춤형 구성


'데이터 템플릿' 과 '데이터 템플릿 선택기' 기능을 사용하면 '스케줄러 자원' 보기에서 병원의 과실에 따라 다른 색깔, 심지어 다른 보기를 적용할 수 있습니다.이를 위해서는 Scheduler 클래스에서 ResourceHeaderTemplateResourceHeaderTemplateSelector API를 사용합니다.
아래의 코드 예시를 참고하시오.
<scheduler:SfScheduler.ResourceHeaderTemplate>
    <DataTemplate>
        <Grid Background="Transparent">
            <StackPanel VerticalAlignment="Center" Orientation="Vertical">
                <Border CornerRadius="36" Height="72" Width="72" BorderThickness="4" BorderBrush="{Binding Data.BackgroundBrush}">
                    <Border CornerRadius="36" Height="64" Width="64" BorderThickness="4" BorderBrush="Transparent">
                        <Image HorizontalAlignment="Center" VerticalAlignment="Center"
                        Width="55"
                        Height="55"
                        Source="{Binding Data.ImageSource}" />
                    </Border>
                </Border>
                <TextBlock HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontSize="15"
                    Text="{Binding Name}"/>
                <TextBlock HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontSize="15"
                    Text="{Binding Data.Designation}"/>
            </StackPanel>
        </Grid>
    </DataTemplate>
</scheduler:SfScheduler.ResourceHeaderTemplate>
WinUI 스케줄러의 리소스 보기 사용자 정의
참고: 자세한 내용은 Custom Resource View in WinUI Scheduler demo on GitHub을 참조하십시오.

결론


읽어주셔서 감사합니다!이 블로그에서 우리는 우리의 WinUI Scheduler을 이용하여 병원 자원 예약을 쉽게 관리하고 분배하는 방법을 보았다.풍부한 기능 집합은 날짜 제한, 수요에 따라 불러오기, 유연한 근무일, 현지화, 글로벌화 등을 포함한다.이 사용자들의 우호적인 기능을 시험해 보고 가벼운 스케줄을 즐겨보세요!
기존 Syncfusion 사용자인 경우 License and Downloads 페이지에서 최신 버전을 다운로드하십시오.또한 NuGet 패키지는 NuGet.org에서 구입할 수 있습니다.
만약 당신이 아직 고객이 아니라면, 당신은 우리가 30일 동안 free trial을 시험해 보고, 이 기능들을 좀 볼 수 있습니다.이 GitHub에서 다른 WinUI 컨트롤 프레젠테이션을 시도해 보십시오.
질문이나 의견이 있으면 support forums, Direct-Trac 또는 feedback portal으로 문의하십시오.우리는 언제든지 기꺼이 당신을 돕겠습니다!

관련 블로그





  • 좋은 웹페이지 즐겨찾기