`ctakes` is an implementation detail. This should actually be made into a real Java component, with the script service as a shallow wrapper.

The problem with script services is that they can't be nicely used from other java code, only from frontend scripts, because they only implement the generic and empty `ScriptService` interface (component role), so using them requires a hard typecast into the actual implementation, which is exactly what component-based architectures try to avoid.

So, you should define a new `@Role` interface called `ClinicalTextParser` or `ClinicalTermExtractor` or something like that, with an `extract` method. Then you should move the code from here into a `@Component public class CTAKESClinicalTermExtractor implements ClinicalTermExtractor`, which can be used from other Java components. And this script service should be called `ClinicalTermExtractorScriptService`, `@Named("clinicalTermExtractor")`, which has a dependency `@Inject private ClinicalTextParser parser`, and its `execute` method simply does `return this.parser.execute(input);`.