diff --git a/src/views/Patient/MedReqDropDown/MedReqDropDown.tsx b/src/views/Patient/MedReqDropDown/MedReqDropDown.tsx index 3c456f7..f1db671 100644 --- a/src/views/Patient/MedReqDropDown/MedReqDropDown.tsx +++ b/src/views/Patient/MedReqDropDown/MedReqDropDown.tsx @@ -207,7 +207,7 @@ function MedReqDropDown(props: MedReqDropDownProps) { [resourceId] ); let tempHook: OrderSelectHook; - if(env.get('REACT_APP_SEND_FHIR_AUTH_ENABLED').asBool()){ + if (env.get('REACT_APP_SEND_FHIR_AUTH_ENABLED').asBool()) { tempHook = hook.generate(client); } else { tempHook = hook.generate(); diff --git a/src/views/Questionnaire/QuestionnaireForm.tsx b/src/views/Questionnaire/QuestionnaireForm.tsx index f4a9752..2164cb5 100644 --- a/src/views/Questionnaire/QuestionnaireForm.tsx +++ b/src/views/Questionnaire/QuestionnaireForm.tsx @@ -188,7 +188,6 @@ export function QuestionnaireForm(props: QuestionnaireProps) { } }); const loadAndMergeForms = (newResponse: QuestionnaireResponse | null) => { - let lform = LForms.Util.convertFHIRQuestionnaireToLForms( props.qform, props.fhirVersion.toUpperCase() @@ -212,7 +211,6 @@ export function QuestionnaireForm(props: QuestionnaireProps) { ); } - LForms.Util.addFormToPage(lform, questionnaireFormId); const specificForm = document.getElementById(questionnaireFormId); if (specificForm) { @@ -1022,9 +1020,11 @@ export function QuestionnaireForm(props: QuestionnaireProps) { return true; } else { // check if form is fully filled out based on required fields - const requiredFieldErrors = formValidationErrors ? formValidationErrors.filter((error) => { - return error.includes('requires a value'); - }) : []; + const requiredFieldErrors = formValidationErrors + ? formValidationErrors.filter(error => { + return error.includes('requires a value'); + }) + : []; return !(formValidationErrors && requiredFieldErrors.length); } }; @@ -1035,14 +1035,16 @@ export function QuestionnaireForm(props: QuestionnaireProps) { return {tooltip}; }; - // Get missing fields to display + // Get missing fields to display const getMissingFields = () => { const fields: string[] = []; - const requiredFieldErrors = formValidationErrors ? formValidationErrors.filter((error) => { - return error.includes('requires a value'); - }) : []; + const requiredFieldErrors = formValidationErrors + ? formValidationErrors.filter(error => { + return error.includes('requires a value'); + }) + : []; if (requiredFieldErrors.length) { - requiredFieldErrors.forEach((err) => { + requiredFieldErrors.forEach(err => { const name = err.split(' requires a value')[0]; fields.push(name); }); @@ -1053,12 +1055,13 @@ export function QuestionnaireForm(props: QuestionnaireProps) { const getDisplayButtons = () => { if (!isAdaptiveForm()) { return ( -
+
- -
- {!isFilledOut() ?

You must include a value for {getMissingFields()}

: <>} + {!isFilledOut() ? ( +

You must include a value for {getMissingFields()}

+ ) : ( + <> + )}
); } else { @@ -1085,7 +1094,9 @@ export function QuestionnaireForm(props: QuestionnaireProps) { return (
- ) : null} {isAdaptiveFormWithItem() ? ( -
) : null}
) : null} -
- {!isAdaptive ?
Form Loaded: {formLoaded}
:
} +
+ {!isAdaptive ?
Form Loaded: {formLoaded}
:
} {getDisplayButtons()}
diff --git a/src/views/Questionnaire/SmartApp.tsx b/src/views/Questionnaire/SmartApp.tsx index f6f62db..e6cf402 100644 --- a/src/views/Questionnaire/SmartApp.tsx +++ b/src/views/Questionnaire/SmartApp.tsx @@ -347,13 +347,13 @@ export function SmartApp(props: SmartAppProps) { // update the ignore required checkbox const updateRequired = (defaultFilter: boolean) => { let checked: boolean, requiredCheckbox: HTMLInputElement; - if (!defaultFilter) { - requiredCheckbox = document.getElementById('required-fields-checkbox') as HTMLInputElement; - checked = requiredCheckbox ? requiredCheckbox.checked : false; - } else { - checked = true; - } - setIgnoreRequiredCheckbox(checked); + if (!defaultFilter) { + requiredCheckbox = document.getElementById('required-fields-checkbox') as HTMLInputElement; + checked = requiredCheckbox ? requiredCheckbox.checked : false; + } else { + checked = true; + } + setIgnoreRequiredCheckbox(checked); }; const fetchResourcesAndExecuteCql = ( @@ -593,7 +593,9 @@ export function SmartApp(props: SmartAppProps) { // update required checkbox ref const onRequiredCheckboxRefChange = () => { - const requiredCheckbox = document.getElementById(questionnaire ? `required-fields-checkbox-${questionnaire.id}` : 'required-fields-checkbox') as HTMLInputElement; + const requiredCheckbox = document.getElementById( + questionnaire ? `required-fields-checkbox-${questionnaire.id}` : 'required-fields-checkbox' + ) as HTMLInputElement; if (requiredCheckbox != null) { requiredCheckbox.checked = ignoreRequiredCheckbox; } @@ -640,7 +642,7 @@ export function SmartApp(props: SmartAppProps) { ref={onFilterCheckboxRefChange} >
- { showRequiredCheckbox ? + {showRequiredCheckbox ? (
{' '} { updateRequired(false); }} - id={questionnaire ? `required-fields-checkbox-${questionnaire.id}` : 'required-fields-checkbox'} + id={ + questionnaire + ? `required-fields-checkbox-${questionnaire.id}` + : 'required-fields-checkbox' + } ref={onRequiredCheckboxRefChange} >
- :
} + ) : ( +
+ )}
);