@Test public void getFormTemplateByUuid_shouldReturnForm() throws IOException, FormController.FormFetchException { List<FormTemplate> formTemplates = buildFormTemplates(); String uuid = formTemplates.get(0).getUuid(); when(formService.getFormTemplateByUuid(uuid)).thenReturn(formTemplates.get(0)); assertThat(formController.getFormTemplateByUuid(uuid), is(formTemplates.get(0))); }
public FormTemplate getFormTemplateByUuid(String formId) throws FormFetchException { try { return formService.getFormTemplateByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } }
FormController { public FormTemplate getFormTemplateByUuid(String formId) throws FormFetchException { try { return formService.getFormTemplateByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } } }
FormController { public FormTemplate getFormTemplateByUuid(String formId) throws FormFetchException { try { return formService.getFormTemplateByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public FormTemplate getFormTemplateByUuid(String formId) throws FormFetchException { try { return formService.getFormTemplateByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTemplateByUuid(String formId); AvailableForms getAvailableFormByTags(List<String> tagsUuid); List<Form> getAllAvailableForms(); AvailableForms getAvailableFormByTags(List<String> tagsUuid, boolean alwaysIncludeRegistrationForms); List<Tag> getAllTags(); List<Tag> getAllTagsExcludingRegistrationTag(); DownloadedForms getAllDownloadedForms(); List<Form> downloadAllForms(); List<FormTemplate> downloadFormTemplates(String[] formUuids); FormTemplate downloadFormTemplateByUuid(String uuid); void saveAllForms(List<Form> forms); void updateAllForms(List<Form> forms); void deleteAllForms(); void deleteAllFormTemplates(); void deleteForms(List<Form> forms); void deleteFormTemplatesByUUID(List<String> formTemplateUUIDs); void replaceFormTemplates(List<FormTemplate> formTemplates); void saveFormTemplates(List<FormTemplate> formTemplates); boolean isFormDownloaded(Form form); int getTagColor(String uuid); void resetTagColors(); List<Tag> getSelectedTags(); void setSelectedTags(List<Tag> selectedTags); FormData getFormDataByUuid(String formDataUuid); List<FormData> getFormDataByUuids(List<String> formDataUuids); CompleteFormWithPatientData getCompleteFormDataByUuid(String formDataUuid); void saveFormData(FormData formData); List<FormData> getAllFormData(String status); List<FormData> getAllFormDataByPatientUuid(String patientUuid, String status); IncompleteFormsWithPatientData getAllIncompleteFormsWithPatientData(); CompleteFormsWithPatientData getAllCompleteFormsWithPatientData(Context context); IncompleteForms getAllIncompleteFormsForPatientUuid(String patientUuid); CompleteForms getAllCompleteFormsForPatientUuid(String patientUuid); int countAllIncompleteForms(); int countAllCompleteForms(); int getCompleteFormsCountForPatient(String patientId); int getIncompleteFormsCountForPatient(String patientId); AvailableForms getDownloadedRegistrationForms(); Patient createNewPatient(MuzimaApplication muzimaApplication, FormData formData); boolean uploadAllCompletedForms(); AvailableForms getRecommendedForms(); AvailableForms getProviderReports(); int getRecommendedFormsCount(); void deleteCompleteAndIncompleteEncounterFormData(List<String> formDataUuids); List<FormData> getNonUploadedFormData(String templateUUID); void markFormDataAsIncompleteAndDeleteRelatedEncountersAndObs(final FormData formData); void deleteFormDataAndRelatedEncountersAndObs(List<FormData> formData); List<FormData> getArchivedFormData(); FormDataStatus downloadFormDataStatus(FormData formData); boolean isFormAlreadyExist(String jsonPayload, FormData formData); boolean isRegistrationFormDataWithEncounterForm(String formUuid); boolean isRegistrationFormData(FormData formData); boolean isGenericRegistrationHTMLFormData(FormData formData); boolean isEncounterFormData(FormData formData); Map<String, List<FormData>> getFormDataGroupedByPatient(List<String> uuids); Map<String, List<FormData>> deleteFormDataWithNoRelatedCompleteRegistrationFormDataInGroup(
            Map<String, List<FormData>> groupedFormData); Map<String, List<FormData>> deleteRegistrationFormDataWithAllRelatedEncountersInGroup(Map<String, List<FormData>> groupedFormData); AvailableForms getAvailableFormByTagsSortedByConfigOrder(List<String> tagsUuid, boolean alwaysIncludeRegistrationForms); AvailableForms getDownloadedRelationshipForms(); AvailableForm getAvailableFormByFormUuid(String uuid); ArrayList<String> getFormListAsPerConfigOrder(); AvailableForms getAvailableFormsPerConfigOrder(ArrayList<String> formUuids, List<Form> filteredForms); }
FormController { public FormTemplate getFormTemplateByUuid(String formId) throws FormFetchException { try { return formService.getFormTemplateByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTemplateByUuid(String formId); AvailableForms getAvailableFormByTags(List<String> tagsUuid); List<Form> getAllAvailableForms(); AvailableForms getAvailableFormByTags(List<String> tagsUuid, boolean alwaysIncludeRegistrationForms); List<Tag> getAllTags(); List<Tag> getAllTagsExcludingRegistrationTag(); DownloadedForms getAllDownloadedForms(); List<Form> downloadAllForms(); List<FormTemplate> downloadFormTemplates(String[] formUuids); FormTemplate downloadFormTemplateByUuid(String uuid); void saveAllForms(List<Form> forms); void updateAllForms(List<Form> forms); void deleteAllForms(); void deleteAllFormTemplates(); void deleteForms(List<Form> forms); void deleteFormTemplatesByUUID(List<String> formTemplateUUIDs); void replaceFormTemplates(List<FormTemplate> formTemplates); void saveFormTemplates(List<FormTemplate> formTemplates); boolean isFormDownloaded(Form form); int getTagColor(String uuid); void resetTagColors(); List<Tag> getSelectedTags(); void setSelectedTags(List<Tag> selectedTags); FormData getFormDataByUuid(String formDataUuid); List<FormData> getFormDataByUuids(List<String> formDataUuids); CompleteFormWithPatientData getCompleteFormDataByUuid(String formDataUuid); void saveFormData(FormData formData); List<FormData> getAllFormData(String status); List<FormData> getAllFormDataByPatientUuid(String patientUuid, String status); IncompleteFormsWithPatientData getAllIncompleteFormsWithPatientData(); CompleteFormsWithPatientData getAllCompleteFormsWithPatientData(Context context); IncompleteForms getAllIncompleteFormsForPatientUuid(String patientUuid); CompleteForms getAllCompleteFormsForPatientUuid(String patientUuid); int countAllIncompleteForms(); int countAllCompleteForms(); int getCompleteFormsCountForPatient(String patientId); int getIncompleteFormsCountForPatient(String patientId); AvailableForms getDownloadedRegistrationForms(); Patient createNewPatient(MuzimaApplication muzimaApplication, FormData formData); boolean uploadAllCompletedForms(); AvailableForms getRecommendedForms(); AvailableForms getProviderReports(); int getRecommendedFormsCount(); void deleteCompleteAndIncompleteEncounterFormData(List<String> formDataUuids); List<FormData> getNonUploadedFormData(String templateUUID); void markFormDataAsIncompleteAndDeleteRelatedEncountersAndObs(final FormData formData); void deleteFormDataAndRelatedEncountersAndObs(List<FormData> formData); List<FormData> getArchivedFormData(); FormDataStatus downloadFormDataStatus(FormData formData); boolean isFormAlreadyExist(String jsonPayload, FormData formData); boolean isRegistrationFormDataWithEncounterForm(String formUuid); boolean isRegistrationFormData(FormData formData); boolean isGenericRegistrationHTMLFormData(FormData formData); boolean isEncounterFormData(FormData formData); Map<String, List<FormData>> getFormDataGroupedByPatient(List<String> uuids); Map<String, List<FormData>> deleteFormDataWithNoRelatedCompleteRegistrationFormDataInGroup(
            Map<String, List<FormData>> groupedFormData); Map<String, List<FormData>> deleteRegistrationFormDataWithAllRelatedEncountersInGroup(Map<String, List<FormData>> groupedFormData); AvailableForms getAvailableFormByTagsSortedByConfigOrder(List<String> tagsUuid, boolean alwaysIncludeRegistrationForms); AvailableForms getDownloadedRelationshipForms(); AvailableForm getAvailableFormByFormUuid(String uuid); ArrayList<String> getFormListAsPerConfigOrder(); AvailableForms getAvailableFormsPerConfigOrder(ArrayList<String> formUuids, List<Form> filteredForms);  }