@PaigeMiller wrote:
IF substr(ICD10Code,1,1)=:"T21" & substr(ICD10Code,8,1) in ("A", "B", "C") THEN MIC=1;
I assume you mean
IF ICD10Code=:"T21" & substr(ICD10Code,8,1) in ("A", "B", "C") THEN MIC=1;
because substr(ICD10Code,1,1)=:"T21" would be equivalent to ICD10Code=:"T".
But ICD10Code=:"T21" is equivalent to substr(ICD10Code,1,3)="T21" (assuming that ICD10Code has length >=3), which did not meet @Ihsan-Mahdi's expectations.
So I would look at the values of ICD10Code in $HEX. format (or use @Tom's suggestions) to find out why the IF condition is not met for a value that looks like "T21.06XA".
... View more