Search in sources :

Example 11 with ElementRefBean

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

the class MetaDataReportBean method addItemGroupDef.

public void addItemGroupDef(boolean isStudy, String currentIndent) {
    StringBuffer xml = this.getXmlOutput();
    String indent = this.getIndent();
    ArrayList<ItemGroupDefBean> igs = (ArrayList<ItemGroupDefBean>) odmstudy.getMetaDataVersion().getItemGroupDefs();
    for (ItemGroupDefBean ig : igs) {
        if (ig.getComment().length() > 0) {
            xml.append(currentIndent + "<ItemGroupDef OID=\"" + StringEscapeUtils.escapeXml(ig.getOid()) + "\" Name=\"" + StringEscapeUtils.escapeXml(ig.getName()) + "\" Repeating=\"" + ig.getRepeating() + "\" SASDatasetName=\"" + this.getSasNameValidator().getValidName(ig.getPreSASDatasetName()) + "\" Comment=\"" + StringEscapeUtils.escapeXml(ig.getComment()) + "\">");
        } else {
            xml.append(currentIndent + "<ItemGroupDef OID=\"" + StringEscapeUtils.escapeXml(ig.getOid()) + "\" Name=\"" + StringEscapeUtils.escapeXml(ig.getName()) + "\" Repeating=\"" + ig.getRepeating() + "\" SASDatasetName=\"" + this.getSasNameValidator().getValidName(ig.getPreSASDatasetName()) + "\">");
        }
        xml.append(nls);
        ArrayList<ElementRefBean> items = (ArrayList<ElementRefBean>) ig.getItemRefs();
        for (ElementRefBean item : items) {
            xml.append(currentIndent + indent + "<ItemRef ItemOID=\"" + StringEscapeUtils.escapeXml(item.getElementDefOID()) + "\" OrderNumber=\"" + item.getOrderNumber() + "\" Mandatory=\"" + item.getMandatory() + "\"/>");
            xml.append(nls);
        }
        // add ItemGroupDetails for oc1.3
        if ("oc1.3".equals(this.getODMVersion())) {
        // this.addItemGroupDetails(ig.getItemGroupDetails(), currentIndent + indent);
        }
        xml.append(currentIndent + "</ItemGroupDef>");
        xml.append(nls);
    }
}
Also used : ItemGroupDefBean(org.akaza.openclinica.bean.odmbeans.ItemGroupDefBean) ElementRefBean(org.akaza.openclinica.bean.odmbeans.ElementRefBean) ArrayList(java.util.ArrayList)

Example 12 with ElementRefBean

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

the class MetaDataReportBean method addFormDef.

public void addFormDef(boolean isStudy, String currentIndent) {
    StringBuffer xml = this.getXmlOutput();
    String indent = this.getIndent();
    ArrayList<FormDefBean> forms = (ArrayList<FormDefBean>) odmstudy.getMetaDataVersion().getFormDefs();
    for (FormDefBean form : forms) {
        xml.append(currentIndent + "<FormDef OID=\"" + StringEscapeUtils.escapeXml(form.getOid()) + "\" Name=\"" + StringEscapeUtils.escapeXml(form.getName()) + "\" Repeating=\"" + form.getRepeating() + "\">");
        xml.append(nls);
        ArrayList<ElementRefBean> igs = (ArrayList<ElementRefBean>) form.getItemGroupRefs();
        for (ElementRefBean ig : igs) {
            xml.append(currentIndent + indent + "<ItemGroupRef ItemGroupOID=\"" + StringEscapeUtils.escapeXml(ig.getElementDefOID()) + "\" Mandatory=\"" + ig.getMandatory() + "\"/>");
            xml.append(nls);
        }
        ArrayList<ElementRefBean> formLayoutRefs = (ArrayList<ElementRefBean>) form.getFormLayoutRefs();
        for (ElementRefBean formLayoutRef : formLayoutRefs) {
            xml.append(currentIndent + indent + "<OpenClinica:FormLayoutDef OID=\"" + StringEscapeUtils.escapeXml(formLayoutRef.getName()) + "\">");
            xml.append(nls);
            xml.append(currentIndent + indent + "<OpenClinica:URL>" + StringEscapeUtils.escapeXml(formLayoutRef.getUrl()) + "</OpenClinica:URL>");
            xml.append(nls);
            xml.append(currentIndent + indent + "</OpenClinica:FormLayoutDef>");
            xml.append(nls);
        }
        // add FormDetails for oc1.3
        if ("oc1.3".equals(this.getODMVersion())) {
            this.addFormDetails(form.getFormDetails(), currentIndent + indent);
        }
        xml.append(currentIndent + "</FormDef>");
        xml.append(nls);
    }
}
Also used : ElementRefBean(org.akaza.openclinica.bean.odmbeans.ElementRefBean) ArrayList(java.util.ArrayList) FormDefBean(org.akaza.openclinica.bean.odmbeans.FormDefBean)

Example 13 with ElementRefBean

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

the class MetaDataReportBean method addProtocol.

public void addProtocol(String currentIndent) {
    // The protocol lists the kinds of study events that can occur within a
    // specific version of a Study.
    StringBuffer xml = this.getXmlOutput();
    String indent = this.getIndent();
    xml.append(currentIndent + "<Protocol>");
    xml.append(nls);
    for (ElementRefBean seref : odmstudy.getMetaDataVersion().getProtocol().getStudyEventRefs()) {
        // At this point, Mandatory has been set yes
        xml.append(currentIndent + indent + "<StudyEventRef StudyEventOID=\"" + StringEscapeUtils.escapeXml(seref.getElementDefOID()) + "\" OrderNumber=\"" + seref.getOrderNumber() + "\" Mandatory=\"Yes\"/>");
        xml.append(nls);
    }
    xml.append(currentIndent + "</Protocol>");
    xml.append(nls);
}
Also used : ElementRefBean(org.akaza.openclinica.bean.odmbeans.ElementRefBean)

Example 14 with ElementRefBean

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

the class MetaDataReportBean method addStudyEventDef.

public void addStudyEventDef(boolean isStudy, String currentIndent) {
    StringBuffer xml = this.getXmlOutput();
    String indent = this.getIndent();
    ArrayList<StudyEventDefBean> seds = (ArrayList<StudyEventDefBean>) odmstudy.getMetaDataVersion().getStudyEventDefs();
    for (StudyEventDefBean sed : seds) {
        xml.append(currentIndent + "<StudyEventDef OID=\"" + StringEscapeUtils.escapeXml(sed.getOid()) + "\"  Name=\"" + StringEscapeUtils.escapeXml(sed.getName()) + "\" Repeating=\"" + sed.getRepeating() + "\" Type=\"" + sed.getType() + "\">");
        xml.append(nls);
        ArrayList<ElementRefBean> formRefs = (ArrayList<ElementRefBean>) sed.getFormRefs();
        for (ElementRefBean formRef : formRefs) {
            xml.append(currentIndent + indent + "<FormRef FormOID=\"" + StringEscapeUtils.escapeXml(formRef.getElementDefOID()) + "\" Mandatory=\"" + formRef.getMandatory() + "\">");
            xml.append(nls);
            ConfigurationParameters conf = formRef.getConfigurationParameters();
            if (conf != null) {
                xml.append(currentIndent + indent + indent + "<OpenClinica:ConfigurationParameters HideCRF=\"" + (conf.isHiddenCrf() ? "Yes" : "No") + "\" ParticipantForm=\"" + (conf.isParticipantForm() ? "Yes" : "No") + "\" AllowAnonymousSubmission=\"" + (conf.isAllowAnynymousSubmission() ? "Yes" : "No") + "\" SubmissionUrl=\"" + conf.getSubmissionUrl() + "\" Offline=\"" + (conf.isOffline() ? "Yes" : "No") + "\"/>");
                xml.append(nls);
                ArrayList<ElementRefBean> formLayoutRefs = (ArrayList<ElementRefBean>) formRef.getFormLayoutRefs();
                for (ElementRefBean formLayoutRef : formLayoutRefs) {
                    xml.append(currentIndent + indent + indent + "<OpenClinica:FormLayoutRef OID=\"" + StringEscapeUtils.escapeXml(formLayoutRef.getName()) + "\" IsDefaultVersion=\"" + (formLayoutRef.isDefaultVersion() ? "Yes" : "No") + "\"/>");
                    xml.append(nls);
                }
            }
            xml.append(currentIndent + indent + "</FormRef>");
            xml.append(nls);
        }
        // MR=416
        if ("oc1.3".equals(this.getODMVersion())) {
            this.addEventDefinitionDetails(sed.getEventDefinitionDetais(), currentIndent + indent);
        }
        xml.append(currentIndent + "</StudyEventDef>");
        xml.append(nls);
    }
}
Also used : StudyEventDefBean(org.akaza.openclinica.bean.odmbeans.StudyEventDefBean) ElementRefBean(org.akaza.openclinica.bean.odmbeans.ElementRefBean) ArrayList(java.util.ArrayList) ConfigurationParameters(org.akaza.openclinica.bean.odmbeans.ConfigurationParameters)

Example 15 with ElementRefBean

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

the class GenerateClinicalDataServiceImpl method fillDNObject.

private void fillDNObject(DiscrepancyNoteBean dnNoteBean, ArrayList<DiscrepancyNoteBean> dnNotes, boolean addDN, DiscrepancyNote dn, String columnName) {
    if (dn.getParentDiscrepancyNote() != null) {
    } else {
        dnNoteBean = new DiscrepancyNoteBean();
        dnNoteBean.setStatus(dn.getResolutionStatus().getName());
        dnNoteBean.setNoteType(dn.getEntityType());
        dnNoteBean.setOid("DN_" + dn.getDiscrepancyNoteId());
        dnNoteBean.setNoteType(dn.getDiscrepancyNoteType().getName());
        dnNoteBean.setDateUpdated(dn.getDateCreated());
        dnNoteBean.setEntityName(columnName);
        for (DiscrepancyNote childDN : dn.getChildDiscrepancyNotes()) {
            ChildNoteBean childNoteBean = new ChildNoteBean();
            childNoteBean.setOid("CDN_" + childDN.getDiscrepancyNoteId());
            ElementRefBean userRef = new ElementRefBean();
            childNoteBean.setDescription(childDN.getDescription());
            childNoteBean.setStatus(childDN.getResolutionStatus().getName());
            childNoteBean.setDetailedNote(childDN.getDetailedNotes());
            childNoteBean.setDateCreated(childDN.getDateCreated());
            if (childDN.getUserAccountByOwnerId() != null) {
                childNoteBean.setOwnerUserName(childDN.getUserAccountByOwnerId().getUserName());
                childNoteBean.setOwnerFirstName(childDN.getUserAccountByOwnerId().getFirstName());
                childNoteBean.setOwnerLastName(childDN.getUserAccountByOwnerId().getLastName());
            }
            if (childDN.getUserAccount() != null) {
                userRef.setElementDefOID("USR_" + childDN.getUserAccount().getUserId());
                userRef.setUserName(childDN.getUserAccount().getUserName());
                userRef.setFullName(childDN.getUserAccount().getFirstName() + " " + childDN.getUserAccount().getLastName());
            } else {
                userRef.setElementDefOID("");
                userRef.setUserName("");
                userRef.setFullName("");
            }
            childNoteBean.setUserRef(userRef);
            dnNoteBean.getChildNotes().add(childNoteBean);
        }
        dnNoteBean.setNumberOfChildNotes(dnNoteBean.getChildNotes().size());
        if (!dnNotes.contains(dnNoteBean)) {
            dnNotes.add(dnNoteBean);
        }
    }
}
Also used : DiscrepancyNote(org.akaza.openclinica.domain.datamap.DiscrepancyNote) ChildNoteBean(org.akaza.openclinica.bean.odmbeans.ChildNoteBean) ElementRefBean(org.akaza.openclinica.bean.odmbeans.ElementRefBean) DiscrepancyNoteBean(org.akaza.openclinica.bean.odmbeans.DiscrepancyNoteBean)

Aggregations

ElementRefBean (org.akaza.openclinica.bean.odmbeans.ElementRefBean)19 ArrayList (java.util.ArrayList)15 HashMap (java.util.HashMap)9 Iterator (java.util.Iterator)9 LinkedHashMap (java.util.LinkedHashMap)9 ChildNoteBean (org.akaza.openclinica.bean.odmbeans.ChildNoteBean)5 DiscrepancyNoteBean (org.akaza.openclinica.bean.odmbeans.DiscrepancyNoteBean)5 FormDefBean (org.akaza.openclinica.bean.odmbeans.FormDefBean)5 StudyEventDefBean (org.akaza.openclinica.bean.odmbeans.StudyEventDefBean)5 Date (java.util.Date)4 CRFBean (org.akaza.openclinica.bean.admin.CRFBean)4 EventDefinitionCRFBean (org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)4 HashSet (java.util.HashSet)3 ItemGroupDefBean (org.akaza.openclinica.bean.odmbeans.ItemGroupDefBean)3 CodeListBean (org.akaza.openclinica.bean.odmbeans.CodeListBean)2 CodeListItemBean (org.akaza.openclinica.bean.odmbeans.CodeListItemBean)2 ConfigurationParameters (org.akaza.openclinica.bean.odmbeans.ConfigurationParameters)2 FormDetailsBean (org.akaza.openclinica.bean.odmbeans.FormDetailsBean)2 ItemDefBean (org.akaza.openclinica.bean.odmbeans.ItemDefBean)2 MetaDataVersionProtocolBean (org.akaza.openclinica.bean.odmbeans.MetaDataVersionProtocolBean)2