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.
|
void |
deleteFormResource(FormResource formResource) |
Form |
duplicateForm(Form form)
Creates new form from the given
Form |
java.util.List<Field> |
getAllFields(boolean includeRetired)
Returns all fields in the database, possibly including retired ones
|
java.util.List<FieldType> |
getAllFieldTypes(boolean includeRetired)
Get all field types
|
java.util.List<FormField> |
getAllFormFields()
Returns all FormFields in the database
|
java.util.List<Form> |
getAllForms(boolean includeRetired)
Returns all forms in the database, possibly including retired ones
|
Field |
getField(java.lang.Integer fieldId) |
FieldAnswer |
getFieldAnswerByUuid(java.lang.String uuid) |
Field |
getFieldByUuid(java.lang.String uuid)
Auto generated method comment
|
java.util.List<Field> |
getFields(java.util.Collection<Form> forms,
java.util.Collection<FieldType> fieldTypes,
java.util.Collection<Concept> concepts,
java.util.Collection<java.lang.String> tableNames,
java.util.Collection<java.lang.String> attributeNames,
java.lang.Boolean selectMultiple,
java.util.Collection<FieldAnswer> containsAllAnswers,
java.util.Collection<FieldAnswer> containsAnyAnswer,
java.lang.Boolean retired)
Returns all fields that match a broad range of (nullable) criteria
|
java.util.List<Field> |
getFields(java.lang.String search) |
FieldType |
getFieldType(java.lang.Integer fieldTypeId)
Get fieldType by internal identifier
|
FieldType |
getFieldTypeByUuid(java.lang.String uuid)
Auto generated method comment
|
Form |
getForm(java.lang.Integer formId)
Get form by internal form identifier
|
Form |
getForm(java.lang.String name,
java.lang.String version)
Get form by exact name and version
|
Form |
getFormByUuid(java.lang.String uuid)
Auto generated method comment
|
java.lang.Integer |
getFormCount(java.lang.String partialName,
java.lang.Boolean published,
java.util.Collection<EncounterType> encounterTypes,
java.lang.Boolean retired,
java.util.Collection<FormField> containingAnyFormField,
java.util.Collection<FormField> containingAllFormFields,
java.util.Collection<Field> fields) |
FormField |
getFormField(Form form,
Concept concept,
java.util.Collection<FormField> ignoreFormFields,
boolean force) |
FormField |
getFormField(java.lang.Integer formFieldId) |
FormField |
getFormFieldByUuid(java.lang.String uuid)
Auto generated method comment
|
java.util.List<FormField> |
getFormFieldsByField(Field field)
Return a list of FormFields given a Field
|
FormResource |
getFormResource(Form form,
java.lang.String name) |
FormResource |
getFormResource(java.lang.Integer formResourceId) |
FormResource |
getFormResourceByUuid(java.lang.String uuid) |
java.util.Collection<FormResource> |
getFormResourcesForForm(Form form) |
java.util.List<Form> |
getForms(java.lang.String partialName,
java.lang.Boolean published,
java.util.Collection<EncounterType> encounterTypes,
java.lang.Boolean retired,
java.util.Collection<FormField> containingAnyFormField,
java.util.Collection<FormField> containingAllFormFields,
java.util.Collection<Field> fields)
Gets all forms that match all the criteria.
|
java.util.List<Form> |
getFormsByName(java.lang.String name)
Gets all forms with the given name, sorted (alphabetically) by descending version
|
java.util.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) |
FormResource |
saveFormResource(FormResource formResource) |
Form saveForm(Form form) throws DAOException
DAOException
FormService.saveForm(Form)
Form duplicateForm(Form form) throws DAOException
Form
form
- Form
to duplicateForm
DAOException
Form getForm(java.lang.Integer formId) throws DAOException
formId
- Integer
internal identifier for requested FormForm
DAOException
Form getForm(java.lang.String name, java.lang.String version) throws DAOException
name
- the name of the form to getversion
- the version of the form to getDAOException
java.util.List<Form> getFormsByName(java.lang.String name) throws DAOException
name
- String name of the forms to getDAOException
void 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 deleteDAOException
java.util.List<FieldType> getAllFieldTypes(boolean includeRetired) throws DAOException
includeRetired
- boolean - include retired field types as well?DAOException
FieldType getFieldType(java.lang.Integer fieldTypeId) throws DAOException
fieldTypeId
- Internal Integer identifier of FieldTypeDAOException
java.util.List<Form> getAllForms(boolean includeRetired) throws DAOException
includeRetired
- boolean - include retired forms?DAOException
java.util.List<FormField> getAllFormFields() throws DAOException
DAOException
FormField getFormField(Form form, Concept concept, java.util.Collection<FormField> ignoreFormFields, boolean force) throws DAOException
java.util.List<Field> getFields(java.lang.String search) throws DAOException
search
- String phrase to search forDAOException
java.util.List<Field> getAllFields(boolean includeRetired) throws DAOException
includeRetired
- whether or not to return retired fieldsDAOException
Field getField(java.lang.Integer fieldId) throws DAOException
DAOException
FormService.getField(Integer)
Field saveField(Field field) throws DAOException
DAOException
FormService.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 deleteDAOException
FormField getFormField(java.lang.Integer formFieldId) throws DAOException
DAOException
FormService.getFormField(Integer)
FormField saveFormField(FormField formField) throws DAOException
DAOException
FormService.saveFormField(FormField)
void deleteFormField(FormField formField) throws DAOException
formField
- the FormField to deleteDAOException
java.util.List<Field> getFields(java.util.Collection<Form> forms, java.util.Collection<FieldType> fieldTypes, java.util.Collection<Concept> concepts, java.util.Collection<java.lang.String> tableNames, java.util.Collection<java.lang.String> attributeNames, java.lang.Boolean selectMultiple, java.util.Collection<FieldAnswer> containsAllAnswers, java.util.Collection<FieldAnswer> containsAnyAnswer, java.lang.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 TableName
s which the fields must point to
attributeNames
- Collection of String
attribute names which the
fields must point to
selectMultiple
- Boolean
value that matching fields must have for
selectMultiplecontainsAllAnswers
- Collection
of FieldAnswer
s, all of which
a matching field must contain (not yet implemented)containsAnyAnswer
- Collection
of FieldAnswer
s, any one of
which a matching field must contain (not yet implemented)retired
- Boolean
retired status that fields must matchDAOException
java.util.List<Form> getFormsContainingConcept(Concept concept) throws DAOException
Concept
as one of their fields. (Includes
retired forms.)concept
- the Concept
to search through form fields forDAOException
java.util.List<Form> getForms(java.lang.String partialName, java.lang.Boolean published, java.util.Collection<EncounterType> encounterTypes, java.lang.Boolean retired, java.util.Collection<FormField> containingAnyFormField, java.util.Collection<FormField> containingAllFormFields, java.util.Collection<Field> fields) throws DAOException
partialName
- String of partial name of form to search onpublished
- boolean - is the form published?encounterTypes
- Collection of EncounterType
s that the form must representretired
- boolean - is the form retired?containingAnyFormField
- Collection of FormField
s, any one of which must be
contained in the formcontainingAllFormFields
- Collection of FormField
s, all of which must be
contained in the formfields
- Collection of Field
s that the form must containDAOException
FormService.getForms(java.lang.String, java.lang.Boolean,
java.util.Collection, java.lang.Boolean, java.util.Collection, java.util.Collection,
java.util.Collection)
java.lang.Integer getFormCount(java.lang.String partialName, java.lang.Boolean published, java.util.Collection<EncounterType> encounterTypes, java.lang.Boolean retired, java.util.Collection<FormField> containingAnyFormField, java.util.Collection<FormField> containingAllFormFields, java.util.Collection<Field> fields) throws DAOException
void deleteFieldType(FieldType fieldType) throws DAOException
fieldType
- FieldType to deleteDAOException
Field getFieldByUuid(java.lang.String uuid)
uuid
- FieldAnswer getFieldAnswerByUuid(java.lang.String uuid)
FieldType getFieldTypeByUuid(java.lang.String uuid)
uuid
- Form getFormByUuid(java.lang.String uuid)
uuid
- FormField getFormFieldByUuid(java.lang.String uuid)
uuid
- FieldType saveFieldType(FieldType fieldType) throws DAOException
fieldType
- FieldType to save to the databaseDAOException
java.util.List<FormField> getFormFieldsByField(Field field)
field
- FormResource getFormResource(java.lang.Integer formResourceId)
FormService.getFormResource(java.lang.Integer)
FormResource getFormResourceByUuid(java.lang.String uuid)
FormService.getFormResourceByUuid(java.lang.String)
FormResource getFormResource(Form form, java.lang.String name)
FormService.getFormResource(org.openmrs.Form, java.lang.String)
java.util.Collection<FormResource> getFormResourcesForForm(Form form)
FormService.getFormResourcesForForm(org.openmrs.Form)
FormResource saveFormResource(FormResource formResource)
FormService.saveFormResource(org.openmrs.FormResource)
void deleteFormResource(FormResource formResource)
FormService.purgeFormResource(org.openmrs.FormResource)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.