while ($rowPart2 = mysqli_fetch_array($resPart2)) { $AdrTerminology = $rowPart2['AdrTerminology']; $socMeddra = $rowPart2['socMeddra']; $Adr_onsetDate = dateChecker($rowPart2['Adr_onsetDate']); $Adr_rctFirstTime = $rowPart2['Adr_rctFirstTime']; $Adr_rctFirstTimeUnit = getAgeUnitByValue($con, $rowPart2['Adr_rctFirstTimeUnit']); $Adr_outcome = getOutcomeByValue($con, $rowPart2['Adr_outcome']); $seriousness = $rowPart2['seriousness']; if ($seriousness == 1) { $seriousness = "Yes"; } else { if ($seriousness == 2) { $seriousness = "No"; } } $seriousnessCrit = getSeriousnessCritByValue($con, $rowPart2['seriousnessCrit']); $AdrTerminology = $rowPart2['AdrTerminology']; $part2Table .= "<tr> <td>{$AdrTerminology}</td> <td>{$socMeddra}</td> <td>{$Adr_onsetDate}</td> <td>{$Adr_rctFirstTime} {$Adr_rctFirstTimeUnit}</td> <td>{$Adr_outcome}</td> <td>{$seriousness}</td> <td>{$seriousnessCrit}</td> <td></td> </tr>"; } } else { $part2Table .= "<tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr>"; } $part2Table .= "</table>"; } $sqlPart3 = "SELECT DISTINCT adrDrugListID, suspected, actvIngredient, product_name, route, dosage, dosageUnit, doseInterval, indication, therapy_start, therapy_stop \n\t\t\t\t\t\t\t\t\tFROM adr_druglist WHERE adrFormID = '{$fID}'"; $resPart3 = mysqli_query($con, $sqlPart3); if ($resPart3) { $part3Table = "<table border='1' class='table table-condensed table-bordered'><tr class='dark'><td colspan='8'> <b> DRUG DETAILS </b> </td></tr><tr><td> Characterisation </td><td> Active Ingredient </td><td> Product Name </td><td> Route </td><td> Dose / Dose Unit </td><td> Dose Frequency </td><td> Indication </td><td> Therapy Start Date - Therapy Stop Date </td></tr>"; if (mysqli_num_rows($resPart3) > 0) { while ($rowPart3 = mysqli_fetch_array($resPart3)) { $suspected = $rowPart3['suspected'];
// $labTable .= '<tr> <td>'.$LDS_TESTTYPE.'</td> <td>'.$LDS_RESDATE.'</td> <td>'.$LDS_RES.'</td> </tr>'; // } // } // } // $labTable .= '</table>'; $adetailSql = "SELECT adrDetailID, adrFormID, AdrDesc, AdrSkinReactYesNo, AdrCutaneous, AdrBodyPart, \n\t\t\tAdrTerminology, DATE_FORMAT(Adr_onsetDate, '%d/%m/%Y') AS Adr_onsetDate, DATE_FORMAT(Adr_endDate, '%d/%m/%Y') AS Adr_endDate, Adr_Dur, Adr_durUnit, Adr_treat, Adr_rctFirstTime, \n\t\t\tAdr_rctFirstTimeUnit, Adr_rctLastTime, Adr_rctLastTimeUnit, Adr_Extent, Adr_outcome, Adr_dateofDeath, \n\t\t\tAdr_causeofDeath, Adr_autopsyyesno, Adr_detDeath, meddraTerm, socMeddra, seriousness, seriousnessCrit\n\t\t\tFROM adrdetail WHERE adrFormID = '{$formID}'"; $adetailRes = mysqli_query($con, $adetailSql); if ($adetailRes) { if (mysqli_num_rows($adetailRes) > 0) { $adetailRows = mysqli_fetch_array($adetailRes); $Adr_onsetDate = $adetailRows['Adr_onsetDate']; $Adr_endDate = $adetailRows['Adr_endDate']; $Adr_Dur = $adetailRows['Adr_durUnit']; $Adr_outcome = $adetailRows['Adr_outcome']; $seriousness = getYesNo($adetailRows['seriousness']); $seriousnessCrit = getSeriousnessCritByValue($con, $adetailRows['seriousnessCrit']); $Adr_dateofDeath = $adetailRows['Adr_dateofDeath']; $Adr_causeofDeath = $adetailRows['Adr_causeofDeath']; $Adr_autopsyyesno = getYesNo($adetailRows['Adr_autopsyyesno']); $Adr_detDeath = $adetailRows['Adr_detDeath']; $Adr_treat = $adetailRows['Adr_treat']; $Adr_rctFirstTime = $adetailRows['Adr_rctFirstTime']; $Adr_rctFirstTimeUnit = getAgeUnitByValue($con, $adetailRows['Adr_rctFirstTimeUnit']); } } // DRUG TABLE $drugTable = '<table border="1" cellpadding="1"> <tr> <th>Chracterisation</th> <th>Product</th> <th>MAL No.</th> <th>Active Ingredient</th> <th>Dose / Dose Unit</th> <th>Dose Frequency</th> <th>Indication</th> <th>Therapy Start Date</th> <th>Therapy Stop Date</th> <th>Relatedness</th> </tr>'; $adrugSql = "SELECT DISTINCT adrFormID, product_name, dosage, dosageUnit, DATE_FORMAT(therapy_start, '%d/%m/%Y') AS therapy_start, DATE_FORMAT(therapy_stop, '%d/%m/%Y') AS therapy_stop, \n\t\t\tsuspected, indication, unit, freq, route, generic, icdcode, dcount, drug_cat, manf, pharm_gr, drug_gr, \n\t\t\tduration, atccode, product_ref, sus_state, req_holder, MALnum, actvIngredient, Pharmaceutical, \n\t\t\tPharmacological, doseInterval, doseIntervalUnit, doseIntervalUnitOtr, cumDoseDay, cumDoseDayUnit, \n\t\t\tdrugAction, relatedness, actionTaken, subsided, reappear, rptrCmmt, conserf_reason, conserf_medType\n\t\t\tFROM adr_druglist WHERE adrFormID = '{$formID}'"; $adrugRes = mysqli_query($con, $adrugSql); if ($adrugRes) { if (mysqli_num_rows($adrugRes) > 0) {
function getReactionStrByFormID($con, $formID) { $sql = "SELECT DISTINCT adrDetailID, AdrTerminology, socMeddra, Adr_onsetDate, Adr_rctFirstTime, Adr_rctFirstTimeUnit, Adr_outcome, seriousness, seriousnessCrit\n\tFROM adrdetail WHERE adrFormID = '{$formID}'"; $res = mysqli_query($con, $sql); $adrStr = "<table class='table table-condensed table-bordered table-hover'>"; if ($res) { if (mysqli_num_rows($res) > 0) { while ($row = mysqli_fetch_array($res)) { $AdrTerminology = $row['AdrTerminology']; $socMeddra = $row['socMeddra']; $Adr_onsetDate = dateChecker($row['Adr_onsetDate']); $Adr_rctFirstTime = $row['Adr_rctFirstTime']; $Adr_rctFirstTimeUnit = getAgeUnitByValue($con, $row['Adr_rctFirstTimeUnit']); $Adr_outcome = getOutcomeByValue($con, $row['Adr_outcome']); $seriousness = $row['seriousness']; if ($seriousness == 1) { $seriousness = "Yes"; } else { if ($seriousness == 2) { $seriousness = "No"; } else { $seriousness = ""; } } $seriousnessCrit = getSeriousnessCritByValue($con, $row['seriousnessCrit']); $adrStr .= "<tr>\n\t\t\t\t<td>\n\t\t\t\t\tADR Terminology: {$AdrTerminology} <br/>\n\t\t\t\t\tSystem Organ Class: {$socMeddra} <br/>\n\t\t\t\t\tDate of Onset: {$Adr_onsetDate} <br/>\n\t\t\t\t\tOnset of Reaction / Time Interval Unit: {$Adr_rctFirstTime} {$Adr_rctFirstTimeUnit} <br/>\n\t\t\t\t\tOutcome of Reaction: {$Adr_outcome} <br/>\n\t\t\t\t\tSeriousness: {$seriousness} <br/>\n\t\t\t\t\tSeriousness Criteria: {$seriousnessCrit} <br/>\n\t\t\t\t</td>\n\t\t\t</tr>"; } $adrStr .= "</table>"; } else { $adrStr .= "No Drug Found"; } } else { $adrStr .= "E"; } return $adrStr; }