Search in sources :

Example 1 with ReliabilityParams

use of ambit2.base.data.study.ReliabilityParams in project ambit-mirror by ideaconsult.

the class SubstanceStudyParser method parseReliability.

// ProtocolApplicationAnnotated
protected void parseReliability(ObjectNode node, ProtocolApplication record) {
    if (node == null)
        return;
    ReliabilityParams reliability = new ReliabilityParams();
    JsonNode jn = node.get(_FIELDS_RELIABILITY.r_isUsedforMSDS.name());
    try {
        reliability.setIsUsedforMSDS(jn.asBoolean());
    } catch (Exception x) {
    }
    jn = node.get(_FIELDS_RELIABILITY.r_isRobustStudy.name());
    try {
        reliability.setIsRobustStudy(jn.asBoolean());
    } catch (Exception x) {
    }
    jn = node.get(_FIELDS_RELIABILITY.r_isUsedforClassification.name());
    try {
        reliability.setIsUsedforClassification(jn.asBoolean());
    } catch (Exception x) {
    }
    jn = node.get(_FIELDS_RELIABILITY.r_purposeFlag.name());
    try {
        reliability.setPurposeFlag(jn.textValue());
    } catch (Exception x) {
    }
    jn = node.get(_FIELDS_RELIABILITY.r_studyResultType.name());
    try {
        reliability.setStudyResultType(jn.textValue());
    } catch (Exception x) {
    }
    jn = node.get(_FIELDS_RELIABILITY.r_value.name());
    try {
        reliability.setValue(jn.textValue());
    } catch (Exception x) {
    }
    record.setReliability(reliability);
}
Also used : ReliabilityParams(ambit2.base.data.study.ReliabilityParams) JsonNode(com.fasterxml.jackson.databind.JsonNode) CDKException(org.openscience.cdk.exception.CDKException) IOException(java.io.IOException)

Example 2 with ReliabilityParams

use of ambit2.base.data.study.ReliabilityParams in project ambit-mirror by ideaconsult.

the class StringArrayHeader method getExperiment.

protected ProtocolApplication<Protocol, IParams, String, IParams, String> getExperiment(CATEGORIES categories, SubstanceRecord record, Protocol protocol, ReliabilityParams reliability) {
    String experimentUUID = prefix + UUID.nameUUIDFromBytes((record.getSubstanceUUID() + lines[_lines.technology.ordinal()] + lines[_lines.endpoint.ordinal()]).getBytes());
    if (record.getMeasurements() != null)
        for (ProtocolApplication<Protocol, IParams, String, IParams, String> experiment : record.getMeasurements()) {
            if (experimentUUID.equals(experiment.getDocumentUUID()))
                return experiment;
        }
    ProtocolApplication<Protocol, IParams, String, IParams, String> experiment = new ProtocolApplication<Protocol, IParams, String, IParams, String>(protocol);
    experiment.setReliability(reliability);
    experiment.setParameters(new Params());
    experiment.getParameters().put("testmat_form", null);
    experiment.getParameters().put("Type of method", null);
    setCitation(experiment);
    experiment.setDocumentUUID(experimentUUID);
    return experiment;
}
Also used : ProtocolApplication(ambit2.base.data.study.ProtocolApplication) IParams(ambit2.base.data.study.IParams) Params(ambit2.base.data.study.Params) IParams(ambit2.base.data.study.IParams) ReliabilityParams(ambit2.base.data.study.ReliabilityParams) Protocol(ambit2.base.data.study.Protocol)

Example 3 with ReliabilityParams

use of ambit2.base.data.study.ReliabilityParams in project ambit-mirror by ideaconsult.

the class ReadSubstanceStudy method getObject.

@Override
public PA getObject(ResultSet rs) throws AmbitException {
    if (record == null) {
        record = (PA) new ProtocolApplication<Protocol, String, String, IParams, String>(new Protocol(null));
    } else
        record.clear();
    try {
        Protocol protocol = new Protocol(rs.getString("endpoint"));
        protocol.addGuideline(rs.getString("guidance"));
        protocol.setCategory(rs.getString("endpointcategory"));
        protocol.setTopCategory(rs.getString("topcategory"));
        record.setProtocol(protocol);
        try {
            record.setDocumentUUID(I5Utils.getPrefixedUUID(rs.getString("document_prefix"), rs.getString("u")));
        } catch (Exception xx) {
            record.setDocumentUUID(null);
        }
        try {
            record.setSubstanceUUID(I5Utils.getPrefixedUUID(rs.getString("substance_prefix"), rs.getString("su")));
        } catch (Exception xx) {
            record.setSubstanceUUID(null);
        }
        record.setReference(rs.getString("reference"));
        try {
            record.setReferenceYear(Integer.toString(rs.getInt("reference_year")));
        } catch (Exception x) {
            record.setReferenceYear(null);
        }
        try {
            record.setReferenceOwner(rs.getString("reference_owner"));
        } catch (Exception x) {
            record.setReferenceOwner(null);
        }
        // parse json
        record.setParameters(rs.getString("params"));
        // parse
        record.setInterpretationCriteria(rs.getString("interpretation_criteria"));
        // json
        // parse
        record.setInterpretationResult(rs.getString("interpretation_result"));
        // json
        record.setCompanyName(rs.getString("owner_name"));
        try {
            record.setCompanyUUID(I5Utils.getPrefixedUUID(rs.getString("owner_prefix"), rs.getString("ou")));
        } catch (Exception xx) {
            record.setCompanyUUID(null);
        }
        try {
            record.setReferenceSubstanceUUID(I5Utils.getPrefixedUUID(rs.getString("rs_prefix"), rs.getString("rsu")));
        } catch (Exception xx) {
            record.setReferenceSubstanceUUID(null);
        }
        ReliabilityParams reliability = new ReliabilityParams();
        record.setReliability(reliability);
        try {
            reliability.setValue(rs.getString("reliability"));
        } catch (Exception x) {
        }
        try {
            reliability.setIsRobustStudy(rs.getBoolean("isRobustStudy"));
        } catch (Exception x) {
        }
        try {
            reliability.setIsUsedforClassification(rs.getBoolean("isUsedforClassification"));
        } catch (Exception x) {
        }
        try {
            reliability.setIsUsedforMSDS(rs.getBoolean("isUsedforMSDS"));
        } catch (Exception x) {
        }
        try {
            reliability.setPurposeFlag(rs.getString("purposeFlag"));
        } catch (Exception x) {
        }
        try {
            reliability.setStudyResultType(rs.getString("studyResultType"));
        } catch (Exception x) {
        }
        try {
            String iuuid = rs.getString("iuuid");
            record.setInvestigationUUID(iuuid);
        } catch (Exception x) {
            record.setInvestigationUUID((String) null);
        }
        try {
            String auuid = rs.getString("auuid");
            record.setAssayUUID(auuid);
        } catch (Exception x) {
            record.setAssayUUID((String) null);
        }
        try {
            record.setUpdated(new Date(rs.getTimestamp("updated").getTime()));
        } catch (Exception x) {
            record.setReferenceYear(null);
        }
    } catch (Exception x) {
        x.printStackTrace();
    }
    return record;
}
Also used : ProtocolApplication(ambit2.base.data.study.ProtocolApplication) ReliabilityParams(ambit2.base.data.study.ReliabilityParams) Protocol(ambit2.base.data.study.Protocol) AmbitException(net.idea.modbcum.i.exceptions.AmbitException) Date(java.util.Date)

Aggregations

ReliabilityParams (ambit2.base.data.study.ReliabilityParams)3 Protocol (ambit2.base.data.study.Protocol)2 ProtocolApplication (ambit2.base.data.study.ProtocolApplication)2 IParams (ambit2.base.data.study.IParams)1 Params (ambit2.base.data.study.Params)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 IOException (java.io.IOException)1 Date (java.util.Date)1 AmbitException (net.idea.modbcum.i.exceptions.AmbitException)1 CDKException (org.openscience.cdk.exception.CDKException)1