function setGpRelation($type1, $id1, $type2, $id2, $set = TRUE) { if (isGpRelation($type1, $id1, $type2, $id2)) { if (!$set) { sqlStatement("DELETE FROM gprelations WHERE " . "type1 = {$type1} AND id1 = {$id1} AND type2 = {$type2} AND id2 = {$id2}"); } } else { if ($set) { sqlStatement("INSERT INTO gprelations " . "( type1, id1, type2, id2 ) VALUES " . "( {$type1}, {$id1}, {$type2}, {$id2} )"); } } }
function setGpRelation($type1, $id1, $type2, $id2, $set = TRUE) { if (isGpRelation($type1, $id1, $type2, $id2)) { if (!$set) { sqlStatement("DELETE FROM gprelations WHERE " . "type1 = ? AND id1 = ? AND type2 = ? AND id2 = ?", array($type1, $id1, $type2, $id2)); } } else { if ($set) { sqlStatement("INSERT INTO gprelations " . "( type1, id1, type2, id2 ) VALUES " . "( ?, ?, ?, ? )", array($type1, $id1, $type2, $id2)); } } }
foreach ($result_sent as $iter) { $result_sent_count++; $row_note_id = $iter['id']; $linked = ""; if ($docid) { if (isGpRelation(1, $docid, 6, $row_note_id)) { $linked = "checked"; } else { // Skip unlinked notes if that is requested. if ($form_doc_only) { continue; } } } else { if ($orderid) { if (isGpRelation(2, $orderid, 6, $row_note_id)) { $linked = "checked"; } else { // Skip unlinked notes if that is requested. if ($form_doc_only) { continue; } } } } $body = $iter['body']; if (preg_match('/^\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d\\:\\d\\d /', $body)) { $body = nl2br(htmlspecialchars(oeFormatPatientNote($body), ENT_NOQUOTES)); } else { $body = htmlspecialchars(oeFormatSDFT(strtotime($iter['date'])) . date(' H:i', strtotime($iter['date'])), ENT_NOQUOTES) . ' (' . htmlspecialchars($iter['user'], ENT_NOQUOTES) . ') ' . nl2br(htmlspecialchars(oeFormatPatientNote($body), ENT_NOQUOTES)); }
// from previous dates, up to a certain number, $N if ($result != "") { echo " <tr class=showborder_head align='left'>\n"; echo " <th style='width:100px';> </th>\n"; echo " <th>" . htmlspecialchars(xl('Active'), ENT_NOQUOTES) . " </th>\n"; echo " <th>" . ($docid ? htmlspecialchars(xl('Linked'), ENT_NOQUOTES) : '') . "</th>\n"; echo " <th>" . htmlspecialchars(xl('Type'), ENT_NOQUOTES) . "</th>\n"; echo " <th>" . htmlspecialchars(xl('Content'), ENT_NOQUOTES) . "</th>\n"; echo " </tr>\n"; $result_count = 0; foreach ($result as $iter) { $result_count++; $row_note_id = $iter['id']; $linked = ""; if ($docid) { if (isGpRelation(1, $docid, 6, $row_note_id)) { $linked = "checked"; } else { // Skip unlinked notes if that is requested. if ($form_doc_only) { continue; } } } $body = $iter['body']; if (preg_match('/^\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d\\:\\d\\d /', $body)) { $body = nl2br(htmlspecialchars(oeFormatPatientNote($body), ENT_NOQUOTES)); } else { $body = htmlspecialchars(oeFormatSDFT(strtotime($iter['date'])) . date(' H:i', strtotime($iter['date'])), ENT_NOQUOTES) . ' (' . htmlspecialchars($iter['user'], ENT_NOQUOTES) . ') ' . nl2br(htmlspecialchars(oeFormatPatientNote($body), ENT_NOQUOTES)); } if ($iter["activity"]) {