medivo 0.1.14 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,8 +8,10 @@ module Medivo
8
8
  def appointment_data
9
9
  data = Medivo::Appointment.find(params[:lab_code], params[:appointment_date])
10
10
  render :json=> data, :layout => nil
11
- rescue
12
- render :json=> {:code=>'Failure', :msg=>"Problem getting data"}, :status=> 500, :layout => nil
11
+ rescue => e
12
+ render :json=> {:status=>'Error', :message=>"Problem getting data: #{e.message}"},
13
+ :status=> 500,
14
+ :layout => nil
13
15
  end
14
16
  end
15
17
  end
@@ -1,3 +1,3 @@
1
1
  module Medivo
2
- VERSION = "0.1.14"
2
+ VERSION = "0.1.15"
3
3
  end
@@ -53,8 +53,9 @@ module Medivo
53
53
  # trying to keep the pdf ( tempfile ) closed until you need it then closing again
54
54
  def read
55
55
  @pdf.open
56
- @pdf.read
56
+ bytes = @pdf.read
57
57
  @pdf.close
58
+ bytes
58
59
  end
59
60
  end
60
61
  end
@@ -47,14 +47,27 @@ UnitedHealthcare Clinical Services
47
47
  Southeast Region
48
48
  MD
49
49
 
50
+ fields = {
51
+ :full_name => 'my full name',
52
+ :address => 'my address',
53
+ :first_name => 'me!!!!!',
54
+ :sched_date => 'todays date',
55
+ :app_date => 'my appt date',
56
+ :app_time => 'appt time', # small field .. so too much text will break test
57
+ :lab_name => 'LabCorp',
58
+ :lab_address => 'the lab address',
59
+ :order_number => 'the lab id',
60
+ :director_name=>md
61
+ }
62
+
50
63
  path = medivo_fixture_path "uhc_requisition_cover_letter.pdf"
51
64
  img_path = medivo_fixture_path "Southeast.jpg"
52
65
  pdf_file = Medivo::PdfGenerator.variable_fields_with_images(
53
66
  path,
54
- {:director_name=>md},
55
- [{:path=> img_path, :options=>{:at=> [40, 100], :width=>170, :height=>40}}]
67
+ fields,
68
+ [{:path=> img_path, :options=>{:at=> [40, 100], :width=>180, :height=>28}}]
56
69
  )
57
- #show_me_the_pdf(pdf_file, '/tmp/test.pdf')
70
+ show_me_the_pdf(pdf_file, '/tmp/test.pdf')
58
71
  text = pdf_to_text(pdf_file)
59
72
  text.strip_space.should match "Catherine E. Palmier, M.D.".strip_space
60
73
  pdf_file.unlink
@@ -8,6 +8,7 @@ describe Medivo::PdfGroup do
8
8
  static_pdf(path)
9
9
  end
10
10
  expect { pdf_group.read }.should_not raise_error
11
+ pdf_group.read.should_not be_nil
11
12
  end
12
13
 
13
14
  it "#variable_fields" do
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.14
4
+ version: 0.1.15
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: &2173814200 !ruby/object:Gem::Requirement
17
+ requirement: &2156504180 !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: *2173814200
25
+ version_requirements: *2156504180
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: jquery-rails
28
- requirement: &2173813780 !ruby/object:Gem::Requirement
28
+ requirement: &2156503740 !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: *2173813780
36
+ version_requirements: *2156503740
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: coffee-script
39
- requirement: &2173813240 !ruby/object:Gem::Requirement
39
+ requirement: &2156503280 !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: *2173813240
47
+ version_requirements: *2156503280
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: haml-rails
50
- requirement: &2173812800 !ruby/object:Gem::Requirement
50
+ requirement: &2156502840 !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: *2173812800
58
+ version_requirements: *2156502840
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: geocoder
61
- requirement: &2173812380 !ruby/object:Gem::Requirement
61
+ requirement: &2156502420 !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: *2173812380
69
+ version_requirements: *2156502420
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rest-client
72
- requirement: &2173811960 !ruby/object:Gem::Requirement
72
+ requirement: &2156502000 !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: *2173811960
80
+ version_requirements: *2156502000
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: pdfkit
83
- requirement: &2173811520 !ruby/object:Gem::Requirement
83
+ requirement: &2156501520 !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: *2173811520
91
+ version_requirements: *2156501520
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: prawn
94
- requirement: &2173811100 !ruby/object:Gem::Requirement
94
+ requirement: &2156501100 !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: *2173811100
102
+ version_requirements: *2156501100
103
103
  description: Use the medivo platform to find lab locations, make labcorp appointments,
104
104
  place lab orders
105
105
  email:
@@ -293,7 +293,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
293
293
  version: '0'
294
294
  segments:
295
295
  - 0
296
- hash: 1540401396263977125
296
+ hash: 355664742105026717
297
297
  required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  none: false
299
299
  requirements:
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
302
  version: '0'
303
303
  segments:
304
304
  - 0
305
- hash: 1540401396263977125
305
+ hash: 355664742105026717
306
306
  requirements: []
307
307
  rubyforge_project:
308
308
  rubygems_version: 1.6.2