medivo 0.2.14 → 0.2.15
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/medivo/appointment.rb +4 -3
- data/lib/medivo/version.rb +1 -1
- data/spec/dummy/log/test.log +86 -0
- data/spec/dummy/tmp/cache/assets/C46/F00/sprockets%2F2281d588b540056c5a7306c32a3761b9 +0 -0
- data/spec/dummy/tmp/cache/assets/C53/C80/sprockets%2F9297b5f504687910109d311f03f8a7b3 +0 -0
- data/spec/dummy/tmp/cache/assets/C81/D00/sprockets%2F64f056bd752d271308a86a6f865b1911 +0 -0
- data/spec/dummy/tmp/cache/assets/CB4/BD0/sprockets%2F3378f27c0d4f5e6d708665b22707a31f +0 -0
- data/spec/dummy/tmp/cache/assets/CC3/EF0/sprockets%2F453b504c1f8f374578636f699eaa455d +0 -0
- data/spec/dummy/tmp/cache/assets/CD5/670/sprockets%2F7f42231e2382a32f5a39dc7807f0b4d1 +0 -0
- data/spec/dummy/tmp/cache/assets/CDD/820/sprockets%2Fb28231960c7ac62eff9048e702a29c70 +0 -0
- data/spec/dummy/tmp/cache/assets/CEC/EF0/sprockets%2F4b24a74018f693c06088bd52f8cc9f86 +0 -0
- data/spec/dummy/tmp/cache/assets/CEE/250/sprockets%2F96688f33f2f8aa261bf6701c1d6d7575 +0 -0
- data/spec/dummy/tmp/cache/assets/D20/F10/sprockets%2Fb2e907e4faa85fe755f4439e3b229088 +0 -0
- data/spec/dummy/tmp/cache/assets/D29/000/sprockets%2F61a10ddf57f1129c02a1049bfed6e007 +0 -0
- data/spec/dummy/tmp/cache/assets/D2C/F80/sprockets%2F399f6d5eb273936af7ff8f35a77c5037 +0 -0
- data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/D45/320/sprockets%2Fc50ff379a1bdf1dd4d22249058749cf6 +0 -0
- data/spec/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
- data/spec/dummy/tmp/cache/assets/D5D/3E0/sprockets%2F63fea6cc142b5f02da93bf81e70b2116 +0 -0
- data/spec/dummy/tmp/cache/assets/D60/030/sprockets%2Ffc9485f617fc5e9b8918755d2e08ecc6 +0 -0
- data/spec/dummy/tmp/cache/assets/D64/C50/sprockets%2F22ee6fb2ab1ea9694ac7f0f41a406094 +0 -0
- data/spec/dummy/tmp/cache/assets/D74/9A0/sprockets%2F0ca4e6e833c72156fc7e7d5f007d9ce3 +0 -0
- data/spec/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
- data/spec/dummy/tmp/cache/assets/D88/2C0/sprockets%2F452ab3ebb1912cf1c2ba617eec52a718 +0 -0
- data/spec/dummy/tmp/cache/assets/DCA/B80/sprockets%2Fb4aad54185f42b1b871997ef2dc2fabb +0 -0
- data/spec/dummy/tmp/cache/assets/DCE/E80/sprockets%2Fc71ec62157b9cc7aabfc030955cef87b +0 -0
- data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/E32/FC0/sprockets%2Fe55fb2eef11567fe04fdaf7e73af5ba4 +0 -0
- data/spec/models/appointment_spec.rb +12 -4
- metadata +20 -20
@@ -17,7 +17,7 @@ module Medivo
|
|
17
17
|
#
|
18
18
|
# @return Hash { :times=>['time1', 'time2'] }
|
19
19
|
#
|
20
|
-
# @throws exception mainly
|
20
|
+
# @throws exception mainly Restclient::Exception types
|
21
21
|
def find(lab_code, date, am_pm='')
|
22
22
|
if real_data?
|
23
23
|
data = resource.get :params=>{:labcorp_id=>lab_code, :appointment_date=>date}
|
@@ -72,8 +72,9 @@ module Medivo
|
|
72
72
|
|
73
73
|
def filter_data(hash, am_pm)
|
74
74
|
now = Time.now
|
75
|
-
hash['times'].reject! do |
|
76
|
-
|
75
|
+
hash['times'].reject! do |time_string|
|
76
|
+
time = Time.strptime(time_string, LABCORP_FORMAT) rescue nil
|
77
|
+
!time or !time_string.match(/#{am_pm}/) or (time < now)
|
77
78
|
end
|
78
79
|
hash
|
79
80
|
end
|
data/lib/medivo/version.rb
CHANGED
data/spec/dummy/log/test.log
CHANGED
@@ -2997,3 +2997,89 @@ Started POST "/medivo/labs/make_appointment" for 127.0.0.1 at 2011-11-15 17:41:5
|
|
2997
2997
|
Processing by Medivo::LabsController#make_appointment as HTML
|
2998
2998
|
Parameters: {"lab_code"=>"20060", "time"=>"2011-11-01 08:30:00 UTC", "user"=>{"first_name"=>"dude", "last_name"=>nil, "date_of_birth"=>"12/28/1980", "email_address"=>"dudeman@dude.com", "phone_number"=>"4155551212"}}
|
2999
2999
|
Completed 200 OK in 2ms (Views: 0.2ms)
|
3000
|
+
Processing by OrdersController#download_requisition as HTML
|
3001
|
+
Rendered text template (0.0ms)
|
3002
|
+
Sent data unitedhealthcare_requisition.pdf (76.0ms)
|
3003
|
+
Completed 200 OK in 989ms (Views: 75.1ms)
|
3004
|
+
Processing by OrdersController#download_result as HTML
|
3005
|
+
Sent data unitedhealthcare_result.pdf (2.4ms)
|
3006
|
+
Completed 200 OK in 709ms (Views: 1.7ms)
|
3007
|
+
|
3008
|
+
|
3009
|
+
Started GET "/medivo/labs?zip_code=90210" for 127.0.0.1 at 2011-11-04 00:00:00 -0400
|
3010
|
+
Processing by Medivo::LabsController#index as HTML
|
3011
|
+
Parameters: {"zip_code"=>"90210"}
|
3012
|
+
Completed 200 OK in 0ms (Views: 0.0ms)
|
3013
|
+
|
3014
|
+
|
3015
|
+
Started GET "/labs/lab_search?zip_code=90210" for 127.0.0.1 at 2011-11-04 00:00:00 -0400
|
3016
|
+
Processing by LabsController#lab_search as HTML
|
3017
|
+
Parameters: {"zip_code"=>"90210"}
|
3018
|
+
Completed 200 OK in 0ms (Views: 0.0ms)
|
3019
|
+
|
3020
|
+
|
3021
|
+
Started GET "/assets/application.css" for 127.0.0.1 at 2011-11-04 00:00:00 -0400
|
3022
|
+
Compiled application.css (0ms) (pid 9135)
|
3023
|
+
Served asset /application.css - 200 OK (0ms)
|
3024
|
+
|
3025
|
+
|
3026
|
+
Started GET "/assets/application.js" for 127.0.0.1 at 2011-11-04 00:00:00 -0400
|
3027
|
+
Compiled application.js (0ms) (pid 9135)
|
3028
|
+
Compiled jquery.js (0ms) (pid 9135)
|
3029
|
+
Compiled jquery_ujs.js (0ms) (pid 9135)
|
3030
|
+
Compiled medivo/lab_list/application.js (0ms) (pid 9135)
|
3031
|
+
Compiled medivo/handlebars.js (0ms) (pid 9135)
|
3032
|
+
Compiled medivo/helpers.js (0ms) (pid 9135)
|
3033
|
+
Compiled medivo/lab_list/models.js (0ms) (pid 9135)
|
3034
|
+
Compiled medivo/models.js (0ms) (pid 9135)
|
3035
|
+
Compiled medivo/lab_list/views.js (0ms) (pid 9135)
|
3036
|
+
Compiled medivo/views.js (0ms) (pid 9135)
|
3037
|
+
Compiled medivo/lab_list/handlers.js (0ms) (pid 9135)
|
3038
|
+
Compiled medivo/lab_list/sample/show_labs.js (0ms) (pid 9135)
|
3039
|
+
Compiled medivo/lab_appointment/application.js (0ms) (pid 9135)
|
3040
|
+
Compiled medivo/date.js (0ms) (pid 9135)
|
3041
|
+
Compiled medivo/lab_appointment/models.js (0ms) (pid 9135)
|
3042
|
+
Compiled medivo/lab_appointment/views.js (0ms) (pid 9135)
|
3043
|
+
Compiled medivo/lab_appointment/handlers.js (0ms) (pid 9135)
|
3044
|
+
Compiled medivo/lab_appointment/sample/show_appointments.js (0ms) (pid 9135)
|
3045
|
+
Served asset /application.js - 200 OK (0ms)
|
3046
|
+
|
3047
|
+
|
3048
|
+
Started GET "/assets/medivo/ajax_waiting.gif" for 127.0.0.1 at 2011-11-04 00:00:00 -0400
|
3049
|
+
Served asset /medivo/ajax_waiting.gif - 200 OK (0ms)
|
3050
|
+
|
3051
|
+
|
3052
|
+
Started GET "/assets/medivo/markerA.png" for 127.0.0.1 at 2011-11-04 00:00:00 -0400
|
3053
|
+
Served asset /medivo/markerA.png - 200 OK (0ms)
|
3054
|
+
|
3055
|
+
|
3056
|
+
Started GET "/assets/medivo/markerB.png" for 127.0.0.1 at 2011-11-04 00:00:00 -0400
|
3057
|
+
Served asset /medivo/markerB.png - 200 OK (0ms)
|
3058
|
+
|
3059
|
+
|
3060
|
+
Started GET "/assets/medivo/arrow.png" for 127.0.0.1 at 2011-11-04 00:00:00 -0400
|
3061
|
+
Served asset /medivo/arrow.png - 200 OK (0ms)
|
3062
|
+
|
3063
|
+
|
3064
|
+
Started GET "/medivo/labs/find_appointment?date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-04 00:00:00 -0400
|
3065
|
+
Processing by Medivo::LabsController#find_appointment as HTML
|
3066
|
+
Parameters: {"date"=>"11/01/2011", "lab_code"=>"20060"}
|
3067
|
+
Completed 200 OK in 0ms (Views: 0.0ms)
|
3068
|
+
|
3069
|
+
|
3070
|
+
Started GET "/medivo/labs/find_appointment?date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-04 00:00:00 -0400
|
3071
|
+
Processing by Medivo::LabsController#find_appointment as HTML
|
3072
|
+
Parameters: {"date"=>"11/01/2011", "lab_code"=>"20060"}
|
3073
|
+
Completed 200 OK in 0ms (Views: 0.0ms)
|
3074
|
+
|
3075
|
+
|
3076
|
+
Started GET "/medivo/labs/find_appointment?date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-04 00:00:00 -0400
|
3077
|
+
Processing by Medivo::LabsController#find_appointment as HTML
|
3078
|
+
Parameters: {"date"=>"11/01/2011", "lab_code"=>"20060"}
|
3079
|
+
Completed 404 Not Found in 0ms (Views: 0.0ms)
|
3080
|
+
|
3081
|
+
|
3082
|
+
Started POST "/medivo/labs/make_appointment" for 127.0.0.1 at 2011-11-04 00:00:00 -0400
|
3083
|
+
Processing by Medivo::LabsController#make_appointment as HTML
|
3084
|
+
Parameters: {"lab_code"=>"20060", "time"=>"2011-11-01 08:30:00 UTC", "user"=>{"first_name"=>"dude", "last_name"=>nil, "date_of_birth"=>"12/28/1980", "email_address"=>"dudeman@dude.com", "phone_number"=>"4155551212"}}
|
3085
|
+
Completed 200 OK in 0ms (Views: 0.0ms)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -6,8 +6,11 @@ describe Medivo::Appointment do
|
|
6
6
|
describe "finding appointments" do
|
7
7
|
|
8
8
|
describe "with valid data" do
|
9
|
-
|
10
|
-
|
9
|
+
before do
|
10
|
+
@all_times = ["11/03/2011|08:30 AM", "11/04/2011|08:30 AM", "11/04/2011|08:30 PM"]
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:body) { {'times'=> @all_times} }
|
11
14
|
|
12
15
|
def returned_times(date, am_pm)
|
13
16
|
Timecop.freeze(Time.strptime(date, "%m/%d/%Y"))
|
@@ -18,11 +21,11 @@ describe Medivo::Appointment do
|
|
18
21
|
end
|
19
22
|
|
20
23
|
it "returns times" do
|
21
|
-
returned_times('11/01/2011', '').should == all_times
|
24
|
+
returned_times('11/01/2011', '').should == @all_times
|
22
25
|
end
|
23
26
|
|
24
27
|
it "filters out past date times" do
|
25
|
-
returned_times('11/04/2011', '').should == all_times.slice(1, 2)
|
28
|
+
returned_times('11/04/2011', '').should == @all_times.slice(1, 2)
|
26
29
|
end
|
27
30
|
|
28
31
|
it "filters out past or pm times" do
|
@@ -32,6 +35,11 @@ describe Medivo::Appointment do
|
|
32
35
|
it "filters out past or am times" do
|
33
36
|
returned_times('11/04/2011', 'PM').should == ["11/04/2011|08:30 PM"]
|
34
37
|
end
|
38
|
+
|
39
|
+
it "filters out invalid time strings" do
|
40
|
+
@all_times = ["11/02011|08:30 AM", "11/04/2011|11:30 AM"]
|
41
|
+
returned_times('11/04/2011', '').should == ["11/04/2011|11:30 AM"]
|
42
|
+
end
|
35
43
|
end
|
36
44
|
|
37
45
|
describe "with invalid request returns error message" 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.2.
|
4
|
+
version: 0.2.15
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-16 00:00:00.000000000 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
|
-
requirement: &
|
17
|
+
requirement: &2165114340 !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: *
|
25
|
+
version_requirements: *2165114340
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: jquery-rails
|
28
|
-
requirement: &
|
28
|
+
requirement: &2165113900 !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: *
|
36
|
+
version_requirements: *2165113900
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: coffee-script
|
39
|
-
requirement: &
|
39
|
+
requirement: &2165113440 !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: *
|
47
|
+
version_requirements: *2165113440
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: haml-rails
|
50
|
-
requirement: &
|
50
|
+
requirement: &2165113020 !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: *
|
58
|
+
version_requirements: *2165113020
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: geocoder
|
61
|
-
requirement: &
|
61
|
+
requirement: &2165112600 !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: *
|
69
|
+
version_requirements: *2165112600
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rest-client
|
72
|
-
requirement: &
|
72
|
+
requirement: &2165112180 !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: *
|
80
|
+
version_requirements: *2165112180
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: pdfkit
|
83
|
-
requirement: &
|
83
|
+
requirement: &2165111740 !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: *
|
91
|
+
version_requirements: *2165111740
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: prawn
|
94
|
-
requirement: &
|
94
|
+
requirement: &2165111320 !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: *
|
102
|
+
version_requirements: *2165111320
|
103
103
|
description: Use the medivo platform to find lab locations, make labcorp appointments,
|
104
104
|
place lab orders
|
105
105
|
email:
|
@@ -312,7 +312,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
312
312
|
version: '0'
|
313
313
|
segments:
|
314
314
|
- 0
|
315
|
-
hash:
|
315
|
+
hash: 883431128477834155
|
316
316
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
317
317
|
none: false
|
318
318
|
requirements:
|
@@ -321,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
321
321
|
version: '0'
|
322
322
|
segments:
|
323
323
|
- 0
|
324
|
-
hash:
|
324
|
+
hash: 883431128477834155
|
325
325
|
requirements: []
|
326
326
|
rubyforge_project:
|
327
327
|
rubygems_version: 1.6.2
|