public interface FormDAO
| Modifier and Type | Method and Description |
|---|---|
void |
deleteField(Field field)
Deletes a field from the database.
|
void |
deleteFieldType(FieldType fieldType)
Delete the given field type from the database
|
void |
deleteForm(Form form)
Delete form from database.
|
void |
deleteFormField(FormField formField)
Deletes a FormField from the database.
|
Form |
duplicateForm(Form form)
Creates new form from the given
Form |
List<Field> |
getAllFields(boolean includeRetired)
Returns all fields in the database, possibly including retired ones
|
List<FieldType> |
getAllFieldTypes(boolean includeRetired)
Get all field types
|
List<FormField> |
getAllFormFields()
Returns all FormFields in the database
|
List<Form> |
getAllForms(boolean includeRetired)
Returns all forms in the database, possibly including retired ones
|
Field |
getField(Integer fieldId) |
FieldAnswer |
getFieldAnswerByUuid(String uuid) |
Field |
getFieldByUuid(String uuid)
Auto generated method comment
|
List<Field> |
getFields(Collection<Form> forms,
Collection<FieldType> fieldTypes,
Collection<Concept> concepts,
Collection<String> tableNames,
Collection<String> attributeNames,
Boolean selectMultiple,
Collection<FieldAnswer> containsAllAnswers,
Collection<FieldAnswer> containsAnyAnswer,
Boolean retired)
Returns all fields that match a broad range of (nullable) criteria
|
List<Field> |
getFields(String search) |
FieldType |
getFieldType(Integer fieldTypeId)
Get fieldType by internal identifier
|
FieldType |
getFieldTypeByUuid(String uuid)
Auto generated method comment
|
Form |
getForm(Integer formId)
Get form by internal form identifier
|
Form |
getForm(String name,
String version)
Get form by exact name and version
|
Form |
getFormByUuid(String uuid)
Auto generated method comment
|
Integer |
getFormCount(String partialName,
Boolean published,
Collection<EncounterType> encounterTypes,
Boolean retired,
Collection<FormField> containingAnyFormField,
Collection<FormField> containingAllFormFields,
Collection<Field> fields) |
FormField |
getFormField(Form form,
Concept concept,
Collection<FormField> ignoreFormFields,
boolean force) |
FormField |
getFormField(Integer formFieldId) |
FormField |
getFormFieldByUuid(String uuid)
Auto generated method comment
|
List<FormField> |
getFormFieldsByField(Field field)
Return a list of FormFields given a Field
|
List<Form> |
getForms(String partialName,
Boolean published,
Collection<EncounterType> encounterTypes,
Boolean retired,
Collection<FormField> containingAnyFormField,
Collection<FormField> containingAllFormFields,
Collection<Field> fields)
Gets all forms that match all the criteria.
|
List<Form> |
getFormsByName(String name)
Gets all forms with the given name, sorted (alphabetically) by descending version
|
List<Form> |
getFormsContainingConcept(Concept concept)
Get all forms that contain the given
Concept as one of their fields. |
Field |
saveField(Field field) |
FieldType |
saveFieldType(FieldType fieldType)
Save the given field type to the database
|
Form |
saveForm(Form form) |
FormField |
saveFormField(FormField formField) |
Form saveForm(Form form) throws DAOException
DAOExceptionFormService.saveForm(Form)Form duplicateForm(Form form) throws DAOException
Formform - Form to duplicateFormDAOExceptionForm getForm(Integer formId) throws DAOException
formId - Integer internal identifier for requested FormFormDAOExceptionForm getForm(String name, String version) throws DAOException
name - the name of the form to getversion - the version of the form to getDAOExceptionList<Form> getFormsByName(String name) throws DAOException
name - String name of the forms to getDAOExceptionvoid deleteForm(Form form) throws DAOException
Forms
should be retired and not deleted altogether (since many foreign key
constraints depend on forms, deleting a form would require deleting all traces, and any
historical trail would be lost). This method only clears form roles and attempts to delete
the form record. If the form has been included in any other parts of the database (through a
foreign key), the attempt to delete the form will violate foreign key constraints and fail.form - Form to deleteDAOExceptionList<FieldType> getAllFieldTypes(boolean includeRetired) throws DAOException
includeRetired - boolean - include retired field types as well?DAOExceptionFieldType getFieldType(Integer fieldTypeId) throws DAOException
fieldTypeId - Internal Integer identifier of FieldTypeDAOExceptionList<Form> getAllForms(boolean includeRetired) throws DAOException
includeRetired - boolean - include retired forms?DAOExceptionList<FormField> getAllFormFields() throws DAOException
DAOExceptionFormField getFormField(Form form, Concept concept, Collection<FormField> ignoreFormFields, boolean force) throws DAOException
List<Field> getFields(String search) throws DAOException
search - String phrase to search forDAOExceptionList<Field> getAllFields(boolean includeRetired) throws DAOException
includeRetired - whether or not to return retired fieldsDAOExceptionField getField(Integer fieldId) throws DAOException
DAOExceptionFormService.getField(Integer)Field saveField(Field field) throws DAOException
DAOExceptionFormService.saveField(Field)void deleteField(Field field) throws DAOException
This will fail if any other entities reference this field via a foreign key
field - the Field to deleteDAOExceptionFormField getFormField(Integer formFieldId) throws DAOException
DAOExceptionFormService.getFormField(Integer)FormField saveFormField(FormField formField) throws DAOException
DAOExceptionFormService.saveFormField(FormField)void deleteFormField(FormField formField) throws DAOException
formField - the FormField to deleteDAOExceptionList<Field> getFields(Collection<Form> forms, Collection<FieldType> fieldTypes, Collection<Concept> concepts, Collection<String> tableNames, Collection<String> attributeNames, Boolean selectMultiple, Collection<FieldAnswer> containsAllAnswers, Collection<FieldAnswer> containsAnyAnswer, Boolean retired) throws DAOException
forms - Collection of Form to which the requested Fields must
belongfieldTypes - Collection of FieldType of which the requested
fields must beconcepts - Collection of Concepts which the fields must point
totableNames - Collection of TableNames which the fields must point toattributeNames - Collection of String attribute names which the
fields must point toselectMultiple - Boolean value that matching fields must have for
selectMultiplecontainsAllAnswers - Collection of FieldAnswers, all of which
a matching field must contain (not yet implemented)containsAnyAnswer - Collection of FieldAnswers, any one of
which a matching field must contain (not yet implemented)retired - Boolean retired status that fields must matchDAOExceptionList<Form> getFormsContainingConcept(Concept concept) throws DAOException
Concept as one of their fields. (Includes
retired forms.)concept - the Concept to search through form fields forDAOExceptionList<Form> getForms(String partialName, Boolean published, Collection<EncounterType> encounterTypes, Boolean retired, Collection<FormField> containingAnyFormField, Collection<FormField> containingAllFormFields, Collection<Field> fields) throws DAOException
partialName - String of partial name of form to search onpublished - boolean - is the form published?encounterTypes - Collection of EncounterTypes that the form must representretired - boolean - is the form retired?containingAnyFormField - Collection of FormFields, any one of which must be
contained in the formcontainingAllFormFields - Collection of FormFields, all of which must be
contained in the formfields - Collection of Fields that the form must containDAOExceptionFormService.getForms(java.lang.String, java.lang.Boolean,
java.util.Collection, java.lang.Boolean, java.util.Collection, java.util.Collection,
java.util.Collection)Integer getFormCount(String partialName, Boolean published, Collection<EncounterType> encounterTypes, Boolean retired, Collection<FormField> containingAnyFormField, Collection<FormField> containingAllFormFields, Collection<Field> fields) throws DAOException
void deleteFieldType(FieldType fieldType) throws DAOException
fieldType - FieldType to deleteDAOExceptionField getFieldByUuid(String uuid)
uuid - FieldAnswer getFieldAnswerByUuid(String uuid)
FieldType getFieldTypeByUuid(String uuid)
uuid - Form getFormByUuid(String uuid)
uuid - FormField getFormFieldByUuid(String uuid)
uuid - FieldType saveFieldType(FieldType fieldType) throws DAOException
fieldType - FieldType to save to the databaseDAOExceptionCopyright © 2018 OpenMRS LLC.. All Rights Reserved.