using FluentValidation;

public class FhirEncounterUpsertRequestValidator : AbstractValidator<FhirEncounterUpsertRequest>
{
    public FhirEncounterUpsertRequestValidator()
    {
        RuleFor(x => x.IdentifierSystem).NotEmpty().MaximumLength(500);
        RuleFor(x => x.IdentifierValue).NotEmpty().MaximumLength(200);
        RuleFor(x => x.PatientId).NotEmpty();
        RuleFor(x => x.EncounterType).IsInEnum();
        RuleFor(x => x.Department).IsInEnum();
        RuleFor(x => x.AttendingPhysician).NotEmpty().MaximumLength(200);
        RuleFor(x => x.TargetStatus).IsInEnum();
        RuleFor(x => x.RoomBed).MaximumLength(20)
            .When(x => x.RoomBed is not null);
        RuleFor(x => x.AdmissionReason).MaximumLength(500)
            .When(x => x.AdmissionReason is not null);
        RuleFor(x => x.DischargeDiagnosis).MaximumLength(500)
            .When(x => x.DischargeDiagnosis is not null);
    }
}
