|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openmrs.util.FormUtil
public class FormUtil
OpenMRS utilities related to forms.
Form
,
FormField
,
Field
,
FieldType
,
FieldAnswer
Constructor Summary | |
---|---|
FormUtil()
|
Method Summary | |
---|---|
static java.lang.String |
conceptToString(Concept concept,
ConceptName localizedName)
Turn the given concept/concept-name pair into a string acceptable for hl7 and forms |
static java.lang.String |
conceptToString(Concept concept,
java.util.Locale locale)
Turn the given concept into a string acceptable to for hl7 and forms |
static java.lang.String |
dateToString()
|
static java.lang.String |
dateToString(java.util.Date date)
|
static java.lang.String |
drugToString(Drug drug)
Turn the given drug into a string acceptable for hl7 and forms |
static java.util.TreeMap<java.lang.Integer,java.util.TreeSet<FormField>> |
getFormStructure(Form form)
Returns a sorted and structured map of FormField s for the given OpenMRS form. |
static java.lang.String |
getFormUriWithoutExtension(Form form)
Get a string somewhat unique to this form. |
static java.lang.String |
getNewTag(java.lang.String s,
java.util.Vector<java.lang.String> tagList)
Generates a new, unique tag name for any given string |
static java.lang.String |
getXmlToken(java.lang.String s)
Converts a string into a valid XML token (tag name) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FormUtil()
Method Detail |
---|
public static java.lang.String getXmlToken(java.lang.String s)
s
- string to convert into XML token
public static java.lang.String getNewTag(java.lang.String s, java.util.Vector<java.lang.String> tagList)
s
- string to convert into a unique XML tagtagList
- java.util.Vector containing all previously created tags. If the tagList is
null, it will be initialized automatically
tagList
)public static java.util.TreeMap<java.lang.Integer,java.util.TreeSet<FormField>> getFormStructure(Form form)
FormField
s for the given OpenMRS form.
The root sections of the schema are stored under a key of zero (i.e.,
java.lang.Integer.valueOf(0)
). All other entries represent sequences of
children stored under the identifier (formField.getFormFieldId()
) of
their parent FormField. The form structure is sorted by the natural sorting order of the
FormField
s (as defined by the .equals() and .compareTo()
methods).
form
- form for which structure is requested
FormField
s, where the top-level fields are under the key
zero and all other leaves are stored under their parent FormField
's id.public static java.lang.String dateToString()
public static java.lang.String dateToString(java.util.Date date)
public static java.lang.String getFormUriWithoutExtension(Form form)
form
- Form to get the uri for
public static java.lang.String conceptToString(Concept concept, java.util.Locale locale)
concept
- Concept to convert to a stringlocale
- Locale to use for the concept name
public static java.lang.String conceptToString(Concept concept, ConceptName localizedName)
concept
- Concept to convert to a stringlocalizedName
- specific localized concept-name
public static java.lang.String drugToString(Drug drug)
drug
- Drug to convert to a string
|
OpenMRS-1.7.x | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |