change_healthcare 1.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,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2d7766b076c5a57716adbc686f8fbdac7d68a7bad362e7dcc08e3e47e7af46fc
4
+ data.tar.gz: ad99024a691a484739b087c6793b9270b0a70f2a0d855e3d16783e4675d9aef4
5
+ SHA512:
6
+ metadata.gz: 6e707823891ef3daa7b34dea8b9c7e271542d4d67c2dea2d18e3d9ffca344c2525a8849796184b02e524c1c75ef7d7ef01cf5df409fc763e919f7a275d677588
7
+ data.tar.gz: e221da01922964064e693a4ae3db98493b57831e130a57bce7113ae0e8e2f4822d115b8f03aed335a267e1c40f4474aff7b5b861072ebd94872da2b0addd4746
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in change_healthcare.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,90 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ change_healthcare (1.0.1)
5
+ activesupport (>= 6)
6
+ nokogiri (>= 1)
7
+ rest-client (~> 2)
8
+ rexml
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ activesupport (7.0.2.4)
14
+ concurrent-ruby (~> 1.0, >= 1.0.2)
15
+ i18n (>= 1.6, < 2)
16
+ minitest (>= 5.1)
17
+ tzinfo (~> 2.0)
18
+ addressable (2.8.0)
19
+ public_suffix (>= 2.0.2, < 5.0)
20
+ coderay (1.1.3)
21
+ concurrent-ruby (1.1.10)
22
+ crack (0.4.5)
23
+ rexml
24
+ diff-lcs (1.5.0)
25
+ domain_name (0.5.20190701)
26
+ unf (>= 0.0.5, < 1.0.0)
27
+ hashdiff (1.0.1)
28
+ http-accept (1.7.0)
29
+ http-cookie (1.0.4)
30
+ domain_name (~> 0.5)
31
+ i18n (1.10.0)
32
+ concurrent-ruby (~> 1.0)
33
+ method_source (1.0.0)
34
+ mime-types (3.4.1)
35
+ mime-types-data (~> 3.2015)
36
+ mime-types-data (3.2022.0105)
37
+ minitest (5.15.0)
38
+ netrc (0.11.0)
39
+ nokogiri (1.13.6-x86_64-darwin)
40
+ racc (~> 1.4)
41
+ pry (0.14.1)
42
+ coderay (~> 1.1)
43
+ method_source (~> 1.0)
44
+ public_suffix (4.0.7)
45
+ racc (1.6.0)
46
+ rake (13.0.6)
47
+ rest-client (2.1.0)
48
+ http-accept (>= 1.7.0, < 2.0)
49
+ http-cookie (>= 1.0.2, < 2.0)
50
+ mime-types (>= 1.16, < 4.0)
51
+ netrc (~> 0.8)
52
+ rexml (3.2.5)
53
+ rspec (3.11.0)
54
+ rspec-core (~> 3.11.0)
55
+ rspec-expectations (~> 3.11.0)
56
+ rspec-mocks (~> 3.11.0)
57
+ rspec-core (3.11.0)
58
+ rspec-support (~> 3.11.0)
59
+ rspec-expectations (3.11.0)
60
+ diff-lcs (>= 1.2.0, < 2.0)
61
+ rspec-support (~> 3.11.0)
62
+ rspec-mocks (3.11.1)
63
+ diff-lcs (>= 1.2.0, < 2.0)
64
+ rspec-support (~> 3.11.0)
65
+ rspec-support (3.11.0)
66
+ tzinfo (2.0.4)
67
+ concurrent-ruby (~> 1.0)
68
+ unf (0.1.4)
69
+ unf_ext
70
+ unf_ext (0.0.8.1)
71
+ vcr (6.1.0)
72
+ webmock (3.14.0)
73
+ addressable (>= 2.8.0)
74
+ crack (>= 0.3.2)
75
+ hashdiff (>= 0.4.0, < 2.0.0)
76
+
77
+ PLATFORMS
78
+ ruby
79
+
80
+ DEPENDENCIES
81
+ bundler (>= 2.0)
82
+ change_healthcare!
83
+ pry (>= 0.10)
84
+ rake (>= 13.0)
85
+ rspec (>= 3.0)
86
+ vcr
87
+ webmock
88
+
89
+ BUNDLED WITH
90
+ 2.1.4
data/LICENSE ADDED
@@ -0,0 +1,51 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
37
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
38
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
39
+
40
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
41
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
42
+
43
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
44
+
45
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
46
+
47
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
48
+
49
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
50
+
51
+ END OF TERMS AND CONDITIONS
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # ChangeHealthcare
2
+
3
+ The ChangeHealthcare Ruby library provides convenient access to the ChangeHealthcare API from applications written in the Ruby language. It includes a pre-defined set of classes for API resources.
4
+
5
+ The library also provides other features. For example:
6
+
7
+ Easy configuration path for fast setup and use.
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'change_healthcare'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install change_healthcare
24
+
25
+ ## Usage
26
+
27
+ Check specs for usage information
28
+
29
+ ## Development
30
+
31
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
32
+
33
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
34
+
35
+ Run specs with
36
+
37
+ $ bundle exec rspec
38
+
39
+ ## Contributing
40
+
41
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/change_healthcare.
42
+
43
+ ## License
44
+
45
+ The gem is available as open source under the terms of the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "change_healthcare"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,33 @@
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "change_healthcare/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "change_healthcare"
7
+ spec.version = ChangeHealthcare::VERSION
8
+ spec.authors = ["Saul Moncada"]
9
+ spec.email = ["smoncada@mdlive.com"]
10
+
11
+ spec.summary = %q{Api Client for ChangeHealthcare}
12
+ spec.homepage = "https://www.mdlive.com"
13
+ spec.license = "MIT"
14
+
15
+ spec.metadata["homepage_uri"] = spec.homepage
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_runtime_dependency "rest-client", "~> 2"
23
+ spec.add_runtime_dependency "nokogiri", '>= 1'
24
+ spec.add_runtime_dependency "activesupport", '>= 6'
25
+ spec.add_runtime_dependency "rexml"
26
+
27
+ spec.add_development_dependency "bundler", ">= 2.0"
28
+ spec.add_development_dependency "rake", ">= 13.0"
29
+ spec.add_development_dependency "rspec", ">= 3.0"
30
+ spec.add_development_dependency "pry", ">= 0.10"
31
+ spec.add_development_dependency "vcr"
32
+ spec.add_development_dependency "webmock"
33
+ end
@@ -0,0 +1,68 @@
1
+ class ChangeHealthcare::ApiClient
2
+ include Singleton
3
+ attr_reader :session_id
4
+
5
+ def call(object_name, operation, params = {}, include_organization = true, session_id = nil)
6
+ xml = build_xml(object_name, operation, params, include_organization, session_id)
7
+ do_request "#{configuration.base_url}?request=#{xml}"
8
+ end
9
+
10
+ def configuration
11
+ ChangeHealthcare.configuration
12
+ end
13
+
14
+ private
15
+
16
+ # https://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/Builder
17
+ def build_xml(object_name, operation, params, include_organization, session_id)
18
+ request_params = base_request_params
19
+ request_params[:sessionid] = session_id unless session_id == nil
20
+
21
+ builder = Nokogiri::XML::Builder.new do |xml|
22
+ xml.REQUEST(request_params) do
23
+ if params.is_a? Hash
24
+ xml.OBJECT(name: object_name, op: operation) do
25
+ params.each_pair do |k,v|
26
+ save_element(xml, k, v)
27
+ end
28
+ xml.organization configuration.facility if include_organization
29
+ end
30
+ elsif params.is_a? Array
31
+ params.each do |element|
32
+ xml.OBJECT(name: object_name, op: operation) do
33
+ element.each_pair do |k,v|
34
+ save_element(xml, k, v)
35
+ end
36
+ end
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+ builder.to_xml
43
+ end
44
+
45
+ def save_element(xml, k,v)
46
+ if ["object_id"].include?(k.to_s)
47
+ xml.send(k.to_s+"_", v)
48
+ else
49
+ xml.send(k, v)
50
+ end
51
+ end
52
+
53
+ def base_request_params
54
+ {
55
+ userid: configuration.user_id,
56
+ password: configuration.password,
57
+ facility: configuration.facility
58
+ }
59
+ end
60
+
61
+ def do_request(url)
62
+ response = ChangeHealthcare::XmlResponse.new(RestClient.get(url))
63
+ doc = response.xml
64
+ raise ChangeHealthcare::Error.new(doc.root) if doc.children[0].name == "ERROR"
65
+ @session_id = doc.root.attributes["sessionid"].value if doc.root.attributes.keys.include?("sessionid")
66
+ response
67
+ end
68
+ end
@@ -0,0 +1,27 @@
1
+ class ChangeHealthcare::BaseApiObject
2
+ def self.attributes
3
+ raise "Not Implemented"
4
+ end
5
+
6
+ def self.chc_object_name
7
+ raise "Not Implemented"
8
+ end
9
+
10
+ def initialize(hash)
11
+ hash.extract!(*self.class.attributes.map{|a|a.to_s}).each_pair {|k,v| public_send("#{k}=",v)}
12
+ end
13
+
14
+ def self.configuration
15
+ ChangeHealthcare.configuration
16
+ end
17
+
18
+ private
19
+
20
+ def self.call_api(name, params={}, include_organization = true)
21
+ ChangeHealthcare::ApiClient.instance.call(chc_object_name, name, params, include_organization)
22
+ end
23
+
24
+ def self.response_to_list(resp)
25
+ resp.xml.root.children.map {|node| new(Hash.from_xml(node.to_s)["OBJECT"])}
26
+ end
27
+ end
@@ -0,0 +1,35 @@
1
+ # https://cli-cert.emdeon.com/api/cert/caregiver.html
2
+ class ChangeHealthcare::Caregiver < ChangeHealthcare::BaseApiObject
3
+ def self.attributes
4
+ [
5
+ :birth_date, :caregiver, :caregiver_type, :caregiverhsi, :dea_number,
6
+ :first_name, :hsi_value, :hsilabel, :is_epcs_enabled, :label_name,
7
+ :last_name, :license_exp_date, :license_number, :license_state, :license_status,
8
+ :license_type, :middle_name, :npi, :organization, :organization_name, :prefix,
9
+ :sex, :ssn, :suffix, :title, :upin,
10
+ ]
11
+ end
12
+
13
+ attr_accessor(*self.attributes)
14
+
15
+ def self.chc_object_name
16
+ "caregiver"
17
+ end
18
+
19
+ # https://cli-cert.emdeon.com/api/cert/caregiver.html#search
20
+ # params = {npi: "1877324149"}
21
+ def self.search(params={})
22
+ resp = call_api(__method__.to_s, params, false)
23
+ response_to_list(resp)
24
+ end
25
+
26
+ # https://cli-cert.emdeon.com/api/cert/caregiver.html#put_no_update
27
+ # params = {npi: "1684638855", last_name: "TestMDL", first_name: "TestMDL", birth_date: "1/1/1959", caregiver_type: "P"}
28
+ # Available Types:
29
+ # N: Nurse, NP: Nurse Practitioner, OSTEOPA: Osteopathic Physician Assistant
30
+ # PA: PA , P: Physician, DC: Doctor of Chiropractic
31
+ def self.put_no_update(params={})
32
+ resp = call_api(__method__.to_s, params, false)
33
+ response_to_list(resp)
34
+ end
35
+ end
@@ -0,0 +1,24 @@
1
+ # https://cli-cert.emdeon.com/api/cert/clientid.html
2
+ class ChangeHealthcare::ClientId < ChangeHealthcare::BaseApiObject
3
+ def self.attributes
4
+ [
5
+ :caregiver, :caregiver_type, :clientid, :deliver_report, :description,
6
+ :file_delivery_cfg, :first_name, :id_value, :is_active, :is_default, :lab,
7
+ :lab_name, :last_name, :middle_name, :provider, :provider_name, :providercaregiver,
8
+ :sex, :suffix, :upin
9
+ ]
10
+ end
11
+
12
+ attr_accessor(*self.attributes)
13
+
14
+ def self.chc_object_name
15
+ "clientid"
16
+ end
17
+
18
+ # https://cli-cert.emdeon.com/api/cert/clientid.html#search_orglab
19
+ # params = {lab: "23402537", provider: "23402521", is_active: "Y"}
20
+ def self.search_orglab(params={})
21
+ resp = call_api(__method__.to_s, params)
22
+ response_to_list(resp)
23
+ end
24
+ end
@@ -0,0 +1,30 @@
1
+ # https://cli-cert.emdeon.com/api/cert/clinicalreport.html
2
+ class ChangeHealthcare::ClinicalReport < ChangeHealthcare::BaseApiObject
3
+ def self.attributes
4
+ [
5
+ :abnormals_count, :clinicalreport, :content_expiration_date, :creation_date, :creation_datetime, :document,
6
+ :expiration_date, :filler_order_number, :forwarded, :has_external_content, :is_abnormal, :is_annotated,
7
+ :is_downloaded, :is_forwarded, :is_latest, :is_printed, :is_viewed, :lab_code, :ordering_cg_fname,
8
+ :ordering_cg_lname, :ordering_cg_mname, :ordering_cg_suffix, :ordering_client_id, :orderresult, :orders_transmitted,
9
+ :organization_name, :originalreport, :person, :person_account_number, :person_first_name, :person_last_name,
10
+ :person_middle_name, :person_suffix, :placer_order_number, :previousreport, :psc_orders_created, :receiving_cg_fname,
11
+ :receiving_cg_lname, :receiving_cg_mname, :receiving_cg_suffix, :receiving_client_id, :receivingorganization,
12
+ :report_priority, :report_request_date, :report_service_date, :report_status, :report_subject, :report_type,
13
+ :reports_count, :reports_delivered, :reports_forwarded, :reports_printed, :reports_undelivered, :reports_viewed,
14
+ :sequence, :sponsor, :sponsor_name, :std_orders_created
15
+ ]
16
+ end
17
+
18
+ attr_accessor(*self.attributes)
19
+
20
+ def self.chc_object_name
21
+ "clinicalreport"
22
+ end
23
+
24
+ # https://cli-cert.emdeon.com/api/cert/order.html#get
25
+ # params = { order: "3004834610" }
26
+ def self.get(params={})
27
+ resp = call_api(__method__.to_s, params, false)
28
+ response_to_list(resp)
29
+ end
30
+ end
@@ -0,0 +1,9 @@
1
+ class ChangeHealthcare::Error < StandardError
2
+ attr_reader :code, :description, :root
3
+
4
+ def initialize(xml_root_node)
5
+ @root = xml_root_node
6
+ @code = xml_root_node.children[0].children[0].to_s
7
+ @description = xml_root_node.children[1].children[0].to_s
8
+ end
9
+ end
@@ -0,0 +1,22 @@
1
+ # https://cli-cert.emdeon.com/api/cert/hsilabel.html
2
+ class ChangeHealthcare::HsiLabel < ChangeHealthcare::BaseApiObject
3
+ def self.attributes
4
+ [
5
+ :description, :hsilabel, :is_hsi_for, :label_name, :object_type,
6
+ :organization, :registration
7
+ ]
8
+ end
9
+
10
+ attr_accessor(*self.attributes)
11
+
12
+ def self.chc_object_name
13
+ "hsilabel"
14
+ end
15
+
16
+ # https://cli-cert.emdeon.com/api/cert/hsilabel.html#search
17
+ # params = {is_hsi_for: "PATIENT", registration: "Y"}
18
+ def self.search(params={})
19
+ resp = call_api(__method__.to_s, params, true)
20
+ response_to_list(resp)
21
+ end
22
+ end
@@ -0,0 +1,45 @@
1
+ # https://cli-cert.emdeon.com/api/cert/labcfg.html
2
+ class ChangeHealthcare::LabConfig < ChangeHealthcare::BaseApiObject
3
+ def self.attributes
4
+ [
5
+ :address_1, :address_2, :city, :configurable_item, :control_type,
6
+ :control_width, :description, :domain_code_type, :is_required,
7
+ :lab, :lab_code, :lab_name, :parent_level, :parentlab, :range,
8
+ :sequence, :state, :transmission_mode, :validate, :validation,
9
+ :value, :zip
10
+ ]
11
+ end
12
+
13
+ attr_accessor(*self.attributes)
14
+
15
+ def self.chc_object_name
16
+ "labcfg"
17
+ end
18
+
19
+ # https://cli-cert.emdeon.com/api/cert/labcfg.html#search
20
+ def self.search(lab_id)
21
+ params = configurable_items.map{|i| {lab: lab_id, configurable_item: i} }
22
+ resp = call_api(__method__.to_s, params)
23
+ response_to_list(resp)
24
+ end
25
+
26
+ def self.configurable_items
27
+ [
28
+ "Max diagnoses per test",
29
+ "Max diagnoses per requisition",
30
+ "Show Report Comments",
31
+ "Max tests per requisition",
32
+ "Show Fasting Hours",
33
+ "STAT Indicator",
34
+ "Phone Results",
35
+ "Copy To Functionality",
36
+ "Max copy to per requisition",
37
+ "Custom ABN Format",
38
+ "Support Standard Requisitions",
39
+ "Support PSC Requisitions",
40
+ "Support Third Party Billing",
41
+ "Support Client Billing",
42
+ "Support Patient Billing"
43
+ ]
44
+ end
45
+ end
@@ -0,0 +1,19 @@
1
+ # https://cli-cert.emdeon.com/api/cert/labsystemcode.html
2
+ class ChangeHealthcare::LabSystemCode < ChangeHealthcare::BaseApiObject
3
+ def self.attributes
4
+ [ :code_type, :lab, :lab_system_code, :system_code ]
5
+ end
6
+
7
+ attr_accessor(*self.attributes)
8
+
9
+ def self.chc_object_name
10
+ "labsystemcode"
11
+ end
12
+
13
+ # https://cli-cert.emdeon.com/api/cert/labsystemcode.html#search_uniq_codes
14
+ # params = {lab: 23402537, code_type: "ORD_CATEG"}
15
+ def self.search_uniq_codes(params={})
16
+ resp = call_api(__method__.to_s, params, false)
17
+ response_to_list(resp)
18
+ end
19
+ end
@@ -0,0 +1,30 @@
1
+ # https://cli-cert.emdeon.com/api/cert/objectdoc.html
2
+ class ChangeHealthcare::ObjectDoc < ChangeHealthcare::BaseApiObject
3
+ def self.attributes
4
+ [
5
+ :body_text, :expiration_date, :mime_type, :object_id,
6
+ :object_type, :objectdoc, :report_date, :storage_date
7
+ ]
8
+ end
9
+
10
+ attr_accessor(*self.attributes)
11
+
12
+ def self.chc_object_name
13
+ "objectdoc"
14
+ end
15
+
16
+ # https://cli-cert.emdeon.com/api/cert/objectdoc.html#search
17
+ # params = { object_id: "3004834601"}
18
+ def self.search(params={})
19
+ resp = call_api(__method__.to_s, params, false)
20
+ response_to_list(resp)
21
+ end
22
+
23
+ # https://cli-cert.emdeon.com/api/cert/objectdoc.html#get
24
+ # params = { objectdoc: "621448196359963"}
25
+ def self.get(params={})
26
+ resp = call_api(__method__.to_s, params, false)
27
+ response_to_list(resp)
28
+ end
29
+
30
+ end