Skip to content

Commit c073a6e

Browse files
committed
Merge branch 'main' into task/migrate-ecep
2 parents d201227 + 8d1723f commit c073a6e

File tree

7 files changed

+184
-15
lines changed

7 files changed

+184
-15
lines changed

apcd-cms/src/apps/admin_regis_table/templates/view_registration_modal.html

+11
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ <h5>Entity {{forloop.counter}}</h5>
4848
<dd class="c-data-list__value">{{entity.license}}</dd>
4949
<dt class="c-data-list__key">NAIC Company Code</dt>
5050
<dd class="c-data-list__value">{{entity.naic}}</dd>
51+
<h6>Type of Plan</h6>
52+
<dd>
53+
<dl class="c-data-list--is-vert c-data-list--is-wide">
54+
<dt class="c-data-list__key">Types of Plans</dt>
55+
{% for plan_type, plan_type_selected in entity.plans_type.items %}
56+
{% if plan_type_selected %}
57+
<dd class="c-data-list__value">{{plan_type}}</dd>
58+
{% endif %}
59+
{% endfor %}
60+
</dl>
61+
</dd>
5162
<h6>File Submission</h6>
5263
<dd>
5364
<dl class="c-data-list--is-vert c-data-list--is-wide">

apcd-cms/src/apps/admin_regis_table/views.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,17 @@ def _set_entities(reg_ent):
111111
'no_covered': reg_ent[6],
112112
'ent_name': reg_ent[7],
113113
'fein': reg_ent[8] if reg_ent[8] else None,
114+
'plans_type': {
115+
"Commercial": reg_ent[9],
116+
"Medicare": reg_ent[10],
117+
"Medicaid": reg_ent[11],
118+
},
114119
'files_type': {
115-
"Eligibility/Enrollment": reg_ent[9],
116-
"Provider": reg_ent[10],
117-
"Medical": reg_ent[11],
118-
"Pharmacy": reg_ent[12],
119-
"Dental": reg_ent[13]
120+
"Eligibility/Enrollment": reg_ent[12],
121+
"Provider": reg_ent[13],
122+
"Medical": reg_ent[14],
123+
"Pharmacy": reg_ent[15],
124+
"Dental": reg_ent[16]
120125
}
121126
}
122127
def _set_contacts(reg_cont):

apcd-cms/src/apps/registrations/static/registrations/css/submission_form.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ input[name^="contact_phone"] {
2525
/* Field Layouts */
2626

2727
/* To make (radio/check)box sets take up less vertical space */
28-
#types_of_files, #submission_method, #on-behalf-of {
28+
#types_of_files, #types_of_plans, #submission_method, #on-behalf-of {
2929
display: flex;
3030
flex-wrap: wrap;
3131
column-gap: 1em;

apcd-cms/src/apps/registrations/templates/submission_form/registration_form_body.html

+69
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,31 @@ <h5 id="entity_header_{{ent_no}}_{{r.reg_id}}">Entity {{ ent_no }}</h5>
332332
</div>
333333
</div>
334334
</div>
335+
<h6>Type of Plan</h6>
336+
<div class="field-wrapper required">
337+
<label>
338+
Plan Types
339+
</label>
340+
</div>
341+
342+
<div class="field-wrapper checkboxselectmultiple required">
343+
<div class="field-errors" style="display: none"></div>
344+
345+
<ul id="types_of_plans" class="checkboxselectmultiple">
346+
{% for plan_type, plan_type_selected in entity.plans_type.items %}
347+
<li>
348+
<label for="types_of_plans_{{ plan_type|lower }}_{{ent_no}}_{{r.reg_id}}"
349+
><input
350+
type="checkbox"
351+
name="types_of_plans_{{ plan_type|lower }}_{{ent_no}}_{{r.reg_id}}"
352+
id="types_of_plans_{{ plan_type|lower }}_{{ent_no}}_{{r.reg_id}}"
353+
{% if plan_type_selected %}checked{% endif %}
354+
/>{{ plan_type }}</label
355+
>
356+
</li>
357+
{% endfor %}
358+
</ul>
359+
</div>
335360
<h6>File Submission</h6>
336361
<div class="field-wrapper required">
337362
<label>
@@ -554,6 +579,50 @@ <h4>
554579
</div>
555580
</div>
556581
</div>
582+
<h6>Type of Plan</h6>
583+
<div class="field-wrapper required">
584+
<label>
585+
Plan Types<span class="asterisk">*</span>
586+
</label>
587+
</div>
588+
589+
<div class="field-wrapper checkboxselectmultiple required">
590+
<div class="field-errors" style="display: none"></div>
591+
592+
<ul id="types_of_plans" class="checkboxselectmultiple">
593+
<li>
594+
<label for="types_of_plans_commercial_1"
595+
><input
596+
type="checkbox"
597+
name="types_of_plans_commercial_1"
598+
id="types_of_plans_commercial_1"
599+
required
600+
/>Commercial</label
601+
>
602+
</li>
603+
<li>
604+
<label for="types_of_plans_medicare_1"
605+
><input
606+
type="checkbox"
607+
name="types_of_plans_medicare_1"
608+
id="types_of_plans_medicare_1"
609+
required
610+
/>Medicare</label
611+
>
612+
</li>
613+
<li>
614+
<label for="types_of_plans_medicaid_1"
615+
><input
616+
type="checkbox"
617+
name="types_of_plans_medicaid_1"
618+
id="types_of_plans_medicaid_1"
619+
required
620+
/>Medicaid</label
621+
>
622+
</li>
623+
</ul>
624+
</div>
625+
557626
<h6>File Submission</h6>
558627
<div class="field-wrapper required">
559628
<label>

apcd-cms/src/apps/registrations/templates/submission_form/registration_form_scripts.html

+76-8
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,30 @@
3434
}));
3535
}
3636
</script>
37+
<script id="form-entity_plan_type-required">
38+
function entityPlanTypeValidation(ent_no, reg_id) {
39+
const planGroup = Array.from(
40+
document.querySelectorAll(`
41+
input[name=types_of_plans_commercial_${ent_no}${ reg_id ? `_${reg_id}`: ''}],
42+
input[name=types_of_plans_medicare_${ent_no}${ reg_id ? `_${reg_id}`: ''}],
43+
input[name=types_of_plans_medicaid_${ent_no}${ reg_id ? `_${reg_id}`: ''}]`)
44+
);
45+
planGroup.forEach(i => i.addEventListener('invalid', function (event) {
46+
if (!event.target.checked) {
47+
event.target.setCustomValidity('Please select at least one plan type.');
48+
}
49+
}));
50+
planGroup.forEach(i => i.addEventListener('click', function (event) {
51+
planGroup.forEach(j => {
52+
j.required = true;
53+
if (planGroup.some(input => input.checked)) { // if box checked, no other inputs in this group are required
54+
j.setCustomValidity('');
55+
j.required = false;
56+
}
57+
});
58+
}));
59+
}
60+
</script>
3761
{# To let user add and remove entities #}
3862
{# RFE: Do not duplicate entity markup #}
3963
{# IDEA: HTML template for any instance; used by markup for 0, JS for 1+ #}
@@ -67,6 +91,7 @@
6791

6892
for (let ent_no = 1; ent_no < entities + 1; ent_no +=1) {
6993
entityIdGroupValidation(ent_no, reg_id); // add validation for entities already on form at page load
94+
entityPlanTypeValidation(ent_no, reg_id);
7095
};
7196
btnStatus();
7297

@@ -154,6 +179,49 @@
154179
</div>
155180
</div>
156181
</div>
182+
<h6>Type of Plan</h6>
183+
<div class="field-wrapper required">
184+
<label>
185+
Plan Types<span class="asterisk">*</span>
186+
</label>
187+
</div>
188+
189+
<div class="field-wrapper checkboxselectmultiple required">
190+
<div class="field-errors" style="display: none"></div>
191+
192+
<ul id="types_of_plans" class="checkboxselectmultiple">
193+
<li>
194+
<label for="types_of_plans_commercial_${entities}{% if r %}_{{r.reg_id}}{% endif %}"
195+
><input
196+
type="checkbox"
197+
name="types_of_plans_commercial_${entities}{% if r %}_{{r.reg_id}}{% endif %}"
198+
id="types_of_plans_commercial_${entities}{% if r %}_{{r.reg_id}}{% endif %}"
199+
required
200+
/>Commercial</label
201+
>
202+
</li>
203+
<li>
204+
<label for="types_of_plans_medicare_${entities}{% if r %}_{{r.reg_id}}{% endif %}"
205+
><input
206+
type="checkbox"
207+
name="types_of_plans_medicare_${entities}{% if r %}_{{r.reg_id}}{% endif %}"
208+
id="types_of_plans_medicare_${entities}{% if r %}_{{r.reg_id}}{% endif %}"
209+
required
210+
/>Medicare</label
211+
>
212+
</li>
213+
<li>
214+
<label for="types_of_plans_medicaid_${entities}{% if r %}_{{r.reg_id}}{% endif %}"
215+
><input
216+
type="checkbox"
217+
name="types_of_plans_medicaid_${entities}{% if r %}_{{r.reg_id}}{% endif %}"
218+
id="types_of_plans_medicaid_${entities}{% if r %}_{{r.reg_id}}{% endif %}"
219+
required
220+
/>Medicaid</label
221+
>
222+
</li>
223+
</ul>
224+
</div>
157225
<h6>File Submission</h6>
158226
<div class="field-wrapper required">
159227
<label>
@@ -277,15 +345,15 @@ <h6>
277345
<div id="help-text-total_claims_value_${entities}" class="help-text">
278346
</div>
279347
</div>
348+
${ entities === 5 ?
349+
{% if not r %}
350+
`<p class="c-message c-message--type-info c-message--scope-inline">If you need to associate more than 5 entities with your registration, <a href="/workbench/dashboard" target="_blank">submit a ticket</a> with your additional entries and your registration ID (displayed after submitting this form).</p>`
351+
{% endif %}
352+
: ''
353+
}
280354
`;
281-
const inputs = Array.from(
282-
document.querySelectorAll(`
283-
input[name=fein_${entities}{% if r %}_{{r.reg_id}}{% endif %}],
284-
input[name=license_number_${entities}{% if r %}_{{r.reg_id}}{% endif %}],
285-
input[name=naic_company_code_${entities}{% if r %}_{{r.reg_id}}{% endif %}]
286-
`)
287-
);
288-
entityIdGroupValidation(entities, reg_id); // add entity id validation for new entities on form
355+
entityIdGroupValidation(entities, reg_id); // add entity input validation for new entities on form
356+
entityPlanTypeValidation(entities, reg_id);
289357

290358
const addEntityNameInput = document.querySelectorAll(`input[name=entity_name_${entities}{% if r %}_{{r.reg_id}}{% endif %}]`);
291359
noEmptyInputs(addEntityNameInput);

apcd-cms/src/apps/registrations/templates/submission_form/submission_form.html

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<div class="container">
99
{% include "nav_cms_breadcrumbs.html" %}
10+
{% include 'snippets/tup-175-css-alerts-messages-ui-pattern.html' %}
1011

1112

1213

apcd-cms/src/apps/utils/apcd_database.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ def get_registration_entities(reg_id=None):
294294
registration_entities.total_covered_lives,
295295
registration_entities.entity_name,
296296
registration_entities.fein,
297+
registration_entities.plan_coml,
298+
registration_entities.plan_mdcr,
299+
registration_entities.plan_mdcd,
297300
registration_entities.file_me,
298301
registration_entities.file_pv,
299302
registration_entities.file_mc,
@@ -331,6 +334,9 @@ def create_registration_entity(form, reg_id, iteration, from_update_reg=None):
331334
_set_int(form['total_covered_lives_{}'.format(str_end)]),
332335
_clean_value(form['entity_name_{}'.format(str_end)]),
333336
_clean_value(form['fein_{}'.format(str_end)]),
337+
True if 'types_of_plans_commercial_{}'.format(str_end) in form else False,
338+
True if 'types_of_plans_medicare_{}'.format(str_end) in form else False,
339+
True if 'types_of_plans_medicaid_{}'.format(str_end) in form else False,
334340
True,
335341
True if 'types_of_files_provider_{}'.format(str_end) in form else False,
336342
True if 'types_of_files_medical_{}'.format(str_end) in form else False,
@@ -347,12 +353,15 @@ def create_registration_entity(form, reg_id, iteration, from_update_reg=None):
347353
total_covered_lives,
348354
entity_name,
349355
fein,
356+
plan_coml,
357+
plan_mdcr,
358+
plan_mdcd,
350359
file_me,
351360
file_pv,
352361
file_mc,
353362
file_pc,
354363
file_dc
355-
) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"""
364+
) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"""
356365

357366
conn = psycopg2.connect(
358367
host=APCD_DB['host'],
@@ -397,6 +406,9 @@ def update_registration_entity(form, reg_id, iteration, no_entities):
397406
_set_int(form['total_covered_lives_{}'.format(str_end)]),
398407
_clean_value(form['entity_name_{}'.format(str_end)]),
399408
_clean_value(form['fein_{}'.format(str_end)]),
409+
True if 'types_of_plans_commercial_{}'.format(str_end) in form else False,
410+
True if 'types_of_plans_medicare_{}'.format(str_end) in form else False,
411+
True if 'types_of_plans_medicaid_{}'.format(str_end) in form else False,
400412
True if 'types_of_files_provider_{}'.format(str_end) in form else False,
401413
True if 'types_of_files_medical_{}'.format(str_end) in form else False,
402414
True if 'types_of_files_pharmacy_{}'.format(str_end) in form else False,
@@ -421,6 +433,9 @@ def update_registration_entity(form, reg_id, iteration, no_entities):
421433
total_covered_lives = %s,
422434
entity_name = %s,
423435
fein = %s,
436+
plan_coml = %s,
437+
plan_mdcr = %s,
438+
plan_mdcd = %s,
424439
file_pv = %s,
425440
file_mc = %s,
426441
file_pc = %s,

0 commit comments

Comments
 (0)