allscripts_api 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/allscripts_api/client.rb +1 -1
- data/lib/allscripts_api/documents/document_sender.rb +1 -1
- data/lib/allscripts_api/named_magic_methods.rb +71 -1
- data/lib/allscripts_api/orders/order.rb +28 -0
- data/lib/allscripts_api/orders/ordering_methods.rb +27 -1
- data/lib/allscripts_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbdb760abff22c5ef1e82fe9275340348c746361
|
4
|
+
data.tar.gz: '059566e9ec3065e974ebb87f48782f76ec99b32a'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bc7c7a80ebdbbf862781ee03b29c836ac0bd80ea9c853b34d80cb8778bb676a1f0b872cf1aadeffc9ef03025d56ff51c73d7cdaed954829978401fe42a3c048
|
7
|
+
data.tar.gz: 75e34e7c0385837cdb9d0e59af2d2c504f61671f72e0b266f9e0a825facba7d697c4c7234a71700f2b4cd8d02fc086c9f05603dbe4a52431d6dc3a930c5cd142
|
@@ -20,7 +20,7 @@ module AllscriptsApi
|
|
20
20
|
# owner_code: "TW0001",
|
21
21
|
# first_name: "Allison",
|
22
22
|
# last_name: "Allscripts",
|
23
|
-
# document_type: "sEKG",
|
23
|
+
# document_type: "sEKG", # Document_Type_DE dictionary
|
24
24
|
# organization_name: "New World Health"
|
25
25
|
# }
|
26
26
|
# ds = AllscriptsApi::Documents::DocumentSender.new(client, pdf, "test.pdf", document_params)
|
@@ -21,6 +21,34 @@ module AllscriptsApi
|
|
21
21
|
results["getproviderinfo"]
|
22
22
|
end
|
23
23
|
|
24
|
+
# a wrapper around GetProviders
|
25
|
+
#
|
26
|
+
# @param security_filter [String] optional EntryCode of the Security_Code_DE dictionary for the providers being sought. A list of valid security codes can be obtained from GetDictionary on the Security_Code_DE dictionary.
|
27
|
+
# @param name_filter [String] optional If specified, will filter for providers with a lastname or entrycode that match. Defaults to %.
|
28
|
+
# @param show_only_providers_flag [String] optional (Y/N) Indicate whether or not to return only users that are also Providers. Defaults to Y.
|
29
|
+
# @param internal_external [String] optional I for Internal (User/providers that are internal to the enterprise). E for External (Referring physicians). Defaults to I.
|
30
|
+
# @param ordering_authority [String] optional Show only those users with an ordering provider level of X (which is a number)
|
31
|
+
# @param real_provider [String] optional Whether an NPI (National Provider ID) is required (Y/N). Y returns only actual providers. Default is N.
|
32
|
+
# @return [Array<Hash>, Array, MagicError] a list of providers
|
33
|
+
def get_providers(security_filter = nil,
|
34
|
+
name_filter = nil,
|
35
|
+
show_only_providers_flag = "Y",
|
36
|
+
internal_external = "I",
|
37
|
+
ordering_authority = nil,
|
38
|
+
real_provider = "N")
|
39
|
+
params =
|
40
|
+
MagicParams.format(
|
41
|
+
parameter1: security_filter,
|
42
|
+
parameter2: name_filter,
|
43
|
+
parameter3: show_only_providers_flag,
|
44
|
+
parameter4: internal_external,
|
45
|
+
parameter5: ordering_authority,
|
46
|
+
parameter6: real_provider
|
47
|
+
)
|
48
|
+
results = magic("GetProviders", magic_params: params)
|
49
|
+
results["getprovidersinfo"]
|
50
|
+
end
|
51
|
+
|
24
52
|
# a wrapper around GetPatientProblems
|
25
53
|
#
|
26
54
|
# @param patient_id [String] patient id
|
@@ -50,6 +78,24 @@ module AllscriptsApi
|
|
50
78
|
results["getpatientproblemsinfo"]
|
51
79
|
end
|
52
80
|
|
81
|
+
|
82
|
+
# a wrapper around GetResults
|
83
|
+
#
|
84
|
+
# @param patient_id [String] patient id
|
85
|
+
# @param since [String] Specify a date/time combination to return only results that have been modified on or after that date/time. For example, 2014-01-01 or 2015-01-14 08:44:28.563. Defaults to nil
|
86
|
+
# @return [Array<Hash>, Array, MagicError] a list of found results (lab/imaging),
|
87
|
+
# an empty array, or an error
|
88
|
+
def get_results(patient_id,
|
89
|
+
since = nil)
|
90
|
+
params = MagicParams.format(
|
91
|
+
user_id: @allscripts_username,
|
92
|
+
patient_id: patient_id,
|
93
|
+
parameter1: since
|
94
|
+
)
|
95
|
+
results = magic("GetResults", magic_params: params)
|
96
|
+
results["getresultsinfo"]
|
97
|
+
end
|
98
|
+
|
53
99
|
# a wrapper around GetSchedule, returns appointments scheduled under the
|
54
100
|
# the user for a given date range
|
55
101
|
#
|
@@ -71,7 +117,7 @@ module AllscriptsApi
|
|
71
117
|
# @param patient_id [String] patient id
|
72
118
|
# @param encounter_type [String] encounter type to filter on from Encounter_Type_DE
|
73
119
|
# @param when_or_limit [String] filter by specified date
|
74
|
-
# @param nostradamus [String] how many days to look into the future. Defaults to 0.
|
120
|
+
# @param nostradamus [String] how many days to look into the future. Defaults to 0.
|
75
121
|
# @param show_past_flag [String] show previous encounters, "Y" or "N". Defaults to Y
|
76
122
|
# @param billing_provider_user_name [String] filter by user name (if specified)
|
77
123
|
# @return [Array<Hash>, Array, MagicError] a list of encounters
|
@@ -120,6 +166,30 @@ module AllscriptsApi
|
|
120
166
|
results["getdictionaryinfo"]
|
121
167
|
end
|
122
168
|
|
169
|
+
# a wrapper around GetServerInfo, which returns
|
170
|
+
# the time zone of the server, unity version and date
|
171
|
+
# and license key
|
172
|
+
#
|
173
|
+
# @return [Array<Hash>, Array, MagicError] local information about the
|
174
|
+
# server hosting the Unity webservice.
|
175
|
+
def get_server_info
|
176
|
+
params = MagicParams.format(user_id: @allscripts_username)
|
177
|
+
results = magic("GetServerInfo", magic_params: params)
|
178
|
+
results["getserverinfoinfo"][0] # infoinfo is an Allscript typo
|
179
|
+
end
|
180
|
+
|
181
|
+
def last_logs(errors_only = "N", show_wand = "N", how_many = 10, start_time = "", end_time = "")
|
182
|
+
params =
|
183
|
+
MagicParams.format(
|
184
|
+
parameter1: errors_only,
|
185
|
+
parameter2: show_wand,
|
186
|
+
parameter3: how_many,
|
187
|
+
parameter4: start_time,
|
188
|
+
parameter5: end_time
|
189
|
+
)
|
190
|
+
results = magic("LastLogs", magic_params: params)
|
191
|
+
end
|
192
|
+
|
123
193
|
private
|
124
194
|
|
125
195
|
def format_date_range(start_date, end_date)
|
@@ -44,12 +44,40 @@ module AllscriptsApi
|
|
44
44
|
builder.field("id" => "orderdeferralunit", "value" => "Days")
|
45
45
|
builder.field("id" => "orderstatusreason", "value" => "")
|
46
46
|
builder.field("id" => "encounter", "value" => encounter_id.to_s)
|
47
|
+
builder.field("id" => "orderintorext", "value" => "External/Internal for referral only")
|
47
48
|
builder.orderlinkedproblems
|
48
49
|
builder.clinicalquestions
|
49
50
|
end
|
50
51
|
|
51
52
|
builder.to_xml
|
52
53
|
end
|
54
|
+
|
55
|
+
|
56
|
+
# Builder for get order workflow xml
|
57
|
+
#
|
58
|
+
# @param order_id [String] order dictionary ID
|
59
|
+
# @param order_trans_id [String] the provider's Allscripts id
|
60
|
+
# @param order_category [DateTime] determines what order field data to send back.
|
61
|
+
# @param encounter_id [String|Nil] an encounter id, used when
|
62
|
+
# ordering to current encounter
|
63
|
+
# @return [String] xml formatted for
|
64
|
+
# {AllscriptsApi::OrderingMethods#save_order}
|
65
|
+
def self.build_xml_for_order_workflow(order_id,
|
66
|
+
order_category,
|
67
|
+
problem_id = "",
|
68
|
+
problem_trans_id = "0",
|
69
|
+
order_trans_id = "0")
|
70
|
+
builder = Nokogiri::XML::Builder.new
|
71
|
+
builder.saveorderxml do
|
72
|
+
builder.field("id" => "order_id", "value" => order_id)
|
73
|
+
builder.field("id" => "order_transid", "value" => order_trans_id)
|
74
|
+
builder.field("id" => "order_category", "value" => order_category)
|
75
|
+
builder.field("id" => "problem_id", "value" => problem_id)
|
76
|
+
builder.field("id" => "problem_transid", "value" => problem_trans_id)
|
77
|
+
end
|
78
|
+
|
79
|
+
builder.to_xml
|
80
|
+
end
|
53
81
|
end
|
54
82
|
end
|
55
83
|
end
|
@@ -13,7 +13,7 @@ module AllscriptsApi
|
|
13
13
|
# Immunization, InstructionOrder, ProcedureOrder,
|
14
14
|
# Referral, SuppliesOrder.
|
15
15
|
#
|
16
|
-
# xml can be constructed with {AllscriptsApi::Order.build_xml}
|
16
|
+
# xml can be constructed with {AllscriptsApi::Orders::Order.build_xml}
|
17
17
|
#
|
18
18
|
# @param patient_id [String]
|
19
19
|
# @param xml [String] xml containing saveorderxml fields and values
|
@@ -39,6 +39,32 @@ module AllscriptsApi
|
|
39
39
|
)
|
40
40
|
magic("SaveOrder", magic_params: params)
|
41
41
|
end
|
42
|
+
|
43
|
+
# a wrapper around GetOrderWorkflow
|
44
|
+
#
|
45
|
+
# @param patient_id [String] patient id
|
46
|
+
# @param xml_string [String] xml from build_xml_for_order_workflow method
|
47
|
+
# @param order_trans_id [String] order_activity_header.ID when calling for an existing order
|
48
|
+
# @param order_category [String] determines what order field data to send back.
|
49
|
+
# @param problem_id [String] problem dictionary id
|
50
|
+
# @param problem_trans_id [String] problem_header id
|
51
|
+
# @return [Array<Hash>, Array, MagicError] a list of encounters
|
52
|
+
def get_order_workflow(patient_id, xml_string,
|
53
|
+
order_trans_id = "0", order_category = "ProcedureOrder",
|
54
|
+
problem_id = "", problem_trans_id = "")
|
55
|
+
params =
|
56
|
+
MagicParams.format(
|
57
|
+
user_id: @allscripts_username,
|
58
|
+
patient_id: patient_id,
|
59
|
+
parameter1: xml_string,
|
60
|
+
parameter2: order_trans_id,
|
61
|
+
parameter3: order_category,
|
62
|
+
parameter4: problem_id,
|
63
|
+
parameter5: problem_trans_id
|
64
|
+
)
|
65
|
+
results = magic("GetOrderWorkflow", magic_params: params)
|
66
|
+
results["getorderworkflow"]
|
67
|
+
end
|
42
68
|
end
|
43
69
|
end
|
44
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allscripts_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chase
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|