I would like to mark all diagnoses whose conceptId starts with "G35." as main diagnosis. How can I implement this?
d:Diagnosis{d.conceptId.startswith("G35.") -> MainDiagnosis};
d:Diagnosis{d.conceptId[0:3] == "G35." -> MainDiagnosis};
All the best Philipp
You could use
REGEXPcondition to match a pattern on the value of a feature (i.e. Diagnosis.conceptId). A solution in your case would be something like this:For more information on
REGEXPCondition, feel free to consult the documentationAnother option would be to use StringFunctions; similar to what you tried to do in the first rule.
However this requires you to activate an optional extension
org.apache.uima.ruta.string.bool.BooleanOperationsExtensionin your Ruta Analysis Engine by setting its parameter PARAM_ADDITIONAL_EXTENSIONS