Calendar API

Calendar and date related functions.  These are not included unless needed.

Summary
Calendar and date related functions.
Determine if a date falls between a beginning and end date.
Check to see if date is in the past
Get the text name of a day of the week
Form a human readable time string from an hour and a minute.
Scroll a given date back by a month
Scroll a given date forward by a month
Retrieve starting hour for booking in the scheduler.
Retrieve ending hour for booking in the scheduler.
Create an “interference map” which allows the system to determine which appointments may conflict with others based on several criteria.
Check to see whether an entry exists in a particular interference map.
Creates AM/PM user-friendly hour display.
Creates AM/PM user-friendly time display.
Display calendar event from scheduler.
Return proper names for special event mappings, as per the group calendar and Travel.
Creates a scheduler map.
Determine whether an appointment of the specified duration at the specified time will fit in the specified map.
Creates a blank scheduler map.
Creates 3rd generation multiple scheduling map.
Increment time slot by 15 minutes.

Functions

date_in_range

function date_in_range ($checkdate,
$dtbegin,
$dtend)

Determine if a date falls between a beginning and end date.

Parameters

$checkdateDate to check.  Should be in ANSI SQL date format (YYYY-MM-DD).
$dtbeginBeginning of time span to compare against.
$dtendEnding of time span to compare against.

Returns

Boolean value, whether date falls between specified dates.

date_in_the_past

function date_in_the_past ($datestamp)

Check to see if date is in the past

Parameters

$dateSQL formatted date string (YYYY-MM-DD)

Returns

Boolean, true if date is past, false if date is present or future.

day_of_the_week

function day_of_the_week ($this_date = "",
$short = false)

Get the text name of a day of the week

Parameters

$this_date(optional) Date to examine.  Defaults to the current date.
$short(optional) Return short date format.  Defaults to false.

Returns

Text string describing the day of the week.

fc_get_time_string

function fc_get_time_string ($hour,
$minute)

Form a human readable time string from an hour and a minute.

Parameters

$hourHour in 24 hour format (0 to 24).
$minuteMinutes (0 to 60).

Returns

Formatted time string.

fc_scroll_prev_month

function fc_scroll_prev_month ($given_date = "")

Scroll a given date back by a month

Parameters

$given_date(optional) Date to scroll back from in SQL date format (YYYY-MM-DD).  Defaults to current date.

Returns

SQL formatted date string for a date approximately one month previous to the given date.

fc_scroll_next_month

function fc_scroll_next_month ($given_date = "")

Scroll a given date forward by a month

Parameters

$given_date(optional) Date to scroll forward from in SQL date format (YYYY-MM-DD).  Defaults to current date.

Returns

SQL formatted date string for a date approximately one month after the given date.

fc_starting_hour

function fc_starting_hour ()

Retrieve starting hour for booking in the scheduler.

Returns

Starting hour of booking for the scheduler.

fc_ending_hour

function fc_ending_hour ()

Retrieve ending hour for booking in the scheduler.

Returns

Ending hour of booking for the scheduler.

fc_generate_interference_map

function fc_generate_interference_map ($query_part,  
$this_date,  
$privacy = false)

Create an “interference map” which allows the system to determine which appointments may conflict with others based on several criteria.

Parameters

$query_partSQL qualifiers to narrow the search parameters.  Example: “calphysician=’2’”
$this_dateDate that the interference map is being generated for, in SQL date format (YYYY-MM-DD).
$privacy(optional) If this is specified, only the initials of the patients in question will be displayed.  Defaults to false.

Returns

Multidimentional hash/array (interference map).

fc_check_interference_map

function fc_check_interference_map ($hour,
$minute,
$check_date,
$querystr)

Check to see whether an entry exists in a particular interference map.

Parameters

$hour -

$minute -

$check_date -

$query_string -

Returns

Boolean, true if an entry exists, false if it does not.

freemedCalendar

Summary
Creates AM/PM user-friendly hour display.
Creates AM/PM user-friendly time display.
Display calendar event from scheduler.
Return proper names for special event mappings, as per the group calendar and Travel.
Creates a scheduler map.
Determine whether an appointment of the specified duration at the specified time will fit in the specified map.
Creates a blank scheduler map.
Creates 3rd generation multiple scheduling map.
Increment time slot by 15 minutes.

Functions

freemedCalendar:: display_hour

Creates AM/PM user-friendly hour display.

Parameters

$hourHour in 0..24 military format.

Returns

AM/PM display of hour

freemedCalendar:: display_time

Creates AM/PM user-friendly time display.

Parameters

$hourHour in 0..24 military format.
$minuteMinute in 0..60 format.

Returns

User-friendly AM/PM display of time.

freemedCalendar:: event_calendar_print

Display calendar event from scheduler.

Parameters

$eventscheduler table event id number.

Returns

XHTML formatted calendar event.

freemedCalendar:: event_special

Return proper names for special event mappings, as per the group calendar and Travel.

Parameters

$mappingSpecial id mapping.  This is usually a number from 0 to 8.

Returns

Text name of specified mapping.

freemedCalendar:: map

Creates a scheduler map.  This is the 2nd generation of the depreciated interference map.

Parameters

$querySQL query string.

Returns

”map” associative multi-dimentional array containing scheduling interference data.

See Also

freemedCalendar::map_fit freemedCalendar::map_init

freemedCalendar:: map_fit

Determine whether an appointment of the specified duration at the specified time will fit in the specified map.

Parameters

$mapScheduler “map” as generated by freemedCalendar::map.
$timeTime string specifying the time of the appointment to check.  Should be in format HH:MM.
$duration(optional) Duration of the appointment in minutes.  This is 15 by default.
$id(optional) If this is specified it shows the pre-existing scheduler id for an appointment, so that if it is being moved, it does not conflict with itself.

Returns

Boolean, whether specified appointment fits into the specified map.

See Also

freemedCalendar::map freemedCalendar::map_init

freemedCalendar:: map_init

Creates a blank scheduler map.

Returns

Blank scheduler map (associative array).

See Also

freemedCalendar::map freemedCalendar::map_fit

freemedCalendar:: multimap

Creates 3rd generation multiple scheduling map.  This is used to automatically create additional columns due to overlapping and overbooking.

Parameters

$querySQL query string describing options.
$selected(optional) Scheduler table id of selected appointment.  If this is not specified, no appointment will be selected by default.

Returns

Multimap (associative array).

See Also

freemedCalendar::map

freemedCalendar:: next_time

Increment time slot by 15 minutes.

Parameters

$timeTime in HH:MM format.

Returns

Next time slot in HH:MM format.

function date_in_range ($checkdate,
$dtbegin,
$dtend)
Determine if a date falls between a beginning and end date.
function date_in_the_past ($datestamp)
Check to see if date is in the past
function day_of_the_week ($this_date = "",
$short = false)
Get the text name of a day of the week
function fc_get_time_string ($hour,
$minute)
Form a human readable time string from an hour and a minute.
function fc_scroll_prev_month ($given_date = "")
Scroll a given date back by a month
function fc_scroll_next_month ($given_date = "")
Scroll a given date forward by a month
function fc_starting_hour ()
Retrieve starting hour for booking in the scheduler.
function fc_ending_hour ()
Retrieve ending hour for booking in the scheduler.
function fc_generate_interference_map ($query_part,  
$this_date,  
$privacy = false)
Create an “interference map” which allows the system to determine which appointments may conflict with others based on several criteria.
function fc_check_interference_map ($hour,
$minute,
$check_date,
$querystr)
Check to see whether an entry exists in a particular interference map.
Determine whether an appointment of the specified duration at the specified time will fit in the specified map.
Creates a blank scheduler map.
Creates a scheduler map.