Beispiel #1
0
 public function updateStatus($data)
 {
     if (UserService::valid($data[0]) == 'existingpatient') {
         require_once "../../library/pnotes.inc";
         foreach ($data[1] as $id) {
             updatePnoteMessageStatus($id, $data[2]);
         }
     } else {
         throw new SoapFault("Server", "credentials failed");
     }
 }
Beispiel #2
0
                 $note .= $row['body'];
             }
             // There's no note ID, and/or it's assigned to the patient.
             // In these cases a new note is created.
             addPnote($reply_to, $note, $userauthorized, '1', $form_note_type, $assigned_to, '', $form_message_status);
         }
     }
     break;
 case "savePatient":
 case "save":
     // Update alert.
     $noteid = $_POST['noteid'];
     $form_message_status = $_POST['form_message_status'];
     $reply_to = $_POST['reply_to'];
     if ($task == "save") {
         updatePnoteMessageStatus($noteid, $form_message_status);
     } else {
         updatePnotePatient($noteid, $reply_to);
     }
     $task = "edit";
     $note = $_POST['note'];
     $title = $_POST['form_note_type'];
     $reply_to = $_POST['reply_to'];
 case "edit":
     if ($noteid == "") {
         $noteid = $_GET['noteid'];
     }
     // Update the message if it already exists; it's appended to an existing note in Patient Notes.
     $result = getPnoteById($noteid);
     if ($result) {
         if ($title == "") {
Beispiel #3
0
$title = $_POST['title'];
$newtext = $_POST['newtext'];
$assigned_to = $_POST['assigned_to'];
$message_status = $_POST['message_status'];
$message_id = isset($_POST['message_id']) && !empty($_POST['message_id']) ? $_POST['message_id'] : '';
if ($userId = validateToken($token)) {
    $user = getUsername($userId);
    $acl_allow = acl_check('patients', 'notes', $user);
    if ($acl_allow) {
        $provider_id = $userId;
        $assigned_to_array = explode(',', $assigned_to);
        $_SESSION['authUser'] = $user;
        $_SESSION['authProvider'] = 'Default';
        foreach ($assigned_to_array as $assignee) {
            if ($message_status == 'Done' && !empty($message_id)) {
                updatePnoteMessageStatus($message_id, $message_status);
                $result = 1;
                break;
            } else {
                $result = addPnote($patientId, $newtext, $authorized, $activity, $title, $assignee, $datetime = '', $message_status);
                $device_token_badge = getDeviceTokenBadge($assignee, 'message');
                $badge = $device_token_badge['badge'];
                $deviceToken = $device_token_badge['device_token'];
                if ($deviceToken) {
                    $notification_res = notification($deviceToken, $badge, $msg_count = 0, $apt_count = 0, $message = 'New Message Notification!');
                }
            }
        }
        if ($result) {
            $xml_string .= "<status>0</status>";
            $xml_string .= "<reason>Message send successfully</reason>";