diff --git a/app/models/scheme.rb b/app/models/scheme.rb index f563573b5..cf13ff29d 100644 --- a/app/models/scheme.rb +++ b/app/models/scheme.rb @@ -148,9 +148,8 @@ class Scheme < ApplicationRecord enum :sensitive, SENSITIVE, suffix: true REGISTERED_UNDER_CARE_ACT = { - "Yes – registered care home providing nursing care": 4, - "Yes – registered care home providing personal care": 3, - "Yes – part registered as a care home": 2, + "Yes": 5, + "Partially - some but not all units in the scheme are regulated by the CQC": 2, "No": 1, }.freeze @@ -251,7 +250,7 @@ class Scheme < ApplicationRecord { name: "Status", value: status, id: "status" }, { name: "Confidential information", value: sensitive, id: "sensitive", edit: true }, { name: "Type of scheme", value: scheme_type, id: "scheme_type", edit: true }, - { name: "Registered under Care Standards Act 2000", value: registered_under_care_act, id: "registered_under_care_act", edit: true }, + { name: "Regulated by the Care Quality Commission", value: registered_under_care_act, id: "registered_under_care_act", edit: true }, { name: "Housing stock owned by", value: owning_organisation.name, id: "owning_organisation_id", edit: true }, { name: "Support services provided by", value: arrangement_type, id: "arrangement_type", edit: true }, { name: "Primary client group", value: primary_client_group, id: "primary_client_group", edit: true }, @@ -262,10 +261,8 @@ class Scheme < ApplicationRecord ] end - def care_acts_options_with_hints - hints = { "Yes – part registered as a care home": "A proportion of units are registered as being a care home." } - - Scheme.registered_under_care_acts.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: hints[key.to_sym]) } + def self.care_acts_options + Scheme.registered_under_care_acts.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s) } end def support_level_options_with_hints diff --git a/app/views/schemes/details.html.erb b/app/views/schemes/details.html.erb index d1943cabe..722e58883 100644 --- a/app/views/schemes/details.html.erb +++ b/app/views/schemes/details.html.erb @@ -38,16 +38,12 @@ :name, legend: { text: "What is this type of scheme?", size: "m" } %> - <% care_acts_options_hints = { "Yes – part registered as a care home": "A proportion of units are registered as being a care home." } %> - - <% care_acts_options_with_hints = Scheme.registered_under_care_acts.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: care_acts_options_hints[key.to_sym]) } %> - <%= f.govuk_collection_radio_buttons :registered_under_care_act, - care_acts_options_with_hints, + Scheme.care_acts_options, :id, :name, :description, - legend: { text: "Is this scheme registered under the Care Standards Act 2000?", size: "m" } %> + legend: { text: "Is the scheme regulated by the Care Quality Commission (CQC)?", size: "m" } %> <% scheme_owning_organisation_options = owning_organisation_options(current_user) %> diff --git a/app/views/schemes/new.html.erb b/app/views/schemes/new.html.erb index 1be0f7f74..88bddacd5 100644 --- a/app/views/schemes/new.html.erb +++ b/app/views/schemes/new.html.erb @@ -33,16 +33,12 @@ :name, legend: { text: "What is this type of scheme?", size: "m" } %> - <% care_acts_options_hints = { "Yes – part registered as a care home": "A proportion of units are registered as being a care home." } %> - - <% care_acts_options_with_hints = Scheme.registered_under_care_acts.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: care_acts_options_hints[key.to_sym]) } %> - <%= f.govuk_collection_radio_buttons :registered_under_care_act, - care_acts_options_with_hints, + Scheme.care_acts_options, :id, :name, :description, - legend: { text: "Is this scheme registered under the Care Standards Act 2000?", size: "m" } %> + legend: { text: "Is the scheme regulated by the Care Quality Commission (CQC)?", size: "m" } %> <% if current_user.data_coordinator? && current_user.organisation.stock_owners.count.zero? && !current_user.organisation.has_recent_absorbed_organisations? %> <%= f.hidden_field :owning_organisation_id, value: current_user.organisation.id %> diff --git a/lib/tasks/update_scheme_registered_under_care_value.rake b/lib/tasks/update_scheme_registered_under_care_value.rake new file mode 100644 index 000000000..f29b9e1dd --- /dev/null +++ b/lib/tasks/update_scheme_registered_under_care_value.rake @@ -0,0 +1,4 @@ +desc "Alter registered under care act values for schemes in the database to 5 if they are 3 or 4, as these options are being deprecated" +task update_scheme_registered_under_care_value: :environment do + Scheme.where(registered_under_care_act: [3, 4]).update_all(registered_under_care_act: 5) +end diff --git a/spec/features/schemes_helpers.rb b/spec/features/schemes_helpers.rb index 0b99d54de..e14c65cbf 100644 --- a/spec/features/schemes_helpers.rb +++ b/spec/features/schemes_helpers.rb @@ -29,7 +29,7 @@ module SchemesHelpers fill_in "Scheme name", with: "FooBar" check "This scheme contains confidential information" choose "Direct access hostel" - choose "Yes – registered care home providing nursing care" + choose "Yes" select organisation_name, from: "scheme-owning-organisation-id-field" choose answers["housing_stock_owners"].presence || "The same organisation that owns the housing stock" click_button "Save and continue" diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index e9cb23770..ec053b615 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -446,7 +446,7 @@ RSpec.describe "Schemes scheme Features" do expect(page).to have_content "This scheme contains confidential information" expect(page).to have_content "Which organisation owns the housing stock for this scheme?" expect(page).to have_content "What is this type of scheme?" - expect(page).to have_content "Is this scheme registered under the Care Standards Act 2000?" + expect(page).to have_content "Is the scheme regulated by the Care Quality Commission (CQC)?" expect(page).to have_content "Who provides the support services used by this scheme?" end @@ -463,7 +463,7 @@ RSpec.describe "Schemes scheme Features" do expect(page).to have_content "This scheme contains confidential information" expect(page).to have_content "What is this type of scheme?" expect(page).to have_content "Who provides the support services used by this scheme?" - expect(page).to have_content "Is this scheme registered under the Care Standards Act 2000?" + expect(page).to have_content "Is the scheme regulated by the Care Quality Commission (CQC)?" end it "returns to the primary client group question after amending scheme details" do diff --git a/spec/fixtures/files/original_schemes.csv b/spec/fixtures/files/original_schemes.csv index f28bbedbb..a068a132c 100644 --- a/spec/fixtures/files/original_schemes.csv +++ b/spec/fixtures/files/original_schemes.csv @@ -1,6 +1,6 @@ scheme_code,scheme_service_name,scheme_status,scheme_confidential,scheme_type,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_support_services_provided_by,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,scheme_active_dates -{id1},Test name,active,Yes,Housing for older people,Yes – registered care home providing nursing care,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,Yes,Older people with support needs,High level,Medium stay,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" -{id2},Test name,active,Yes,Housing for older people,Yes – registered care home providing nursing care,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,Yes,Older people with support needs,High level,Medium stay,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" -{id3},Test name,active,Yes,Housing for older people,Yes – registered care home providing nursing care,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,Yes,Older people with support needs,High level,Medium stay,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" -{id4},Incomplete scheme,incomplete,Yes,Housing for older people,Yes – registered care home providing nursing care,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,,,,,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" -SWrong_id,Incomplete scheme,incomplete,Yes,Housing for older people,Yes – registered care home providing nursing care,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,,,,,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" +{id1},Test name,active,Yes,Housing for older people,Yes,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,Yes,Older people with support needs,High level,Medium stay,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" +{id2},Test name,active,Yes,Housing for older people,Yes,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,Yes,Older people with support needs,High level,Medium stay,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" +{id3},Test name,active,Yes,Housing for older people,Yes,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,Yes,Older people with support needs,High level,Medium stay,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" +{id4},Incomplete scheme,incomplete,Yes,Housing for older people,Yes,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,,,,,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" +SWrong_id,Incomplete scheme,incomplete,Yes,Housing for older people,Yes,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,,,,,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" diff --git a/spec/fixtures/files/updated_schemes.csv b/spec/fixtures/files/updated_schemes.csv index 5f4631a02..5091ea2de 100644 --- a/spec/fixtures/files/updated_schemes.csv +++ b/spec/fixtures/files/updated_schemes.csv @@ -1,6 +1,6 @@ scheme_code,scheme_service_name,scheme_status,scheme_confidential,scheme_type,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_support_services_provided_by,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,scheme_active_dates {id1},Updated test name,incomplete,No,Direct Access Hostel,No,Different organisation,Another registered stock owner,People with drug problems,No,Older people with support needs,Low level,Permanent,2022-04-01T00:00:00+01:00,"Active from 2 April 2020" -{id2},Test name,active,Yes,Housing for older people,Yes – registered care home providing nursing care,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,Yes,Older people with support needs,High level,Medium stay,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" -{id3}, ,active,Yse,Direct access Hostel,Yes – registered care home providing nursing care,non existing org,wrong answer,FD,no,lder people with support needs,high,Permanent ,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" +{id2},Test name,active,Yes,Housing for older people,Yes,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,Yes,Older people with support needs,High level,Medium stay,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" +{id3}, ,active,Yse,Direct access Hostel,Yes,non existing org,wrong answer,FD,no,lder people with support needs,high,Permanent ,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" Wrong_id,Incomplete scheme,incomplete,Yes,Housing for older people,No,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,,,,,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" SWrong_id,Incomplete scheme,incomplete,Yes,Housing for older people,No,MHCLG,The same organisation that owns the housing stock,People with alcohol problems,,,,,2021-04-01T00:00:00+01:00,"Active from 1 April 2020" diff --git a/spec/lib/tasks/update_schemes_and_locations_from_csv_spec.rb b/spec/lib/tasks/update_schemes_and_locations_from_csv_spec.rb index c397b456a..6c8aa25ed 100644 --- a/spec/lib/tasks/update_schemes_and_locations_from_csv_spec.rb +++ b/spec/lib/tasks/update_schemes_and_locations_from_csv_spec.rb @@ -57,7 +57,7 @@ RSpec.describe "bulk_update" do 3, service_name: "Test name", sensitive: 1, - registered_under_care_act: 4, + registered_under_care_act: 5, support_type: 4, scheme_type: 7, arrangement_type: "D", @@ -123,7 +123,7 @@ RSpec.describe "bulk_update" do schemes[1].reload expect(schemes[1].service_name).to eq("Test name") expect(schemes[1].sensitive).to eq("Yes") - expect(schemes[1].registered_under_care_act).to eq("Yes – registered care home providing nursing care") + expect(schemes[1].registered_under_care_act).to eq("Yes") expect(schemes[1].support_type).to eq("High level") expect(schemes[1].scheme_type).to eq("Housing for older people") expect(schemes[1].arrangement_type).to eq("The same organisation that owns the housing stock") @@ -141,7 +141,7 @@ RSpec.describe "bulk_update" do schemes[2].reload expect(schemes[2].service_name).to eq("Test name") expect(schemes[2].sensitive).to eq("Yes") - expect(schemes[2].registered_under_care_act).to eq("Yes – registered care home providing nursing care") + expect(schemes[2].registered_under_care_act).to eq("Yes") expect(schemes[2].support_type).to eq("High level") expect(schemes[2].scheme_type).to eq("Housing for older people") expect(schemes[2].arrangement_type).to eq("The same organisation that owns the housing stock")