forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for CPOE, labs, and messaging contributed by Thomas Wong
- Loading branch information
bradymiller
committed
Mar 24, 2010
1 parent
4b0be92
commit 17fedad
Showing
17 changed files
with
1,194 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
// Copyright (C) 2010 OpenEMR Support LLC | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License | ||
// as published by the Free Software Foundation; either version 2 | ||
// of the License, or (at your option) any later version. | ||
|
||
require_once("$include_root/globals.php"); | ||
require_once("$srcdir/pnotes.inc"); | ||
require_once("$srcdir/patient.inc"); | ||
require_once("$srcdir/auth.inc"); | ||
include_once("$srcdir/formdata.inc.php"); | ||
|
||
function lab_results_messages($set_pid, $rid, $provider_id="") { | ||
if ($provider_id != "") { | ||
$where = "AND id = '".$provider_id."'"; | ||
} | ||
// Get all active users. | ||
$rez = sqlStatement("select id, username from users where username != '' AND active = '1' $where"); | ||
for ($iter = 0; $row = sqlFetchArray($rez); $iter++) { | ||
$result[$iter] = $row; | ||
} | ||
|
||
if (!empty($result)) { | ||
foreach ($result as $user_detail) { | ||
unset($thisauth); // Make sure it is empty. | ||
// Check user authorization. Only send the panding review message to authorised user. | ||
// $thisauth = acl_check('patients', 'sign', $user_detail['username']); | ||
|
||
// if not given prrovider, send messages to admin (super user) | ||
if ($provider_id == "") { | ||
$thisauth = acl_check('admin', 'super', $user_detail['username']); | ||
} | ||
else { | ||
$thisauth = true; | ||
} | ||
|
||
if ($thisauth) { | ||
// Send messages to selected users when there is a new lab report. | ||
$userauthorized = formData("userauthorized"); | ||
$pname = getPatientName($set_pid); | ||
$link = "<a href='../../orders/orders_results.php?review=1&set_pid=$set_pid'" . | ||
" onclick='return top.restoreSession()'>here</a>"; | ||
$note = "Patient $pname's lab results have arrived. Please click $link to review them.<br/>"; | ||
$note_type = "Lab Results"; | ||
$messsage_status = "New"; | ||
// Add pnote. | ||
$noteid = addPnote($set_pid, $note, $userauthorized, '1', $note_type, $user_detail['username']); | ||
sqlQ("update pnotes set message_status='".$messsage_status."' where id = '$noteid'"); | ||
} | ||
} | ||
} | ||
} | ||
|
||
?> |
Oops, something went wrong.