isdrugallergic 0.0.1
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.
- checksums.yaml +7 -0
- data/lib/isdrugallergic.rb +33 -0
- metadata +42 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 40855e074694810de44398b4811b34649f02411235319b01905d8d965535a3cb
|
4
|
+
data.tar.gz: ec56bfeb8774bfd13bf2f249aac364a982cf8229d45e73b7b90967956f98545a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c463629f1e8493c435afc5f162c2664b384717d0e39d4fe3cc8bf42700ab967b9b6b4b980147a31ca7293cc5e2025ec35044618c553b27f4b9b1ab945c35f48e
|
7
|
+
data.tar.gz: 6c13ad08599e8942b2bdf23294afc260e4cd3913237aa5805ff0a4e264b93234de9eea1ec9b0415b43522c4b083ab9e1d90a22408081ed0d5d45eb7bc024d030
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class Checkallergy
|
2
|
+
|
3
|
+
def self.check_allergy(presc_drug, allergies)
|
4
|
+
|
5
|
+
|
6
|
+
#initialize variables
|
7
|
+
@presc_drug = presc_drug
|
8
|
+
@allergies = allergies
|
9
|
+
@status_code
|
10
|
+
@status_message
|
11
|
+
|
12
|
+
#loop through each patient allergy
|
13
|
+
@allergies.each do |allergy|
|
14
|
+
|
15
|
+
# puts("\n\n\n"+allergy.allergy_name.downcase+" <==> "+@presc_drug.downcase+"\n\n\n")
|
16
|
+
if allergy.allergy_name.downcase.eql? @presc_drug.downcase
|
17
|
+
# puts("Allergic Conflict Found")
|
18
|
+
@status_code = 0
|
19
|
+
@status_message = "There was an allergy conflict with the proposed drug:"+@presc_drug
|
20
|
+
break
|
21
|
+
else
|
22
|
+
# puts("Allergic conflict not found")
|
23
|
+
@status_code = 1
|
24
|
+
@status_message = "No allergy conflicts found with drug:"+@presc_drug
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
#return response to the caller with the allergy conflict status
|
30
|
+
return({"status_code":@status_code, "status_message":@status_message})
|
31
|
+
|
32
|
+
end
|
33
|
+
end #end module
|
metadata
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: isdrugallergic
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- PaulByrne
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-08-28 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A simple gem comparing the prescribed drug to patients allergies
|
14
|
+
email: paulbyrnew@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/isdrugallergic.rb
|
20
|
+
homepage: http://rubygems.org/gems/isdrugallergic
|
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
|
+
rubygems_version: 3.0.4
|
39
|
+
signing_key:
|
40
|
+
specification_version: 4
|
41
|
+
summary: Test to if patient is allergic to drug
|
42
|
+
test_files: []
|