First, thanks in advance to anyone who takes the time to help me.
Second, I am self-taught, new to perl, so please try to make answers easy to read aka: simple.
Question: I am needing a script that will allow someone to enter multiple diagnosis codes (100+) in a text file or CSV file or array and then those diagnosis codes will match up with another list in a text file or CSV file or multiple arrays and if they match they will be renamed with their technical diagnosis name. This is what I have so far…
my $Search = qw(6280); if ( @found = grep { $_ eq $Search } @array) { my $found = join ",", @found; print "Primary Diagnosis: Meningitis, $found\n"; } if ( @found = grep { $_ eq $Search } @Encephalitis_77 ) { my $found = join ",", @found; print "Primary Diagnosis: Encephalitis, $found\n"; } else { print "Sorry, \"$Search\" not found in diagnosis list\n"};
But this only allows me to search one diagnosis code at a time which won’t work and it’s so much coding because I will have to do a grep function for each diagnosis and there are 1,000+. There must be a simpilar way!! Also, I am then needing the script to determine if one code was found more than any other code and label that as the patient’s primary diagnosis.
I have tried listing them in arrays, in hashes with arrays, in text files, in CSV files and unfortunately I may get it to find a couple codes, but I can’t figure out how to rename multiple codes and then also find the code that was matched the most. Hope this question is clear. Thank you for your help.
In reply to Search multiple variables by Raya4505
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |