Skip to content

Commit

Permalink
implement get patient diagnosis
Browse files Browse the repository at this point in the history
  • Loading branch information
ljcesca committed Jan 16, 2015
1 parent 40ca58b commit 7790e51
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
24 changes: 22 additions & 2 deletions lib/allscripts_unity_client/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,28 @@ def get_patient_cda
raise NotImplementedError, 'GetPatientCDA magic action not implemented'
end

def get_patient_diagnosis
raise NotImplementedError, 'GetPatientDiagnosis magic action not implemented'
def get_patient_diagnosis(userid, patientid, encounter_date = nil, encounter_type = nil, encounter_date_range = nil, encounter_id = nil)
magic_params = {
action: 'GetPatientDiagnosis',
userid: userid,
patientid: patientid,
parameter1: encounter_date,
parameter2: encounter_type,
parameter3: encounter_date_range,
parameter4: encounter_id
}

results = magic(magic_params)

if !results.is_a? Array
if results.empty?
results = []
else
results = [results]
end
end

result
end

def get_patient_full
Expand Down
2 changes: 1 addition & 1 deletion lib/allscripts_unity_client/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module AllscriptsUnityClient
VERSION = '2.2.0'
VERSION = '2.2.2'
end
4 changes: 1 addition & 3 deletions spec/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@
it { expect { subject.get_patient_cda }.to raise_error(NotImplementedError) }
end

describe '#get_patient_diagnosis' do
it { expect { subject.get_patient_diagnosis }.to raise_error(NotImplementedError) }
end
describe '#get_patient_diagnosis'

describe '#get_patient_full' do
it { expect { subject.get_patient_full }.to raise_error(NotImplementedError) }
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
# Print the 10 slowest examples and example groups at the
# end of the spec run, to help surface which specs are running
# particularly slow.
config.profile_examples = 10
# config.profile_examples = 10

# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
Expand Down

0 comments on commit 7790e51

Please sign in to comment.