I think it would be difficult to implement this in code unless the criteria for determining what is considered the same and what is considered a different diagnosis is clear. Therefore, I think it is necessary to take a step such as storing the replacement of w/ with/ in a temporary variable for matching. In my experience, I think it is best to repeat the following steps and gradually build up the conversion pattern for the data that does not match. For example, first exclude the matches without conversion. Next, eliminate the matches by converting "w/" to "with/" and "with /" to "with/", and memorize this conversion pattern. Next, eliminate matches by converting "&" to "and", and memorize this conversion pattern. Next... And so on. Then, when you have some replacement patterns, you may want to create a list of the ones that match the first X characters, while removing spaces from the remaining ones using compress or something.
... View more