use of org.akaza.openclinica.service.crfdata.front.InstantOnChangeFrontStr in project OpenClinica by OpenClinica.
the class InstantOnChangeService method addToNonRepOrigins.
public void addToNonRepOrigins(Map<Integer, InstantOnChangeFrontStrGroup> nonRepOrigins, InstantOnChangePairContainer instantPair) {
Integer oigItemId = instantPair.getOriginItemId();
if (oigItemId > 0 && instantPair.getDestItemId() > 0 && instantPair.getOptionValue().length() > 0) {
if (nonRepOrigins.containsKey(oigItemId)) {
InstantOnChangeFrontStrGroup istr = nonRepOrigins.get(oigItemId);
InstantOnChangeFrontStr nonRep = istr.getNonRepFrontStr();
nonRep.chainUpFrontStr(instantPair);
istr.setNonRepFrontStr(nonRep);
} else {
InstantOnChangeFrontStr nonRep = new InstantOnChangeFrontStr();
nonRep.chainUpFrontStr(instantPair);
if (nonRep.getFrontStr().length() > 0) {
InstantOnChangeFrontStrGroup istr = new InstantOnChangeFrontStrGroup();
istr.setOriginItemId(oigItemId);
istr.setNonRepFrontStr(nonRep);
nonRepOrigins.put(oigItemId, istr);
}
}
} else {
logger.debug("Empty found upon item_ids/option_value, so no InstantOnChangeFrontStrGroup available.");
}
}
use of org.akaza.openclinica.service.crfdata.front.InstantOnChangeFrontStr in project OpenClinica by OpenClinica.
the class InstantOnChangeService method addToRepOrigins.
/**
* Both origin and destination are in the same repeating group.
* @param allItems
* @param groupedOrigins
*/
public void addToRepOrigins(Map<String, Map<Integer, InstantOnChangeFrontStrGroup>> repOrigins, InstantOnChangePairContainer instantPair) {
String oigOid = instantPair.getOriginItemGroupOid();
Integer oigItemId = instantPair.getOriginItemId();
if (oigOid.length() > 0 && oigItemId > 0 && instantPair.getDestItemId() > 0 && instantPair.getOptionValue().length() > 0) {
if (repOrigins.containsKey(oigOid)) {
Map<Integer, InstantOnChangeFrontStrGroup> strMap = repOrigins.get(oigOid);
if (strMap == null) {
logger.debug("repeating " + oigOid + " contains Null InstantOnChangeFrontStr.");
} else {
if (strMap.containsKey(oigItemId)) {
InstantOnChangeFrontStr repGrpFrontStr = strMap.get(oigItemId).getSameRepGrpFrontStr();
repGrpFrontStr.chainUpFrontStr(instantPair);
} else {
InstantOnChangeFrontStr repGrp = new InstantOnChangeFrontStr();
repGrp.chainUpFrontStr(instantPair);
if (repGrp.getFrontStr().length() > 0) {
InstantOnChangeFrontStrGroup iocstr = new InstantOnChangeFrontStrGroup();
iocstr.setOriginItemId(oigItemId);
iocstr.setSameRepGrpFrontStr(repGrp);
strMap.put(oigItemId, iocstr);
}
}
}
} else {
InstantOnChangeFrontStr repGrp = new InstantOnChangeFrontStr();
repGrp.chainUpFrontStr(instantPair);
if (repGrp.getFrontStr().length() > 0) {
Map<Integer, InstantOnChangeFrontStrGroup> smap = new HashMap<Integer, InstantOnChangeFrontStrGroup>();
InstantOnChangeFrontStrGroup instantFrontStr = new InstantOnChangeFrontStrGroup();
instantFrontStr.setOriginItemId(oigItemId);
instantFrontStr.setSameRepGrpFrontStr(repGrp);
smap.put(oigItemId, instantFrontStr);
repOrigins.put(oigOid, smap);
}
}
} else {
logger.debug("Empty found upon origin_group_oid/item_ids/option_value, so no InstantOnChangeFrontStrGroup available.");
}
}
Aggregations