use of org.akaza.openclinica.bean.odmbeans.MeasurementUnitBean in project OpenClinica by OpenClinica.
the class MetaDataReportBean method addMeasurementUnits.
public void addMeasurementUnits(BasicDefinitionsBean bd) {
ArrayList<MeasurementUnitBean> units = bd.getMeasurementUnits();
if (units.size() > 0) {
StringBuffer xml = this.getXmlOutput();
String indent = this.getIndent();
String currentIndent = indent + indent;
xml.append(currentIndent + "<BasicDefinitions>");
xml.append(nls);
for (MeasurementUnitBean unit : units) {
xml.append(currentIndent + indent + "<MeasurementUnit OID=\"" + StringEscapeUtils.escapeXml(unit.getOid()) + "\" Name=\"" + StringEscapeUtils.escapeXml(unit.getName()) + "\">");
xml.append(nls);
addSymbol(unit, currentIndent + indent + indent);
xml.append(currentIndent + indent + "</MeasurementUnit>");
xml.append(nls);
}
xml.append(currentIndent + "</BasicDefinitions>");
xml.append(nls);
}
}
use of org.akaza.openclinica.bean.odmbeans.MeasurementUnitBean in project OpenClinica by OpenClinica.
the class OdmExtractDAO method getBasicDefinitions.
public void getBasicDefinitions(int studyId, BasicDefinitionsBean basicDef) {
ArrayList<MeasurementUnitBean> units = basicDef.getMeasurementUnits();
String uprev = "";
this.setStudyMeasurementUnitsTypesExpected();
ArrayList rows = this.select(this.getStudyMeasurementUnitsSql(studyId));
Iterator it = rows.iterator();
while (it.hasNext()) {
HashMap row = (HashMap) it.next();
String oid = (String) row.get("mu_oid");
String name = (String) row.get("name");
MeasurementUnitBean u = new MeasurementUnitBean();
SymbolBean symbol = new SymbolBean();
ArrayList<TranslatedTextBean> texts = new ArrayList<TranslatedTextBean>();
if (uprev.equals(oid)) {
u = units.get(units.size() - 1);
symbol = u.getSymbol();
texts = symbol.getTranslatedText();
} else {
u.setOid(oid);
u.setName(name);
units.add(u);
}
TranslatedTextBean t = new TranslatedTextBean();
t.setText(name);
texts.add(t);
symbol.setTranslatedText(texts);
u.setSymbol(symbol);
}
}
use of org.akaza.openclinica.bean.odmbeans.MeasurementUnitBean in project OpenClinica by OpenClinica.
the class OdmExtractDAO method getBasicDefinitions.
public void getBasicDefinitions(String crfVersionOID, BasicDefinitionsBean basicDef) {
ArrayList<MeasurementUnitBean> units = basicDef.getMeasurementUnits();
String uprev = "";
this.setStudyMeasurementUnitsTypesExpected();
ArrayList rows = this.select(this.getStudyMeasurementUnitsSql(crfVersionOID));
Iterator it = rows.iterator();
while (it.hasNext()) {
HashMap row = (HashMap) it.next();
String oid = (String) row.get("mu_oid");
String name = (String) row.get("name");
MeasurementUnitBean u = new MeasurementUnitBean();
SymbolBean symbol = new SymbolBean();
ArrayList<TranslatedTextBean> texts = new ArrayList<TranslatedTextBean>();
if (uprev.equals(oid)) {
u = units.get(units.size() - 1);
symbol = u.getSymbol();
texts = symbol.getTranslatedText();
} else {
u.setOid(oid);
u.setName(name);
units.add(u);
}
TranslatedTextBean t = new TranslatedTextBean();
t.setText(name);
texts.add(t);
symbol.setTranslatedText(texts);
u.setSymbol(symbol);
}
}
Aggregations