health_calculator 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +79 -0
- data/Rakefile +1 -0
- data/health_calculator.gemspec +23 -0
- data/lib/health_calculator/version.rb +3 -0
- data/lib/health_calculator.rb +104 -0
- metadata +81 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MTJkNzkyNjIzMzI0MmRkMzdhOTVmYTY0MDk2ZWM5ZjY4Yzk0ZTkwYw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NWMzZmU2ZGFhOTY2MWJhZmJiZmNkYzMyMzc5MzBlZjk3MzZiZjM0OA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ODNiNWY0MTkxMGFkMTI3YzU0ZDkxODU2NzFjMTAxMWEyY2U5ZGJmYzQ0N2U1
|
10
|
+
Y2M1ZTdiM2VlMDVhZWFhYzdkNzA1MjEzNmM5MDJjMjQ4OWVjZTE0ZDI4ZGE0
|
11
|
+
MzU4NTcyNTczZWVjNWY3OGU1N2Q1M2U4YzU4N2FiZDk4OTkwNDQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZGYzODdiMjcwODFhNDZkYWY5MTM5YWE4Y2I0MjY0YzRiMTUzZWUxNDVkNTE4
|
14
|
+
Y2UwNzc4MDMyMTQ1ZWJmZDI2ZGU0ZmQ4NmI3OWFmNGMyMWYyMzJkOGFiOWU1
|
15
|
+
M2U0NmFmOWU2ODU2YmI3ODVjY2FkNjllOTE4ZTk1Y2JkYzg0ODA=
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 saikiranmothe
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
# HealthCalculator
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'health_calculator'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install health_calculator
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
Health Calucator Provides caluclations on your health data !
|
23
|
+
|
24
|
+
###############################
|
25
|
+
BMI Caluclator
|
26
|
+
###############################
|
27
|
+
#pound_to_kilo_converter
|
28
|
+
|
29
|
+
#Calucalte BMI with weight in Kilos(KGS) and Height in Meters
|
30
|
+
|
31
|
+
|
32
|
+
1.Blood Pressure (BP) -- Hyper and Hypo
|
33
|
+
|
34
|
+
2.Glucose (Sugar)
|
35
|
+
|
36
|
+
3.WBC
|
37
|
+
|
38
|
+
4.RBC
|
39
|
+
|
40
|
+
5.DLC (differntial lucicite count)
|
41
|
+
|
42
|
+
6. Urine Test (Keytone Bodids)
|
43
|
+
|
44
|
+
7.blood urea
|
45
|
+
|
46
|
+
8.Ploy urea
|
47
|
+
|
48
|
+
9.Poly Depcia
|
49
|
+
|
50
|
+
10.
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
####HARMONES
|
55
|
+
4.Growth harmone ( Gigantism,Dwarfism)
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
###Functions
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
## Contributing
|
64
|
+
|
65
|
+
1. Fork it
|
66
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
67
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
68
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
69
|
+
5. Create new Pull Request
|
70
|
+
|
71
|
+
|
72
|
+
###SAIKIRAN MOTHE -- saikiran.mothe@gmail.com
|
73
|
+
## Contributing
|
74
|
+
|
75
|
+
1. Fork it
|
76
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
77
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
78
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
79
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'health_calculator/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "health_calculator"
|
8
|
+
spec.version = HealthCalculator::VERSION
|
9
|
+
spec.authors = ["saikiranmothe"]
|
10
|
+
spec.email = ["saikiran.mothe@gmail.com"]
|
11
|
+
spec.description = %q{HealthCaluclator : calucalate your health data :) }
|
12
|
+
spec.summary = %q{HealthCaluclator : calucalate your Health Data}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
require "health_calculator/version"
|
2
|
+
|
3
|
+
module HealthCalculator
|
4
|
+
# Your code goes here...
|
5
|
+
##BMI Caluclator
|
6
|
+
class BMI #
|
7
|
+
|
8
|
+
# convert weight into kilos
|
9
|
+
# one pound = 0.4535 ( 1 lb = 453.59 gms)
|
10
|
+
# one kilo = 2.20462 lbs
|
11
|
+
def pound_to_kilo_converter(weight_lb)
|
12
|
+
@weight_kg = ( weight_lb * (0.453592) ) #one pound = 0.453592 kilos
|
13
|
+
print @weight_kg
|
14
|
+
end
|
15
|
+
|
16
|
+
#Kilo to Pound Converter
|
17
|
+
def kilo_to_pound_converter(weight_kg)
|
18
|
+
puts "#{weight_kg} Kilos"
|
19
|
+
@weight_lb = ( (weight_kg) * (0.453592) ).to_f + "\s Pounds"
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
#Convert height Inches into Feet
|
24
|
+
def inch_to_feet_converter
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
#Calucalte BMI with weight in Kilos(KGS) and Height in Meters
|
30
|
+
def bmi_kg(weight_kg,height_mi)
|
31
|
+
puts "Weight should be in Kilos and Height should be in meters"
|
32
|
+
#puts "Weight = 10kgs ; height = 6 meters"
|
33
|
+
@bmi_calac_kg = (weight_kg / (height_mi * height_mi)).round(2)
|
34
|
+
end
|
35
|
+
|
36
|
+
#Calucalte BMI with weight in Pounds(LBS) and Height in Inches
|
37
|
+
##If Mass in Pounds(lbs)
|
38
|
+
def bmi_lb(weight_lb,height_in)
|
39
|
+
puts "Weight should be in Pounds and Height in Inches "
|
40
|
+
#puts "Weight = 10lbs ; height = 160 Inches , 1 Foot = 12 Inches"
|
41
|
+
#@bmi_calac_lb = ( (weight_lb / (height_in * height_in)).round(2) ) * 703
|
42
|
+
@bmi_calac_lb = ( (weight_lb) / (height_in * height_in).round(2) ) * 703.06957964
|
43
|
+
end
|
44
|
+
|
45
|
+
#For instance, a person with
|
46
|
+
#BMI 34 has a BMI Prime of 34/25 = 1.36,
|
47
|
+
#BMI PRIME = BMIVALUE / 25
|
48
|
+
def bmi_prime_kg(bmi_value)
|
49
|
+
if bmi_value > 25
|
50
|
+
@bmi_prime_kg = bmi_value / 25
|
51
|
+
end
|
52
|
+
end
|
53
|
+
#########################
|
54
|
+
# Refernce From WIKIPEDIA
|
55
|
+
#------------------------------
|
56
|
+
#Category BMI range – kg/m2 BMI Prime
|
57
|
+
#############################
|
58
|
+
# Very severely underweight less than 15 less than 0.60
|
59
|
+
# Severely underweight from 15.0 to 16.0 from 0.60 to 0.64
|
60
|
+
# Underweight from 16.0 to 18.5 from 0.64 to 0.74
|
61
|
+
# Normal (healthy weight) from 18.5 to 25 from 0.74 to 1.0
|
62
|
+
# Overweight from 25 to 30 from 1.0 to 1.2
|
63
|
+
# Obese Class I (Moderately obese) from 30 to 35 from 1.2 to 1.4
|
64
|
+
# Obese Class II (Severely obese) from 35 to 40 from 1.4 to 1.6
|
65
|
+
# Obese Class III (Very severely obese) over 40 over 1.6
|
66
|
+
|
67
|
+
####RATING FOR BMI VALUE POUND BASED
|
68
|
+
def rating_lb(bmi_value)
|
69
|
+
result = case bmi_value
|
70
|
+
when 0..15 then "Very severely underweight less than 15"
|
71
|
+
when 15..16 then "Severely underweight from 15.0 to 16.0"
|
72
|
+
when 16..18.5 then "Underweight from 16.0 to 18.5"
|
73
|
+
when 18.5..25 then "Normal (healthy weight) from 18.25 to 25"
|
74
|
+
when 25..30 then "Overweight from 25 to 30"
|
75
|
+
when 30..35 then " Obese Class I (Moderately obese) from 30 to 35"
|
76
|
+
when 35..40 then "Obese Class II (Severely obese) from 35 to 40"
|
77
|
+
when 40..100 then "Obese Class III (Very severely obese) over 40"
|
78
|
+
else "Invalid Score"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
#########################################
|
82
|
+
|
83
|
+
####RATING FOR BMI VALUE MASS (KILO) BASED
|
84
|
+
def rating_kg(bmi_value)
|
85
|
+
result = case bmi_value
|
86
|
+
when 0..15 then "Very severely underweight less than 0.60"
|
87
|
+
when 15..16 then "Severely underweight from 0.60 to 0.64"
|
88
|
+
when 16..18.5 then "Underweight from 0.64 to 0.74"
|
89
|
+
when 18.5..25 then "Normal (healthy weight) from 0.74 to 1.0"
|
90
|
+
when 25..30 then "Overweight from 1.0 to 1.2"
|
91
|
+
when 30..35 then " Obese Class I (Moderately obese) from 1.2 to 1.4"
|
92
|
+
when 35..40 then "Obese Class II (Severely obese) from 1.4 to 1.6"
|
93
|
+
when 40..100 then "Obese Class III (Very severely obese) over 1.6"
|
94
|
+
else "Invalid Score"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
##############################################
|
98
|
+
|
99
|
+
end # Class Ends here
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: health_calculator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- saikiranmothe
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-31 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: ! 'HealthCaluclator : calucalate your health data :) '
|
42
|
+
email:
|
43
|
+
- saikiran.mothe@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- .gitignore
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- health_calculator.gemspec
|
54
|
+
- lib/health_calculator.rb
|
55
|
+
- lib/health_calculator/version.rb
|
56
|
+
homepage: ''
|
57
|
+
licenses:
|
58
|
+
- MIT
|
59
|
+
metadata: {}
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
requirements: []
|
75
|
+
rubyforge_project:
|
76
|
+
rubygems_version: 2.1.3
|
77
|
+
signing_key:
|
78
|
+
specification_version: 4
|
79
|
+
summary: ! 'HealthCaluclator : calucalate your Health Data'
|
80
|
+
test_files: []
|
81
|
+
has_rdoc:
|