function showPatientAssoc($attributes, $clsRpt, $volRec, $lVolID, $volClient) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- $bActive = $volRec->bActive; $attributes->bCloseDiv = false; $attributes->divID = 'pAssoc'; $attributes->divImageID = 'pAssocDivImg'; $attributes->lUnderscoreWidth = 400; if ($bActive) { $strLinkAddNewA = strLinkAdd_PatientAssociation($lVolID, 'Add patient association', true) . ' ' . strLinkAdd_PatientAssociation($lVolID, 'Add patient association', false); } else { $strLinkAddNewA = ''; } openBlock('Volunteer/Patient Associations', $strLinkAddNewA, $attributes); if (count($volClient) == 0) { echoT('<i>No associated patients</i>'); } else { echoT(' <table class="enpRpt"> <tr> <td class="enpRptLabel"> Patient ID </td> <td class="enpRptLabel"> Patient </td> <td class="enpRptLabel"> Status </td>'); if ($bActive) { echoT(' <td class="enpRptLabel"> </td> <td class="enpRptLabel"> </td>'); } echoT(' </tr>'); foreach ($volClient as $vc) { $bVCActive = $vc->bActive; if ($bVCActive) { $strALabel = 'Set inactive'; $lRowSpan = 3; $strNameColor = '#000'; } else { $strALabel = 'Set active'; $lRowSpan = 2; $strNameColor = '#999'; } $lAssocID = $vc->lKeyID; $lPatientID = $vc->lPatientID; echoT(' <tr class="makeStripe"> <td style="vertical-align: top; color: ' . $strNameColor . ';" class="enpRpt">' . strLinkView_PatientRecord($lPatientID, 'View patient record', true) . ' ' . str_pad($lPatientID, 5, '0', STR_PAD_LEFT) . ' </td>'); echoT(' <td style="vertical-align: top; padding-right: 8px; color: ' . $strNameColor . ';" class="enpRpt">' . htmlspecialchars($vc->patient->strLName . ', ' . $vc->patient->strFName) . ' </td>'); echoT(' <td style="vertical-align: top; padding-right: 8px; color: ' . $strNameColor . ';" class="enpRpt">' . ($bVCActive ? '<b>Active</b>' : 'Inactive') . ' </td>'); if ($bActive) { if ($bVCActive) { echoT(' <td style="vertical-align: top;" class="enpRpt">' . strLinkAdd_HospicePVist($lVolID, $vc->lPatientID, 'Add patient visit', true) . ' ' . strLinkAdd_HospicePVist($lVolID, $vc->lPatientID, 'Add patient visit', false) . ' </td>'); } else { echoT(' <td style="vertical-align: top;" class="enpRpt"> </td>'); } echoT(' <td style="vertical-align: top;" class="enpRpt">' . strLink_VolAssocActiveInactive($lVolID, $lAssocID, !$bActive, $strALabel, true) . ' ' . strLink_VolAssocActiveInactive($lVolID, $lAssocID, !$bActive, $strALabel, false) . ' </td>'); } echoT(' </tr>'); } echoT('</table>'); } $attributes->bCloseDiv = true; closeBlock($attributes); }
echoT($clsRpt->openRow(true)); echoT($clsRpt->writeCell($lRowIDX, '', 'text-align: center;')); echoT($clsRpt->writeCell(strLinkView_PatientRecord($lPatientID, 'View patient record', true, ' id="prec_' . $lPatientID . '" ') . ' ' . str_pad($lPatientID, 5, '0', STR_PAD_LEFT), 60, $strStyleActive . 'text-align: center;')); echoT($clsRpt->writeCell(strLink_PatientActiveInactive($lPatientID, !$bActive, $bActive ? 'Set Inactive' : 'Activate', true), 30, $strStyleActive . 'text-align: center;')); echoT($clsRpt->writeCell('<b>' . $patient->strSafeNameLF . '</b><br>DOB: ' . $patient->dteBirth, 170, $strStyleActive)); echoT($clsRpt->writeCell($patient->strAddress, 170, $strStyleActive)); //--------------------------- // volunteer associations //--------------------------- if (count($patient->volClient) == 0) { echoT($clsRpt->writeCell('- none -', $lVolWidth, 'text-align: center;')); } else { $strVols = '<ul style="list-style-position: inside; list-style-type: square; display:inline; margin-left: 0pt; padding-left: 0pt;">'; foreach ($patient->volClient as $vc) { $strVols .= '<li>' . htmlspecialchars($vc->vol->strLName . ', ' . $vc->vol->strFName) . ' ' . strLinkAdd_HospicePVist($vc->lVolID, $vc->lPatientID, 'Add visit', false, ' id="apv_' . $vc->lVolID . '_' . $vc->lPatientID . ' " ') . '</li>'; } echoT($clsRpt->writeCell($strVols . '</ul>', $lVolWidth, '')); } //--------------------------- // patient contacts //--------------------------- $strLinkAddNewPC = strLinkAdd_PatientContact($lPatientID, 'Add patient contact', true, ' id="newPCon_' . $lPatientID . '" ') . ' ' . strLinkAdd_PatientContact($lPatientID, 'Add patient contact', false); if (count($patient->pContacts) == 0) { echoT($clsRpt->writeCell('<span style="text-align: center; margin-left: 40pt;">- none -</span><br>' . $strLinkAddNewPC, '200pt;', '')); } else { $strPC = ''; foreach ($patient->pContacts[0]->contacts as $pc) { $lPConID = $pc->lContactID; $strPC .= trim(htmlspecialchars($pc->strPConTitle . ' ' . $pc->strFName . ' ' . $pc->strLName . ' (' . $pc->strRelationship . ')')) . strLinkView_PContact($lPConID, 'View patient contact record', true, ' id="viewPCon_' . $lPConID . '" ') . '<br>'; }
$strNameColor = '#999'; } if ($bInactive) { $lRowSpan = 1; } $lAssocID = $vc->lKeyID; $lPatientID = $vc->lPatientID; if ($bInactive) { $strNameColor = '#999'; } $strPatients .= '<tr> <td style="vertical-align: top; padding-right: 8px; color: ' . $strNameColor . ';" rowspan=' . $lRowSpan . '>' . htmlspecialchars($vc->patient->strLName . ', ' . $vc->patient->strFName) . ' </td>'; if (!$bInactive && $bVAActive) { $strPatients .= ' <td style="vertical-align: top;">' . strLinkAdd_HospicePVist($lVolID, $vc->lPatientID, 'Patient visit', true, ' id="addVisit_' . $lVolID . '_' . $vc->lPatientID . '" ') . ' ' . strLinkAdd_HospicePVist($lVolID, $vc->lPatientID, 'Patient visit', false) . ' </td> </tr> <tr>'; } if (!$bInactive) { $strPatients .= ' <td style="vertical-align: top;">' . strLink_VolAssocActiveInactive($lVolID, $lAssocID, !$bVAActive, $strALabel, true) . ' ' . strLink_VolAssocActiveInactive($lVolID, $lAssocID, !$bVAActive, $strALabel, false) . ' </td> </tr> <tr> <td style="vertical-align: top; padding-bottom: 8px;">' . strLinkView_PatientRecord($lPatientID, 'View patient record', true) . ' patient ID: ' . str_pad($lPatientID, 5, '0', STR_PAD_LEFT) . ' </td>'; } $strPatients .= ' </tr>';