-
Notifications
You must be signed in to change notification settings - Fork 0
/
acvpu2gcs.pl
100 lines (95 loc) · 2.31 KB
/
acvpu2gcs.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
# this emulates #! processing on NIH machines.
# (remove #! line above if indigestible)
eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
# process any FOO=bar switches
$, = ' '; # set output field separator
$\ = "\n"; # set output record separator
print 'This is AcVPU score and conversion to GCS score';
print '================================================';
{
$IGNORECASE = 1;
}
print 'Is the patient Alert? [Y/N]';
while ($A ne 'Y' || $A ne 'N') {
$A = <STDIN>;
chomp($A);
if ($A eq 'Y' || $A eq 'N') {
last;
}
else {
'Response is out of range, please answer Y for yes, and N for no';
}
}
if ($A eq 'Y') {
print 'The AVPU score is A (ALERT) the GCS score is 15/15';
exit;
}
elsif ($A eq 'N') {
print 'Is the patient confused (new onset confuction)? [Y/N]';
while ($C ne 'Y' || $C ne 'N') {
$C = <STDIN>;
chomp($C);
if ($C eq 'Y' || $C eq 'N') {
last;
}
else {
'Response is out of range, please answer Y for yes, and N for no';
}
}
if ($C eq 'Y') {
print 'The AcVPU score is C (Confused) the GCS score is <15/15 (13-14/15)';
exit;
}
elsif ($C eq 'N') {
print 'Is the patient verbally responsive? [Y/N]';
}
while ($V ne 'Y' || $V ne 'N') {
$V = <STDIN>;
chomp($V);
if ($V eq 'Y' || $V eq 'N') {
last;
}
else {
'Response is out of range, please answer Y for yes, and N for no';
}
}
if ($V eq 'Y') {
print 'The AVPU score is V (VERBAL) the GCS score is 13/15';
{ exit;
}
}
elsif ($V eq 'N') {
print 'Is the patient responsive to painful stimuli? [Y/N]';
}
while ($P ne 'Y' || $P ne 'N') {
$P = <STDIN>;
chomp($P);
if ($P eq 'Y' || $P eq 'N') {
last;
}
else {
'Response is out of range, please answer Y for yes, and N for no';
}
}
if ($P eq 'Y') {
print 'The AVPU score is P (Pain) the GCS score is 8/15';
exit;
}
elsif ($P eq 'N') {
print 'The patient is possibly unresponsive.';
}
{ print 'AVPU score is U (Unresponsive) the GCS is 3/15';
last;
}
#{
#exit $ExitValue;
#}
#sub readline {
# if ($getline_ok = (($_ = <>) ne '')) {
# ;
# }
# $_;
}