Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add housing_status field. #3276

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/helpers/patients_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ def insurance_options(current_value = nil)
options_plus_current(full_set, current_value)
end

def housing_status_options(curent_value = nil)
[
nil,
[ t('patient.helper.housing_status.secure'), 'Housing secure' ],
[ t('patient.helper.housing_status.insecure'), 'Housing insecure' ],
[ t('common.prefer_not_to_answer'), 'Prefer not to answer']
]
end

def procedure_type_options(current_value = nil)
procedure_type_options = Config.find_or_create_by(config_key: 'procedure_type').options

Expand Down
10 changes: 10 additions & 0 deletions app/javascript/locales.json
Original file line number Diff line number Diff line change
Expand Up @@ -6724,6 +6724,10 @@
"student": "Student",
"unemployed": "Unemployed"
},
"housing_status": {
"insecure": "Housing insecure",
"secure": "Housing secure"
},
"income": {
"10_to_15": "$10,000-14,999 ($192-287/wk - $834-1250/mo)",
"15_to_20": "$15,000-19,999 ($288-384/wk - $1251-1666/mo)",
Expand Down Expand Up @@ -6790,6 +6794,7 @@
},
"information": {
"household_help": "(including patient)",
"housing_status": "Housing status",
"identifier": "Identifier",
"income_help": "Employment, Food Stamps, SS, TANF, etc.",
"insurance": "Patient insurance",
Expand Down Expand Up @@ -11063,6 +11068,10 @@
"student": "Estudiante",
"unemployed": "Desempleada"
},
"housing_status": {
"insecure": "Vivienda insegura",
"secure": "Vivienda segura"
},
"income": {
"10_to_15": "$10,000-14,999 ($192-287/sm - $834-1250/mes)",
"15_to_20": "$15,000-19,999 ($288-384/sm - $1251-1666/mes)",
Expand Down Expand Up @@ -11129,6 +11138,7 @@
},
"information": {
"household_help": "(incluyendo paciente)",
"housing_status": "Estado de la vivienda",
"identifier": "Identificador",
"income_help": "Empleo, Cupones de Alimentos, SS, TANF, etc.",
"insurance": "Seguro médico del patiente",
Expand Down
4 changes: 4 additions & 0 deletions app/views/patients/_patient_information.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@
options_for_select(insurance_options(patient.insurance),
patient.insurance),
label: t('patient.information.insurance') %>
<%= f.select :housing_status,
options_for_select(housing_status_options(patient.housing_status),
patient.housing_status),
label: t('patient.information.housing_status') %>
<%= f.select :referred_by,
options_for_select(referred_by_options(patient.referred_by),
patient.referred_by),
Expand Down
4 changes: 4 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ en:
none: No insurance
other: Other (add to notes)
unknown: Don't know
housing_status:
secure: Housing secure
insecure: Housing insecure
language:
English: English
practical_support:
Expand Down Expand Up @@ -498,6 +501,7 @@ en:
household_help: "(including patient)"
identifier: Identifier
income_help: Employment, Food Stamps, SS, TANF, etc.
housing_status: Housing status
insurance: Patient insurance
language: Preferred Language
other_contact:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ es:
none: Sin Seguro
other: Otro (Añadir a las notas)
unknown: No Se
housing_status:
secure: Vivienda segura
insecure: Vivienda insegura
language:
English: Inglés
practical_support:
Expand Down Expand Up @@ -498,6 +501,7 @@ es:
household_help: "(incluyendo paciente)"
identifier: Identificador
income_help: Empleo, Cupones de Alimentos, SS, TANF, etc.
housing_status: Estado de la vivienda
insurance: Seguro médico del patiente
language: Idioma preferido
other_contact:
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20240912001804_add_housing_status_to_patient.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddHousingStatusToPatient < ActiveRecord::Migration[7.1]
def change
add_column :patients, :housing_status, :string
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2024_08_18_162657) do
ActiveRecord::Schema[7.1].define(version: 2024_09_12_001804) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand Down Expand Up @@ -316,6 +316,7 @@
t.integer "ultrasound_cost"
t.boolean "multiday_appointment"
t.boolean "practical_support_waiver", comment: "Optional practical support services waiver, for funds that use them"
t.string "housing_status"
t.index ["clinic_id"], name: "index_patients_on_clinic_id"
t.index ["fund_id"], name: "index_patients_on_fund_id"
t.index ["identifier"], name: "index_patients_on_identifier"
Expand Down