...
Order the mapping rules by mapGroup and then by mapPriority.
For each mapGroup, iterate over the rules in ascending order of priority and evaluate them until a matching mapTarget is found.
To evaluate each rule, the system uses the
javax.script.ScriptEngine
evaluator to convert the rule into a JavaScript expression and then evaluates the expression. The evaluator can optionally take into account the patient's age and gender.If the JavaScript expression evaluates to true, then the corresponding mapTarget has the matching ICD-10 code for the given mapGroup. The system collects these codes into an ArrayList of matching ICD-10 codes.
The resulting ICD-10 codes are then added as an extra column to the existing reportthat are generated by the mapping process will be displayed in the enriched column of the report.