Miscellaneous functions

freemed::config_value

mixed freemed::config_value(string key);

Accesses the FreeMED configuration database and returns the value associated with the specified key.

freemed::connect

void freemed::connect

Authorizes the current user. This should not be called if a session is not active (for example, when using XML-RPC services).

freemed::get_link_rec

array freemed::get_link_rec(string id, string table);

Returns an associative array describing the table row associated with the specified id. This accesses EMRi::get_link_rec() if id is not an integer.

freemed::get_link_field

array freemed::get_link_field(string id, string table, string field);

Returns an element of freemed::get_link_rec(). If this is to be used more than once on the same table, freemed::get_link_rec() is recommended for greater performance.

freemed::itemlist_conditions

string freemed::itemlist_conditions([boolean where]);

To be used in a freemed::display_itemlist call. This sets the appropriate pagination and search criteria that freemed::display_itemlist sets. The optional where parameter is set to true if a WHERE clause has already been started.

Example 2-1. Example of freemed::itemlist_conditions

	print freemed_display_itemlist (
		$sql->query (
			"SELECT cptcode, cptnameint, id FROM ".
			$this->table_name." ".
			freemed::itemlist_conditions().
			" ORDER BY ".$this->order_fields
		), $this->page_name,
		array (
			__("Procedural Code") => "cptcode",
			__("Internal Description") => "cptnameint"
		),
		array ( "", "" )
	);
	

freemed::image_filename

mixed freemed::image_filename(int patient_id, int record_number, string image_type, [boolean image_store]);

Returns a relative filename for an image in the image store, which uses MD5 hashes. If the optional image_store parameter is declared false, it drops the directory specification for img/store/ and returns the directory local to there.

freemed::multiple_choice

mixed freemed::multiple_choice(string sql_query, string display_field, string widget_name, string blob_data, [boolean display_all]);

Creates a multiple-choice selection widget, based on the data provided. An SQL query string, sql_query, is provided, then display_field is used as a formatting string, with field names surrounded by '##'s. widget_name is the form name of the widget, and blob data is the data provided to the widget. display_all can optionally be set to false to remove the "ALL" option, which is normally equal to -1.

freemed::patient_box

mixed freemed::patient_box(object patient_object);

When provided with a patient object, freemed::patient_box() returns an EMR header box with vital information and links to the core EMR.

freemed::patient_widget

mixed freemed::patient_widget(string var_name, [string form_name], [string submit_name]);

Provides a patient selector widget, which calls patient_lookup.php in a popup window. If form_name or submit_name are specified, the names of the form and submit widget can be changed. By default, form_name is "myform" and submit_name is "submit_action".

freemed::query_to_array

mixed freemed::query_to_array(string query);

Uses the specified query, and returns an associative array with the results. The key should be mapped to column 'k' and the value to column 'v'.

freemed::race_widget

string freemed::race_widget(string variable_name);

Creates an HL7 v2.3.1 compliant race widget.

freemed::religion_widget

string freemed::religion_widget(string variable_name);

Creates an HL7 v2.3.1 compliant religion widget.

freemed::secure_filename

string freemed::secure_filename(string filename);

Removes potentially dangerous characters from a filename, to sanitize user input.

freemed::store_image

string freemed::store_image(int patient_id, string variable_name, string type);

Stores an image in the FreeMED image store. Returns the name of the stored file.

freemed::support_djvu

boolean freemed::support_djvu(object browser);

Determines whether the current browser supports the DJVU format.

freemed::module_check

boolean freemed::module_check(string module_name, string minimum_version);

freemed::config_value

mixed freemed::config_value(string key);

Accesses the FreeMED configuration database and returns the value associated with the specified key.