Skip to content

Commit

Permalink
E-prescription solution, take 1, contributed by MMF Systems
Browse files Browse the repository at this point in the history
  • Loading branch information
bradymiller committed Dec 10, 2010
1 parent 1c7457f commit 34afff0
Show file tree
Hide file tree
Showing 27 changed files with 13,124 additions and 349 deletions.
376 changes: 349 additions & 27 deletions controllers/C_Prescription.class.php

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions interface/forms/CAMOS/content_parser.php
Expand Up @@ -86,6 +86,22 @@ function remove_comments($string_to_process) {
//process commands embedded in C style comments where function name is first
//followed by args separated by :: delimiter and nothing else

function pre_view_process ($encounter,$pid,$string_to_process) {
if (preg_match("/\|\s*date_add\s*\(\s*(.*?)\s*\)\s*\|/",$string_to_process, $matches)) {
$to_replace = $matches[0];
$days = $matches[1];
$query = "select date_format(date_add(date, interval $days day),'%W, %m-%d-%Y') as date from form_encounter where pid = $pid and encounter = $encounter";
$statement = sqlStatement($query);
if ($result = sqlFetchArray($statement)){
$string_to_process = str_replace($to_replace,$result['date'],$string_to_process);
}
}
return $string_to_process;
}

//process commands embedded in C style comments where function name is first
//followed by args separated by :: delimiter and nothing else

function process_commands(&$string_to_process, &$camos_return_data) {

//First, handle replace function as special case. full depth of inserts should be evaluated prior
Expand Down

0 comments on commit 34afff0

Please sign in to comment.