Raya4505 has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Search multiple variables
by hdb (Monsignor) on Feb 20, 2014 at 15:37 UTC | |
by Raya4505 (Novice) on Feb 20, 2014 at 20:53 UTC | |
by hdb (Monsignor) on Feb 21, 2014 at 07:15 UTC | |
by Raya4505 (Novice) on Feb 25, 2014 at 15:14 UTC | |
by hdb (Monsignor) on Feb 25, 2014 at 15:24 UTC | |
|
Re: Search multiple variables
by ww (Archbishop) on Feb 20, 2014 at 15:18 UTC | |
|
Re: Search multiple variables
by kcott (Archbishop) on Feb 20, 2014 at 16:10 UTC | |
|
Re: Search multiple variables
by wjw (Priest) on Feb 20, 2014 at 19:27 UTC | |
|
Re: Search multiple variables
by Anonymous Monk on Feb 20, 2014 at 16:20 UTC |