################################################################# # Database Definition Variables # ################################################################# #Columns of database $db{"gen_name"} = 0; $db{"trade_name"} = 1; $db{"drug_class"} = 2; $db{"indications"} = 3; $db{"pharmacodynamics"} = 4; $db{"side_effects"} = 5; $db{"pharmacokinetics"} = 6; $db{"routes"} = 7; $db{"similar"} = 8; $db{"remarks"} = 9; $db{"email"} = 10; $db{"modification_time"}= 11; $db{"who_modified"} = 12; $db{"group_modified"} = 13; $db{"db_id"} = 14; #Where things are located $index_of_db_id_number = 14; $index_of_who_modified = 12; $index_of_group_who_modified = 13; $index_of_modification_time = 11; $index_for_email = 10; $index_of_field_to_be_sorted_by = "0"; #What can be edited by owners @db_user_definable_field_order = ("gen_name", "trade_name", "drug_class", "indications", "pharmacodynamics", "side_effects", "pharmacokinetics", "routes", "similar", "remarks", "email"); #these will become parameters which can contain multiple fields (ie. checkboxes), #they will become comma delimited. @multi_fields = ("side_effects", "routes"); #Move the addition fields to here @db_user_add_field_order = ( "", "", "", "", "", " CNS CV Derm Endo GI GU Hemo Immuno Musc/Skel None Resp Teratogenic Other", "", " inhalation intramuscular intrathecal intravenous oral subcutaneous topical", " ", "", ""); #Fields to be added by adders @db_add_fields = ("Generic Name", "Trade Name", "Drug Class", "Indications", "Pharmacodynamics", "Side Effects", "Pharmacokinetics", "Administration Routes", "Similar Drugs", "Remarks", "Email"); #What is viewed by viewers, headers @db_display_fields = ("Generic Name", "Trade Name", "Drug Class", "Indications", "Pharmacodynamics", "Side Effects", "Pharmacokinetics", "Administration Routes", "Similar Drugs", "Remarks", "Email"); #What is viewed by viewers, body @db_index_for_display = ($db{"gen_name"}, $db{"trade_name"}, $db{"drug_class"}, $db{"indications"}, $db{"pharmacodynamics"}, $db{"side_effects"}, $db{"pharmacokinetics"}, $db{"routes"}, $db{"similar"}, $db{"remarks"}, $db{"email"}); #possible searches of data @db_query_criteria = ("keywords|0,1,2,3,4,5,6,7,9|=|string", "gen_name|0|=|string", "trade_name|1|=|string", "drug_class|2|=|string", "indications|3|=|string", "pharmacodynamics|4|=|string", "side_effects|5|=|string", "pharmacokinetics|6|=|string", "pharmacokinetics|7|=|string", "routes|8|=|string", "similar|10|=|string", "remarks|11|=|string"); ######################################################################### # Authentication Variables # ######################################################################### $should_i_authenticate = "no"; $auth_lib = "./Library"; $auth_server = "off"; $auth_cgi = "on"; $auth_user_file = "./Users/drug.users"; $auth_alt_user_file = ""; $auth_default_group = "user"; $auth_add_register = "on"; $auth_allow_register = "on"; $auth_email_register = "off"; $auth_admin_from_address = "doyle\@cs.umn.edu"; $auth_admin_email_address = "doyle\@cs.umn.edu"; $auth_session_length = 1; $auth_session_dir = "./Session_files"; $auth_register_message = "Thanks, you may now logon with your new username and password."; $auth_allow_search = "off"; $auth_generate_password = "off"; $auth_check_duplicates = "on"; $auth_password_message = "Thanks for applying to our site, your password is"; @auth_extra_fields = ("auth_first_name", "auth_last_name", "auth_email"); @auth_extra_desc = ("First Name", "Last Name", "Email"); ################################################################# # Miscellaneous Variables # ################################################################# $data_file_path = "./Data_files/drug.data"; $max_rows_returned = "50"; $current_century = "20"; $this_script_url = "db_manager.cgi"; $location_of_counter_file = "./Data_files/drug.counter"; $location_of_log_file = "./Data_files/drug.log"; $location_of_lock_file = "./Data_files/drug.lock"; ##### Specifically for ISAP ##### $MOD_DATE='10/02/97'; # Date last modified $HOME = 'index.cgi'; # $SCRIPT_AUTHOR='Dave Doyle'; # $AUTHOR_EMAIL='doyle@cs.umn.edu '; # $QUESTIONS_NAME='Len Lichtblau'; # Contact person $QUESTIONS_ADDR='len@phcl.umn.edu'; # ################################################################# # Add to Log Subroutine # ################################################################# sub add_to_log { local ($drug_to_log) = @_; @time = localtime(time); $mon = $time[4]+1; $time = "$time[2]:$time[1]-$mon/$time[3]/$time[5]"; ($user, $access_string, $random) = split(/:/, $form_data{'session_key'}); open (LOG, ">>admin/drug_log") || die "$0: can\'t open drug_log: $!\n"; print LOG "$drug_to_log $access_string $time\n"; close(LOG); } ################################################################# # Generic Header Subroutine # ################################################################# sub generic_header { local ($title) = @_; print qq~
![]() |
Script Author:
$SCRIPT_AUTHOR For Questions or Comments: $QUESTIONS_NAME Script Last Updated: $MOD_DATE |
| $db_add_fields[$i] | "; print "$db_user_add_field_order[$i] | "; print "
|---|
In the following text fields, you may search the database according to keywords. You can also use the exact match and case sensitive boxes to modify your search |
|
| Keywords | |
|---|---|
In the following fields, you can enter the word or words that would help find information about specific drugs. |
|
| Drug Name(s) | |
|---|---|
| Similar Drug(s) | |
| Sort by which field |
|---|
\n"; } print "
| @db_display_fields[$index] | "; } else { print "|
|---|---|
| @db_display_fields[$index] | "; } if ($index == $index_for_email) { print qq~$fields[$index]. | $fields[$index]. | \n ~; } if ($form_data{'search_and_display_for_modification_button'} ne "") { print "
| $db_user_add_field_order[$index] |