Extract IG loading (#426)
This commit is contained in:
committed by
GitHub
parent
d660d5f76d
commit
43d50a0c71
@@ -0,0 +1,18 @@
|
||||
package ca.uhn.fhir.jpa.starter.annotations;
|
||||
|
||||
import ca.uhn.fhir.jpa.starter.AppProperties;
|
||||
import org.springframework.boot.context.properties.bind.Binder;
|
||||
import org.springframework.context.annotation.Condition;
|
||||
import org.springframework.context.annotation.ConditionContext;
|
||||
import org.springframework.core.type.AnnotatedTypeMetadata;
|
||||
|
||||
public class OnImplementationGuidesPresent implements Condition {
|
||||
@Override
|
||||
public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata metadata) {
|
||||
|
||||
AppProperties config = Binder.get(conditionContext.getEnvironment()).bind("hapi.fhir", AppProperties.class).orElse(null);
|
||||
if (config == null) return false;
|
||||
if (config.getImplementationGuides() == null) return false;
|
||||
return !config.getImplementationGuides().isEmpty();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user