medivo 0.1.21 → 0.1.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
1
+ module Medivo
2
+ module OrdersControllerHelpers
3
+
4
+ protected
5
+
6
+ def set_pdf_headers
7
+ if request.env['HTTP_USER_AGENT'] =~ /msie/i
8
+ headers['Pragma'] = nil
9
+ headers['Cache-Control'] = nil
10
+ else
11
+ headers['Cache-Control'] = 'no-store'
12
+ end
13
+ end
14
+
15
+ def get_lab_order
16
+ raise 'implement your own logic here'
17
+ end
18
+
19
+ def send_pdf(bytes, file_name)
20
+ send_data bytes, :disposition => 'inline', :type=> 'application/pdf', :filename=>file_name, :layout=>false
21
+ end
22
+
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module Medivo
2
- VERSION = "0.1.21"
2
+ VERSION = "0.1.22"
3
3
  end
@@ -1,15 +1,17 @@
1
1
  class OrdersController < ActionController::Base
2
- def download_requisition
3
- lab_test_order = current_user.lab_order
4
- pdf = lab_test_order.pdf_requisition
2
+ include Medivo::OrdersControllerHelpers
3
+
4
+ before_filter :set_pdf_headers, :get_lab_order, :only=>[:download_requisition,:download_result]
5
5
 
6
- send_data pdf.read, :disposition => 'inline', :type=> 'application/pdf', :filename=>'unitedhealthcare_requisition.pdf', :layout=>false
6
+ def download_requisition
7
+ send_pdf @lab_test_order.pdf_requisition.read, 'unitedhealthcare_requisition.pdf'
7
8
  end
8
9
 
9
10
  def download_result
10
- lab_test_order = current_user.lab_order
11
- pdf = lab_test_order.pdf_result
11
+ send_pdf @lab_test_order.pdf_result.read, 'unitedhealthcare_result.pdf'
12
+ end
12
13
 
13
- send_data pdf.read, :disposition => 'inline', :type=> 'application/pdf', :filename=>'unitedhealthcare_result.pdf', :layout=>false
14
+ def get_lab_order
15
+ @lab_test_order = current_user.lab_order
14
16
  end
15
17
  end
@@ -931,3 +931,10 @@ Completed 200 OK in 901ms (Views: 69.7ms)
931
931
  Processing by OrdersController#download_result as HTML
932
932
  Sent data unitedhealthcare_result.pdf (2.5ms)
933
933
  Completed 200 OK in 729ms (Views: 1.7ms)
934
+ Processing by OrdersController#download_requisition as HTML
935
+ Rendered text template (0.0ms)
936
+ Sent data unitedhealthcare_requisition.pdf (112.2ms)
937
+ Completed 200 OK in 953ms (Views: 111.8ms)
938
+ Processing by OrdersController#download_result as HTML
939
+ Sent data unitedhealthcare_result.pdf (2.4ms)
940
+ Completed 200 OK in 695ms (Views: 1.5ms)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: medivo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.21
4
+ version: 0.1.22
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &2153546460 !ruby/object:Gem::Requirement
17
+ requirement: &2152651280 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.1.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2153546460
25
+ version_requirements: *2152651280
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: jquery-rails
28
- requirement: &2153546020 !ruby/object:Gem::Requirement
28
+ requirement: &2152650840 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2153546020
36
+ version_requirements: *2152650840
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: coffee-script
39
- requirement: &2153545560 !ruby/object:Gem::Requirement
39
+ requirement: &2152650380 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *2153545560
47
+ version_requirements: *2152650380
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: haml-rails
50
- requirement: &2153545120 !ruby/object:Gem::Requirement
50
+ requirement: &2152649960 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *2153545120
58
+ version_requirements: *2152649960
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: geocoder
61
- requirement: &2153544680 !ruby/object:Gem::Requirement
61
+ requirement: &2152649520 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *2153544680
69
+ version_requirements: *2152649520
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rest-client
72
- requirement: &2153544260 !ruby/object:Gem::Requirement
72
+ requirement: &2152649060 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *2153544260
80
+ version_requirements: *2152649060
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: pdfkit
83
- requirement: &2153543840 !ruby/object:Gem::Requirement
83
+ requirement: &2152648640 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '0'
89
89
  type: :runtime
90
90
  prerelease: false
91
- version_requirements: *2153543840
91
+ version_requirements: *2152648640
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: prawn
94
- requirement: &2153543400 !ruby/object:Gem::Requirement
94
+ requirement: &2152648220 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ! '>='
@@ -99,7 +99,7 @@ dependencies:
99
99
  version: '0'
100
100
  type: :runtime
101
101
  prerelease: false
102
- version_requirements: *2153543400
102
+ version_requirements: *2152648220
103
103
  description: Use the medivo platform to find lab locations, make labcorp appointments,
104
104
  place lab orders
105
105
  email:
@@ -139,6 +139,7 @@ files:
139
139
  - app/assets/stylesheets/medivo/application.css
140
140
  - app/controllers/medivo/application_controller.rb
141
141
  - app/controllers/medivo/labs_controller.rb
142
+ - app/controllers/medivo/orders_controller_helpers.rb
142
143
  - app/models/medivo/appointment.rb
143
144
  - app/models/medivo/insurance_order.rb
144
145
  - app/models/medivo/lab.rb
@@ -298,7 +299,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
298
299
  version: '0'
299
300
  segments:
300
301
  - 0
301
- hash: 3484021772595195344
302
+ hash: 1786802512616553513
302
303
  required_rubygems_version: !ruby/object:Gem::Requirement
303
304
  none: false
304
305
  requirements:
@@ -307,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
308
  version: '0'
308
309
  segments:
309
310
  - 0
310
- hash: 3484021772595195344
311
+ hash: 1786802512616553513
311
312
  requirements: []
312
313
  rubyforge_project:
313
314
  rubygems_version: 1.6.2