// Do calculations for combination drugs, so we can add market share, cost, efficacies to dosage listings for (Dosages it : dosages) { if (it.getfullname().contains("_")) { String[] temp = it.getfullname().split("-"); String[] temp_two = temp[0].split("_"); String[] temp_three = temp[1].split("/"); String drugone = temp_two[0] + "-" + temp_three[0]; String drugtwo = temp_two[1] + "-" + temp_three[1]; // Now that we have separate the combination drug into two separate drugs with doses // We can figure out the proper lipid levels Double[][] drug_efficacy = new Double[2][4]; for (Dosages it_two : dosages) { if (it_two.getfullname().equals(drugone)) { drug_efficacy[0][0] = it_two.getefficacy_ldl(); drug_efficacy[0][1] = it_two.getefficacy_hdl(); drug_efficacy[0][2] = it_two.getefficacy_tg(); drug_efficacy[0][3] = it_two.getefficacy_tcho(); } if (it_two.getfullname().equals(drugtwo)) { drug_efficacy[1][0] = it_two.getefficacy_ldl(); drug_efficacy[1][1] = it_two.getefficacy_hdl(); drug_efficacy[1][2] = it_two.getefficacy_tg(); drug_efficacy[1][3] = it_two.getefficacy_tcho(); } } it.setefficacy_ldl(drug_efficacy[0][0] * (1 + (drug_efficacy[1][0]/drug_efficacy[0][0]))); it.setefficacy_hdl(drug_efficacy[0][1] * (1 + (drug_efficacy[1][1]/drug_efficacy[0][1]))); it.setefficacy_tg(drug_efficacy[0][2] * (1 + (drug_efficacy[1][2]/drug_efficacy[0][2]))); it.setefficacy_tcho(drug_efficacy[0][3] * (1 + (drug_efficacy[1][3]/drug_efficacy[0][3]))); } }