Constructor and Description |
---|
FormUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
conceptToString(Concept concept,
ConceptName localizedName)
Turn the given concept/concept-name pair into a string acceptable for hl7 and forms
|
static String |
conceptToString(Concept concept,
Locale locale)
Turn the given concept into a string acceptable to for hl7 and forms
|
static String |
dateToString() |
static String |
dateToString(Date date) |
static String |
drugToString(Drug drug)
Turn the given drug into a string acceptable for hl7 and forms
|
static TreeMap<Integer,TreeSet<FormField>> |
getFormStructure(Form form)
Returns a sorted and structured map of
FormField s for the given OpenMRS form. |
static String |
getFormUriWithoutExtension(Form form)
Get a string somewhat unique to this form.
|
static String |
getNewTag(String s,
Vector<String> tagList)
Generates a new, unique tag name for any given string
|
static String |
getXmlToken(String s)
Converts a string into a valid XML token (tag name)
|
public static String getXmlToken(String s)
s
- string to convert into XML tokenpublic static String getNewTag(String s, Vector<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 automaticallytagList
)public static TreeMap<Integer,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 requestedFormField
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 String dateToString()
public static String getFormUriWithoutExtension(Form form)
form
- Form to get the uri forpublic static String conceptToString(Concept concept, Locale locale)
concept
- Concept to convert to a stringlocale
- Locale to use for the concept namepublic static String conceptToString(Concept concept, ConceptName localizedName)
concept
- Concept to convert to a stringlocalizedName
- specific localized concept-nameCopyright © 2018 OpenMRS LLC.. All Rights Reserved.