FreeMED. Messages

Summary
Retrieve message by message id key
Convert a recipients field (comma delimited users) into a list of user names.
Remove a message from the system by its id key
Send a message using the FreeMED messaging system
Get all messages for this user or patient.
Get all messages associated with a patient
Get all messages associated with the current user

Functions

get

function get ($message)

Retrieve message by message id key

Parameters

$messageMessage id key

Returns

Associative array containing message information.

recipients_to_text

function recipients_to_text ($recip)

Convert a recipients field (comma delimited users) into a list of user names.

Parameters

$recip’msgrecip’ field

Returns

Comma-delimited list of user names

remove

function remove ($message_id)

Remove a message from the system by its id key

Parameters

$message_idMessage id key

Returns

Boolean, successful

send

function send ($message)

Send a message using the FreeMED messaging system

Parameters

$messageAssociative array containing information describing the message.

Returns

Boolean, successful

view

function view ($unread_only = false,
$patient = NULL)

Get all messages for this user or patient.  Use view_per_user and view_per_patient instead of using this function directly.

Parameters

$unread_only(optional) Whether to retrieve messages that are unread, or if false to return all messages whether they have been read or not.  Defaults to false.
$patient(optional) Which patient to view messages for.  This causes the search criteria to be per patient, not per user.  This is wrapped by view_per_patient.

Returns

Array of associative arrays containing message information, or boolean false if there are no messages.

See Also

view_per_patient view_per_user

view_per_patient

function view_per_patient ($patient,  
$unread_only =  false)

Get all messages associated with a patient

Parameters

$patientPatient id key
$unread_only(optional) Boolean, restrict to unread messages only.  Defaults to false.

Returns

Array of associative arrays containing message information.

See Also

view view_per_user

view_per_user

function view_per_user ($unread_only =  false)

Get all messages associated with the current user

Parameters

$unread_only(optional) Boolean, restrict to unread messages only.  Defaults to false.

Returns

Array of associative arrays containing message information.

See Also

view view_per_patient

function get ($message)
Retrieve message by message id key
function recipients_to_text ($recip)
Convert a recipients field (comma delimited users) into a list of user names.
function remove ($message_id)
Remove a message from the system by its id key
function send ($message)
Send a message using the FreeMED messaging system
function view ($unread_only = false,
$patient = NULL)
Get all messages for this user or patient.
function view_per_patient ($patient,  
$unread_only =  false)
Get all messages associated with a patient
function view_per_user ($unread_only =  false)
Get all messages associated with the current user