Search in sources :

Example 1 with SymbolBean

use of org.akaza.openclinica.bean.odmbeans.SymbolBean in project OpenClinica by OpenClinica.

the class MetaDataReportBean method addSymbol.

public void addSymbol(MeasurementUnitBean unit, String currentIndent) {
    SymbolBean symbol = unit.getSymbol();
    StringBuffer xml = this.getXmlOutput();
    String indent = this.getIndent();
    ArrayList<TranslatedTextBean> texts = symbol.getTranslatedText();
    xml.append(currentIndent + "<Symbol>");
    xml.append(nls);
    for (TranslatedTextBean text : symbol.getTranslatedText()) {
        xml.append(currentIndent + indent + "<TranslatedText>" + StringEscapeUtils.escapeXml(text.getText()) + "</TranslatedText>");
        xml.append(nls);
    }
    xml.append(currentIndent + "</Symbol>");
    xml.append(nls);
}
Also used : SymbolBean(org.akaza.openclinica.bean.odmbeans.SymbolBean) TranslatedTextBean(org.akaza.openclinica.bean.odmbeans.TranslatedTextBean)

Example 2 with SymbolBean

use of org.akaza.openclinica.bean.odmbeans.SymbolBean 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)

Example 3 with SymbolBean

use of org.akaza.openclinica.bean.odmbeans.SymbolBean 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)

Aggregations

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