allscripts_unity_client 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37f39f6c94937da70a53192060bb913051b67197
4
- data.tar.gz: ea1f2091395c1fde998e0eb599cddd9f37822c39
3
+ metadata.gz: 5af2ceca9d82117d1167e662511df55c3659629a
4
+ data.tar.gz: 428ce6f40066a7c5d15f045fd7d9d4620247eac1
5
5
  SHA512:
6
- metadata.gz: d769e28f027e5bed0601ed9614c517a619966dfcb2b7c89fb93211d5819492fcde6811f1f6893e2c1c29ef6fa04da7a017a51c60a68d8404d37cf791ae392b53
7
- data.tar.gz: 7a04ede9be73ddd21c15d441c3669969ca4474e595da7ded59d266ee2a07e3264c66b654d44073c3fcd4f0b8ef0bf045dce547dd5ef34d97c42a7cdbdc093214
6
+ metadata.gz: ea0bcdd635c8749437600fdc2d1f538be78bb112a34a2130b08fbde06eee79df11efb5f332287c9698cca8284386ac6b1b8a0b7eba8179c2fbb4c6150a42af47
7
+ data.tar.gz: ae7aae6d87dae173deda1e46c079a168ab40b764791c3032f0a49b16e02a34664e379d5578e893caabad4882e37e57e74b90a48b9f872d94d0e75aec6b0f9921
@@ -711,7 +711,7 @@ module AllscriptsUnityClient
711
711
 
712
712
  def save_task(userid, patientid, task_type = nil, target_user = nil, work_object_id = nil, comments = nil)
713
713
  if task_type.nil? && target_user.nil? && work_object_id.nil? && comments.nil?
714
- raise ArugmentError, 'task_type, target_user, work_object_id, and comments can not all be nil'
714
+ raise ArgumentError, 'task_type, target_user, work_object_id, and comments can not all be nil'
715
715
  end
716
716
 
717
717
  magic_parameters = {
@@ -728,7 +728,7 @@ module AllscriptsUnityClient
728
728
 
729
729
  def save_task_status(userid, transaction_id = nil, status = nil, delegate_id = nil, comment = nil, taskchanges = nil, patient_id = nil)
730
730
  if transaction_id.nil? && delegate_id.nil? && comment.nil?
731
- raise ArugmentError, 'transaction_id, delegate_id, and comment can not all be nil'
731
+ raise ArgumentError, 'transaction_id, delegate_id, and comment can not all be nil'
732
732
  end
733
733
 
734
734
  # Generate XML structure for rxxml
@@ -745,6 +745,13 @@ module AllscriptsUnityClient
745
745
  }
746
746
  end
747
747
 
748
+ new_status =
749
+ if taskchanges.nil?
750
+ ""
751
+ else
752
+ nokogiri_to_string(builder)
753
+ end
754
+
748
755
  magic_parameters = {
749
756
  action: 'SaveTaskStatus',
750
757
  userid: userid,
@@ -752,7 +759,7 @@ module AllscriptsUnityClient
752
759
  parameter2: status,
753
760
  parameter3: delegate_id,
754
761
  parameter4: comment,
755
- parameter6: nokogiri_to_string(builder)
762
+ parameter6: new_status
756
763
  }
757
764
 
758
765
  if patient_id
@@ -1,3 +1,3 @@
1
1
  module AllscriptsUnityClient
2
- VERSION = '4.0.0'.freeze
2
+ VERSION = '4.0.1'.freeze
3
3
  end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe AllscriptsUnityClient do
4
4
  subject { described_class }
5
5
 
6
- describe '.create' do
6
+ describe '#create' do
7
7
  context 'when given mode: :json' do
8
8
  it 'returns a client with client_type :json' do
9
9
  parameters = build(:allscripts_unity_client_parameters, mode: :json)
@@ -27,4 +27,40 @@ describe AllscriptsUnityClient do
27
27
  end
28
28
  end
29
29
  end
30
+
31
+ describe '#save_task' do
32
+ it 'raises when each of transaction_id, delegate_id, and comment are nil' do
33
+ parameters = build(:allscripts_unity_client_parameters, mode: :json)
34
+
35
+ client = subject.create(parameters)
36
+
37
+ expect do
38
+ client.save_task(:user_id, :patient_id)
39
+ end.to raise_error(ArgumentError)
40
+ end
41
+ end
42
+
43
+ describe '#save_task_status' do
44
+ it 'raises when each of transaction_id, delegate_id, and comment are nil' do
45
+ parameters = build(:allscripts_unity_client_parameters, mode: :json)
46
+ client = subject.create(parameters)
47
+
48
+ expect do
49
+ client.save_task_status(:user_id, :patient_id)
50
+ end.to raise_error(ArgumentError)
51
+ end
52
+
53
+ it 'maintains a nil parameter6 whenever taskchanges is nil' do
54
+ parameters = build(:allscripts_unity_client_parameters, mode: :json)
55
+ client = subject.create(parameters)
56
+
57
+ def client.magic(params)
58
+ params
59
+ end
60
+
61
+ result = client.save_task_status(1, 1, :status, 1, :comment, nil, 1)
62
+
63
+ expect(result[:parameter6]).to eq("")
64
+ end
65
+ end
30
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allscripts_unity_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - healthfinch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-22 00:00:00.000000000 Z
11
+ date: 2018-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient