clinic_finder 0.0.0 → 0.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: 1395796307b7e4dc1c69d210f37f0c976f666d02
4
- data.tar.gz: d12d1d938849d0414c1e80dab9c85d5de849fd7a
3
+ metadata.gz: 741438e7beda3144d4f1f42f20e8596f032c07da
4
+ data.tar.gz: e7496fc1f2a7d271f8bfeb050b6720d0314e25ad
5
5
  SHA512:
6
- metadata.gz: aacbea8da4beb63753b31d20ec350e3ba2b051d7b414ed574225c24459b0f3b1e0a1db0fea9d28849f4ac6ea3479c4abede1c38f7245a38b4f45ca0cb6ba43fa
7
- data.tar.gz: 4b7f6ac8c24a445a93430b33eb40ff90d0783528201902bb0d86916f85f350f791efdcff0fa0fd25903bde4e414e9412da204ad35011ebc9db0ad07d839fb443
6
+ metadata.gz: 40804f797f85769e3f1782dca2cfd925fe39abffe16449e884a7d1af9d870e1f46f112b4ad59e3fc22ea931f4375029df6f42b319c992eb72c848b7c4f1f9379
7
+ data.tar.gz: 2ebdf1f8cacaebddec292f400e503ab3daa3b17fae01ede25be901901ea303272a0c06bc0a0939ef8a696015cc4af152dec134de69c62abc946bbbcce2856f65
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # clinic_finder
2
2
  # ABORTRON
3
3
 
4
+ * gem: https://github.com/colinxfleming/clinic_finder
4
5
  * CI: https://travis-ci.org/colinxfleming/clinic_finder
5
6
  * build script: build.sh
6
7
  * run tests: rake test
@@ -33,7 +34,13 @@ Information from a patient that we'd like to plug into the tool:
33
34
 
34
35
  ## Setup
35
36
 
36
- [PLACEHOLDER FOR INSTALL INSTRUCTIONS]
37
+ Add clinic_finder to your application's Gemfile. Consult the rubygems page for most recent version
38
+
39
+ `gem 'clinic_finder', '~> 0.0.0'`
40
+
41
+ Run bundler from your terminal
42
+
43
+ Manually install the geokit gem in your application, as the client_finder gem is dependent on it (*open ticket to resolve)
37
44
 
38
45
  This gem currently requires data to be in the form of a .yml file, which is passed in to the library instance at the point of initialization as such:
39
46
 
@@ -94,13 +101,25 @@ This will return an array of hashes that look like so:
94
101
  'costs_24wks' => nil,
95
102
  'costs_30wks' => nil}}]
96
103
  ```
104
+
105
+ To find the closest clinic within your dataset that will serve the patient based on their LMP and patient zip code, call:
106
+
107
+ `@abortron.locate_nearest_clinic(patient_zip: 94117, gestational_age: 100)`
97
108
 
109
+ This will return an array of hashes of the 3 closest clinics and their calculated distance, which should look like so:
110
+
111
+ ```
112
+ => [{:name => "castro_family_planning", :distance => 0.92356303468274},
113
+ {:name => "planned_parenthood_san_fran", :distance => 1.8319683663768311},
114
+ {:name => "planned_parenthood_oakland", :distance => 9.580895789655901}]
115
+ ```
98
116
 
99
117
  ## Further goals
100
118
  * Make gem usable with ActiveRecord models directly, instead of via a yml file that requires maintenance
119
+ * Fix dependency on user manually requiring geokit
101
120
  * Incorporate check for NAF only (the infrastructure is currently present as a default-false argument, but is not being used)
102
121
  * Create method for cheapest **and** closest, defined as the cheapest clinic of your three closest clinics
103
- * Create a method for easiest/fastest access via public transportation (this may require patient to provide full address, not just zip)
122
+ * Create a method for easiest/fastest access via public transportation (this may require patient to provide full address, not just zip code)
104
123
 
105
124
  ## Measuring success
106
125
 
@@ -1,11 +1,11 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'clinic_finder'
3
- s.version = '0.0.0'
3
+ s.version = '0.0.1'
4
4
  s.date = '2017-02-23'
5
5
  s.summary = 'Finding abortion clinics based on zip and LMP'
6
6
  s.description = 'Help abortion fund case managers match ' \
7
7
  'patients to optimal clinics.'
8
- s.authors = ['Team Code for DCAF', 'Colin Fleming', 'Lisa Waldschmitt']
8
+ s.authors = ['Team Code for DCAF', 'Colin Fleming', 'Lisa Waldschmitt', 'Sara Gilford', 'Claire Schlessinger', 'Katherine Bui', 'Sierra McLawhorn']
9
9
  s.email = 'info@dcabortionfund.org'
10
10
  s.files = ['lib/clinic_finder.rb', 'lib/clinic_finder/gestation_helper.rb']
11
11
  s.homepage = 'http://www.dcabortionfund.org'
@@ -69,7 +69,7 @@ class ClinicFinder
69
69
  # This method makes the sorted clinic data more easily traversible by converting the data into a hash of names (keys) and informational attributes (values) rather than leaving them as separate values in a nested array.
70
70
  private def decorate_data(data)
71
71
  sorted_clinics = []
72
- three_cheapest(data).map { |clinic_array| sorted_clinics << { clinic_array.first => clinic_array.last } }
72
+ three_cheapest(data).map { |clinic_array| sorted_clinics << { name: clinic_array.first, cost: clinic_array.last[@gestational_tier] } }
73
73
  sorted_clinics
74
74
  end
75
75
 
@@ -57,22 +57,7 @@ class TestClinicFinder < TestClass
57
57
  end
58
58
 
59
59
  def test_locate_cheapest_clinic_locates
60
- clinic = {
61
- 'planned_parenthood_oakland' =>
62
- {
63
- 'street_address' => '1001 Broadway',
64
- 'city' => 'Oakland',
65
- 'state' => 'CA',
66
- 'zip' => 94607,
67
- 'accepts_naf' => false,
68
- 'gestational_limit' => 139,
69
- 'costs_9wks' => 425,
70
- 'costs_12wks' => 475,
71
- 'costs_18wks' => 975,
72
- 'costs_24wks' => nil,
73
- 'costs_30wks' => nil
74
- }
75
- }
76
- assert_equal clinic, @abortron.locate_cheapest_clinic(gestational_age: 100)[0]
60
+ clinic_result = {name: 'planned_parenthood_oakland', cost: 975}
61
+ assert_equal clinic_result, @abortron.locate_cheapest_clinic(gestational_age: 100)[0]
77
62
  end
78
63
  end
metadata CHANGED
@@ -1,12 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clinic_finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Code for DCAF
8
8
  - Colin Fleming
9
9
  - Lisa Waldschmitt
10
+ - Sara Gilford
11
+ - Claire Schlessinger
12
+ - Katherine Bui
13
+ - Sierra McLawhorn
10
14
  autorequire:
11
15
  bindir: bin
12
16
  cert_chain: []
@@ -52,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
56
  version: '0'
53
57
  requirements: []
54
58
  rubyforge_project: clinic_finder
55
- rubygems_version: 2.6.8
59
+ rubygems_version: 2.4.5.1
56
60
  signing_key:
57
61
  specification_version: 4
58
62
  summary: Finding abortion clinics based on zip and LMP