@Test public void searchFilterLocation() throws URISyntaxException { final SearchFilterCollector searchFilterCollector = new SearchFilterCollector( Collections.singletonMap( "location", Collections.singletonList( "hyusiofh7s8" ) ) ); final SearchFilter searchFilter = new SearchFilter( searchFilterCollector, false ); provider.initSearchFilter( FhirVersion.R4, new RuleInfo<>( new EnrollmentRule(), Collections.emptyList() ), searchFilter ); final List<String> variables = new ArrayList<>(); UriBuilder uriBuilder = new DefaultUriBuilderFactory().builder(); uriBuilder = searchFilterCollector.add( uriBuilder, variables ); Assert.assertEquals( new URI( "?ou=hyusiofh7s8" ), uriBuilder.build( variables ) ); }
@Override protected void initSearchFilter( @Nonnull FhirVersion fhirVersion, @Nonnull RuleInfo<EnrollmentRule> ruleInfo, @Nonnull SearchFilter searchFilter ) { searchFilter.addReference( CarePlan.SP_INSTANTIATES_CANONICAL, FhirResourceType.PLAN_DEFINITION, DhisResourceType.PROGRAM_METADATA, "program" ); searchFilter.addReference( CarePlan.SP_INSTANTIATES_URI, FhirResourceType.PLAN_DEFINITION, DhisResourceType.PROGRAM_METADATA, "program" ); searchFilter.addReference( CarePlan.SP_PATIENT, FhirResourceType.PATIENT, DhisResourceType.TRACKED_ENTITY, "trackedEntityInstance" ); searchFilter.addReference( CarePlan.SP_SUBJECT, null, DhisResourceType.TRACKED_ENTITY, "trackedEntityInstance" ); searchFilter.addReference( LocationExtensionUtils.LOCATION_SEARCH_PARAM, FhirResourceType.LOCATION, DhisResourceType.ORGANIZATION_UNIT, "ou" ); }
R4EnrollmentToFhirDataProvider extends AbstractEnrollmentToFhirDataProvider { @Override protected void initSearchFilter( @Nonnull FhirVersion fhirVersion, @Nonnull RuleInfo<EnrollmentRule> ruleInfo, @Nonnull SearchFilter searchFilter ) { searchFilter.addReference( CarePlan.SP_INSTANTIATES_CANONICAL, FhirResourceType.PLAN_DEFINITION, DhisResourceType.PROGRAM_METADATA, "program" ); searchFilter.addReference( CarePlan.SP_INSTANTIATES_URI, FhirResourceType.PLAN_DEFINITION, DhisResourceType.PROGRAM_METADATA, "program" ); searchFilter.addReference( CarePlan.SP_PATIENT, FhirResourceType.PATIENT, DhisResourceType.TRACKED_ENTITY, "trackedEntityInstance" ); searchFilter.addReference( CarePlan.SP_SUBJECT, null, DhisResourceType.TRACKED_ENTITY, "trackedEntityInstance" ); searchFilter.addReference( LocationExtensionUtils.LOCATION_SEARCH_PARAM, FhirResourceType.LOCATION, DhisResourceType.ORGANIZATION_UNIT, "ou" ); } }
R4EnrollmentToFhirDataProvider extends AbstractEnrollmentToFhirDataProvider { @Override protected void initSearchFilter( @Nonnull FhirVersion fhirVersion, @Nonnull RuleInfo<EnrollmentRule> ruleInfo, @Nonnull SearchFilter searchFilter ) { searchFilter.addReference( CarePlan.SP_INSTANTIATES_CANONICAL, FhirResourceType.PLAN_DEFINITION, DhisResourceType.PROGRAM_METADATA, "program" ); searchFilter.addReference( CarePlan.SP_INSTANTIATES_URI, FhirResourceType.PLAN_DEFINITION, DhisResourceType.PROGRAM_METADATA, "program" ); searchFilter.addReference( CarePlan.SP_PATIENT, FhirResourceType.PATIENT, DhisResourceType.TRACKED_ENTITY, "trackedEntityInstance" ); searchFilter.addReference( CarePlan.SP_SUBJECT, null, DhisResourceType.TRACKED_ENTITY, "trackedEntityInstance" ); searchFilter.addReference( LocationExtensionUtils.LOCATION_SEARCH_PARAM, FhirResourceType.LOCATION, DhisResourceType.ORGANIZATION_UNIT, "ou" ); } R4EnrollmentToFhirDataProvider( @Nonnull ScriptExecutor scriptExecutor, @Nonnull EnrollmentService enrollmentService ); }
R4EnrollmentToFhirDataProvider extends AbstractEnrollmentToFhirDataProvider { @Override protected void initSearchFilter( @Nonnull FhirVersion fhirVersion, @Nonnull RuleInfo<EnrollmentRule> ruleInfo, @Nonnull SearchFilter searchFilter ) { searchFilter.addReference( CarePlan.SP_INSTANTIATES_CANONICAL, FhirResourceType.PLAN_DEFINITION, DhisResourceType.PROGRAM_METADATA, "program" ); searchFilter.addReference( CarePlan.SP_INSTANTIATES_URI, FhirResourceType.PLAN_DEFINITION, DhisResourceType.PROGRAM_METADATA, "program" ); searchFilter.addReference( CarePlan.SP_PATIENT, FhirResourceType.PATIENT, DhisResourceType.TRACKED_ENTITY, "trackedEntityInstance" ); searchFilter.addReference( CarePlan.SP_SUBJECT, null, DhisResourceType.TRACKED_ENTITY, "trackedEntityInstance" ); searchFilter.addReference( LocationExtensionUtils.LOCATION_SEARCH_PARAM, FhirResourceType.LOCATION, DhisResourceType.ORGANIZATION_UNIT, "ou" ); } R4EnrollmentToFhirDataProvider( @Nonnull ScriptExecutor scriptExecutor, @Nonnull EnrollmentService enrollmentService ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); }
R4EnrollmentToFhirDataProvider extends AbstractEnrollmentToFhirDataProvider { @Override protected void initSearchFilter( @Nonnull FhirVersion fhirVersion, @Nonnull RuleInfo<EnrollmentRule> ruleInfo, @Nonnull SearchFilter searchFilter ) { searchFilter.addReference( CarePlan.SP_INSTANTIATES_CANONICAL, FhirResourceType.PLAN_DEFINITION, DhisResourceType.PROGRAM_METADATA, "program" ); searchFilter.addReference( CarePlan.SP_INSTANTIATES_URI, FhirResourceType.PLAN_DEFINITION, DhisResourceType.PROGRAM_METADATA, "program" ); searchFilter.addReference( CarePlan.SP_PATIENT, FhirResourceType.PATIENT, DhisResourceType.TRACKED_ENTITY, "trackedEntityInstance" ); searchFilter.addReference( CarePlan.SP_SUBJECT, null, DhisResourceType.TRACKED_ENTITY, "trackedEntityInstance" ); searchFilter.addReference( LocationExtensionUtils.LOCATION_SEARCH_PARAM, FhirResourceType.LOCATION, DhisResourceType.ORGANIZATION_UNIT, "ou" ); } R4EnrollmentToFhirDataProvider( @Nonnull ScriptExecutor scriptExecutor, @Nonnull EnrollmentService enrollmentService ); @Nonnull @Override Set<FhirVersion> getFhirVersions();  }