Search in sources :

Example 1 with MeasurementUnitBean

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);
    }
}
Also used : MeasurementUnitBean(org.akaza.openclinica.bean.odmbeans.MeasurementUnitBean)

Example 2 with MeasurementUnitBean

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);
    }
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) MeasurementUnitBean(org.akaza.openclinica.bean.odmbeans.MeasurementUnitBean) SymbolBean(org.akaza.openclinica.bean.odmbeans.SymbolBean) TranslatedTextBean(org.akaza.openclinica.bean.odmbeans.TranslatedTextBean)

Example 3 with MeasurementUnitBean

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);
    }
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) MeasurementUnitBean(org.akaza.openclinica.bean.odmbeans.MeasurementUnitBean) SymbolBean(org.akaza.openclinica.bean.odmbeans.SymbolBean) TranslatedTextBean(org.akaza.openclinica.bean.odmbeans.TranslatedTextBean)

Aggregations

MeasurementUnitBean (org.akaza.openclinica.bean.odmbeans.MeasurementUnitBean)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Iterator (java.util.Iterator)2 LinkedHashMap (java.util.LinkedHashMap)2 SymbolBean (org.akaza.openclinica.bean.odmbeans.SymbolBean)2 TranslatedTextBean (org.akaza.openclinica.bean.odmbeans.TranslatedTextBean)2