diff --git a/apcd-cms/src/apps/utils/apcd_database.py b/apcd-cms/src/apps/utils/apcd_database.py index 307e1b52..4625d65d 100644 --- a/apcd-cms/src/apps/utils/apcd_database.py +++ b/apcd-cms/src/apps/utils/apcd_database.py @@ -354,14 +354,14 @@ def create_registration_entity(entity, reg_id, from_update_reg=None):#, old_reg_ _set_int(entity['total_covered_lives']), _clean_value(entity['entity_name']), _clean_value(entity['fein']), - True if 'types_of_plans_commercial' in entity else False, - True if 'types_of_plans_medicare' in entity else False, - True if 'types_of_plans_medicaid' in entity else False, + entity['types_of_plans_commercial'], + entity['types_of_plans_medicare'], + entity['types_of_plans_medicaid'], True, - True if 'types_of_files_provider' in entity else False, - True if 'types_of_files_medical' in entity else False, - True if 'types_of_files_pharmacy' in entity else False, - True if 'types_of_files_dental' in entity else False + entity['types_of_files_provider'], + entity['types_of_files_medical'], + entity['types_of_files_pharmacy'], + entity['types_of_files_dental'] ) operation = """INSERT INTO registration_entities( @@ -423,13 +423,13 @@ def update_registration_entity(entity, reg_id): _set_int(entity['total_covered_lives']), _clean_value(entity['entity_name']), _clean_value(entity['fein']), - True if 'types_of_plans_commercial' in entity else False, - True if 'types_of_plans_medicare' in entity else False, - True if 'types_of_plans_medicaid' in entity else False, - True if 'types_of_files_provider' in entity else False, - True if 'types_of_files_medical' in entity else False, - True if 'types_of_files_pharmacy' in entity else False, - True if 'types_of_files_dental' in entity else False, + entity['types_of_plans_commercial'], + entity['types_of_plans_medicare'], + entity['types_of_plans_medicaid'], + entity['types_of_files_provider'], + entity['types_of_files_medical'], + entity['types_of_files_pharmacy'], + entity['types_of_files_dental'], reg_id, entity['entity_id'] ) @@ -556,7 +556,7 @@ def create_registration_contact(contact, reg_id, from_update_reg=None): #str_end = f'{iteration}{ f"_{reg_id}" if from_update_reg else (f"_{old_reg_id}" if old_reg_id else "") }' values = ( reg_id, - True if 'contact_notifications' in contact else False, + contact['contact_notifications'], _clean_value(contact['contact_type']), _clean_value(contact['contact_name']), re.sub("[^0-9]", "", contact['contact_phone']), @@ -606,7 +606,7 @@ def update_registration_contact(contact, reg_id): return create_registration_contact(contact, reg_id) values = ( - True if 'contact_notifications' in contact else False, + contact['contact_notifications'], _clean_value(contact['contact_type']), _clean_value(contact['contact_name']), re.sub("[^0-9]", "", contact['contact_phone']), diff --git a/apcd-cms/src/client/src/components/Forms/Registrations/FormEntity.tsx b/apcd-cms/src/client/src/components/Forms/Registrations/FormEntity.tsx index 8ca62c6a..18685663 100644 --- a/apcd-cms/src/client/src/components/Forms/Registrations/FormEntity.tsx +++ b/apcd-cms/src/client/src/components/Forms/Registrations/FormEntity.tsx @@ -85,6 +85,7 @@ export const RegistrationEntity: React.FC<{ index: number }> = ({ index }) => { /> ))} +
File Submission
@@ -150,6 +151,7 @@ export const RegistrationEntity: React.FC<{ index: number }> = ({ index }) => { /> ))} +
diff --git a/apcd-cms/src/client/src/components/Forms/Registrations/RegistrationForm.tsx b/apcd-cms/src/client/src/components/Forms/Registrations/RegistrationForm.tsx index 763d689b..106706a4 100644 --- a/apcd-cms/src/client/src/components/Forms/Registrations/RegistrationForm.tsx +++ b/apcd-cms/src/client/src/components/Forms/Registrations/RegistrationForm.tsx @@ -73,6 +73,7 @@ const validationSchema = Yup.object().shape({ if (!value.fein && !value.license_number && !value.naic_company_code) { return this.createError({ message: 'Please fill in at least one Number/Code.', + path: this.path + '.fein', }); } return true; @@ -85,6 +86,7 @@ const validationSchema = Yup.object().shape({ ) { return this.createError({ message: 'Please select at least one plan type.', + path: this.path + ".types_of_plans_hidden" }); } return true; @@ -97,6 +99,7 @@ const validationSchema = Yup.object().shape({ ) { return this.createError({ message: 'Please select at least one claims file type (see above).', + path: this.path + ".types_of_files_hidden" }); } return true; @@ -133,14 +136,16 @@ const initialValues: RegistrationFormValues = { fein: '', license_number: '', naic_company_code: '', - types_of_plans_commerical: false, + types_of_plans_commercial: false, types_of_plans_medicare: false, types_of_plans_medicaid: false, + types_of_plans_hidden: false, types_of_files_eligibility_enrollment: true, types_of_files_provider: false, types_of_files_medical: false, types_of_files_pharmacy: false, types_of_files_dental: false, + types_of_files_hidden: false, total_covered_lives: '', claims_encounters_volume: '', total_claims_value: '', @@ -159,6 +164,23 @@ const initialValues: RegistrationFormValues = { ], }; +const initialTouched = { + on_behalf_of: true, + type: true, + entities: [ + { + types_of_plans_commercial: true, + types_of_plans_medicare: true, + types_of_plans_medicaid: true, + types_of_files_eligibility_enrollment: true, + types_of_files_provider: true, + types_of_files_medical: true, + types_of_files_pharmacy: true, + types_of_files_dental: true, + } + ] +} + export const RegistrationForm: React.FC<{ isEdit?: boolean; inputValues?: RegistrationFormValues; @@ -237,6 +259,7 @@ export const RegistrationForm: React.FC<{ ? transformToRegistrationFormValues(data) : inputValues ?? initialValues } + initialTouched={initialTouched} validationSchema={validationSchema} onSubmit={handleSubmit} > @@ -304,11 +327,11 @@ export const RegistrationForm: React.FC<{ />{' '} Other -
+ +
Whether you submit on behalf of your own organization (Self) or another organization (Other) -
- +
- {helpText ?
{helpText}
: <>} + ); }; diff --git a/apcd-cms/src/client/src/hooks/registrations/index.ts b/apcd-cms/src/client/src/hooks/registrations/index.ts index b66981a3..e5cbfdb7 100644 --- a/apcd-cms/src/client/src/hooks/registrations/index.ts +++ b/apcd-cms/src/client/src/hooks/registrations/index.ts @@ -84,14 +84,16 @@ export type RegistrationFormValues = { fein: string; license_number: string; naic_company_code: string; - types_of_plans_commerical: boolean; + types_of_plans_commercial: boolean; types_of_plans_medicare: boolean; types_of_plans_medicaid: boolean; + types_of_plans_hidden?: boolean; types_of_files_eligibility_enrollment: boolean; types_of_files_provider: boolean; types_of_files_medical: boolean; types_of_files_pharmacy: boolean; types_of_files_dental: boolean; + types_of_files_hidden?: boolean; total_covered_lives: any; claims_encounters_volume: any; total_claims_value: any; @@ -125,7 +127,7 @@ export function transformToRegistrationFormValues( fein: entity.fein ?? '', license_number: entity.license ?? '', naic_company_code: entity.naic ?? '', - types_of_plans_commerical: entity.plans_type['Commercial'], + types_of_plans_commercial: entity.plans_type['Commercial'], types_of_plans_medicare: entity.plans_type['Medicare'], types_of_plans_medicaid: entity.plans_type['Medicaid'], types_of_files_eligibility_enrollment: