@Test( expected = TransformerDataException.class ) public void convertStatusOther() { transformer.convertStatus( CarePlan.CarePlanStatus.DRAFT ); }
@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 ); } }
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 ); } } }
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 ); } } 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 ); }
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 ); } } 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 ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); }
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 ); } } 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 ); @Nonnull @Override Set<FhirVersion> getFhirVersions();  }