Permalink
Browse files

clean up

  • Loading branch information...
1 parent c1985b9 commit 63d3b67e036e1e0badf08298e9d75098bf38de25 @nuex nuex committed May 17, 2012
View
@@ -1,16 +1,16 @@
Gem::Specification.new do |s|
- s.name = "ability"
- s.version = "0.0.7"
- s.date = "2012-03-12"
- s.summary = "Ability Access API Ruby Client"
- s.description = "A Ruby client for interacting with the Ability ACCESS API"
- s.authors = ["consolochase@gmail.com"]
- s.email = "consolochase@gmail.com"
- s.homepage = "http://github.com/consolo/ability_client"
- s.files = Dir.glob("lib/**/*") + %w(README.md)
- s.add_dependency "rest-client"
- s.add_dependency "builder"
- s.add_dependency "xml-simple"
- s.add_development_dependency "webmock"
- s.require_paths = ["lib"]
+ s.name = 'ability'
+ s.version = '0.0.8'
+ s.date = '2012-03-12'
+ s.summary = 'Ability Access API Ruby Client'
+ s.description = 'A Ruby client for interacting with the Ability ACCESS API'
+ s.authors = ['consolochase@gmail.com']
+ s.email = 'consolochase@gmail.com'
+ s.homepage = 'http://github.com/consolo/ability_client'
+ s.files = Dir.glob('lib/**/*') + %w(README.md)
+ s.add_dependency 'rest-client'
+ s.add_dependency 'builder'
+ s.add_dependency 'xml-simple'
+ s.add_development_dependency 'webmock'
+ s.require_paths = ['lib']
end
View
@@ -1,5 +1,5 @@
module Ability; end
-require File.expand_path(File.join(File.dirname(__FILE__), "ability", "version"))
-require File.expand_path(File.join(File.dirname(__FILE__), "ability", "error"))
-require File.expand_path(File.join(File.dirname(__FILE__), "ability", "parser"))
-require File.expand_path(File.join(File.dirname(__FILE__), "ability", "client"))
+require File.expand_path(File.join(File.dirname(__FILE__), 'ability', 'version'))
+require File.expand_path(File.join(File.dirname(__FILE__), 'ability', 'error'))
+require File.expand_path(File.join(File.dirname(__FILE__), 'ability', 'parser'))
+require File.expand_path(File.join(File.dirname(__FILE__), 'ability', 'client'))
View
@@ -7,8 +7,8 @@ module Ability
# Ability::Client is a module for interacting with the Ability ACCESS API
module Client
- SEAPI_VERSION = 1
- API_ROOT = "https://access.abilitynetwork.com/portal/seapi/services"
+ API_ROOT = 'https://access.abilitynetwork.com/access'
+ API_VERSION = 1
def self.version
Ability::VERSION
@@ -34,14 +34,6 @@ def self.password=(password)
@password = password
end
- def self.service_id
- @service_id
- end
-
- def self.service_id=(service_id)
- @service_id = service_id
- end
-
def self.ssl_ca_file
@ssl_ca_file
end
@@ -55,7 +47,7 @@ def self.ssl_client_cert
end
def self.ssl_client_cert=(ssl_client_cert)
- @ssl_client_cert
+ @ssl_client_cert = ssl_client_cert
end
def self.ssl_client_key
@@ -68,28 +60,21 @@ def self.ssl_client_key=(ssl_client_key)
# Configure the client
def self.configure(opts)
- @user = opts[:user]
- @password = opts[:password]
- @ssl_ca_file = opts[:ssl_ca_file]
- @service_id = opts[:service_id]
- @ssl_client_cert = opts[:ssl_client_cert]
- @ssl_client_key = opts[:ssl_client_key]
- @ssl_ca_file = opts[:ssl_ca_file]
- end
-
- # Returns a list of services.
- def self.services
- parse(get(API_ROOT))["service"]
+ self.user = opts[:user]
+ self.password = opts[:password]
+ self.ssl_client_cert = opts[:ssl_client_cert]
+ self.ssl_client_key = opts[:ssl_client_key]
+ self.ssl_ca_file = opts[:ssl_ca_file]
end
- # Return the results of an eligibility inquiry
- def self.eligibility_inquiry(*args)
+ # Return the results of a HIQA inquiry
+ def self.hiqa_inquiry(*args)
opts = args_to_hash(*args)
details = opts[:details]
xml = Builder::XmlMarkup.new(:indent => 2)
xml.instruct! :xml
- xml.eligibilityInquiryRequest(:xmlns => "http://www.visionshareinc.com/seapi/2008-09-22") {
+ xml.hiqaRequest {
xml.medicareMainframe {
xml.application {
xml.facilityState opts[:facility_state]
@@ -100,33 +85,40 @@ def self.eligibility_inquiry(*args)
xml.password password
}
}
+
xml.details {
if !details || details == :all || details.include?(:all)
- xml.detail "ALL"
+ xml.detail 'ALL'
else
- %w(1751 1752 175J 1755 1756 1757 1758_175C 1759 175K 175L).each do |screen|
- xml.detail "FSS0_#{screen}" if details.include?(:"fss0_#{screen}")
+ %w(1 2_3 4 5 6_7 8 9 10 11 12 13_N).each do |screen|
+ xml.detail "Page#{screen}" if details.include?(:"page_#{screen}")
end
end
}
- if beneficiary = opts[:beneficiary]
- xml.beneficiary {
- xml.hic beneficiary[:hic]
- xml.lastName beneficiary[:last_name]
- xml.firstName beneficiary[:first_name]
- xml.sex beneficiary[:sex]
- xml.dateOfBirth beneficiary[:date_of_birth]
- }
- end
+
+ xml.searchCriteria {
+ xml.hic opts[:hic]
+ xml.lastName opts[:last_name][0,5]
+ xml.firstInitial opts[:first_initial]
+ xml.dateOfBirth opts[:date_of_birth].strftime('%Y-%m-%d')
+ xml.sex opts[:sex]
+ xml.requestorId opts[:requestor_id]
+ xml.intermediaryNumber opts[:intermediary_number]
+ xml.npiIndicator opts[:npi_indicator] if opts[:npi_indicator]
+ xml.providerId opts[:provider_id]
+ xml.hostId opts[:host_id] if opts[:host_id]
+ xml.applicableDate Date.strptime('%Y-%m-%d', opts[:applicable_date]) if opts[:applicable_date]
+ xml.reasonCode opts[:reason_code] if opts[:reason_code]
+ }
}
- parse(post(endpoint("DDEEligibilityInquiry"), xml.target!))["eligibility"]
+ parse(post(endpoint('cwf/hiqa'), xml.target!))
end
# Generate a password
def self.generate_password(*args)
opts = args_to_hash(*args)
- post(endpoint("PasswordGenerate"))
+ post(endpoint('password/generate'))
end
# Change a password or clerk password
@@ -135,7 +127,7 @@ def self.change_password(new_password, *args)
xml = Builder::XmlMarkup.new(:indent => 2)
xml.instruct! :xml, :standalone => "yes"
- xml.passwordChangeRequest(:xmlns => "http://www.visionshareinc.com/seapi/2008-09-22") {
+ xml.passwordChangeRequest {
xml.medicareMainframe {
xml.application {
xml.facilityState opts[:facility_state]
@@ -155,7 +147,7 @@ def self.change_password(new_password, *args)
xml.newPassword new_password
}
- post(endpoint("PasswordChange"), xml.target!)
+ post(endpoint('password/change'), xml.target!)
# Change client password unless clerk password is being changed
self.password = new_password unless opts[:clerk]
@@ -164,7 +156,7 @@ def self.change_password(new_password, *args)
private
def self.endpoint(resource)
- "#{API_ROOT}/#{resource}/#{service_id}"
+ "#{API_ROOT}/#{resource}"
end
# Convert XML to a hash
@@ -186,13 +178,13 @@ def self.rest_exec(method, url, payload = nil)
:url => url,
:accept => :xml,
:headers => {
- "User-Agent" => self.user_agent,
- "X-SEAPI-Version" => SEAPI_VERSION,
- "Content-Type" => "text/xml"
+ 'User-Agent' => self.user_agent,
+ 'X-Access-Version' => API_VERSION,
+ 'Content-Type' => 'text/xml'
}
}
- if @ssl_client_cert && @ssl_client_key && @ssl_ca_file
+ if ssl_client_cert && ssl_client_key && ssl_ca_file
opts.merge!({
:ssl_ca_file => ssl_ca_file,
:ssl_client_key => ssl_client_key,
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<claimInquiryRequest xmlns="http://www.visionshareinc.com/seapi/2008-09-22">
- <medicareMainframe>
- <application>
- <facilityState>OH</facilityState>
- <lineOfBusiness>PartA</lineOfBusiness>
- </application>
- <credential>
- <userId>DS77915</userId>
- <password>somepass</password>
- </credential>
- </medicareMainframe>
- <details>
- <detail>Beneficiary</detail>
- </details>
- <searchCriteria maxResults="100">
- <npi>1234567893</npi>
- <hic>123456789A</hic>
- <status>P</status>
- <location>B9997</location>
- <typeOfBill>131</typeOfBill>
- <fromDate>2007-05-08</fromDate>
- <toDate>2007-05-08</toDate>
- <totalCharges>100.23</totalCharges>
- </searchCriteria>
-</claimInquiryRequest>
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<claimInquiryResponse xmlns="http://www.visionshareinc.com/seapi/2008-09-22">
- <searchResult numResults="2">
- <claim>
- <npi>123457890</npi>
- <hic>123456789A</hic>
- <medicareProviderNumber>123456</medicareProviderNumber>
- <status>P</status>
- <location>B9997</location>
- <typeOfBill>131</typeOfBill>
- <fromDate>2007-05-08</fromDate>
- <toDate>2007-05-08</toDate>
- <admissionDate>2007-05-08</admissionDate>
- <receivedDate>2007-05-15</receivedDate>
- <lastName>Doe</lastName>
- <firstInitial>J</firstInitial>
- <totalCharges>100.23</totalCharges>
- <providerReimbursement>50.23</providerReimbursement>
- <processedDate>2007-06-04</processedDate>
- <paymentCancelledDate>2007-06-14</paymentCancelledDate>
- <reasonCodes>
- <reasonCode>37192</reasonCode>
- </reasonCodes>
- <nonPaymentCode>123</nonPaymentCode>
- <!-- Beneficiary Detail -->
- <patientControlNumber>PCN123456789</patientControlNumber>
- <firstName>John</firstName>
- <middleInitial>Z</middleInitial>
- <dateOfBirth>1942-01-07</dateOfBirth>
- <sex>M</sex>
- <address1>123 street</address1>
- <address2>city</address2>
- <address3>state</address3>
- <zipCode>987654321</zipCode>
- </claim>
- </searchResult>
-</claimInquiryResponse>
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<claimStatusInquiryRequest xmlns="http://www.visionshareinc.com/seapi/2008-09-22">
- <medicareMainframe>
- <application>
- <facilityState>OK</facilityState>
- <lineOfBusiness>PartB</lineOfBusiness>
- </application>
- <credential>
- <userId>DS77915</userId>
- <password>somepass</password>
- </credential>
- <clerkCredential>
- <userId>ABCD</userId>
- <password>clerkpass</password>
- </clerkCredential>
- </medicareMainframe>
- <searchCriteria>
- <npi>123456789</npi>
- <hic>123456789A</hic>
- <fromDate>2000-01-01</fromDate>
- <toDate>2020-01-01</toDate>
- <hcpcs>A1234</hcpcs>
- <icn>1234567890123</icn>
- </searchCriteria>
-</claimStatusInquiryRequest>
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<claimStatusInquiryResponse xmlns="http://www.visionshareinc.com/seapi/2008-09-22">
- <beneficiary>
- <npi>1234567890</npi>
- <hic>1234567890A</hic>
- <lastName>Last</lastName>
- <firstName>First</firstName>
- <middleInitial>I</middleInitial>
- <sex>F</sex>
- <dateOfBirth>2000-01-01</dateOfBirth>
- <traceNumber>01112012010492</traceNumber>
- </beneficiary>
- <claims>
- <claim>
- <icn>123456789ABCD</icn>
- <categoryCode1>F3F</categoryCode1>
- <statusCode1>1</statusCode1>
- <categoryCode2>F3</categoryCode2>
- <statusCode2>101</statusCode2>
- <totalBilledAmount>1500.25</totalBilledAmount>
- <paidDate>2001-03-01</paidDate>
- <totalPaidAmount>50.5</totalPaidAmount>
- <checkNumber>12345678</checkNumber>
- <checkDate>2001-04-01</checkDate>
- <paymentMethod>EFT</paymentMethod>
- <serviceLines>
- <serviceLine>
- <fromDate>2001-02-01</fromDate>
- <toDate>2001-02-02</toDate>
- <hcpcs>G1234</hcpcs>
- <modifier1>59</modifier1>
- <modifier2>60</modifier2>
- <modifier3>61</modifier3>
- <modifier4>62</modifier4>
- <unitsOfService>999</unitsOfService>
- <categoryCode>F1</categoryCode>
- <statusCode>65</statusCode>
- <billedAmount>75.75</billedAmount>
- <paidAmount>25.25</paidAmount>
- <controlNumber>0123456789</controlNumber>
- </serviceLine>
- </serviceLines>
- </claim>
- </claims>
-</claimStatusInquiryResponse>
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<eligibilityInquiryRequest xmlns="http://www.visionshareinc.com/seapi/2008-09-22">
- <medicareMainframe>
- <application>
- <facilityState>OH</facilityState>
- <lineOfBusiness>PartA</lineOfBusiness>
- </application>
- <credential>
- <userId>DS77915</userId>
- <password>somepass</password>
- </credential>
- </medicareMainframe>
- <details>
- <detail>ALL</detail>
- </details>
- <beneficiary>
- <hic>123456789A</hic>
- <lastName>Doe</lastName>
- <firstName>John</firstName>
- <sex>M</sex>
- <dateOfBirth>1925-05-08</dateOfBirth>
- </beneficiary>
-</eligibilityInquiryRequest>
Oops, something went wrong.

0 comments on commit 63d3b67

Please sign in to comment.