Fir build

This commit is contained in:
James Agnew 2019-11-03 19:15:53 -05:00
parent f481e11ad5
commit 9672dac827
2 changed files with 22 additions and 13 deletions

View File

@ -54,7 +54,7 @@ public class SearchParamExtractorR4 extends BaseSearchParamExtractor implements
@VisibleForTesting
public SearchParamExtractorR4(ModelConfig theModelConfig, FhirContext theCtx, IValidationSupport theValidationSupport, ISearchParamRegistry theSearchParamRegistry) {
super(theCtx, theSearchParamRegistry);
initFhirPath();
initFhirPath(theValidationSupport);
start();
}
@ -71,16 +71,22 @@ public class SearchParamExtractorR4 extends BaseSearchParamExtractor implements
@Override
@PostConstruct
public void initFhirPath() {
public void start() {
super.start();
if (myFhirPathEngine == null) {
IValidationSupport support = myApplicationContext.getBean(IValidationSupport.class);
IWorkerContext worker = new HapiWorkerContext(getContext(), support);
myFhirPathEngine = new FHIRPathEngine(worker);
myFhirPathEngine.setHostServices(new SearchParamExtractorR4HostServices());
initFhirPath(support);
}
}
public void initFhirPath(IValidationSupport theSupport) {
IWorkerContext worker = new HapiWorkerContext(getContext(), theSupport);
myFhirPathEngine = new FHIRPathEngine(worker);
myFhirPathEngine.setHostServices(new SearchParamExtractorR4HostServices());
}
private static class SearchParamExtractorR4HostServices implements FHIRPathEngine.IEvaluationContext {

View File

@ -43,8 +43,6 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
public class SearchParamExtractorR5 extends BaseSearchParamExtractor implements ISearchParamExtractor {
@Autowired
private IValidationSupport myValidationSupport;
private FHIRPathEngine myFhirPathEngine;
public SearchParamExtractorR5() {
@ -56,21 +54,26 @@ public class SearchParamExtractorR5 extends BaseSearchParamExtractor implements
*/
public SearchParamExtractorR5(FhirContext theCtx, DefaultProfileValidationSupport theDefaultProfileValidationSupport, ISearchParamRegistry theSearchParamRegistry) {
super(theCtx, theSearchParamRegistry);
myValidationSupport = theDefaultProfileValidationSupport;
initFhirPath();
initFhirPath(theDefaultProfileValidationSupport);
start();
}
@Override
@PostConstruct
public void initFhirPath() {
public void start() {
super.start();
if (myFhirPathEngine == null) {
IValidationSupport support = myApplicationContext.getBean(IValidationSupport.class);
IWorkerContext worker = new HapiWorkerContext(getContext(), support);
myFhirPathEngine = new FHIRPathEngine(worker);
myFhirPathEngine.setHostServices(new SearchParamExtractorR5HostServices());
initFhirPath(support);
}
}
public void initFhirPath(IValidationSupport theSupport) {
IWorkerContext worker = new HapiWorkerContext(getContext(), theSupport);
myFhirPathEngine = new FHIRPathEngine(worker);
myFhirPathEngine.setHostServices(new SearchParamExtractorR5HostServices());
}
@Override
protected IValueExtractor getPathValueExtractor(IBaseResource theResource, String nextPath) {
return () -> myFhirPathEngine.evaluate((Base) theResource, nextPath);