class R4FhirCarePlanToEnrollmentTransformer extends AbstractFhirCarePlanToEnrollmentTransformer {

    @Nonnull
    protected EnrollmentStatus convertStatus( @Nullable CarePlan.CarePlanStatus carePlanStatus )
    {
        if ( carePlanStatus == null )
        {
            throw new TransformerDataException( "Care plan status is mandatory." );
        }

        switch ( carePlanStatus )
        {
            case ACTIVE:
                return EnrollmentStatus.ACTIVE;
            case COMPLETED:
                return EnrollmentStatus.COMPLETED;
            case REVOKED:
                return EnrollmentStatus.CANCELLED;
            default:
                throw new TransformerDataException( "Care plan status is not allowed: " + carePlanStatus );
        }
    }

    public  R4FhirCarePlanToEnrollmentTransformer( @Nonnull ScriptExecutor scriptExecutor, @Nonnull TrackedEntityMetadataService trackedEntityMetadataService, @Nonnull TrackedEntityService trackedEntityService,
        @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository, @Nonnull OrganizationUnitService organizationUnitService, @Nonnull ProgramMetadataService programMetadataService, @Nonnull EnrollmentService enrollmentService,
        @Nonnull FhirResourceMappingRepository resourceMappingRepository, @Nonnull FhirDhisAssignmentRepository fhirDhisAssignmentRepository, @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull ValueConverter valueConverter );

}