patient_severity 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/patient_severity.rb +41 -0
  3. metadata +43 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a804c6fd00e8abc95d65813fc2534da9baa7c8c5
4
+ data.tar.gz: 6b26a0482cd56367e8455fcee19efc516caf5032
5
+ SHA512:
6
+ metadata.gz: b375a5c9425e63ab20730c6bb16880e7751742d306c73c5851efa4abef67c88fbe63704eb3f354bcd247873185f3fb14835ee33ca66ffc50a4ccc71b1b67420f
7
+ data.tar.gz: f3944d617947339fa413820a8cecb5510463cfecca1452763a496d75d5b557fa4b485a527215cc7b5d12a0524b70324c03a6350e7fc46d5461cdf79c19a07ae1
@@ -0,0 +1,41 @@
1
+ class Check
2
+ # enter "condition_age", for example "Flu_29"
3
+ def self.runcheck(key_word)
4
+ arr = key_word.split('_')
5
+ condition = arr[0]
6
+ age = arr[1].to_i
7
+
8
+ severity = 0
9
+ if condition == 'Common Cold'
10
+ severity = 1
11
+ elsif condition == 'Flu'
12
+ severity = 2
13
+ elsif condition == 'Chest Infection'
14
+ severity = 3
15
+ elsif condition == 'Pancreatitis'
16
+ severity = 4
17
+ elsif condition == 'Cancer'
18
+ severity = 5
19
+ end
20
+
21
+ if age < 10
22
+ if age < 2
23
+ severity = severity + 2
24
+ else
25
+ severity = severity + 1
26
+ end
27
+ elsif age > 65
28
+ if age > 75
29
+ severity = severity + 2
30
+ else
31
+ severity = severity + 1
32
+ end
33
+ end
34
+
35
+ if severity > 5
36
+ severity = 5
37
+ end
38
+
39
+ return severity
40
+ end
41
+ end
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: patient_severity
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.5
5
+ platform: ruby
6
+ authors:
7
+ - David Lawlor
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-04-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A Gem made for my Cloud App Development class
14
+ email: awlorl@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/patient_severity.rb
20
+ homepage: http://rubygems.org/gems/patient_severity
21
+ licenses: []
22
+ metadata: {}
23
+ post_install_message:
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ required_rubygems_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ requirements: []
38
+ rubyforge_project:
39
+ rubygems_version: 2.6.8
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: Assigns patients a severity based on condition and age
43
+ test_files: []