redox 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f64bfbcc2ac1671a0a5759f322f78db2dd8ed5b8
4
- data.tar.gz: 4f89888f5eaa8dab551527840bca9a26f5373254
2
+ SHA256:
3
+ metadata.gz: 47f44d451f8680f73732d56c1ffb9b98ed7e761f77f95e9861749483fc8c1230
4
+ data.tar.gz: 8347e91851762273e87c73424bfff4960648f39167af9a9d50aa99792d97dab2
5
5
  SHA512:
6
- metadata.gz: 73b0882cffa6ec4f67229ea1e26f292fd1066e553c6a60b6f5748cb41bee9b66000ab63aab508a4c8bbd60a5daa0ba001ed1a7bcca5a389a9fa5d3307398f60e
7
- data.tar.gz: 15226854bcdbd88eb650db21109bd3c24b6e67c312b057af4b2b50c3b0796c76c5ab00de5cbc95639fbc72c76d88df5b4be9fbf98620b5c8fcd0d9ce6eb82342
6
+ metadata.gz: e1dae8c7072e0ae4b7ebeac951ed91d6d435d5ca89996ce42616c6cf707145748cf7db0eeec9251f0db06418ec4a894c408c8e7126b3ab5ef052e6cab7911b7f
7
+ data.tar.gz: 9ecd93f6bc23bc0ddf8639b95dbf7a5dd1cdc9df6584cce2068e907de82773d7bb6ccd4735b4d449988ac746f4e2d260670e1e291355c26fc9537a16cd6ed696
data/.circleci/config.yml CHANGED
@@ -15,9 +15,6 @@ jobs:
15
15
  key: redox
16
16
  paths:
17
17
  - vendor/bundle
18
- - type: shell
19
- command: |
20
- bundle exec rubocop
21
18
  - type: shell
22
19
  command: |
23
20
  bundle exec rake test
data/CHANGELOG.md CHANGED
@@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.3] - 2018-10-03
10
+ ### Added
11
+ - Code of Conduct
12
+ - CircleCI status badge
13
+ - PatientUpdate EventType
14
+ - Ability to set FacilityCode
15
+
16
+ ### Changed
17
+ - Update gemspec to allow pushes to rubygems.org
18
+
19
+ ### Removed
20
+ - rubocop
21
+
9
22
  # [0.1.2] - 2018-03-08
10
23
  ### Added
11
24
  - CircleCI config
@@ -25,6 +38,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
25
38
  ### Added
26
39
  - Initial Release
27
40
 
28
- [Unreleased]: https://github.com/WeInfuse/redox/compare/0.1.2...HEAD
41
+ [Unreleased]: https://github.com/WeInfuse/redox/compare/0.1.3...HEAD
42
+ [0.1.3]: https://github.com/WeInfuse/redox/compare/0.1.2...0.1.3
29
43
  [0.1.2]: https://github.com/WeInfuse/redox/compare/0.1.1...0.1.2
30
44
  [0.1.1]: https://github.com/WeInfuse/redox/compare/0.1.0...0.1.1
@@ -0,0 +1,73 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ education, socio-economic status, nationality, personal appearance, race,
10
+ religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![CircleCI](https://circleci.com/gh/WeInfuse/redox.svg?style=svg)](https://circleci.com/gh/WeInfuse/redox)
2
+
1
3
  # Redox
2
4
  Ruby API wrapper for [Redox Engine](https://www.redoxengine.com)
3
5
 
data/lib/redox.rb CHANGED
@@ -21,11 +21,12 @@ module Redox
21
21
  # destinations: destinations,
22
22
  # test: true
23
23
  # )
24
- def initialize(api_key:, secret:, source:, destinations:, test: true)
24
+ def initialize(api_key:, secret:, source:, destinations:, facility_code: nil, test: true)
25
25
  @api_key = api_key
26
26
  @secret = secret
27
27
  @source = source
28
28
  @destinations = destinations
29
+ @facility_code = facility_code
29
30
  @test = test
30
31
  end
31
32
 
@@ -52,9 +53,32 @@ module Redox
52
53
  JSON.parse(response.body)
53
54
  end
54
55
 
56
+ # Send PatientUpdate message
57
+ #
58
+ # @param [Hash] patient_params data to send in the Patient JSON object
59
+ # @return [Hash] parsed response object
60
+ # @example
61
+ # Redox::Redox.new(*connection_params).update_patient(
62
+ # Identifiers: [],
63
+ # Demographics: {
64
+ # FirstName: 'Joe'
65
+ # }
66
+ # )
67
+ def update_patient(patient_params)
68
+ patient_request = Net::HTTP::Post.new('/endpoint', auth_header)
69
+ request_body = request_meta(
70
+ data_model: 'PatientAdmin', event_type: 'PatientUpdate'
71
+ ).merge(Patient: patient_params)
72
+ patient_request.body = request_body.to_json
73
+
74
+ response = connection.request(patient_request)
75
+
76
+ JSON.parse(response.body)
77
+ end
78
+
55
79
  private
56
80
 
57
- attr_reader :api_key, :secret, :source, :destinations, :test
81
+ attr_reader :api_key, :secret, :source, :destinations, :facility_code, :test
58
82
 
59
83
  def access_token
60
84
  return @access_token if @access_token
@@ -89,16 +113,20 @@ module Redox
89
113
  end
90
114
 
91
115
  def request_meta(data_model:, event_type:)
92
- {
116
+ meta_object = {
93
117
  Meta: {
94
118
  DataModel: data_model,
95
119
  EventType: event_type,
96
- EventDateTime: Time.now.to_json,
120
+ EventDateTime: nil,
97
121
  Test: test,
98
122
  Source: source,
99
- Destinations: destinations
123
+ Destinations: destinations,
100
124
  }
101
125
  }
126
+
127
+ meta_object[:Meta][:FacilityCode] = facility_code if facility_code
128
+
129
+ meta_object
102
130
  end
103
131
  end
104
132
  end
data/lib/redox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Redox
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
data/redox.gemspec CHANGED
@@ -29,7 +29,6 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency 'bundler', '~> 1.13'
30
30
  spec.add_development_dependency 'minitest', '~> 5.0'
31
31
  spec.add_development_dependency 'rake', '~> 10.0'
32
- spec.add_development_dependency 'rubocop', '~> 0.5'
33
32
  spec.add_development_dependency 'webmock', '~> 3.1'
34
33
  spec.add_development_dependency 'yard', '~> 0.9'
35
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Clark
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-08 00:00:00.000000000 Z
11
+ date: 2018-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
- - !ruby/object:Gem::Dependency
56
- name: rubocop
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0.5'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '0.5'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: webmock
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -105,6 +91,7 @@ files:
105
91
  - ".editorconfig"
106
92
  - ".gitignore"
107
93
  - CHANGELOG.md
94
+ - CODE_OF_CONDUCT.md
108
95
  - Gemfile
109
96
  - README.md
110
97
  - Rakefile
@@ -133,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
120
  version: '0'
134
121
  requirements: []
135
122
  rubyforge_project:
136
- rubygems_version: 2.5.1
123
+ rubygems_version: 2.7.6
137
124
  signing_key:
138
125
  specification_version: 4
139
126
  summary: Ruby wrapper for the Redox Engine API