Exemple #1
0
             $catrow = sqlQuery("SELECT name, parent FROM categories WHERE id = '{$tmp}'");
             $note = $catrow['name'] . "/{$note}";
             $tmp = $catrow['parent'];
         }
         $note = "New scanned document {$newid}: {$note}";
         $form_note_message = trim($_POST['form_note_message']);
         if (get_magic_quotes_gpc()) {
             $form_note_message = stripslashes($form_note_message);
         }
         if ($form_note_message) {
             $note .= "\n" . $form_note_message;
         }
         // addPnote() will do its own addslashes().
         $noteid = addPnote($_POST['form_pid'], $note, $userauthorized, '1', $_POST['form_note_type'], $_POST['form_note_to']);
         // Link the new patient note to the document.
         setGpRelation(1, $newid, 6, $noteid);
     }
     // end post patient note
 } else {
     // Get desired $encounter_id.
     $encounter_id = 0;
     if (empty($_POST['form_copy_sn_visit'])) {
         $info_msg .= "This patient has no visits! ";
     } else {
         $encounter_id = 0 + $_POST['form_copy_sn_visit'];
     }
     if (!$info_msg) {
         // Merge the selected pages.
         $info_msg .= mergeTiffs();
         $tmp_name = "{$faxcache}/temp.tif";
     }
                    setGpRelation(2, $orderid, 6, $id, !empty($_POST["lnk{$id}"]));
                }
            }
        }
    } elseif ($mode == "new") {
        $note = $_POST['note'];
        if ($noteid) {
            updatePnote($noteid, $note, $_POST['form_note_type'], $_POST['assigned_to']);
        } else {
            $noteid = addPnote($patient_id, $note, $userauthorized, '1', $_POST['form_note_type'], $_POST['assigned_to']);
        }
        if ($docid) {
            setGpRelation(1, $docid, 6, $noteid);
        }
        if ($orderid) {
            setGpRelation(2, $orderid, 6, $noteid);
        }
        $noteid = '';
    } elseif ($mode == "delete") {
        if ($noteid) {
            deletePnote($noteid);
            newEvent("delete", $_SESSION['authUser'], $_SESSION['authProvider'], 1, "pnotes: id " . $noteid);
        }
        $noteid = '';
    }
}
$title = '';
$assigned_to = $_SESSION['authUser'];
if ($noteid) {
    $prow = getPnoteById($noteid, 'title,assigned_to,body');
    $title = $prow['title'];
Exemple #3
0
// form parameter docid can be passed to restrict the display to a document.
$docid = empty($_REQUEST['docid']) ? 0 : 0 + $_REQUEST['docid'];
// this code handles changing the state of activity tags when the user updates
// them through the interface
if (isset($mode)) {
    if ($mode == "update") {
        foreach ($_POST as $var => $val) {
            if (strncmp($var, 'act', 3) == 0) {
                $id = str_replace("act", "", $var);
                if ($_POST["chk{$id}"]) {
                    reappearPnote($id);
                } else {
                    disappearPnote($id);
                }
                if ($docid) {
                    setGpRelation(1, $docid, 6, $id, !empty($_POST["lnk{$id}"]));
                }
            }
        }
    } elseif ($mode == "new") {
        $note = $_POST['note'];
        if ($noteid) {
            updatePnote($noteid, $note, $_POST['form_note_type'], $_POST['assigned_to']);
            $noteid = '';
        } else {
            addPnote($pid, $note, $userauthorized, '1', $_POST['form_note_type'], $_POST['assigned_to']);
        }
    } elseif ($mode == "delete") {
        if ($noteid) {
            deletePnote($noteid);
            newEvent("delete", $_SESSION['authUser'], $_SESSION['authProvider'], 1, "pnotes: id " . $noteid);
Exemple #4
0
 /**
  * Post a patient note that is linked to this document.
  *
  * @param  string  $provider     Login name of the provider to receive this note.
  * @param  integer $category_id  The desired document category ID
  * @param  string  $message      Any desired message text for the note.
  */
 function postPatientNote($provider, $category_id, $message = '')
 {
     // Build note text in a way that identifies the new document.
     // See pnotes_full.php which uses this to auto-display the document.
     $note = $this->get_url_file();
     for ($tmp = $category_id; $tmp;) {
         $catrow = sqlQuery("SELECT name, parent FROM categories WHERE id = ?", array($tmp));
         $note = $catrow['name'] . "/{$note}";
         $tmp = $catrow['parent'];
     }
     $note = "New scanned document " . $this->get_id() . ": {$note}";
     if ($message) {
         $note .= "\n" . $message;
     }
     $noteid = addPnote($this->get_foreign_id(), $note, 0, '1', 'New Document', $provider);
     // Link the new note to the document.
     setGpRelation(1, $this->get_id(), 6, $noteid);
 }
 function image_result_indication($doc_id, $encounter, $image_procedure_id = 0)
 {
     $doc_notes = sqlQuery("select note from notes where foreign_id = ?", array($doc_id));
     $narration = isset($doc_notes['note']) ? 'With Narration' : 'Without Narration';
     if ($encounter != 0) {
         $ep = sqlQuery("select u.username as assigned_to from form_encounter inner join users u on u.id = provider_id where encounter = ?", array($encounter));
     } else {
         if ($image_procedure_id != 0) {
             $ep = sqlQuery("select u.username as assigned_to from procedure_order inner join users u on u.id = provider_id where procedure_order_id = ?", array($image_procedure_id));
         } else {
             $ep = array('assigned_to' => $_SESSION['authUser']);
         }
     }
     $encounter_provider = isset($ep['assigned_to']) ? $ep['assigned_to'] : $_SESSION['authUser'];
     $noteid = addPnote($_SESSION['pid'], 'New Image Report received ' . $narration, 0, 1, 'Image Results', $encounter_provider, '', 'New', '');
     setGpRelation(1, $doc_id, 6, $noteid);
 }