pacing 1.0.0 β 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/pacing/pacer.rb +17 -17
- data/lib/pacing/version.rb +1 -1
- data/pacing.gemspec +1 -1
- data/spec/pacing_spec.rb +93 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51308fae8355d11876362b5f8079e2ce3ba4f9895cd84f3fd3f72758a8527a47
|
4
|
+
data.tar.gz: 86235e9e944f0250cb22d67da1483b30b793e0961539556a5b79f152a5b9ea6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bb5310571685c41aa07daa78dfe72272498eda87a01239165692c9ced4a02bd3a4c0afb7b7748f67b6d804756b4cfbdc9d9f55b6c38171dac49eda7c2a3f818
|
7
|
+
data.tar.gz: 58758425a4e180e61b7c47ecac9dec3f2a9e685b37a47d46514a74951f18b5fd87839d05fc46cbef04b40da0c85e93e80853cdc31933917e413d2dc2b285716a
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Pacing
|
2
2
|
|
3
|
-
Pacing is a tool that enables therapists to better manage and track their caseload. It is built for cases where there are therapy frequency limitations that need to be adhered to. For example, in the case of an [IEP (Individualized Education Program)](https://ambiki.com/glossary-concepts/iep), 504 plan, or a
|
3
|
+
Pacing is a tool that enables therapists to better manage and track their caseload. It is built for cases where there are therapy frequency limitations that need to be adhered to. For example, in the case of an [IEP (Individualized Education Program)](https://ambiki.com/glossary-concepts/iep), 504 plan, or a Service plan. This gem helps to calculate remaining visits as well as a therapist's current pace to meet visit mandates.
|
4
4
|
|
5
5
|
- π Ahead of pace
|
6
6
|
- π On pace
|
@@ -31,7 +31,7 @@ gem 'pacing'
|
|
31
31
|
school_plan = {
|
32
32
|
school_plan_services: [
|
33
33
|
{
|
34
|
-
school_plan_type: "IEP", # string ('IEP', '504 Plan', '
|
34
|
+
school_plan_type: "IEP", # string ('IEP', '504 Plan', 'Service Plan' )
|
35
35
|
start_date: "01-01-2022", # string (mm-dd-yyyy)
|
36
36
|
end_date: "01-01-2023", # string (mm-dd-yyyy)
|
37
37
|
type_of_service: "Language Therapy", # string ('Language Therapy', 'Speech Therapy', 'Occupation Therapy', 'Physical Therapy', 'Feeding Therapy', 'Speech and Language Therapy')
|
@@ -43,7 +43,7 @@ school_plan = {
|
|
43
43
|
interval_for_extra_sessions_allowable: "monthly", # string ('weekly', 'monthly', 'yearly')
|
44
44
|
},
|
45
45
|
{
|
46
|
-
school_plan_type: "IEP", # string ('IEP', '504 Plan', '
|
46
|
+
school_plan_type: "IEP", # string ('IEP', '504 Plan', 'Service Plan' )
|
47
47
|
start_date: "01-01-2022", # string (mm-dd-yyyy)
|
48
48
|
end_date: "01-01-2023", # string (mm-dd-yyyy)
|
49
49
|
type_of_service: "Physical Therapy", # string ('Language Therapy', 'Speech Therapy', 'Occupation Therapy', 'Physical Therapy', 'Feeding Therapy', 'Speech and Language Therapy')
|
@@ -155,7 +155,7 @@ The following list shows the various variables and what they consist of:
|
|
155
155
|
|
156
156
|
- **IEP (Individualized Education Program)**: Individualized Education Programs (IEPs) are required by law for every student who receives special education services and are developed on an annual basis. The IEP is an educational document that the school generates. The therapist is bound to the frequency on the IEP, and the insurance companies will not pay for anything above or beyond what is on the IEP. It is a blueprint for a studentβs special education experience in a public school. The plan must ensure that the child receives a free appropriate public education, (FAPE).
|
157
157
|
- **504 Plan**: 504 plans are formal plans that schools develop to give kids with disabilities the support they need. That covers any condition that limits daily activities in a major way. These plans prevent discrimination and they protect the rights of kids with disabilities in school. They are covered under Section 504 of the Rehabilitation Act, a civil rights law.
|
158
|
-
- **
|
158
|
+
- **Service Plan**: A plan paid for by the local school district for students with disabilities who attend private schools. A Service plan does not have to ensure a child is provided with FAPE (free appropriate public education). A Service plan spells out the special education and related services the LEA will make available to a child. These services are provided at no cost to parents. But the student may not be able to receive these services at the private school. Instead, the LEA can require him to go to a public school for services like speech therapy sessions. [Β§34 CFR 300.130 through Β§300.144 of IDEA](https://sites.ed.gov/idea/files/CWD_Enrolled_by_Their_Parents_in_Private_Schools_11-16-06.pdf) is a specific section that describes how services are provided to kids in private school.
|
159
159
|
|
160
160
|
## Testing
|
161
161
|
|
data/lib/pacing/pacer.rb
CHANGED
@@ -16,11 +16,11 @@ module Pacing
|
|
16
16
|
|
17
17
|
raise ArgumentError.new("You must pass in at least one school plan") if @school_plan.nil?
|
18
18
|
raise TypeError.new("School plan must be a hash") if @school_plan.class != Hash
|
19
|
-
|
19
|
+
|
20
20
|
raise ArgumentError.new('You must pass in a date') if @date.nil?
|
21
21
|
raise TypeError.new("The date should be formatted as a string in the format mm-dd-yyyy") if @date.class != String || !/(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])-(19|20)\d\d/.match?(@date)
|
22
22
|
raise ArgumentError.new('Date must be within the interval range of the school plan') if !date_within_range
|
23
|
-
|
23
|
+
|
24
24
|
@non_business_days.each do |non_business_day|
|
25
25
|
raise TypeError.new('"Non business days" dates should be formatted as a string in the format mm-dd-yyyy') if non_business_day.class != String || !/(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])-(19|20)\d\d/.match?(non_business_day)
|
26
26
|
end
|
@@ -117,11 +117,11 @@ module Pacing
|
|
117
117
|
|
118
118
|
def interval_days(interval)
|
119
119
|
case interval
|
120
|
-
when "monthly"
|
120
|
+
when "monthly", "per month"
|
121
121
|
return COMMON_YEAR_DAYS_IN_MONTH[(parse_date(@date)).month]
|
122
|
-
when "weekly"
|
122
|
+
when "weekly", "per week"
|
123
123
|
return 6
|
124
|
-
when "yearly"
|
124
|
+
when "yearly", "per year"
|
125
125
|
return parse_date(@date).leap? ? 366 : 365
|
126
126
|
end
|
127
127
|
end
|
@@ -179,11 +179,11 @@ module Pacing
|
|
179
179
|
# scoped to the interval
|
180
180
|
def reset_date(start_date:, interval:)
|
181
181
|
case interval
|
182
|
-
when "monthly"
|
182
|
+
when "monthly", "per month"
|
183
183
|
return reset_date_monthly(start_date, interval)
|
184
|
-
when "weekly"
|
184
|
+
when "weekly", "per week"
|
185
185
|
return reset_date_weekly(start_date, interval)
|
186
|
-
when "yearly"
|
186
|
+
when "yearly", "per year"
|
187
187
|
return reset_date_yearly(start_date)
|
188
188
|
end
|
189
189
|
end
|
@@ -191,11 +191,11 @@ module Pacing
|
|
191
191
|
# scoped to the interval
|
192
192
|
def start_of_treatment_date(start_date, interval="monthly")
|
193
193
|
case interval
|
194
|
-
when "monthly"
|
194
|
+
when "monthly", "per month"
|
195
195
|
return start_of_treatment_date_monthly(start_date)
|
196
|
-
when "weekly"
|
196
|
+
when "weekly", "per week"
|
197
197
|
return start_of_treatment_date_weekly(start_date)
|
198
|
-
when "yearly"
|
198
|
+
when "yearly", "per year"
|
199
199
|
return start_of_treatment_date_yearly(start_date)
|
200
200
|
end
|
201
201
|
end
|
@@ -218,7 +218,7 @@ module Pacing
|
|
218
218
|
return date if date.monday?
|
219
219
|
date - ((date.wday - offset_from_sunday) % 7)
|
220
220
|
end
|
221
|
-
|
221
|
+
|
222
222
|
# reset date for the yearly interval
|
223
223
|
def reset_date_yearly(start_date)
|
224
224
|
(parse_date(@date).leap? ? parse_date(start_date) + 366 : parse_date(start_date) + 365).strftime("%m-%d-%Y")
|
@@ -284,7 +284,7 @@ module Pacing
|
|
284
284
|
rescue => exception
|
285
285
|
valid_range_or_exceptions = true
|
286
286
|
end
|
287
|
-
|
287
|
+
|
288
288
|
valid_range_or_exceptions
|
289
289
|
end
|
290
290
|
|
@@ -301,7 +301,7 @@ module Pacing
|
|
301
301
|
:reset_date => nil } # some arbitrarity date in the past
|
302
302
|
|
303
303
|
discipline_services = services.filter do |service|
|
304
|
-
["
|
304
|
+
["pragmatic language", "speech and language", "language", "speech", "language therapy", "speech therapy", "speech and language therapy", "speech language therapy"].include?(service[:type_of_service].downcase)
|
305
305
|
end
|
306
306
|
|
307
307
|
return {} if discipline_services.empty?
|
@@ -322,7 +322,7 @@ module Pacing
|
|
322
322
|
:reset_date=> nil } # some arbitrarity date in the past
|
323
323
|
|
324
324
|
discipline_services = services.filter do |service|
|
325
|
-
["occupation therapy", "occupational therapy"].include?
|
325
|
+
["occupation therapy", "occupational therapy"].include?(service[:type_of_service].downcase)
|
326
326
|
end
|
327
327
|
|
328
328
|
return {} if discipline_services.empty?
|
@@ -343,7 +343,7 @@ module Pacing
|
|
343
343
|
:reset_date=> nil } # some arbitrarity date in the past
|
344
344
|
|
345
345
|
discipline_services = services.filter do |service|
|
346
|
-
["
|
346
|
+
["physical therapy"].include?(service[:type_of_service].downcase)
|
347
347
|
end
|
348
348
|
|
349
349
|
return {} if discipline_services.empty?
|
@@ -388,7 +388,7 @@ module Pacing
|
|
388
388
|
end
|
389
389
|
|
390
390
|
discipline[:pace_indicator] = pace_indicator(discipline[:pace])
|
391
|
-
discipline[:pace_suggestion] = readable_suggestion(rate: discipline[:suggested_rate])
|
391
|
+
discipline[:pace_suggestion] = readable_suggestion(rate: discipline[:suggested_rate])
|
392
392
|
|
393
393
|
discipline.delete(:suggested_rate)
|
394
394
|
discipline
|
data/lib/pacing/version.rb
CHANGED
data/pacing.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = 'pacing'
|
7
7
|
s.version = Pacing::VERSION
|
8
8
|
s.summary = "Pacing is a tool that enables therapists to better manage and track their caseload."
|
9
|
-
s.description = "Pacing is built for cases where there are therapy frequency limitations that need to be adhered to. For example, in the case of an [IEP (Individualized Education Program)](https://ambiki.com/glossary-concepts/iep), 504 plan, or a
|
9
|
+
s.description = "Pacing is built for cases where there are therapy frequency limitations that need to be adhered to. For example, in the case of an [IEP (Individualized Education Program)](https://ambiki.com/glossary-concepts/iep), 504 plan, or a Service plan. This gem helps to calculate remaining visits as well as a therapist's current pace to meet visit mandates."
|
10
10
|
s.authors = ["Kevin S. Dias", "Samuel Okoth", "Lukong I. Nsoseka"]
|
11
11
|
s.email = 'info@ambiki.com'
|
12
12
|
s.files = `git ls-files -z`.split("\x0")
|
data/spec/pacing_spec.rb
CHANGED
@@ -293,7 +293,7 @@ RSpec.describe Pacing::Pacer do
|
|
293
293
|
}
|
294
294
|
]
|
295
295
|
)
|
296
|
-
|
296
|
+
|
297
297
|
end
|
298
298
|
|
299
299
|
it "should return a negative pacing when fewer visits are completed than expected before a particular point in time" do
|
@@ -472,7 +472,7 @@ RSpec.describe Pacing::Pacer do
|
|
472
472
|
}
|
473
473
|
]
|
474
474
|
)
|
475
|
-
|
475
|
+
|
476
476
|
end
|
477
477
|
|
478
478
|
it "should return a negative pacing when fewer visits are completed than expected before a particular point in time" do
|
@@ -729,7 +729,7 @@ RSpec.describe Pacing::Pacer do
|
|
729
729
|
non_business_days = []
|
730
730
|
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
731
731
|
expect(results).to eq([{:discipline=>"Speech Therapy", :remaining_visits=>6, :used_visits=>6, :pace=>0, :pace_indicator=>"π", :pace_suggestion=>"once every other day", :expected_visits_at_date=>6, :reset_date=>"11-01-2022"}])
|
732
|
-
end
|
732
|
+
end
|
733
733
|
|
734
734
|
it "should correctly parse the pacing for patient 23" do
|
735
735
|
school_plan = {:school_plan_services=>
|
@@ -739,14 +739,14 @@ RSpec.describe Pacing::Pacer do
|
|
739
739
|
:start_date=>"11-18-2021",
|
740
740
|
:end_date=>"11-18-2022",
|
741
741
|
:type_of_service=>"Language Therapy",
|
742
|
-
:frequency=>6,
|
742
|
+
:frequency=>6,
|
743
743
|
:interval=>"monthly",
|
744
744
|
:time_per_session_in_minutes=>20,
|
745
745
|
:completed_visits_for_current_interval=>2,
|
746
746
|
:extra_sessions_allowable=>0,
|
747
747
|
:interval_for_extra_sessions_allowable=>"monthly"
|
748
748
|
}, {
|
749
|
-
:school_plan_type=>"IEP",
|
749
|
+
:school_plan_type=>"IEP",
|
750
750
|
:start_date=>"11-18-2021",
|
751
751
|
:end_date=>"11-18-2022",
|
752
752
|
:type_of_service=>"Speech and Language Therapy",
|
@@ -4901,5 +4901,93 @@ RSpec.describe Pacing::Pacer do
|
|
4901
4901
|
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
4902
4902
|
expect(results).to eq([{:discipline=>"Speech Therapy", :remaining_visits=>12, :used_visits=>43, :pace=>3, :pace_indicator=>"π", :pace_suggestion=>"once a week", :expected_visits_at_date=>40, :reset_date=>"01-04-2023"}])
|
4903
4903
|
end
|
4904
|
+
|
4905
|
+
it "should also accept 'per month' as an interval" do
|
4906
|
+
school_plan = {:school_plan_services=>[{:school_plan_type=>"IEP", :start_date=>"05-23-2022", :end_date=>"05-23-2023", :type_of_service=>"Speech Therapy", :frequency=>6, :interval=>"per month", :time_per_session_in_minutes=>20, :completed_visits_for_current_interval=>4, :extra_sessions_allowable=>1, :interval_for_extra_sessions_allowable=>"per month"}, {:school_plan_type=>"IEP", :start_date=>"05-23-2022", :end_date=>"05-23-2023", :type_of_service=>"Language Therapy", :frequency=>6, :interval=>"per month", :time_per_session_in_minutes=>20, :completed_visits_for_current_interval=>4, :extra_sessions_allowable=>1, :interval_for_extra_sessions_allowable=>"per month"}]}
|
4907
|
+
date = "10-17-2022"
|
4908
|
+
non_business_days = []
|
4909
|
+
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
4910
|
+
expect(results).to eq([{:discipline=>"Speech Therapy", :remaining_visits=>6, :used_visits=>8, :pace=>2, :pace_indicator=>"π", :pace_suggestion=>"once every other day", :expected_visits_at_date=>6, :reset_date=>"11-01-2022"}])
|
4911
|
+
end
|
4912
|
+
|
4913
|
+
it "should also accept 'per year' as an interval" do
|
4914
|
+
school_plan = {:school_plan_services=>[{:school_plan_type=>"IEP", :start_date=>"01-04-2022", :end_date=>"01-04-2023", :type_of_service=>"Language Therapy", :frequency=>55, :interval=>"per year", :time_per_session_in_minutes=>20, :completed_visits_for_current_interval=>43, :extra_sessions_allowable=>0, :interval_for_extra_sessions_allowable=>"per year"}]}
|
4915
|
+
date = "10-17-2022"
|
4916
|
+
non_business_days = []
|
4917
|
+
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
4918
|
+
expect(results).to eq([{:discipline=>"Speech Therapy", :remaining_visits=>12, :used_visits=>43, :pace=>3, :pace_indicator=>"π", :pace_suggestion=>"once a week", :expected_visits_at_date=>40, :reset_date=>"01-04-2023"}])
|
4919
|
+
end
|
4920
|
+
|
4921
|
+
it "should also accept 'per week' as an interval" do
|
4922
|
+
school_plan = {:school_plan_services=>[{:school_plan_type=>"IEP", :start_date=>"08-19-2022", :end_date=>"08-19-2023", :type_of_service=>"Language Therapy", :frequency=>3, :interval=>"per week", :time_per_session_in_minutes=>10, :completed_visits_for_current_interval=>0, :extra_sessions_allowable=>0, :interval_for_extra_sessions_allowable=>"per week"}, {:school_plan_type=>"IEP", :start_date=>"08-19-2022", :end_date=>"08-19-2023", :type_of_service=>"Speech Therapy", :frequency=>3, :interval=>"per week", :time_per_session_in_minutes=>10, :completed_visits_for_current_interval=>0, :extra_sessions_allowable=>0, :interval_for_extra_sessions_allowable=>"per week"}]}
|
4923
|
+
date = "10-17-2022"
|
4924
|
+
non_business_days = []
|
4925
|
+
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
4926
|
+
expect(results).to eq([{:discipline=>"Speech Therapy", :remaining_visits=>6, :used_visits=>0, :pace=>0, :pace_indicator=>"π", :pace_suggestion=>"once a day", :expected_visits_at_date=>0, :reset_date=>"10-24-2022"}])
|
4927
|
+
end
|
4928
|
+
|
4929
|
+
it "should also accept 'Speech' as a type of service" do
|
4930
|
+
school_plan = {:school_plan_services=>[{:school_plan_type=>"IEP", :start_date=>"05-23-2022", :end_date=>"05-23-2023", :type_of_service=>"Speech", :frequency=>6, :interval=>"monthly", :time_per_session_in_minutes=>20, :completed_visits_for_current_interval=>4, :extra_sessions_allowable=>1, :interval_for_extra_sessions_allowable=>"monthly"}, {:school_plan_type=>"IEP", :start_date=>"05-23-2022", :end_date=>"05-23-2023", :type_of_service=>"Language Therapy", :frequency=>6, :interval=>"monthly", :time_per_session_in_minutes=>20, :completed_visits_for_current_interval=>4, :extra_sessions_allowable=>1, :interval_for_extra_sessions_allowable=>"monthly"}]}
|
4931
|
+
date = "10-17-2022"
|
4932
|
+
non_business_days = []
|
4933
|
+
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
4934
|
+
expect(results).to eq([{:discipline=>"Speech Therapy", :remaining_visits=>6, :used_visits=>8, :pace=>2, :pace_indicator=>"π", :pace_suggestion=>"once every other day", :expected_visits_at_date=>6, :reset_date=>"11-01-2022"}])
|
4935
|
+
end
|
4936
|
+
|
4937
|
+
it "should also accept 'Language' as a type of service" do
|
4938
|
+
school_plan = {:school_plan_services=>[{:school_plan_type=>"IEP", :start_date=>"05-23-2022", :end_date=>"05-23-2023", :type_of_service=>"Speech Therapy", :frequency=>6, :interval=>"monthly", :time_per_session_in_minutes=>20, :completed_visits_for_current_interval=>4, :extra_sessions_allowable=>1, :interval_for_extra_sessions_allowable=>"monthly"}, {:school_plan_type=>"IEP", :start_date=>"05-23-2022", :end_date=>"05-23-2023", :type_of_service=>"Language", :frequency=>6, :interval=>"monthly", :time_per_session_in_minutes=>20, :completed_visits_for_current_interval=>4, :extra_sessions_allowable=>1, :interval_for_extra_sessions_allowable=>"monthly"}]}
|
4939
|
+
date = "10-17-2022"
|
4940
|
+
non_business_days = []
|
4941
|
+
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
4942
|
+
expect(results).to eq([{:discipline=>"Speech Therapy", :remaining_visits=>6, :used_visits=>8, :pace=>2, :pace_indicator=>"π", :pace_suggestion=>"once every other day", :expected_visits_at_date=>6, :reset_date=>"11-01-2022"}])
|
4943
|
+
end
|
4944
|
+
|
4945
|
+
it "should also accept 'Speech and language' as a type of service" do
|
4946
|
+
school_plan = {:school_plan_services=>[{:school_plan_type=>"IEP", :start_date=>"12-03-2021", :end_date=>"12-03-2022", :type_of_service=>"Speech and language", :frequency=>12, :interval=>"monthly", :time_per_session_in_minutes=>20, :completed_visits_for_current_interval=>4, :extra_sessions_allowable=>1, :interval_for_extra_sessions_allowable=>"monthly"}]}
|
4947
|
+
date = "10-17-2022"
|
4948
|
+
non_business_days = []
|
4949
|
+
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
4950
|
+
expect(results).to eq([{:discipline=>"Speech Therapy", :remaining_visits=>9, :used_visits=>4, :pace=>-2, :pace_indicator=>"π’", :pace_suggestion=>"about once every other day", :expected_visits_at_date=>6, :reset_date=>"11-01-2022"}])
|
4951
|
+
end
|
4952
|
+
|
4953
|
+
it "should also accept 'Pragmatic language' as a type of service" do
|
4954
|
+
school_plan = {:school_plan_services=>[{:school_plan_type=>"IEP", :start_date=>"12-03-2021", :end_date=>"12-03-2022", :type_of_service=>"Pragmatic language", :frequency=>12, :interval=>"monthly", :time_per_session_in_minutes=>20, :completed_visits_for_current_interval=>4, :extra_sessions_allowable=>1, :interval_for_extra_sessions_allowable=>"monthly"}]}
|
4955
|
+
date = "10-17-2022"
|
4956
|
+
non_business_days = []
|
4957
|
+
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
4958
|
+
expect(results).to eq([{:discipline=>"Speech Therapy", :remaining_visits=>9, :used_visits=>4, :pace=>-2, :pace_indicator=>"π’", :pace_suggestion=>"about once every other day", :expected_visits_at_date=>6, :reset_date=>"11-01-2022"}])
|
4959
|
+
end
|
4960
|
+
|
4961
|
+
it "shouldn't care about casing and also accept 'pragmatic language' as a type of service" do
|
4962
|
+
school_plan = {:school_plan_services=>[{:school_plan_type=>"IEP", :start_date=>"12-03-2021", :end_date=>"12-03-2022", :type_of_service=>"Pragmatic language", :frequency=>12, :interval=>"monthly", :time_per_session_in_minutes=>20, :completed_visits_for_current_interval=>4, :extra_sessions_allowable=>1, :interval_for_extra_sessions_allowable=>"monthly"}]}
|
4963
|
+
date = "10-17-2022"
|
4964
|
+
non_business_days = []
|
4965
|
+
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
4966
|
+
expect(results).to eq([{:discipline=>"Speech Therapy", :remaining_visits=>9, :used_visits=>4, :pace=>-2, :pace_indicator=>"π’", :pace_suggestion=>"about once every other day", :expected_visits_at_date=>6, :reset_date=>"11-01-2022"}])
|
4967
|
+
end
|
4968
|
+
|
4969
|
+
it "shouldn't care about casing and also accept 'speech and language' as a type of service" do
|
4970
|
+
school_plan = {:school_plan_services=>[{:school_plan_type=>"IEP", :start_date=>"12-03-2021", :end_date=>"12-03-2022", :type_of_service=>"speech and language", :frequency=>12, :interval=>"monthly", :time_per_session_in_minutes=>20, :completed_visits_for_current_interval=>4, :extra_sessions_allowable=>1, :interval_for_extra_sessions_allowable=>"monthly"}]}
|
4971
|
+
date = "10-17-2022"
|
4972
|
+
non_business_days = []
|
4973
|
+
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
4974
|
+
expect(results).to eq([{:discipline=>"Speech Therapy", :remaining_visits=>9, :used_visits=>4, :pace=>-2, :pace_indicator=>"π’", :pace_suggestion=>"about once every other day", :expected_visits_at_date=>6, :reset_date=>"11-01-2022"}])
|
4975
|
+
end
|
4976
|
+
|
4977
|
+
it "shouldn't care about casing and also accept 'OCCUPATIONAL THERAPY' as a type of service" do
|
4978
|
+
school_plan = {:school_plan_services=>[{:school_plan_type=>"IEP", :start_date=>"01-19-2022", :end_date=>"01-19-2023", :type_of_service=>"OCCUPATIONAL THERAPY", :frequency=>1, :interval=>"weekly", :time_per_session_in_minutes=>30, :completed_visits_for_current_interval=>0, :extra_sessions_allowable=>0, :interval_for_extra_sessions_allowable=>"weekly"}, {:school_plan_type=>"IEP", :start_date=>"01-19-2022", :end_date=>"01-19-2023", :type_of_service=>"Language Therapy", :frequency=>2, :interval=>"weekly", :time_per_session_in_minutes=>30, :completed_visits_for_current_interval=>0, :extra_sessions_allowable=>0, :interval_for_extra_sessions_allowable=>"weekly"}]}
|
4979
|
+
date = "10-17-2022"
|
4980
|
+
non_business_days = []
|
4981
|
+
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
4982
|
+
expect(results).to eq([{:discipline=>"Speech Therapy", :remaining_visits=>2, :used_visits=>0, :pace=>0, :pace_indicator=>"π", :pace_suggestion=>"once every 3 days", :expected_visits_at_date=>0, :reset_date=>"10-24-2022"}, {:discipline=>"Occupational Therapy", :remaining_visits=>1, :used_visits=>0, :pace=>0, :pace_indicator=>"π", :pace_suggestion=>"once a week", :expected_visits_at_date=>0, :reset_date=>"10-24-2022"}])
|
4983
|
+
end
|
4984
|
+
|
4985
|
+
it "shouldn't care about casing and also accept 'PHYSICAL THERAPY' as a type of service" do
|
4986
|
+
school_plan = {:school_plan_services=>[{:school_plan_type=>"IEP", :start_date=>"11-08-2021", :end_date=>"11-08-2022", :type_of_service=>"Occupation Therapy", :frequency=>1, :interval=>"weekly", :time_per_session_in_minutes=>30, :completed_visits_for_current_interval=>0, :extra_sessions_allowable=>0, :interval_for_extra_sessions_allowable=>"weekly"}, {:school_plan_type=>"IEP", :start_date=>"11-08-2021", :end_date=>"11-08-2022", :type_of_service=>"PHYSICAL THERAPY", :frequency=>1, :interval=>"weekly", :time_per_session_in_minutes=>30, :completed_visits_for_current_interval=>0, :extra_sessions_allowable=>0, :interval_for_extra_sessions_allowable=>"weekly"}]}
|
4987
|
+
date = "10-17-2022"
|
4988
|
+
non_business_days = []
|
4989
|
+
results = Pacing::Pacer.new(school_plan: school_plan, date: date, non_business_days: non_business_days).calculate
|
4990
|
+
expect(results).to eq([{:discipline=>"Occupational Therapy", :remaining_visits=>1, :used_visits=>0, :pace=>0, :pace_indicator=>"π", :pace_suggestion=>"once a week", :expected_visits_at_date=>0, :reset_date=>"10-24-2022"}, {:discipline=>"Physical Therapy", :remaining_visits=>1, :used_visits=>0, :pace=>0, :pace_indicator=>"π", :pace_suggestion=>"once a week", :expected_visits_at_date=>0, :reset_date=>"10-24-2022"}])
|
4991
|
+
end
|
4904
4992
|
end
|
4905
4993
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pacing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin S. Dias
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-11-
|
13
|
+
date: 2022-11-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -48,7 +48,7 @@ dependencies:
|
|
48
48
|
version: '8.6'
|
49
49
|
description: Pacing is built for cases where there are therapy frequency limitations
|
50
50
|
that need to be adhered to. For example, in the case of an [IEP (Individualized
|
51
|
-
Education Program)](https://ambiki.com/glossary-concepts/iep), 504 plan, or a
|
51
|
+
Education Program)](https://ambiki.com/glossary-concepts/iep), 504 plan, or a Service
|
52
52
|
plan. This gem helps to calculate remaining visits as well as a therapist's current
|
53
53
|
pace to meet visit mandates.
|
54
54
|
email: info@ambiki.com
|