Example usage for java.lang Double toString

List of usage examples for java.lang Double toString

Introduction

In this page you can find the example usage for java.lang Double toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of this Double object.

Usage

From source file:eu.optimis.ecoefficiencytool.rest.client.EcoEfficiencyToolRESTClientIP.java

/**
 * Specifies the minimum eco-efficiency thresholds at VM level.
 * If any of them are surpassed, a proactive notification will be generated.
 * Note that setting a value of -1.0 to any of the thresholds will disable
 * them (separately)./*ww w . j  ava 2 s.co  m*/
 *
 * @param vmId VM identifier.
 * @param energyEfficiencyTH Energy efficiency threshold.
 * @param ecologicalEfficiencyTH Ecological efficiency threshold.
 */
public void setVMEcoThreshold(String vmId, Double energyEfficiencyTH, Double ecologicalEfficiencyTH) {
    try {
        if (vmId != null) {
            WebResource resource = client.resource(this.getAddress()).path("proactive/vm").path(vmId)
                    .path("setth");
            if (energyEfficiencyTH != null) {
                resource = resource.queryParam("enEffTH", energyEfficiencyTH.toString());
            }
            if (ecologicalEfficiencyTH != null) {
                resource = resource.queryParam("ecoEffTH", ecologicalEfficiencyTH.toString());
            }
            resource.post();
        }
    } catch (UniformInterfaceException ex) {
        ClientResponse cr = ex.getResponse();
        log.error(cr.getStatus());
        ex.printStackTrace();
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }
}

From source file:eu.optimis.ecoefficiencytool.rest.client.EcoEfficiencyToolRESTClientIP.java

/**
 * Specifies the minimum eco-efficiency thresholds at node level.
 * If any of them are surpassed, a proactive notification will be generated.
 * Note that setting a value of -1.0 to any of the thresholds will disable
 * them (separately)./*from  w ww.  ja  va  2  s  . c  om*/
 * @param nodeId Node identifier.
 * @param energyEfficiencyTH Energy efficiency threshold.
 * @param ecologicalEfficiencyTH Ecological efficiency threshold.
 */
public void setNodeEcoThreshold(String nodeId, Double energyEfficiencyTH, Double ecologicalEfficiencyTH) {
    try {
        if (nodeId != null) {
            WebResource resource = client.resource(this.getAddress()).path("proactive/node").path(nodeId)
                    .path("setth");
            if (energyEfficiencyTH != null) {
                resource = resource.queryParam("enEffTH", energyEfficiencyTH.toString());
            }
            if (ecologicalEfficiencyTH != null) {
                resource = resource.queryParam("ecoEffTH", ecologicalEfficiencyTH.toString());
            }
            resource.post();
        }
    } catch (UniformInterfaceException ex) {
        ClientResponse cr = ex.getResponse();
        log.error(cr.getStatus());
        ex.printStackTrace();
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }
}

From source file:eu.optimis.ecoefficiencytool.rest.client.EcoEfficiencyToolRESTClientIP.java

/**
 * Specifies the minimum eco-efficiency thresholds at service level.
 * If any of them are surpassed, a proactive notification will be generated.
 * Note that setting a value of -1.0 to any of the thresholds will disable
 * them (separately).//from  w ww .  jav  a2s.  co  m
 * @param serviceId Service identifier.
 * @param energyEfficiencyTH Energy efficiency threshold.
 * @param ecologicalEfficiencyTH Ecological efficiency threshold.
 */
public void setServiceEcoThreshold(String serviceId, Double energyEfficiencyTH, Double ecologicalEfficiencyTH) {
    try {
        if (serviceId != null) {
            WebResource resource = client.resource(this.getAddress()).path("proactive/service").path(serviceId)
                    .path("setth");
            if (energyEfficiencyTH != null) {
                resource = resource.queryParam("enEffTH", energyEfficiencyTH.toString());
            }
            if (ecologicalEfficiencyTH != null) {
                resource = resource.queryParam("ecoEffTH", ecologicalEfficiencyTH.toString());
            }
            resource.post();
        }
    } catch (UniformInterfaceException ex) {
        ClientResponse cr = ex.getResponse();
        log.error(cr.getStatus());
        ex.printStackTrace();
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }
}

From source file:com.viettel.logistic.wms.service.StockGoodsTotalServiceImpl.java

/**
 * Ham dieu chinh trang thai/serial/so luong hang hoa theo yu cau
 *
 * @param changeOrder//from w w  w.j a  va2 s. c  o  m
 * @param lstChangeGoods
 * @return
 */
@Override
public ResultKTTS changeStockGoods(ChangeOrder changeOrder, List<ChangeGoods> lstChangeGoods) {
    //day thong tin ra LOG
    System.out.println("START OUTPUT DATA CHANGE GOODS: " + changeOrder.getOrderCode());
    System.out.println(changeOrder.toString());
    for (ChangeGoods changeGods : lstChangeGoods) {
        System.out.println(changeGods.toString());
    }
    System.out.println("END OUTPUT DATA CHANGE GOODS: " + changeOrder.getOrderCode());
    //
    ResultKTTS resultKTTS = new ResultKTTS();
    if (DataUtil.isNullObject(changeOrder)) {
        resultKTTS.setStatus(ParamUtils.SYNC.FAIL);
        resultKTTS.setReason(BundelUtils.getkey("infor.changeOrder.zero"));
        return resultKTTS;
    }
    resultKTTS.setOrderCode(changeOrder.getOrderCode());
    List<ConditionBean> lstConditionBeanSearch = new ArrayList<>();
    //danh sach trang thai hang hoa hop le
    List<String> lstGoodsState = new ArrayList();
    lstGoodsState.add("1");
    lstGoodsState.add("2");
    //danh sach lich su can luu lai
    List<HistoryChangeGoodsDTO> lstHistoryChangeGoodsDTOs = new ArrayList();
    List<ChangeGoods> lstChangeGoodsFilter = new ArrayList();
    List<String> lstGoodsCode = new ArrayList();
    Map<String, GoodsDTO> mapGoodsDTO = new HashMap<>();
    Map<String, GoodsDTO> mapGoodsDTOById = new HashMap<>();
    StockDTO stockDTOInfor = new StockDTO();
    List<GoodsDTO> lstGoodsDTO = new ArrayList();
    List<ConditionBean> lstConditionBean = new ArrayList<>();
    List<ChangeGoods> lstErrList = new ArrayList();
    String custId = "";
    String custName = "";
    SynLogDTO synLogDTO = new SynLogDTO();
    synLogDTO.setAppCode("WMS_CHANGE_STOCK_GOODS");
    try {
        //kiem tra thong tin yeu cau dau vao
        StringBuilder sbError = new StringBuilder();
        StringBuilder contentError = new StringBuilder();
        if (DataUtil.isStringNullOrEmpty(changeOrder.getOrderCode())) {//thieu thong tin ma yeu cau
            sbError.append(", ");
            sbError.append(BundelUtils.getkey("infor.orders.orderCode.zero"));
            System.out.println("Thieu thong tin ma yeu cau");
        } else {
            synLogDTO.setKey(changeOrder.getOrderCode());
        }
        if (DataUtil.isStringNullOrEmpty(changeOrder.getStockCode())) {//thieu thong tin kho
            sbError.append(", ");
            sbError.append(BundelUtils.getkey("infor.orders.stockCode.zero"));
            System.out.println("Thieu thong tin ma kho");
        }
        if (DataUtil.isStringNullOrEmpty(changeOrder.getExpectedDate())) {//thieu thong tin ngay gui yc
            sbError.append(", ");
            sbError.append(BundelUtils.getkey("infor.orders.expectedDate.zero"));
            System.out.println("Thieu thong tin ngay gui yeu cau");
        }
        if (DataUtil.isStringNullOrEmpty(changeOrder.getOrderUserName())) {//thieu thong tin nguoi gui yc
            sbError.append(", ");
            sbError.append(BundelUtils.getkey("infor.orders.orderUserName.zero"));
            System.out.println("Thieu thong tin nguoi gui yeu cau");
        }
        if (!DataUtil.isStringNullOrEmpty(sbError.toString())) {
            contentError.append(BundelUtils.getkey("infor.orders.zero"));
            contentError.append(":");
            contentError.append(sbError.toString().replaceFirst(",", ""));
            resultKTTS.setStatus(ParamUtils.SYNC.FAIL);
            resultKTTS.setReason(contentError.toString());
            insertSynLog(synLogDTO, ParamUtils.SYNC.FAIL, BundelUtils.getkey("infor.orders.zero"));
            return resultKTTS;
        }
        // kiem tra la duy nhat tren he thong
        boolean iCheckOrder = checkOrderCodeInTrans(changeOrder.getOrderCode());
        if (!iCheckOrder) {
            resultKTTS.setStatus(ParamUtils.SYNC.FAIL);
            resultKTTS.setReason(BundelUtils.getkey("notifi.orderCode.exists"));
            insertSynLog(synLogDTO, ParamUtils.SYNC.FAIL, BundelUtils.getkey("notifi.orderCode.exists"));
            return resultKTTS;
        }
        //map 2 kho ben KTTS vs Logistics
        MapStockDTO mapStockDTO = new MapStockDTO();
        mapStockDTO.setStockCode(changeOrder.getStockCode());
        mapStockDTO.setType("1");
        List<MapStockDTO> lstMapStockDTOs = WSMapStock.getListMapStockDTO(mapStockDTO, 0, Integer.MAX_VALUE, "",
                "");
        if (!DataUtil.isListNullOrEmpty(lstMapStockDTOs)) {
            changeOrder.setStockCode(lstMapStockDTOs.get(0).getLogStockCode());
        } else {
            contentError.append(BundelUtils.getkey("notifi.stock.notsearch"));
            resultKTTS.setStatus(ParamUtils.SYNC.FAIL);
            resultKTTS.setReason(contentError.toString());
            insertSynLog(synLogDTO, ParamUtils.SYNC.FAIL, BundelUtils.getkey("notifi.stock.notsearch"));
            return resultKTTS;
        }
        //tim kiem thong tin khach hang
        if (!DataUtil.isStringNullOrEmpty(changeOrder.getCustCode())) {
            lstConditionBeanSearch.clear();
            lstConditionBeanSearch
                    .add(new ConditionBean("status", ParamUtils.NAME_EQUAL, "0", ParamUtils.TYPE_STRING));
            lstConditionBeanSearch.add(new ConditionBean("code", ParamUtils.NAME_EQUAL,
                    changeOrder.getCustCode(), ParamUtils.TYPE_STRING));
            List<CustomerDTO> lstTempCus = WSCustomer.getListCustomerByCondition(lstConditionBeanSearch, 0,
                    Integer.MAX_VALUE, "", "");
            if (!DataUtil.isListNullOrEmpty(lstTempCus)) {
                custId = lstTempCus.get(0).getCustId();
                custName = lstTempCus.get(0).getName();
                changeOrder.setCustId(custId);
                changeOrder.setCustName(custName);
            }
        }
        //kiem tra danh sach hang hoa dau vao
        if (DataUtil.isListNullOrEmpty(lstChangeGoods)) {
            resultKTTS.setStatus(ParamUtils.SYNC.FAIL);
            resultKTTS.setReason(BundelUtils.getkey("infor.listGoods.zero"));
            insertSynLog(synLogDTO, ParamUtils.SYNC.FAIL, BundelUtils.getkey("infor.listGoods.zero"));
            return resultKTTS;
        }
        for (ChangeGoods change : lstChangeGoods) {
            if (DataUtil.isStringNullOrEmpty(change.getOldGoodsCode())) {//kiem tra ma hang hoa
                System.out.println("Thieu thong tin ma hang hoa");
                addInforErrorForList(lstErrList, change, "infor.goodscode.zero");
                continue;
            }
            if (DataUtil.isStringNullOrEmpty(change.getOldState())) {//kiem tra trang thai
                System.out.println("Thieu thong tin trang thai");
                addInforErrorForList(lstErrList, change, "infor.goodsstate.zero");
                continue;
            } else {
                if (!lstGoodsState.contains(change.getOldState())) {
                    System.out.println("Sai thong tin tran thai");
                    addInforErrorForList(lstErrList, change, "infor.goodsstate.error");
                    continue;
                }
            }
            if (DataUtil.isStringNullOrEmpty(change.getAmount())) {//kiem tra so luong
                System.out.println("Thieu thong tin so luong");
                addInforErrorForList(lstErrList, change, "infor.amount.zero");
                continue;
            } else {
                change.setAmount(DataUtil.getQuantity(change.getAmount()));
                if ("0".equals(change.getAmount())) {//neu amount = 0 thi bo qua hang hoa(do hang hoa khong thay doi)
                    if (!lstGoodsCode.contains(change.getOldGoodsCode())) {
                        lstGoodsCode.add(change.getOldGoodsCode());
                    }
                    if (!DataUtil.isStringNullOrEmpty(change.getNewGoodsCode())) {
                        if (!lstGoodsCode.contains(change.getNewGoodsCode())) {
                            lstGoodsCode.add(change.getNewGoodsCode());
                        }
                    }
                    continue;
                }
            }
            if (!DataUtil.isStringNullOrEmpty(change.getChangeType())) {
                if (change.getChangeType().equals("1")) {//dieu chinh trang thai
                    if (DataUtil.isStringNullOrEmpty(change.getNewState())) {//kiem tra trang thai hang hoa
                        addInforErrorForList(lstErrList, change, "infor.goodsstate.zero");
                        System.out.println("Thieu thong tin trang thai moi");
                        continue;
                    }
                    Double amount = Double.parseDouble(change.getAmount());
                    if (amount < 0) {//neu amount nho hon 0 thi hang hoa chuyen trang thai tu hong => tot
                        amount = amount * (-1);
                        change.setAmount(DataUtil.getQuantity(amount.toString()));
                        String oldState = change.getOldState();
                        String newState = change.getNewState();
                        change.setOldState(newState);
                        change.setNewState(oldState);
                    }
                } else if (change.getChangeType().equals("2")) {//dieu chinh serial_1 =>serial_2
                    if (!DataUtil.isStringNullOrEmpty(change.getOldFromSerial())
                            && !DataUtil.isStringNullOrEmpty(change.getOldToSerial())
                            && !DataUtil.isStringNullOrEmpty(change.getNewFromSerial())
                            && !DataUtil.isStringNullOrEmpty(change.getNewToSerial())) {
                        //Kiem tra do dai serial neu >19 thi cat do kieu Long chi co do dai toi da 19
                        Long oldAmount = amountInSerial(change.getOldFromSerial(), change.getOldToSerial());
                        Long newAmount = amountInSerial(change.getNewFromSerial(), change.getNewToSerial());
                        Long amount = Long.parseLong(DataUtil.getQuantity(change.getAmount()));
                        if (!amount.equals(oldAmount) || !amount.equals(newAmount)) {
                            addInforErrorForList(lstErrList, change, "infor.amountEqualSerial.zero");
                            System.out.println("Sai thong tin amount != oldAmount != newAmuont");
                            continue;
                        }
                    } else {
                        addInforErrorForList(lstErrList, change, "infor.serial.zero");
                        System.out.println("Thieu thong tin serial");
                        continue;
                    }
                } else if (change.getChangeType().equals("3")) {//dieu chinh ma hang hoa
                    if (DataUtil.isStringNullOrEmpty(change.getNewGoodsCode())) {
                        addInforErrorForList(lstErrList, change, "infor.goodscode.zero");
                        System.out.println("Thieu thong tin ma hang hoa moi");
                        continue;
                    }
                    if (!lstGoodsCode.contains(change.getNewGoodsCode())) {
                        lstGoodsCode.add(change.getNewGoodsCode());
                    }
                } else if (change.getChangeType().equals("4")) {//dieu chinh ca ma hang hoa va trang thai
                    if (DataUtil.isStringNullOrEmpty(change.getNewState())) {
                        addInforErrorForList(lstErrList, change, "infor.goodsstate.zero");
                        System.out.println("Thieu thong tin trang thai moi");
                        continue;
                    }
                    if (DataUtil.isStringNullOrEmpty(change.getNewGoodsCode())) {
                        addInforErrorForList(lstErrList, change, "infor.goodscode.zero");
                        System.out.println("Thieu thong tin ma hang hoa moi");
                        continue;
                    }
                    if (!lstGoodsCode.contains(change.getNewGoodsCode())) {
                        lstGoodsCode.add(change.getNewGoodsCode());
                    }
                } else {//ma dieu chuyen khong dung
                    System.out.println("Ma dieu chuyen khong dung");
                    addInforErrorForList(lstErrList, change, "infor.changeType.error");
                    continue;
                }
            } else {//thieu thong tin dieu chuyen
                addInforErrorForList(lstErrList, change, "infor.changeType.zero");
                System.out.println("Thieu thong tin loai dieu chuyen");
                continue;
            }
            if (!lstGoodsCode.contains(change.getOldGoodsCode())) {
                lstGoodsCode.add(change.getOldGoodsCode());
            }
            lstChangeGoodsFilter.add(change);
        }
        if (!DataUtil.isListNullOrEmpty(lstErrList)) {
            StringBuilder messReason = new StringBuilder();
            for (ChangeGoods goodsError : lstErrList) {
                if (!DataUtil.isStringNullOrEmpty(goodsError.getOldGoodsName())) {
                    messReason.append(BundelUtils.getkey("change.goodsCode"));
                    messReason.append(" ");
                    messReason.append(goodsError.getOldGoodsCode());
                    messReason.append(": ");
                    messReason.append(goodsError.getInforError());
                    messReason.append("; ");
                }
            }
            if (DataUtil.isStringNullOrEmpty(messReason)) {
                messReason.append(BundelUtils.getkey("infor.goodscode.zero"));
            }
            //resultKTTS.setLstChangeGoods(lstErrList);
            resultKTTS.setStatus(ParamUtils.SYNC.FAIL);
            resultKTTS.setReason(BundelUtils.getkey("infor.inforError") + ". " + messReason.toString());
            insertSynLog(synLogDTO, ParamUtils.SYNC.FAIL,
                    BundelUtils.getkey("infor.inforError") + messReason.toString());
            return resultKTTS;
        }
        //lay danh sach hang hoa va dua vao map
        lstGoodsDTO = getListGoods(lstGoodsCode, custId);
        mapGoodsDTO = putGoodsToMap(lstGoodsDTO);
        mapGoodsDTOById = putGoodsToMapById(lstGoodsDTO);
        //map danh sach kho
        if (!DataUtil.isStringNullOrEmpty(changeOrder.getStockCode())) {
            lstConditionBean.clear();
            lstConditionBean.add(new ConditionBean("code", ParamUtils.OP_IN, changeOrder.getStockCode(),
                    ParamUtils.TYPE_STRING));
            List<StockDTO> lstTemp = stockBusiness.searchByConditionBean(lstConditionBean, 0, Integer.MAX_VALUE,
                    "", "code");
            if (!DataUtil.isListNullOrEmpty(lstTemp)) {
                stockDTOInfor = (StockDTO) DataUtil.cloneObject(lstTemp.get(0));
                changeOrder.setStockId(stockDTOInfor.getStockId());
                changeOrder.setStockName(stockDTOInfor.getName());
                //
                StaffStockDTO staffStockDTO = new StaffStockDTO();
                staffStockDTO.setStatus("1");
                staffStockDTO.setStockId(stockDTOInfor.getStockId());
                List<StaffStockDTO> lstStaffStockDTO = WSStaffStock.getListStaffStockDTO(staffStockDTO, 0,
                        Integer.MAX_VALUE, "", "id");
                //loc lay danh sach hang hoa theo kho
                fillterMapStaffGoodsByStock(lstStaffStockDTO);
            }
        }
        //tao giao dich, chi tiet giao dich, chi tiet serial giao dich
        boolean isError = initGoodsTransferTrans(lstChangeGoodsFilter, mapGoodsDTO, changeOrder);
        if (!isError) {
            StringBuilder messReason = new StringBuilder();
            for (ChangeGoods goodsError : lstChangeGoodsError) {
                messReason.append(BundelUtils.getkey("change.goodsCode"));
                messReason.append(" ");
                messReason.append(goodsError.getOldGoodsCode());
                messReason.append(": ");
                messReason.append(goodsError.getInforError());
                messReason.append("; ");
            }
            resultKTTS.setStatus(ParamUtils.SYNC.FAIL);
            resultKTTS.setReason(BundelUtils.getkey("infor.inforError") + ". " + messReason);
            insertSynLog(synLogDTO, ParamUtils.SYNC.FAIL,
                    BundelUtils.getkey("infor.inforError") + ". " + messReason);
            return resultKTTS;
        }
        //
        ResultDTO result = new ResultDTO();
        /*
         Map giua hang da xuat -> danh sach stock_goods cua hang do
         */
        if (!DataUtil.isListNullOrEmpty(lstTransExportDetail)) {
            result = stockExportService.goodsTransferSynsKTTS(transExport, transImport, lstTransExportDetail,
                    lstTransImportDetail, lstTransExportSerial, lstTransImportSerial, changeOrder,
                    lstChangeGoods, mapGoodsDTO, lstMapStaffGoodsDTOs);
            if (!result.getMessage().equals(ParamUtils.SUCCESS)) {
                StringBuilder sb1 = new StringBuilder();
                String sb = "";
                String addInfor = "";
                if ("NotEnoughAmount".equals(result.getKey())) {
                    BundelUtils.getkey("NotEnoughAmount");
                    try {
                        if (!DataUtil.isStringNullOrEmpty(result.getFromSerial())
                                && !DataUtil.isStringNullOrEmpty(result.getToSerial())) {
                            sb1.append(BundelUtils.getkey("notitfi.trans.NotEnoughAmount"));
                            sb = sb1.toString();
                            sb = sb.replace("@fromSerial", result.getFromSerial());
                            sb = sb.replace("@toSerial", result.getToSerial());
                        } else {
                            String message = result.getMessage();
                            if (!DataUtil.isStringNullOrEmpty(message)) {
                                message = message.substring(0, message.indexOf(","));
                            }
                            GoodsDTO gdto = mapGoodsDTOById.get(message);
                            sb = BundelUtils.getkey("notitfi.trans.NotEnoughAmount2");
                            sb = sb.replace("@goodCode", gdto.getCode());
                        }
                    } catch (Exception e) {
                        sb = BundelUtils.getkey("notitfi.trans.NotEnoughAmount3");
                    }
                } else if ("INSERT_ERROR_HISTORY".equals(result.getKey())) {
                    sb = BundelUtils.getkey("notifi.insert.history");
                    addInfor = BundelUtils.getkey("notifi.addInfor.errorHistory");
                } else if ("INSERT_ERROR_MESSAGES".equals(result.getKey())) {
                    sb = BundelUtils.getkey("notifi.insert.history");
                    addInfor = BundelUtils.getkey("notifi.addInfor.errorMessage");
                }
                resultKTTS.setStatus(ParamUtils.SYNC.FAIL);
                String mess = BundelUtils.getkey("changeGoods.error.trans") + sb;
                resultKTTS.setReason(BundelUtils.getkey("changeGoods.error.trans") + ". " + sb);
                insertSynLog(synLogDTO, ParamUtils.SYNC.FAIL, mess + ". " + addInfor);
                return resultKTTS;
            }
        } else {
            lstHistoryChangeGoodsDTOs = convertFromHistoryChangeGoods(changeOrder, lstChangeGoods, mapGoodsDTO);
            String messInsert = historyChangeGoodsBusiness.insertList(lstHistoryChangeGoodsDTOs);
            if (!ParamUtils.SUCCESS.equals(messInsert)) {
                insertSynLog(synLogDTO, ParamUtils.SYNC.SUCCESS, BundelUtils.getkey("notifi.insert.history"));
                resultKTTS.setStatus(ParamUtils.SYNC.FAIL);
                return resultKTTS;
            }
            result.setKey(BundelUtils.getkey("notifi.trans.empty"));
        }
        StringBuilder mesSucc = new StringBuilder();
        mesSucc.append(BundelUtils.getkey("changeStockGoods.success"));
        mesSucc.append(result.getKey() == null ? "" : result.getKey());
        insertSynLog(synLogDTO, ParamUtils.SYNC.SUCCESS, mesSucc.toString());
        //-> commit
        resultKTTS.setStatus(ParamUtils.SYNC.SUCCESS);
        return resultKTTS;
    } catch (Exception e) {
        //e.printStackTrace();
        Logger.getLogger(StockImportServiceImpl.class.getName()).log(Level.SEVERE, null, e);
        resultKTTS.setStatus(ParamUtils.SYNC.FAIL);
        resultKTTS.setReason(BundelUtils.getkey(ParamUtils.SYSTEM_OR_DATA_ERROR));
        insertSynLog(synLogDTO, ParamUtils.SYNC.FAIL, BundelUtils.getkey(ParamUtils.SYSTEM_OR_DATA_ERROR));
        return resultKTTS;
    } finally {
    }
}

From source file:com.ephesoft.dcma.tableextraction.TableExtraction.java

/**
 * Returns the value of the columnName passed for the table row. If <code>cuurencyCode</code> is not <code>NULL</code>, then
 * currencyExtraction rules are applied to the extracted value corresponding to the code.
 * //  ww  w  .j a  v  a  2 s. c  o m
 * @param row {@link Row} row from which the values are to be extracted.
 * @param columnPassed {@link String} name of the column whose value is to be extracted.
 * @param currencyCode {@link CurrencyCode} implies the rules for currency extraction. If null currency extraction is not
 *            performed.
 * @return {@link String} Value extracted corresponding to the column.
 */
private String getColumnValue(final Row row, final String columnPassed, final CurrencyCode currencyCode) {
    String extractedValue = getColumnValue(row, columnPassed);

    if (currencyCode != null) {
        Double currencyValue = CurrencyUtil.getDoubleValue(extractedValue,
                currencyCode.getRepresentationValue());
        if (currencyValue != null) {
            extractedValue = currencyValue.toString();
        }
    }
    LOGGER.info(EphesoftStringUtil.concatenate("Extracted value for ", columnPassed, " is ", extractedValue));
    return extractedValue;
}

From source file:gui.EspecificacionesAnimal.java

private void loteSelector1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loteSelector1ActionPerformed
    this.proveedorSelector1.setFocusable(false);
    this.JDc_FechaCompra.setFocusable(false);
    this.JDc_fechaRecepcion.setFocusable(false);
    this.tf_Compra.setFocusable(false);
    this.tf_PesoCompra.setFocusable(false);
    this.tf_pesoRecepcion.setFocusable(false);
    recepcion = new Recepcion();
    recepcion.cargarPorLote(loteSelector1.getSelectedItem().toString());
    proveedorSelector1.setSelectedItem(recepcion.proveedor.descripcion);
    tf_Compra.setText(recepcion.folio);//from  ww w.ja  v  a 2  s  . com
    Double d = recepcion.peso_origen / recepcion.animales;
    if (d > 0) {
        tf_PesoCompra.setText(d.toString());
    }
    d = recepcion.peso_recepcion / recepcion.animales;
    if (d > 0) {
        tf_pesoRecepcion.setText(d.toString());
    }
    JDc_fechaRecepcion.setDate(recepcion.fecha_recepcion);
    JDc_FechaCompra.setDate(recepcion.fecha_compra);
    ((JLabel) loteSelector1.getRenderer()).setHorizontalAlignment(SwingConstants.CENTER);
}

From source file:classes.MyVisitor.java

@Override
public T visitAsignacion1(MyLanguageParser.Asignacion1Context ctx) {

    // Camino 1, asignar ID
    if (ctx.ID(1) != null) {
        Objeto obj = isDefined(ctx.ID(0).toString());
        Objeto obj2 = buscar(ctx.ID(1).toString());
        if (obj2 == null) {
            // SEMANTICO
            error = "Error, variable: " + ctx.ID(1) + " no definida.";
            error();// www . j  a  v  a  2s .c om
        } else if (obj2.getObjeto() == null) {
            // SEMANTICO
            error = "Error, variable: " + ctx.ID(1) + " no tiene valor.";
            error();
        } else {
            table.remove(obj);
            obj.setObjeto(obj2.getObjeto());
        }
    }
    // Camino 2 asigna expr
    else if (ctx.expr(1) == null && ctx.contenido_escribir() == null && ctx.expr(0) != null) {
        Objeto obj = isDefined(ctx.ID(0).toString());
        T tipo1 = visitExpr(ctx.expr(0));
        T tipo = posicionArray(tipo1);
        if (tipo != null) {

            boolean isNumber = NumberUtils.isNumber(tipo.toString());
            if (getTipo(obj) == 1) {
                if (isNumber) {
                    Double number = Double.valueOf(tipo.toString());
                    if (isInt(number)) {
                        Integer value = Integer.valueOf(tipo.toString());
                        obj.setObjeto(value + "");
                    } else {
                        error = "se esperaba un entero";
                        error();
                    }
                } else {
                    error = "se esperaba un numero";
                    error();

                }
            } else if (getTipo(obj) == 2) {
                if (isNumber) {
                    Double number = Double.valueOf(tipo.toString());

                    String asd = isInt(number) ? Integer.valueOf(tipo.toString()).toString()
                            : number.toString();
                    obj.setObjeto(asd + "");
                } else {
                    error = "se esperaba un numero";
                    error();
                }
            } else if (getTipo(obj) == 3) {
                obj.setObjeto(tipo + "");
            } else if (getTipo(obj) == 4) {
                if (tipo.equals("verdadero") || tipo.equals("falso")) {
                    obj.setObjeto(tipo + "");
                } else {
                    error = "Se esperaba verdadero o falso";
                    error();
                }
            } else {
                error = "error desconocido asignacion - contenido escribir";
                error();
            }
        } else {
            error = "Se debe asignar un valor no nulo";
            error();
        }
    }
    // camino 3 arreglos REWVISAR aslkjdqhiwi
    else if (ctx.expr(1) != null || ctx.contenido_escribir() != null) {
        T tipo = visitExpr(ctx.expr(0));

        // ArrayList<String> arreglo = (ArrayList<String>) tipo;
        String ctxid = ctx.ID().toString().substring(1, ctx.ID().toString().length() - 1);
        String valores = tipo.toString().replace(" ", "");
        String id = ctxid + valores;
        Objeto obj = buscar(id);
        if (obj != null) {
            if (ctx.expr(1) != null) {
                T tipo1 = visitExpr(ctx.expr(1));
                T tipo3 = posicionArray(tipo1);
                obj.setObjeto(tipo3.toString());
            } else {
                obj.setObjeto(visitContenido_escribir(ctx.contenido_escribir()).toString());
            }
        } else {
            error = "Variable no definida " + id;
            error();
        }

    }
    // camino 4 cadenas
    else if (ctx.MENSAJE() != null) {
        Objeto obj = isDefined(ctx.ID(0).toString());
        if (getTipo(obj) != 3) {
            // SEMANTICO
            error = "Se esperaba un " + obj.getTipo();
            error();

        } else {
            obj.setObjeto(ctx.MENSAJE() + "");
        }
    }
    // camino 5 boolean
    else if (ctx.booleanExpr() != null) {
        Objeto obj = isDefined(ctx.ID(0).toString());
        if (getTipo(obj) != 4) {
            // SEMANTICO
            error = "Se esperaba un " + obj.getTipo();
            error();
        } else {
            obj.setTipo(visitBooleanExpr(ctx.booleanExpr()).toString());
        }
    } else {
        error = "Error desconocido asignacion ";
        error();
    }

    return null;

}

From source file:calculadora.controlador.ControladorComandos.java

/**
 * Busca el comando que se le paso al constructor y llama a la calculadora
 * para que ejecute el comando con los argumentos de entrada.
 *
 * Este metodo utiliza el <b>return</b> para devolver los resultados una vez
 * encuentra un comando devuelve el resultado y no pasa por los demas
 * sentencias.// ww w .  j a va2 s . c  o  m
 *
 * Se debe controlar cada uno de los comandos y pasarle los numeros a la
 * calculadora.
 *
 * Nota: -Si en la linea de comandos de entrada no hay ningun comando de la
 * aplicacion no devuelve una cadena vacia para que no muestre nada en
 * pantalla.
 *
 * -Si la opcion es de ayuda se le pasa una cadena unica que interpretara el
 * controlador principal para mostrar la ayuda.
 *
 * -Nunca se devuelve null
 *
 * Refacotorizado varias veces, antes estaba toda la busqueda concentrada en
 * el metodo.
 *
 * @see ControladorCalc#Todos los metodos
 * @see Object#toString()
 * @return String el resultado de la operacion
 * @throws IllegalArgumentException argumentos no son correctos
 * @throws NumberFormatException tipos de argumentos erroneos
 */
public String busquedaDeComandos() throws IllegalArgumentException, NumberFormatException {

    String resultado = "";
    //Resultado de las posibles operaciones
    Double result;
    Boolean resultBoo;

    //Si el comando es help
    if (cmdLine.hasOption(HELP)) {
        if (cmdLine.hasOption(PROPERTY)) {
            //Devuelvo un valor unico posible para decirle al controlador
            //principal que tiene que mostrar la ayuda de el comando -D
            resultado = "AYUDAPROPERTY";
        } else {
            //Devuelvo un valor unico posible para decirle al controlador
            //principal que tiene que mostrar la ayuda a la vista
            resultado = "AYUDA";
        }
    } else //Si el comando es exit
    if (cmdLine.hasOption(EXIT)) {
        //Devuelvo un valor unico posible para decirle al controlador
        //principal que tiene que salirse de la linea de comandos
        resultado = "EXIT";
    } else /* Propiedades */ if (cmdLine.hasOption("D")) {
        //Devuelve el resultado de la conversion
        resultado = conversor();
    } else if ((result = operacionesAritmetricas()) != null) {
        /* OperacionesAritmetricas */
        //Resultado de las posibles operaciones
        resultado = result.toString();
    } else if ((result = operacionesTrigonometricas()) != null) {
        /* OperacionesTrigonometricas */
        resultado = result.toString();
    } else if ((resultBoo = tablasVerdad()) != null) {
        /* Tablas de verdad */
        //Resultado de las posibles operaciones booleanas
        resultado = resultBoo.toString();
    }

    //Devuelve el resultado 
    return resultado;
}

From source file:Main.Interface_Main.java

/**
 * Creates new form Interface_Main// w w  w  .  j  a  v  a2  s.  c  om
 * Populates the com port combo box
 * Init the graphs for Current, Voltage, and Wattage
 */
public Interface_Main() {
    initComponents();
    btnStop.setEnabled(false);
    btnStart.setEnabled(false);
    btnThreshold.setEnabled(false);
    sldScreen.setEnabled(false);
    btnReset.setEnabled(false);
    spnRefSpd.setEnabled(false);

    Image im = null;

    try {
        im = ImageIO.read(getClass().getResource("/faviconbot2edit.png"));
        setIconImage(im);
    } catch (IOException ex) {

    }

    //Version check to notify user and update title bar. 
    Double newVer = checkVersion('A');
    if (newVer > appVersion) {
        JOptionPane.showMessageDialog(this, "Update available! Visit: http://github.com/friedcircuits",
                "Update", JOptionPane.INFORMATION_MESSAGE);
        jlblVer.setVisible(false);
        appTitle = appTitle + " - New Version: " + newVer.toString();
        jlblVer.setText(appTitle);
    } else {
        jlblVer.setText(appTitle);
    }

    cmbPort.removeAllItems();
    ArrayList portNames = listPorts();

    for (int i = 0; i < portNames.size(); i++) {
        cmbPort.addItem(portNames.get(i));
    }

    cmbBaud.setSelectedIndex(7);

    this.seriesCurrent = new TimeSeries("Time1", Millisecond.class);
    this.seriesCurrentMax = new TimeSeries("Time", Millisecond.class);
    this.seriesCurrentMin = new TimeSeries("Time", Millisecond.class);
    final TimeSeriesCollection dataset = new TimeSeriesCollection(this.seriesCurrent);
    dataset.addSeries(seriesCurrentMax);
    dataset.addSeries(seriesCurrentMin);
    JFreeChart chart = createChartCurrent(dataset);
    ChartPanel chartPanel = new ChartPanel(chart);
    //chartPanel.setPreferredSize(new Dimension(100, 260)); //size according to my window
    chartPanel.setMouseWheelEnabled(true);
    plCurrent.add(chartPanel, BorderLayout.CENTER);
    plCurrent.validate();

    this.seriesVolt = new TimeSeries("Time", Millisecond.class);
    this.seriesVoltMax = new TimeSeries("Time", Millisecond.class);
    this.seriesVoltMin = new TimeSeries("Time", Millisecond.class);
    final TimeSeriesCollection datasetVolt = new TimeSeriesCollection(this.seriesVolt);
    datasetVolt.addSeries(seriesVoltMax);
    datasetVolt.addSeries(seriesVoltMin);
    JFreeChart chartVolt = createChartVolt(datasetVolt);
    ChartPanel chartPanelVolt = new ChartPanel(chartVolt);
    //chartPanelVolt.setPreferredSize(new Dimension(400, 260)); //size according to my window
    chartPanelVolt.setMouseWheelEnabled(true);
    plVoltage.add(chartPanelVolt, BorderLayout.CENTER);
    plVoltage.validate();

    this.seriesWatt = new TimeSeries("Time", Millisecond.class);
    final TimeSeriesCollection datasetWatt = new TimeSeriesCollection(this.seriesWatt);
    JFreeChart chartWatt = createChartWatt(datasetWatt);
    ChartPanel chartPanelWatt = new ChartPanel(chartWatt);
    //chartPanelWatt.setPreferredSize(new Dimension(400, 260)); //size according to my window
    chartPanelWatt.setMouseWheelEnabled(true);
    plWattage.add(chartPanelWatt, BorderLayout.CENTER);
    plWattage.validate();

    this.seriesDm = new TimeSeries("Time", Millisecond.class);
    final TimeSeriesCollection datasetDm = new TimeSeriesCollection(this.seriesDm);
    JFreeChart chartDm = createChartDm(datasetDm);
    ChartPanel chartPanelDm = new ChartPanel(chartDm);
    //chartPanelWatt.setPreferredSize(new Dimension(400, 260)); //size according to my window
    chartPanelDm.setMouseWheelEnabled(true);
    plmWh.add(chartPanelDm, BorderLayout.CENTER);
    plmWh.validate();

    this.seriesDp = new TimeSeries("Time", Millisecond.class);
    final TimeSeriesCollection datasetDp = new TimeSeriesCollection(this.seriesDp);
    JFreeChart chartDp = createChartDp(datasetDp);
    ChartPanel chartPanelDp = new ChartPanel(chartDp);
    //chartPanelWatt.setPreferredSize(new Dimension(400, 260)); //size according to my window
    chartPanelDp.setMouseWheelEnabled(true);
    plmAh.add(chartPanelDp, BorderLayout.CENTER);
    plmAh.validate();

    if (cmbPort.getItemCount() > 0) {
        btnStart.setEnabled(true);
        lblStatus.setText("Select COM Port and Baud Rate.");
    } else
        lblStatus.setText("No serial port found.");

    System.out.println(cmbPort.getItemCount());

    File f = new File(logTmpFile);
    if (f.exists()) {
        int reply = JOptionPane.showConfirmDialog(this, "Data temp file exists, resume? (No deletes file)",
                "Resume?", JOptionPane.YES_NO_OPTION);
        if (reply == JOptionPane.NO_OPTION) {
            try {
                f.delete();
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Unable to delete");
                JOptionPane.showMessageDialog(this, e);
            }
        }
    } else {
        JOptionPane.showMessageDialog(this, "New session", "Session", JOptionPane.INFORMATION_MESSAGE);
    }
    System.out.println(f.getAbsolutePath());

}

From source file:gov.nih.nci.ispy.web.reports.quick.QuickClinicalReport.java

public static HSSFWorkbook getReportExcel(Finding finding) {
    ISPYClinicalFinding clinicalFinding = (ISPYClinicalFinding) finding;

    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sheet = wb.createSheet(clinicalFinding.getTaskId());

    List<PatientData> patientsData = clinicalFinding.getPatientData();

    String longHeaders = "ISPY_ID, INST_ID, AGE, AGECAT, RACE_ID, SSTAT, SURVDTD, CHEMOCAT, CHEMO, TAM, HERCEPTIN, DOSEDENSEANTHRA, DOSEDENSETAXANE, MENOSTATUS, SENTINELNODESAMPLE, "
            + "SENTINELNODERESULT, HIST_TYPE_INV_OS, HISTOLOGICGRADEOS, ER_TS, PGR_TS, HER2COMMUNITYPOS, HER2COMMUNITYMETHOD, "
            +//w ww.  j  ava  2 s  . c o  m
            //                "SURGERYLUMPECTOMY, SURGERYMASTECTOMY, HISTOLOGICTYPEPS, INITLUMP_FUPMAST, SURGERY, REASON_NO_SURG, RTTHERAPY, RTBREAST, RTBOOST, " +
            // delete HISTOLOGICTYPEPS
            "SURGERYLUMPECTOMY, SURGERYMASTECTOMY, INITLUMP_FUPMAST, SURGERY, REASON_NO_SURG, RTTHERAPY, RTBREAST, RTBOOST, "
            + "RTAXILLA, RTSNODE, RTIMAMNODE, RTCHESTW, RTOTHER, TSIZECLINICAL, NSIZECLINICAL, STAGETE, STAGENE, "
            + "STAGEME, CLINICALSTAGE, CLINRESPT1_T2, CLINRESPT1_T3, CLINRESPT1_T4, Morphologic pattern at T1,"
            +
            //                "LES_T1, LES_T2, LES_T3, LES_T4, LD_T1, LD_T2, LD_T3, LD_T4, MRI % change T1_T2, MRI % change T1_T3, MRI % change T1_T4," +
            // delete LES_T1, LES_T2, LES_T3, LES_T4, LD_T1, LD_T2, LD_T3, LD_T4
            "MRI % change T1_T2, MRI % change T1_T3, MRI % change T1_T4,"
            + "MRI % change T2_T3, MRI % change T2_T4, MRI % change T3_T4, Height, weight, BSA, ERpos,  PgRpos, FineNeedle, CoreNeedle, Incisional, BilateralCa,"
            + "Laterality,  RtBrTD, RtBoTD, RtAxTD, RtSNTD, RtIMTD, RtCWTD, RtOtTD, LocalProgress, DistProgress, T4Baseline, T4Early, "
            + "T4Int, T4PreS, BaseAxillary, EarlyAxillary, IntAxillary, PreSAxillary, BaseInternalM, EarlyInternalM, IntInternalM,"
            + "PreSInternalM, BaseSupra, EarlySupra, IntSupra, PreSSupra, BaseInfra, EarlyInfra, IntInfra, PreSInfra,DCISONLYPS, PTUMOR1SZCM_MICRO_1, "
            + "HISTOLOGICGRADEPS, NUMPOSNODESPS, NODESEXAMINEDPS, PATHOLOGYSTAGEPS, InSituDzPS, InSituHistoPS, InSituSpan, %InSitu, InSituGradePS,"
            + "InvDzPS, InvDzHistoPS, LVI, InvDzMultiFoc, InvDzCellularity, SurgMargins, MetSzLN, yT, yN, yM, PCR, RCB Index, RCBclass, RCB_PATHSZ_1,"
            + "RCB_PATHSZ_2, PTUMOR1SZCM_MICRO_2, RFS, RFS_ind, LocalSiteIpBreast,LocalSiteAxillaryNode,LocalSiteSupraNode,LocalSiteChestW,LocalSiteIMammaryN,LocalSiteInfrNodes,LocalSiteAxilla,DistSite,LocalProgTimeD (days),DistProgTimeD (days),"
            + "AromataseI, OvarianSup, OvarianAbl";

    String[] heads = StringUtils.split(longHeaders, ",");
    HSSFRow row = sheet.createRow((short) 0);
    for (int j = 0; j < heads.length; j++) {
        HSSFCell cell = row.createCell((short) j);
        cell.setCellValue(heads[j]);
    }
    HSSFRow dataRow;

    for (int i = 0; i < patientsData.size(); i++) {
        dataRow = null;
        dataRow = sheet.createRow((short) i + 1);
        PatientData data = patientsData.get(i);
        String rowData = "";
        String noRowData = "--";
        Double rowDouble = 0.0;

        Long rowLong = new Long(0);
        HSSFCell cell = null;

        cell = dataRow.createCell((short) 0);
        rowData = data.getISPY_ID();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 1);
        rowData = data.getInst_ID();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 2);
        Double age = data.getPatientAge();
        if (age != null) {
            rowData = age.toString();
        } else
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 3);
        AgeCategoryType ageCat = data.getAgeCategory();
        if (ageCat != null) {
            rowData = ageCat.toString();
        } else
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 4);
        RaceType rt = data.getRace();
        if (rt != null) {
            rowData = rt.toString();
        } else
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 5);
        rowData = data.getSSTAT();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 6);
        rowData = data.getSURVDTD();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 7);
        rowData = data.getChemoCat();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 8);
        rowData = data.getChemo();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 9);
        rowData = data.getTAM();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 10);
        rowData = data.getHerceptin();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 11);
        rowData = data.getDosedenseanthra();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 12);
        rowData = data.getDosedensetaxane();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 13);
        rowData = data.getMenoStatus();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 14);
        rowData = data.getSentinelNodeSample();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 15);
        rowData = data.getSentinelNodeResult();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 16);
        rowData = data.getHistTypeOfInvasiveTumor();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 17);
        rowData = data.getHistologicGradeOS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 18);
        rowData = data.getER_TS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 19);
        rowData = data.getPGR_TS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 20);
        rowData = data.getHER2CommunityPOS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 21);
        rowData = data.getHER2CommunityMethod();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 22);
        rowData = data.getSurgeryLumpectomy();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 23);
        rowData = data.getSurgeryMastectomy();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 24);
        rowData = data.getHistTypePS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 25);
        rowData = data.getINITLUMP_FUPMAST();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 26);
        rowData = data.getSurgery();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 27);
        rowData = data.getReasonNoSurg();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 28);
        rowData = data.getRTTherapy();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 29);
        rowData = data.getRTBreast();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 30);
        rowData = data.getRTBOOST();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 31);
        rowData = data.getRTAXILLA();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 32);
        rowData = data.getRTSNODE();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 33);
        rowData = data.getRTIMAMNODE();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 34);
        rowData = data.getRTChestW();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 35);
        rowData = data.getRTOTHER();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 36);
        rowData = data.getTSizeClinical();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 37);
        if (rowData == null)
            rowData = noRowData;
        rowData = data.getNSizeClinical();
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 38);
        rowData = data.getStageTE();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 39);
        rowData = data.getStageNE();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 40);
        rowData = data.getSTAGEME();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 41);
        rowData = data.getClinicalStageStr();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 42);
        rowData = data.getClinRespT1_T2();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 43);
        rowData = data.getClinRespT1_T3();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 44);
        rowData = data.getClinRespT1_T4();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 45);
        MorphologyType mt = data.getMorphology();
        if (mt != null) {
            rowData = mt.toString();
        } else {
            rowData = noRowData;
        }
        cell.setCellValue(rowData);

        //                 cell = dataRow.createCell((short) 46);
        //                 rowData = data.getLES_T1();
        //                 cell.setCellValue(rowData);
        //                 
        //                 cell = dataRow.createCell((short) 47);
        //                 rowData = data.getLES_T2();
        //                 cell.setCellValue(rowData);
        //                 
        //                 cell = dataRow.createCell((short) 48);
        //                 rowData = data.getLES_T3();
        //                 cell.setCellValue(rowData);
        //                 
        //                 cell = dataRow.createCell((short) 49);
        //                 rowData = data.getLES_T4();
        //                 cell.setCellValue(rowData);
        //                 
        //                 cell = dataRow.createCell((short) 50);
        //                 rowDouble = data.getLdT1();
        //                 if(rowDouble!=null){
        //                     cell.setCellValue(rowDouble);
        //                 }
        //                else cell.setCellValue(noRowData);
        //                 
        //                 cell = dataRow.createCell((short) 51);
        //                 rowDouble = data.getLdT2();
        //                 if(rowDouble!=null){
        //                     cell.setCellValue(rowDouble);
        //                 }
        //                else cell.setCellValue(noRowData);
        //                 
        //                 cell = dataRow.createCell((short) 52);
        //                 rowDouble = data.getLdT3();
        //                 if(rowDouble!=null){
        //                     cell.setCellValue(rowDouble);
        //                 }
        //                else cell.setCellValue(noRowData);
        //                 
        //                 cell = dataRow.createCell((short) 53);
        //                 rowDouble = data.getLdT4();
        //                 if(rowDouble!=null){
        //                     cell.setCellValue(rowDouble);
        //                 }
        //                else cell.setCellValue(noRowData);                 
        //                 

        cell = dataRow.createCell((short) 54);
        rowDouble = data.getMriPctChangeT1_T2();
        if (rowDouble != null) {
            cell.setCellValue(rowDouble);
        } else
            cell.setCellValue(noRowData);

        cell = dataRow.createCell((short) 55);
        rowDouble = data.getMriPctChangeT1_T3();
        if (rowDouble != null) {
            cell.setCellValue(rowDouble);
        } else
            cell.setCellValue(noRowData);

        cell = dataRow.createCell((short) 56);
        rowDouble = data.getMriPctChangeT1_T4();
        if (rowDouble != null) {
            cell.setCellValue(rowDouble);
        } else
            cell.setCellValue(noRowData);

        cell = dataRow.createCell((short) 57);
        rowDouble = data.getMriPctChangeT2_T3();
        if (rowDouble != null) {
            cell.setCellValue(rowDouble);
        } else
            cell.setCellValue(noRowData);

        cell = dataRow.createCell((short) 58);
        rowDouble = data.getMriPctChangeT2_T4();
        if (rowDouble != null) {
            cell.setCellValue(rowDouble);
        } else
            cell.setCellValue(noRowData);

        cell = dataRow.createCell((short) 59);
        rowDouble = data.getMriPctChangeT3_T4();
        if (rowDouble != null) {
            cell.setCellValue(rowDouble);
        } else
            cell.setCellValue(noRowData);

        //              Height               
        cell = dataRow.createCell((short) 60);
        rowLong = data.getHeight();
        if (rowLong != null) {
            cell.setCellValue(rowLong);
        } else
            cell.setCellValue(noRowData);

        // Weight               
        cell = dataRow.createCell((short) 61);
        rowLong = data.getWeight();
        if (rowLong != null) {
            cell.setCellValue(rowLong);
        } else
            cell.setCellValue(noRowData);

        // BSA             
        cell = dataRow.createCell((short) 62);
        rowDouble = data.getBsa();
        if (rowDouble != null) {
            cell.setCellValue(rowDouble);
        } else
            cell.setCellValue(noRowData);

        //  ERpos
        cell = dataRow.createCell((short) 63);
        rowData = data.getERpos();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              PgRpos
        cell = dataRow.createCell((short) 64);
        rowData = data.getPgRpos();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // FineNeedle
        cell = dataRow.createCell((short) 65);
        rowData = data.getFineNeedle();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // CoreNeedle
        cell = dataRow.createCell((short) 66);
        rowData = data.getCoreNeedle();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // Incisional
        cell = dataRow.createCell((short) 67);
        rowData = data.getIncisional();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // BilateralCa
        cell = dataRow.createCell((short) 68);
        rowData = data.getBilateralCa();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // Laterality
        cell = dataRow.createCell((short) 69);
        rowData = data.getLaterality();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // RtBrTD
        cell = dataRow.createCell((short) 70);
        rowData = data.getRtBrTD();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //  RtBoTD
        cell = dataRow.createCell((short) 71);
        rowData = data.getRtBoTD();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //  RtAxTD
        cell = dataRow.createCell((short) 72);
        rowData = data.getRtAxTD();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // RtSNTD
        cell = dataRow.createCell((short) 73);
        rowData = data.getRtSNTD();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //  RtIMTD
        cell = dataRow.createCell((short) 74);
        rowData = data.getRtIMTD();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //  RtCWTD
        cell = dataRow.createCell((short) 75);
        rowData = data.getRtCWTD();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //  RtOtTD
        cell = dataRow.createCell((short) 76);
        rowData = data.getRtOtTD();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              LocalProgress
        cell = dataRow.createCell((short) 77);
        rowData = data.getLocalProgress();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //     DistProgress
        cell = dataRow.createCell((short) 78);
        rowData = data.getDistProgress();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              T4Baseline
        cell = dataRow.createCell((short) 79);
        rowData = data.getT4Baseline();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              T4Early
        cell = dataRow.createCell((short) 80);
        rowData = data.getT4Early();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              T4Int
        cell = dataRow.createCell((short) 81);
        rowData = data.getT4Int();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              T4PreS
        cell = dataRow.createCell((short) 82);
        rowData = data.getT4PreS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              BaseAxillary
        cell = dataRow.createCell((short) 83);
        rowData = data.getBaseAxillary();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              EarlyAxillary
        cell = dataRow.createCell((short) 84);
        rowData = data.getEarlyAxillary();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              IntAxillary
        cell = dataRow.createCell((short) 85);
        rowData = data.getIntAxillary();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              PreSAxillary
        cell = dataRow.createCell((short) 86);
        rowData = data.getPreSAxillary();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              BaseInternalM
        cell = dataRow.createCell((short) 87);
        rowData = data.getBaseInternalM();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              EarlyInternalM
        cell = dataRow.createCell((short) 88);
        rowData = data.getEarlyInternalM();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              IntInternalM
        cell = dataRow.createCell((short) 89);
        rowData = data.getIntInternalM();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              PreSInternalM
        cell = dataRow.createCell((short) 90);
        rowData = data.getPreSInternalM();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              BaseSupra
        cell = dataRow.createCell((short) 91);
        rowData = data.getBaseSupra();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              EarlySupra
        cell = dataRow.createCell((short) 92);
        rowData = data.getEarlySupra();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              IntSupra
        cell = dataRow.createCell((short) 93);
        rowData = data.getIntSupra();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              PreSSupra
        cell = dataRow.createCell((short) 94);
        rowData = data.getPreSSupra();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              BaseInfra
        cell = dataRow.createCell((short) 95);
        rowData = data.getBaseInfra();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              EarlyInfra
        cell = dataRow.createCell((short) 96);
        rowData = data.getEarlyInfra();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              IntInfra
        cell = dataRow.createCell((short) 97);
        rowData = data.getIntInfra();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //              PreSInfra
        cell = dataRow.createCell((short) 98);
        rowData = data.getPreSInfra();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 99);
        rowData = data.getDCISOnlyPS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 100);
        rowData = data.getPtumor1szcm_micro_1();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 101);
        rowData = data.getHistologicGradePS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 102);
        rowData = data.getNumPosNodesPS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 103);
        rowData = data.getNodesExaminedPS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        cell = dataRow.createCell((short) 104);
        rowData = data.getPathologyStagePS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //inSituDz
        cell = dataRow.createCell((short) 105);
        rowData = data.getInSituDzPS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //inSituHisto
        cell = dataRow.createCell((short) 106);
        rowData = data.getInSituHistoPS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //inSituSpan
        cell = dataRow.createCell((short) 107);
        rowData = data.getInSituSpan();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //%InSitu
        cell = dataRow.createCell((short) 108);
        rowData = data.getPercentInSitu();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //InSituGrade

        cell = dataRow.createCell((short) 109);
        rowData = data.getInSituGradePS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // invDz

        cell = dataRow.createCell((short) 110);
        rowData = data.getInvDzPS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //invDzHisto

        cell = dataRow.createCell((short) 111);
        rowData = data.getInvDzHistoPS();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //lVI

        cell = dataRow.createCell((short) 112);
        rowData = data.getLVI();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // invDzMultiFoc

        cell = dataRow.createCell((short) 113);
        rowData = data.getInvDzMultiFoc();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //invDzCellularity

        cell = dataRow.createCell((short) 114);
        rowData = data.getInvDzCellularity();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //surgMargins

        cell = dataRow.createCell((short) 115);
        rowData = data.getSurgMargins();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //  metSzLN

        cell = dataRow.createCell((short) 116);
        rowData = data.getMetSzLN();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // yT

        cell = dataRow.createCell((short) 117);
        rowData = data.getYT();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // yN

        cell = dataRow.createCell((short) 118);
        rowData = data.getYN();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // yM

        cell = dataRow.createCell((short) 119);
        rowData = data.getYM();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // PCR

        cell = dataRow.createCell((short) 120);
        PcrType pcrType = data.getPcrType();
        if (pcrType != null) {
            rowData = pcrType.toString();
        } else
            rowData = noRowData;
        cell.setCellValue(rowData);

        // RCB Index
        cell = dataRow.createCell((short) 121);
        if (data.getRcbIndexSize() != null) {
            rowData = data.getRcbIndexSize().toString();
        }
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //rcbClass

        cell = dataRow.createCell((short) 122);
        rowData = data.getRcbClass();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //rCB_PATHSZ_1

        cell = dataRow.createCell((short) 123);
        rowData = data.getRCB_PATHSZ_1();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //rCB_PATHSZ_2

        cell = dataRow.createCell((short) 124);
        rowData = data.getRCB_PATHSZ_2();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // once implement this, make sure to remove PTUMOR1SZCM_MICRO
        //PTUMOR1SZCM_MICRO_1

        /*cell = dataRow.createCell((short) 86);
        rowData = data.getPtumor1szcm_micro_1();
        if(rowData==null)rowData = noRowData;
        cell.setCellValue(rowData);
        */

        // PTUMOR1SZCM_MICRO_2
        cell = dataRow.createCell((short) 125);
        rowData = data.getPtumor1szcm_micro_2();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // DFS

        cell = dataRow.createCell((short) 126);
        rowLong = data.getRFS();
        if (rowLong != null && rowLong.toString().indexOf("-") == -1) {
            cell.setCellValue(rowLong);
        } else
            cell.setCellValue(noRowData);

        // DFS_ind change to RFS_ind
        // change data type from Long to String

        cell = dataRow.createCell((short) 127);
        rowData = data.getRFS_ind();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //                rowLong = data.getRFS_ind();
        //                if(rowLong!=null){
        //                    cell.setCellValue(rowLong);
        //                }
        //                else cell.setCellValue(noRowData);

        // LocalSiteIpBreast

        cell = dataRow.createCell((short) 128);
        rowData = data.getLocalSiteIpBreast();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // LocalSiteAxillaryNode

        cell = dataRow.createCell((short) 129);
        rowData = data.getLocalSiteAxillaryNode();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // LocalSiteAxillaryNode

        cell = dataRow.createCell((short) 130);
        rowData = data.getLocalSiteSupraNode();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // LocalSiteChestW

        cell = dataRow.createCell((short) 131);
        rowData = data.getLocalSiteChestW();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // LocalSiteIMammaryN

        cell = dataRow.createCell((short) 132);
        rowData = data.getLocalSiteIMammaryN();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // LocalSiteInfrNodes

        cell = dataRow.createCell((short) 133);
        rowData = data.getLocalSiteInfrNodes();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // LocalSiteAxilla

        cell = dataRow.createCell((short) 134);
        rowData = data.getLocalSiteAxilla();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        //DistSite

        cell = dataRow.createCell((short) 135);
        rowData = data.getDistSite();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // LocalProgTimeD

        cell = dataRow.createCell((short) 136);
        rowLong = data.getLocalProgTimeD();
        if (rowLong != null && rowLong.toString().indexOf("-") == -1) {
            cell.setCellValue(rowLong);
        } else
            cell.setCellValue(noRowData);

        // DistProgTimeD

        cell = dataRow.createCell((short) 137);
        rowLong = data.getDistProgTimeD();
        if (rowLong != null) {
            cell.setCellValue(rowLong);
        } else
            cell.setCellValue(noRowData);

        // AromataseI

        cell = dataRow.createCell((short) 138);
        rowData = data.getAromataseI();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // OvarianSup

        cell = dataRow.createCell((short) 139);
        rowData = data.getOvarianSup();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

        // OvarianAbl

        cell = dataRow.createCell((short) 140);
        rowData = data.getOvarianAbl();
        if (rowData == null)
            rowData = noRowData;
        cell.setCellValue(rowData);

    }

    return wb;
}