简体   繁体   中英

Mark Diagnosis with a certain ICD-10 Code as main diagnosis

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 REGEXP condition to match a pattern on the value of a feature (ie Diagnosis.conceptId). A solution in your case would be something like this:

d:Diagnosis{REGEXP(d.conceptId, "^G35.*") -> MainDiagnosis};

For more information on REGEXP Condition, feel free to consult the documentation


Another option would be to use StringFunctions; similar to what you tried to do in the first rule.

d:Diagnosis{startsWith(d.conceptId, "G35") -> MainDiagnosis};

However this requires you to activate an optional extension org.apache.uima.ruta.string.bool.BooleanOperationsExtension in your Ruta Analysis Engine by setting its parameter PARAM_ADDITIONAL_EXTENSIONS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM