ruby_ICE_client 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MWE2OTBlMTlhY2I5YTFmYzdiMjEyYWIwOTZlM2NiMmZjYjYwNjYwMQ==
5
+ data.tar.gz: !binary |-
6
+ ZDM5MGE4OGM0OTQ3NWQzOGZkMjIxODE2YTA2ZjExZjZkOWI2ZjVhNg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NDM4MDA3YmI1NzA4YzlkZDJlZjIzMGY5OGQ2NDA5Y2UyYmQyNzg3YTM4NGVh
10
+ OTE4OWRkZDU0ZjUyY2U3NzBjY2JiMjFmNTVjY2QxOWEyZTM5NWYyMmJkNDI4
11
+ YzcxMTc2YmRjMTE0YjIwZWUzNTg2ZDRkNWE4MTdlNjVhNGI3YjE=
12
+ data.tar.gz: !binary |-
13
+ MzQyNzYzNTIyNzk3YzcyMmQ5YzQwOTFkYTJlZWJmMTg0N2ZlY2NkZjQ1MzY0
14
+ NGEzYWU1NjcwYjAyNzE2MGRjMjg4YzY4YTllNzY0YzgxMTE1NDc4YjE0NTRh
15
+ NzFiM2E1OTU5NzQ3YmM1ODdjODc0NDFiYmYzOGVhZWM0ZWUwNDA=
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .idea
6
+ .yardoc
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ruby_ICE_client.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Benjamin Maisano
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ ruby_ICE_client
2
+ ===============
3
+
4
+ A ruby client for calling ICE - Immunization Calculation Engine
5
+
6
+ http://www.hln.com/ice/
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ gem 'ruby_ICE_client'
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install ruby_ICE_client
21
+
22
+ ## Usage
23
+
24
+ TODO: Write usage instructions here
25
+
26
+ ## Contributing
27
+
28
+ 1. Fork it
29
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
30
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
31
+ 4. Push to the branch (`git push origin my-new-feature`)
32
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,3 @@
1
+ module RubyICEClient
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,46 @@
1
+ require 'ruby_ICE_client/version'
2
+ require 'nokogiri'
3
+ require 'base64'
4
+
5
+ module RubyICEClient
6
+ class << self
7
+ def call(message, url)
8
+ xml = Nokogiri::XML::Builder.new
9
+ xml.Envelope {
10
+ xml.Body {
11
+ xml.evaluateAtSpecifiedTime('xmlns:ns2' => 'http://www.omg.org/spec/CDSS/201105/dss') {
12
+ xml.interactionId(scopingEntityId: 'gov.nyc.health', interactionId: '123456')
13
+ xml.specifiedTime "#{Date.today.strftime('%Y-%m-%d')}"
14
+ xml.evaluationRequest(clientLanguage: '', clientTimeZoneOffset: '') {
15
+ xml.kmEvaluationRequest {
16
+ xml.kmId(scopingEntityId: 'org.nyc.cir', businessId: 'ICE', version: '1.0.0')
17
+ }
18
+ xml.dataRequirementItemData {
19
+ xml.driId(itemId: 'cdsPayload') {
20
+ xml.containingEntityId(scopingEntityId: 'gov.nyc.health', businessId: 'ICEData', version: '1.0.0.0')
21
+ }
22
+ xml.data {
23
+ xml.informationModelSSId(scopingEntityId: 'org.opencds.vmr', businessId: 'VMR', version: '1.0')
24
+ xml.base64EncodedPayload Base64.encode64 message
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }
31
+ ns = xml.doc.root.add_namespace_definition 'S', 'http://www.w3.org/2003/05/soap-envelope'
32
+ xml.doc.root.namespace = ns
33
+ xml.doc.root.child.namespace = ns
34
+
35
+ uri = URI.parse url
36
+ http = Net::HTTP.new uri.host, uri.port
37
+ request = Net::HTTP::Post.new uri.path
38
+ request.body = xml.to_xml
39
+ response = http.request request
40
+ response_xml = Nokogiri::XML response.body
41
+ output_message_node = response_xml.xpath '//evaluationResponse//base64EncodedPayload'
42
+
43
+ Base64.decode64 output_message_node.first.text
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ruby_ICE_client/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ruby_ICE_client"
8
+ spec.version = RubyICEClient::VERSION
9
+ spec.authors = ["sergei-krylov"]
10
+ spec.email = ["sergei.krylov@itechart-group.com"]
11
+ spec.description = %q{A ruby client for calling ICE - Immunization Calculation Engine (http://www.hln.com/ice/)}
12
+ spec.summary = %q{}
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
+ spec.add_development_dependency "nokogiri", "~> 1.6"
24
+ spec.add_development_dependency "base64"
25
+ end
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby_ICE_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - sergei-krylov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-21 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
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.6'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: base64
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: A ruby client for calling ICE - Immunization Calculation Engine (http://www.hln.com/ice/)
70
+ email:
71
+ - sergei.krylov@itechart-group.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - Gemfile
78
+ - LICENSE
79
+ - README.md
80
+ - Rakefile
81
+ - lib/ruby_ICE_client.rb
82
+ - lib/ruby_ICE_client/version.rb
83
+ - ruby_ICE_client.gemspec
84
+ homepage: ''
85
+ licenses:
86
+ - MIT
87
+ metadata: {}
88
+ post_install_message:
89
+ rdoc_options: []
90
+ require_paths:
91
+ - lib
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ requirements: []
103
+ rubyforge_project:
104
+ rubygems_version: 2.1.11
105
+ signing_key:
106
+ specification_version: 4
107
+ summary: ''
108
+ test_files: []