From 3c76a67ecc13ecd109cdfbdb601b175d1d8ec6bf Mon Sep 17 00:00:00 2001 From: tmccormi Date: Fri, 29 Jun 2012 14:29:49 -0700 Subject: [PATCH] Contributed GYM Forms, some of the table.sql files include inserts into list_options for supporting selections --- contrib/forms/affirm_sheet/info.txt | 2 + contrib/forms/affirm_sheet/new.php | 199 ++++++++++++++ contrib/forms/affirm_sheet/print.php | 143 ++++++++++ contrib/forms/affirm_sheet/report.php | 114 ++++++++ contrib/forms/affirm_sheet/save.php | 156 +++++++++++ contrib/forms/affirm_sheet/show.php | 172 ++++++++++++ contrib/forms/affirm_sheet/style.css | 114 ++++++++ contrib/forms/affirm_sheet/table.sql | 19 ++ contrib/forms/affirm_sheet/view.php | 207 ++++++++++++++ contrib/forms/dub_soap/info.txt | 2 + contrib/forms/dub_soap/new.php | 237 ++++++++++++++++ contrib/forms/dub_soap/print.php | 181 ++++++++++++ contrib/forms/dub_soap/report.php | 139 ++++++++++ contrib/forms/dub_soap/save.php | 156 +++++++++++ contrib/forms/dub_soap/show.php | 201 ++++++++++++++ contrib/forms/dub_soap/style.css | 114 ++++++++ contrib/forms/dub_soap/table.sql | 229 ++++++++++++++++ contrib/forms/dub_soap/view.php | 245 +++++++++++++++++ contrib/forms/gyn_ros/Makefile | 58 ++++ contrib/forms/gyn_ros/README | 4 + contrib/forms/gyn_ros/gyn_ros.xml | 109 ++++++++ contrib/forms/gyn_ros/info.txt | 2 + contrib/forms/gyn_ros/new.php | 452 ++++++++++++++++++++++++++++++ contrib/forms/gyn_ros/print.php | 151 ++++++++++ contrib/forms/gyn_ros/report.php | 143 ++++++++++ contrib/forms/gyn_ros/save.php | 136 +++++++++ contrib/forms/gyn_ros/show.php | 391 ++++++++++++++++++++++++++ contrib/forms/gyn_ros/style.css | 114 ++++++++ contrib/forms/gyn_ros/table.sql | 50 ++++ contrib/forms/gyn_ros/view.php | 471 ++++++++++++++++++++++++++++++++ contrib/forms/pelvic_soap/info.txt | 2 + contrib/forms/pelvic_soap/new.php | 199 ++++++++++++++ contrib/forms/pelvic_soap/print.php | 143 ++++++++++ contrib/forms/pelvic_soap/report.php | 106 +++++++ contrib/forms/pelvic_soap/save.php | 156 +++++++++++ contrib/forms/pelvic_soap/show.php | 163 +++++++++++ contrib/forms/pelvic_soap/style.css | 114 ++++++++ contrib/forms/pelvic_soap/table.sql | 154 +++++++++++ contrib/forms/pelvic_soap/view.php | 207 ++++++++++++++ contrib/forms/urinary_soap/info.txt | 2 + contrib/forms/urinary_soap/new.php | 215 +++++++++++++++ contrib/forms/urinary_soap/print.php | 159 +++++++++++ contrib/forms/urinary_soap/report.php | 120 ++++++++ contrib/forms/urinary_soap/save.php | 156 +++++++++++ contrib/forms/urinary_soap/show.php | 179 ++++++++++++ contrib/forms/urinary_soap/style.css | 114 ++++++++ contrib/forms/urinary_soap/table.sql | 128 +++++++++ contrib/forms/urinary_soap/view.php | 223 +++++++++++++++ contrib/forms/vaginitis_soap/info.txt | 2 + contrib/forms/vaginitis_soap/new.php | 230 ++++++++++++++++ contrib/forms/vaginitis_soap/print.php | 174 ++++++++++++ contrib/forms/vaginitis_soap/report.php | 133 +++++++++ contrib/forms/vaginitis_soap/save.php | 156 +++++++++++ contrib/forms/vaginitis_soap/show.php | 194 +++++++++++++ contrib/forms/vaginitis_soap/style.css | 114 ++++++++ contrib/forms/vaginitis_soap/table.sql | 177 ++++++++++++ contrib/forms/vaginitis_soap/view.php | 238 ++++++++++++++++ 57 files changed, 8669 insertions(+) create mode 100644 contrib/forms/affirm_sheet/info.txt create mode 100644 contrib/forms/affirm_sheet/new.php create mode 100644 contrib/forms/affirm_sheet/print.php create mode 100644 contrib/forms/affirm_sheet/report.php create mode 100644 contrib/forms/affirm_sheet/save.php create mode 100644 contrib/forms/affirm_sheet/show.php create mode 100644 contrib/forms/affirm_sheet/style.css create mode 100644 contrib/forms/affirm_sheet/table.sql create mode 100644 contrib/forms/affirm_sheet/view.php create mode 100644 contrib/forms/dub_soap/info.txt create mode 100644 contrib/forms/dub_soap/new.php create mode 100644 contrib/forms/dub_soap/print.php create mode 100644 contrib/forms/dub_soap/report.php create mode 100644 contrib/forms/dub_soap/save.php create mode 100644 contrib/forms/dub_soap/show.php create mode 100644 contrib/forms/dub_soap/style.css create mode 100644 contrib/forms/dub_soap/table.sql create mode 100644 contrib/forms/dub_soap/view.php create mode 100755 contrib/forms/gyn_ros/Makefile create mode 100755 contrib/forms/gyn_ros/README create mode 100755 contrib/forms/gyn_ros/gyn_ros.xml create mode 100644 contrib/forms/gyn_ros/info.txt create mode 100644 contrib/forms/gyn_ros/new.php create mode 100644 contrib/forms/gyn_ros/print.php create mode 100644 contrib/forms/gyn_ros/report.php create mode 100644 contrib/forms/gyn_ros/save.php create mode 100644 contrib/forms/gyn_ros/show.php create mode 100644 contrib/forms/gyn_ros/style.css create mode 100644 contrib/forms/gyn_ros/table.sql create mode 100644 contrib/forms/gyn_ros/view.php create mode 100644 contrib/forms/pelvic_soap/info.txt create mode 100644 contrib/forms/pelvic_soap/new.php create mode 100644 contrib/forms/pelvic_soap/print.php create mode 100644 contrib/forms/pelvic_soap/report.php create mode 100644 contrib/forms/pelvic_soap/save.php create mode 100644 contrib/forms/pelvic_soap/show.php create mode 100644 contrib/forms/pelvic_soap/style.css create mode 100644 contrib/forms/pelvic_soap/table.sql create mode 100644 contrib/forms/pelvic_soap/view.php create mode 100644 contrib/forms/urinary_soap/info.txt create mode 100644 contrib/forms/urinary_soap/new.php create mode 100644 contrib/forms/urinary_soap/print.php create mode 100644 contrib/forms/urinary_soap/report.php create mode 100644 contrib/forms/urinary_soap/save.php create mode 100644 contrib/forms/urinary_soap/show.php create mode 100644 contrib/forms/urinary_soap/style.css create mode 100644 contrib/forms/urinary_soap/table.sql create mode 100644 contrib/forms/urinary_soap/view.php create mode 100644 contrib/forms/vaginitis_soap/info.txt create mode 100644 contrib/forms/vaginitis_soap/new.php create mode 100644 contrib/forms/vaginitis_soap/print.php create mode 100644 contrib/forms/vaginitis_soap/report.php create mode 100644 contrib/forms/vaginitis_soap/save.php create mode 100644 contrib/forms/vaginitis_soap/show.php create mode 100644 contrib/forms/vaginitis_soap/style.css create mode 100644 contrib/forms/vaginitis_soap/table.sql create mode 100644 contrib/forms/vaginitis_soap/view.php diff --git a/contrib/forms/affirm_sheet/info.txt b/contrib/forms/affirm_sheet/info.txt new file mode 100644 index 000000000..9704d02f4 --- /dev/null +++ b/contrib/forms/affirm_sheet/info.txt @@ -0,0 +1,2 @@ +Affirm Sheet + diff --git a/contrib/forms/affirm_sheet/new.php b/contrib/forms/affirm_sheet/new.php new file mode 100644 index 000000000..b1efb413f --- /dev/null +++ b/contrib/forms/affirm_sheet/new.php @@ -0,0 +1,199 @@ + tag */ + +/** CHANGE THIS name to the name of your form. **/ +$form_name = 'Affirm Sheet'; + +/** CHANGE THIS to match the folder you created for this form. **/ +$form_folder = 'affirm_sheet'; + +/* Check the access control lists to ensure permissions to this page */ +$thisauth = acl_check('patients', 'med'); +if (!$thisauth) { + die($form_name.': Access Denied.'); +} +/* perform a squad check for pages touching patients, if we're in 'athletic team' mode */ +if ($GLOBALS['athletic_team']!='false') { + $tmp = getPatientData($pid, 'squad'); + if ($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) + $thisauth = 0; +} + +if ($thisauth != 'write' && $thisauth != 'addonly') + die($form_name.': Adding is not authorized.'); +/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'affirm' => + array( 'field_id' => 'affirm', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exam_yeast' => + array( 'field_id' => 'exam_yeast', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'exam_gardnerrla' => + array( 'field_id' => 'exam_gardnerrla', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'exam_trichomonas' => + array( 'field_id' => 'exam_trichomonas', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'lot_number' => + array( 'field_id' => 'lot_number', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exp_date' => + array( 'field_id' => 'exp_date', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ) + ); +$submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=new&return=encounter'; +/* no get logic here */ +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('New '.$form_name); ?> + + + + +
+ + +() + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + + + +
+ + + + + + +
+
+ +
+
+ + +
+
+ + +
+
+
+ + + + diff --git a/contrib/forms/affirm_sheet/print.php b/contrib/forms/affirm_sheet/print.php new file mode 100644 index 000000000..96deea48e --- /dev/null +++ b/contrib/forms/affirm_sheet/print.php @@ -0,0 +1,143 @@ + + array( 'field_id' => 'affirm', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exam_yeast' => + array( 'field_id' => 'exam_yeast', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'exam_gardnerrla' => + array( 'field_id' => 'exam_gardnerrla', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'exam_trichomonas' => + array( 'field_id' => 'exam_trichomonas', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'lot_number' => + array( 'field_id' => 'lot_number', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exp_date' => + array( 'field_id' => 'exp_date', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ) + ); + +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('Print '.$form_name); ?> + + + + + + +
+
+ + + + +
+ + + + diff --git a/contrib/forms/affirm_sheet/report.php b/contrib/forms/affirm_sheet/report.php new file mode 100644 index 000000000..15bb55f79 --- /dev/null +++ b/contrib/forms/affirm_sheet/report.php @@ -0,0 +1,114 @@ + 'textfield','exam_yeast' => 'dropdown_list','exam_gardnerrla' => 'dropdown_list','exam_trichomonas' => 'dropdown_list','lot_number' => 'textfield','exp_date' => 'textfield');/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'affirm' => + array( 'field_id' => 'affirm', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exam_yeast' => + array( 'field_id' => 'exam_yeast', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'exam_gardnerrla' => + array( 'field_id' => 'exam_gardnerrla', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'exam_trichomonas' => + array( 'field_id' => 'exam_trichomonas', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'lot_number' => + array( 'field_id' => 'lot_number', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exp_date' => + array( 'field_id' => 'exp_date', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ) + ); +/* an array of the lists the fields may draw on. */ +$lists = array(); + $data = formFetch($table_name, $id); + if ($data) { + + echo ''; + + foreach($data as $key => $value) { + if ($key == 'id' || $key == 'pid' || $key == 'user' || + $key == 'groupname' || $key == 'authorized' || + $key == 'activity' || $key == 'date' || + $value == '' || $value == '0000-00-00 00:00:00' || + $value == 'n') + { + /* skip built-in fields and "blank data". */ + continue; + } + + /* display 'yes' instead of 'on'. */ + if ($value == 'on') { + $value = 'yes'; + } + + /* remove the time-of-day from the 'date' fields. */ + if ($field_names[$key] == 'date') + if ($value != '') { + $dateparts = split(' ', $value); + $value = $dateparts[0]; + } + + if ( $field_names[$key] == 'checkbox_combo_list' ) { + $value = generate_display_field( $manual_layouts[$key], $value ); + } + + /* replace underscores with spaces, and uppercase all words. */ + /* this is a primitive form of converting the column names into something displayable. */ + $key=ucwords(str_replace('_',' ',$key)); + $mykey = $key; + $myval = $value; + echo ''; + + + $count++; + if ($count == $cols) { + $count = 0; + echo '' . PHP_EOL; + } + } + } + echo '
'.xl("$mykey").': '.xl("$myval").'

'; +} +?> + diff --git a/contrib/forms/affirm_sheet/save.php b/contrib/forms/affirm_sheet/save.php new file mode 100644 index 000000000..d729c7a0d --- /dev/null +++ b/contrib/forms/affirm_sheet/save.php @@ -0,0 +1,156 @@ + 'textfield','exam_yeast' => 'dropdown_list','exam_gardnerrla' => 'dropdown_list','exam_trichomonas' => 'dropdown_list','lot_number' => 'textfield','exp_date' => 'textfield'); +/* an array of the lists the fields may draw on. */ +$lists = array('exam_yeast' => 'proc_res_bool', 'exam_gardnerrla' => 'proc_res_bool', 'exam_trichomonas' => 'proc_res_bool'); + +/* get each field from $_POST[], storing them into $field_names associated with their names. */ +foreach($field_names as $key=>$val) +{ + $pos = ''; + $neg = ''; + if ($val == 'textbox' || $val == 'textarea' || $val == 'provider' || $val == 'textfield') + { + $field_names[$key]=$_POST['form_'.$key]; + } + if ($val == 'date') + { + $field_names[$key]=$_POST[$key]; + } + if (($val == 'checkbox_list' )) + { + $field_names[$key]=''; + if (isset($_POST['form_'.$key]) && $_POST['form_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if (is_array($_POST['form_'.$key])) + { + if ($_POST['form_'.$key][$lrow[option_id]]) + { + if ($field_names[$key] != '') + $field_names[$key]=$field_names[$key].'|'; + $field_names[$key] = $field_names[$key].$lrow[option_id]; + } + } + } + } + } + if (($val == 'checkbox_combo_list')) + { + $field_names[$key]=''; + if (isset($_POST['check_'.$key]) && $_POST['check_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if (is_array($_POST['check_'.$key])) + { + if ($_POST['check_'.$key][$lrow[option_id]]) + { + if ($field_names[$key] != '') + $field_names[$key]=$field_names[$key].'|'; + $field_names[$key] = $field_names[$key].$lrow[option_id].":xx".$_POST['form_'.$key][$lrow[option_id]]; + } + } + } + } + } + if (($val == 'dropdown_list')) + { + $field_names[$key]=''; + if (isset($_POST['form_'.$key]) && $_POST['form_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if ($_POST['form_'.$key] == $lrow[option_id]) + { + $field_names[$key]=$lrow[option_id]; + break; + } + } + } + } +} + +/* at this point, field_names[] contains an array of name->value pairs of the fields we expected from the form. */ + +/* escape form data for entry to the database. */ +foreach ($field_names as $k => $var) { + $field_names[$k] = formDataCore($var); +} + +if ($encounter == '') $encounter = date('Ymd'); + +if ($_GET['mode'] == 'new') { + /* NOTE - for customization you can replace $_POST with your own array + * of key=>value pairs where 'key' is the table field name and + * 'value' is whatever it should be set to + * ex) $newrecord['parent_sig'] = $_POST['sig']; + * $newid = formSubmit($table_name, $newrecord, $_GET['id'], $userauthorized); + */ + + /* make sure we're at the beginning of the array */ + reset($field_names); + + /* save the data into the form's encounter-based table */ + $newid = formSubmit($table_name, $field_names, $_GET['id'], $userauthorized); + /* link this form into the encounter. */ + addForm($encounter, $form_name, $newid, $form_folder, $pid, $userauthorized); +} + +elseif ($_GET['mode'] == 'update') { + /* make sure we're at the beginning of the array */ + reset($field_names); + + /* update the data in the form's table */ + $success = formUpdate($table_name, $field_names, $_GET['id'], $userauthorized); + /* sqlInsert('update '.$table_name." set pid = {".$_SESSION['pid']."},groupname='".$_SESSION['authProvider']."',user='".$_SESSION['authUser']."',authorized=$userauthorized,activity=1,date = NOW(), where id=$id"); */ +} + + +$_SESSION['encounter'] = $encounter; + +formHeader('Redirecting....'); +/* defaults to the encounters page. */ +formJump(); + +formFooter(); +?> + diff --git a/contrib/forms/affirm_sheet/show.php b/contrib/forms/affirm_sheet/show.php new file mode 100644 index 000000000..643da094f --- /dev/null +++ b/contrib/forms/affirm_sheet/show.php @@ -0,0 +1,172 @@ + + array( 'field_id' => 'affirm', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exam_yeast' => + array( 'field_id' => 'exam_yeast', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'exam_gardnerrla' => + array( 'field_id' => 'exam_gardnerrla', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'exam_trichomonas' => + array( 'field_id' => 'exam_trichomonas', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'lot_number' => + array( 'field_id' => 'lot_number', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exp_date' => + array( 'field_id' => 'exp_date', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ) + ); + +/* since we have no-where to return, abuse returnurl to link to the 'edit' page */ +/* FIXME: pass the ID, create blank rows if necissary. */ +$returnurl = "../../forms/$form_folder/view.php?mode=noencounter"; + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('Show '.$form_name); ?> + + + + +
+ + + + + + +
+ +
+ + +
+ +
+ + + + + + + + + +
 
 
 
 
 
+ + +
+ +
+ + +
+
+ +
+
+ +
+ + + + diff --git a/contrib/forms/affirm_sheet/style.css b/contrib/forms/affirm_sheet/style.css new file mode 100644 index 000000000..7feab16db --- /dev/null +++ b/contrib/forms/affirm_sheet/style.css @@ -0,0 +1,114 @@ +/* This CSS is used ONLY by the form defined in this same folder + * customize it as you see fit for your specific form + */ + +/* turn off borders for fieldsets, to make them invisible */ +fieldset { +border: none; +} + +/* links should be undersized */ +.link { + font-size: 80%; +} + +/* links should grow when clicked */ +.link_submit { + font-size: 120%; +} + + +/* give section objects blue borders, bold cell labels, */ +.section { + border: solid; + border-width: 1px; + border-color: #0000ff; + margin: 0 0 0 10pt; + padding: 5pt; +} + +/* prevent the checkboxes on our sections from bunching up. */ +span.sectionlabel { +page-break-after: always; +} + +/* disappear the top button bar */ +.top_buttons { + display: none; +} + +/* center the bottom button bar */ +.button_bar { +text-align: center; +} + +/* section labels should be visible, and bold in view, new, ??...*/ +.sectionlabel { + font-family: sans-serif; + font-weight: bold; +} + +/* section labels on the show page. turn them green, and bold. */ +#show .sectionlabel { + color: #080; + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + height: 2em; +} + + +/* field labels should also be visible, and bold. */ +.fieldlabel { + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + height: 2em; +} + +/* field labels on the show page. turn them bold. */ +#show .fieldlabel { + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + width: 25%; +} + +/* Put some spacing around the edges of the form. */ +body { + padding: 5pt 5pt 5pt 5pt; +} + +/* Use a single font style for most objects in this page. */ +body, td, select { + font-family: Arial, Helvetica, sans-serif; +} + +input { + font-family: Arial, Helvetica, sans-serif; +} + +.save { + margin-left: 2pt; + margin-right: 2pt; +} + +.dontsave { + margin-left: 2pt; + margin-right: 2pt; +} + +.print { + margin-left: 2pt; + margin-right: 2pt; +} + +/* HACK: keep textareas at an eight point font, so they don't get too wide for our 750px 'view' and 'new' pages. */ +textarea { + font-size: 8pt; +} + + diff --git a/contrib/forms/affirm_sheet/table.sql b/contrib/forms/affirm_sheet/table.sql new file mode 100644 index 000000000..29cf08946 --- /dev/null +++ b/contrib/forms/affirm_sheet/table.sql @@ -0,0 +1,19 @@ +CREATE TABLE IF NOT EXISTS `form_affirm_sheet` ( + /* both extended and encounter forms need a last modified date */ + date datetime default NULL comment 'last modified date', + /* these fields are common to all encounter forms. */ + id bigint(20) NOT NULL auto_increment, + pid bigint(20) NOT NULL default 0, + user varchar(255) default NULL, + groupname varchar(255) default NULL, + authorized tinyint(4) default NULL, + activity tinyint(4) default NULL, + affirm varchar(255), + exam_yeast varchar(255), + exam_gardnerrla varchar(255), + exam_trichomonas varchar(255), + lot_number varchar(255), + exp_date varchar(255), + PRIMARY KEY (id) +) ENGINE=InnoDB; + diff --git a/contrib/forms/affirm_sheet/view.php b/contrib/forms/affirm_sheet/view.php new file mode 100644 index 000000000..15a0b049c --- /dev/null +++ b/contrib/forms/affirm_sheet/view.php @@ -0,0 +1,207 @@ + tag */ + +/** CHANGE THIS - name of the database table associated with this form **/ +$table_name = 'form_affirm_sheet'; + +/** CHANGE THIS name to the name of your form. **/ +$form_name = 'Affirm Sheet'; + +/** CHANGE THIS to match the folder you created for this form. **/ +$form_folder = 'affirm_sheet'; + +/* Check the access control lists to ensure permissions to this page */ +$thisauth = acl_check('patients', 'med'); +if (!$thisauth) { + die($form_name.': Access Denied.'); +} +/* perform a squad check for pages touching patients, if we're in 'athletic team' mode */ +if ($GLOBALS['athletic_team']!='false') { + $tmp = getPatientData($pid, 'squad'); + if ($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) + $thisauth = 0; +} + +if ($thisauth != 'write' && $thisauth != 'addonly') + die($form_name.': Adding is not authorized.'); +/* Use the formFetch function from api.inc to load the saved record */ +$xyzzy = formFetch($table_name, $_GET['id']); + +/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'affirm' => + array( 'field_id' => 'affirm', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exam_yeast' => + array( 'field_id' => 'exam_yeast', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'exam_gardnerrla' => + array( 'field_id' => 'exam_gardnerrla', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'exam_trichomonas' => + array( 'field_id' => 'exam_trichomonas', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'proc_res_bool' ), + 'lot_number' => + array( 'field_id' => 'lot_number', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exp_date' => + array( 'field_id' => 'exp_date', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ) + ); +$submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=update&return=encounter&id='.$_GET['id']; +if ($_GET['mode']) { + if ($_GET['mode']=='noencounter') { + $submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=new&return=show&id='.$_GET['id']; + $returnurl = 'show.php'; + } +} +else +{ + $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; +} + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('View '.$form_name); ?> + + + + +
+ + +() + +
+ +
+ + +
+
+ + + +
+
+ + +
+
+ + + + +
+ + + + + + +
+
+ +
+
+ + +
+
+ + + +
+
+
+ + + + diff --git a/contrib/forms/dub_soap/info.txt b/contrib/forms/dub_soap/info.txt new file mode 100644 index 000000000..1459a0cad --- /dev/null +++ b/contrib/forms/dub_soap/info.txt @@ -0,0 +1,2 @@ +DUB/Pain + diff --git a/contrib/forms/dub_soap/new.php b/contrib/forms/dub_soap/new.php new file mode 100644 index 000000000..6f3d7a99e --- /dev/null +++ b/contrib/forms/dub_soap/new.php @@ -0,0 +1,237 @@ + tag */ + +/** CHANGE THIS name to the name of your form. **/ +$form_name = 'DUB/Pain'; + +/** CHANGE THIS to match the folder you created for this form. **/ +$form_folder = 'dub_soap'; + +/* Check the access control lists to ensure permissions to this page */ +$thisauth = acl_check('patients', 'med'); +if (!$thisauth) { + die($form_name.': Access Denied.'); +} +/* perform a squad check for pages touching patients, if we're in 'athletic team' mode */ +if ($GLOBALS['athletic_team']!='false') { + $tmp = getPatientData($pid, 'squad'); + if ($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) + $thisauth = 0; +} + +if ($thisauth != 'write' && $thisauth != 'addonly') + die($form_name.': Adding is not authorized.'); +/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'menstrual_history' => + array( 'field_id' => 'menstrual_history', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Menstrual_History' ), + 'previous_sonogram' => + array( 'field_id' => 'previous_sonogram', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'previous_blood_work' => + array( 'field_id' => 'previous_blood_work', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'previous_needs_rx' => + array( 'field_id' => 'previous_needs_rx', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'dub_objective' => + array( 'field_id' => 'dub_objective', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Objective' ), + 'a_dub' => + array( 'field_id' => 'a_dub', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Diagnosis' ), + 'plan_lab_work' => + array( 'field_id' => 'plan_lab_work', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Lab_Work' ), + 'plan_tests_procedures' => + array( 'field_id' => 'plan_tests_procedures', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Tests_Procedures' ), + 'plan_medications' => + array( 'field_id' => 'plan_medications', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Medications' ) + ); +$submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=new&return=encounter'; +/* no get logic here */ +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('New '.$form_name); ?> + + + + +
+ + +() + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + + + + + + +
+ + + + + +
+
+ +
+
+ +
+
+ + + +
+
+ +
+
+ + +
+
+ + +
+
+
+ + + + diff --git a/contrib/forms/dub_soap/print.php b/contrib/forms/dub_soap/print.php new file mode 100644 index 000000000..7c100b613 --- /dev/null +++ b/contrib/forms/dub_soap/print.php @@ -0,0 +1,181 @@ + + array( 'field_id' => 'menstrual_history', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Menstrual_History' ), + 'previous_sonogram' => + array( 'field_id' => 'previous_sonogram', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'previous_blood_work' => + array( 'field_id' => 'previous_blood_work', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'previous_needs_rx' => + array( 'field_id' => 'previous_needs_rx', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'dub_objective' => + array( 'field_id' => 'dub_objective', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Objective' ), + 'a_dub' => + array( 'field_id' => 'a_dub', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Diagnosis' ), + 'plan_lab_work' => + array( 'field_id' => 'plan_lab_work', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Lab_Work' ), + 'plan_tests_procedures' => + array( 'field_id' => 'plan_tests_procedures', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Tests_Procedures' ), + 'plan_medications' => + array( 'field_id' => 'plan_medications', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Medications' ) + ); + +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('Print '.$form_name); ?> + + + + + + +
+
+ + + + +
+ + + + diff --git a/contrib/forms/dub_soap/report.php b/contrib/forms/dub_soap/report.php new file mode 100644 index 000000000..83a36b8ca --- /dev/null +++ b/contrib/forms/dub_soap/report.php @@ -0,0 +1,139 @@ + 'checkbox_combo_list','previous_sonogram' => 'textfield','previous_blood_work' => 'textfield','previous_needs_rx' => 'textfield','other' => 'textarea','dub_objective' => 'checkbox_combo_list','a_dub' => 'checkbox_combo_list','plan_lab_work' => 'checkbox_combo_list','plan_tests_procedures' => 'checkbox_combo_list','plan_medications' => 'checkbox_combo_list');/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'menstrual_history' => + array( 'field_id' => 'menstrual_history', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Menstrual_History' ), + 'previous_sonogram' => + array( 'field_id' => 'previous_sonogram', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'previous_blood_work' => + array( 'field_id' => 'previous_blood_work', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'previous_needs_rx' => + array( 'field_id' => 'previous_needs_rx', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'dub_objective' => + array( 'field_id' => 'dub_objective', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Objective' ), + 'a_dub' => + array( 'field_id' => 'a_dub', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Diagnosis' ), + 'plan_lab_work' => + array( 'field_id' => 'plan_lab_work', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Lab_Work' ), + 'plan_tests_procedures' => + array( 'field_id' => 'plan_tests_procedures', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Tests_Procedures' ), + 'plan_medications' => + array( 'field_id' => 'plan_medications', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Medications' ) + ); +/* an array of the lists the fields may draw on. */ +$lists = array(); + $data = formFetch($table_name, $id); + if ($data) { + + echo ''; + + foreach($data as $key => $value) { + if ($key == 'id' || $key == 'pid' || $key == 'user' || + $key == 'groupname' || $key == 'authorized' || + $key == 'activity' || $key == 'date' || + $value == '' || $value == '0000-00-00 00:00:00' || + $value == 'n') + { + /* skip built-in fields and "blank data". */ + continue; + } + + /* display 'yes' instead of 'on'. */ + if ($value == 'on') { + $value = 'yes'; + } + + /* remove the time-of-day from the 'date' fields. */ + if ($field_names[$key] == 'date') + if ($value != '') { + $dateparts = split(' ', $value); + $value = $dateparts[0]; + } + + if ( $field_names[$key] == 'checkbox_combo_list' ) { + $value = generate_display_field( $manual_layouts[$key], $value ); + } + + /* replace underscores with spaces, and uppercase all words. */ + /* this is a primitive form of converting the column names into something displayable. */ + $key=ucwords(str_replace('_',' ',$key)); + $mykey = $key; + $myval = $value; + echo ''; + + + $count++; + if ($count == $cols) { + $count = 0; + echo '' . PHP_EOL; + } + } + } + echo '
'.xl("$mykey").': '.xl("$myval").'

'; +} +?> + diff --git a/contrib/forms/dub_soap/save.php b/contrib/forms/dub_soap/save.php new file mode 100644 index 000000000..8244a1be0 --- /dev/null +++ b/contrib/forms/dub_soap/save.php @@ -0,0 +1,156 @@ + 'checkbox_combo_list','previous_sonogram' => 'textfield','previous_blood_work' => 'textfield','previous_needs_rx' => 'textfield','other' => 'textarea','dub_objective' => 'checkbox_combo_list','a_dub' => 'checkbox_combo_list','plan_lab_work' => 'checkbox_combo_list','plan_tests_procedures' => 'checkbox_combo_list','plan_medications' => 'checkbox_combo_list'); +/* an array of the lists the fields may draw on. */ +$lists = array('menstrual_history' => 'DUB_Menstrual_History', 'dub_objective' => 'DUB_Objective', 'a_dub' => 'DUB_Diagnosis', 'plan_lab_work' => 'DUB_Lab_Work', 'plan_tests_procedures' => 'DUB_Tests_Procedures', 'plan_medications' => 'DUB_Medications'); + +/* get each field from $_POST[], storing them into $field_names associated with their names. */ +foreach($field_names as $key=>$val) +{ + $pos = ''; + $neg = ''; + if ($val == 'textbox' || $val == 'textarea' || $val == 'provider' || $val == 'textfield') + { + $field_names[$key]=$_POST['form_'.$key]; + } + if ($val == 'date') + { + $field_names[$key]=$_POST[$key]; + } + if (($val == 'checkbox_list' )) + { + $field_names[$key]=''; + if (isset($_POST['form_'.$key]) && $_POST['form_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if (is_array($_POST['form_'.$key])) + { + if ($_POST['form_'.$key][$lrow[option_id]]) + { + if ($field_names[$key] != '') + $field_names[$key]=$field_names[$key].'|'; + $field_names[$key] = $field_names[$key].$lrow[option_id]; + } + } + } + } + } + if (($val == 'checkbox_combo_list')) + { + $field_names[$key]=''; + if (isset($_POST['check_'.$key]) && $_POST['check_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if (is_array($_POST['check_'.$key])) + { + if ($_POST['check_'.$key][$lrow[option_id]]) + { + if ($field_names[$key] != '') + $field_names[$key]=$field_names[$key].'|'; + $field_names[$key] = $field_names[$key].$lrow[option_id].":xx".$_POST['form_'.$key][$lrow[option_id]]; + } + } + } + } + } + if (($val == 'dropdown_list')) + { + $field_names[$key]=''; + if (isset($_POST['form_'.$key]) && $_POST['form_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if ($_POST['form_'.$key] == $lrow[option_id]) + { + $field_names[$key]=$lrow[option_id]; + break; + } + } + } + } +} + +/* at this point, field_names[] contains an array of name->value pairs of the fields we expected from the form. */ + +/* escape form data for entry to the database. */ +foreach ($field_names as $k => $var) { + $field_names[$k] = formDataCore($var); +} + +if ($encounter == '') $encounter = date('Ymd'); + +if ($_GET['mode'] == 'new') { + /* NOTE - for customization you can replace $_POST with your own array + * of key=>value pairs where 'key' is the table field name and + * 'value' is whatever it should be set to + * ex) $newrecord['parent_sig'] = $_POST['sig']; + * $newid = formSubmit($table_name, $newrecord, $_GET['id'], $userauthorized); + */ + + /* make sure we're at the beginning of the array */ + reset($field_names); + + /* save the data into the form's encounter-based table */ + $newid = formSubmit($table_name, $field_names, $_GET['id'], $userauthorized); + /* link this form into the encounter. */ + addForm($encounter, $form_name, $newid, $form_folder, $pid, $userauthorized); +} + +elseif ($_GET['mode'] == 'update') { + /* make sure we're at the beginning of the array */ + reset($field_names); + + /* update the data in the form's table */ + $success = formUpdate($table_name, $field_names, $_GET['id'], $userauthorized); + /* sqlInsert('update '.$table_name." set pid = {".$_SESSION['pid']."},groupname='".$_SESSION['authProvider']."',user='".$_SESSION['authUser']."',authorized=$userauthorized,activity=1,date = NOW(), where id=$id"); */ +} + + +$_SESSION['encounter'] = $encounter; + +formHeader('Redirecting....'); +/* defaults to the encounters page. */ +formJump(); + +formFooter(); +?> + diff --git a/contrib/forms/dub_soap/show.php b/contrib/forms/dub_soap/show.php new file mode 100644 index 000000000..189e6b37e --- /dev/null +++ b/contrib/forms/dub_soap/show.php @@ -0,0 +1,201 @@ + + array( 'field_id' => 'menstrual_history', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Menstrual_History' ), + 'previous_sonogram' => + array( 'field_id' => 'previous_sonogram', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'previous_blood_work' => + array( 'field_id' => 'previous_blood_work', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'previous_needs_rx' => + array( 'field_id' => 'previous_needs_rx', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'dub_objective' => + array( 'field_id' => 'dub_objective', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Objective' ), + 'a_dub' => + array( 'field_id' => 'a_dub', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Diagnosis' ), + 'plan_lab_work' => + array( 'field_id' => 'plan_lab_work', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Lab_Work' ), + 'plan_tests_procedures' => + array( 'field_id' => 'plan_tests_procedures', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Tests_Procedures' ), + 'plan_medications' => + array( 'field_id' => 'plan_medications', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Medications' ) + ); + +/* since we have no-where to return, abuse returnurl to link to the 'edit' page */ +/* FIXME: pass the ID, create blank rows if necissary. */ +$returnurl = "../../forms/$form_folder/view.php?mode=noencounter"; + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('Show '.$form_name); ?> + + + + +
+ + + + + + +
+ +
+ + +
+ +
+ + + + + + + + + + + + + +
 
 
 
 
 
 
+ + +
+ +
+ + +
+
+ +
+
+ +
+ + + + diff --git a/contrib/forms/dub_soap/style.css b/contrib/forms/dub_soap/style.css new file mode 100644 index 000000000..7feab16db --- /dev/null +++ b/contrib/forms/dub_soap/style.css @@ -0,0 +1,114 @@ +/* This CSS is used ONLY by the form defined in this same folder + * customize it as you see fit for your specific form + */ + +/* turn off borders for fieldsets, to make them invisible */ +fieldset { +border: none; +} + +/* links should be undersized */ +.link { + font-size: 80%; +} + +/* links should grow when clicked */ +.link_submit { + font-size: 120%; +} + + +/* give section objects blue borders, bold cell labels, */ +.section { + border: solid; + border-width: 1px; + border-color: #0000ff; + margin: 0 0 0 10pt; + padding: 5pt; +} + +/* prevent the checkboxes on our sections from bunching up. */ +span.sectionlabel { +page-break-after: always; +} + +/* disappear the top button bar */ +.top_buttons { + display: none; +} + +/* center the bottom button bar */ +.button_bar { +text-align: center; +} + +/* section labels should be visible, and bold in view, new, ??...*/ +.sectionlabel { + font-family: sans-serif; + font-weight: bold; +} + +/* section labels on the show page. turn them green, and bold. */ +#show .sectionlabel { + color: #080; + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + height: 2em; +} + + +/* field labels should also be visible, and bold. */ +.fieldlabel { + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + height: 2em; +} + +/* field labels on the show page. turn them bold. */ +#show .fieldlabel { + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + width: 25%; +} + +/* Put some spacing around the edges of the form. */ +body { + padding: 5pt 5pt 5pt 5pt; +} + +/* Use a single font style for most objects in this page. */ +body, td, select { + font-family: Arial, Helvetica, sans-serif; +} + +input { + font-family: Arial, Helvetica, sans-serif; +} + +.save { + margin-left: 2pt; + margin-right: 2pt; +} + +.dontsave { + margin-left: 2pt; + margin-right: 2pt; +} + +.print { + margin-left: 2pt; + margin-right: 2pt; +} + +/* HACK: keep textareas at an eight point font, so they don't get too wide for our 750px 'view' and 'new' pages. */ +textarea { + font-size: 8pt; +} + + diff --git a/contrib/forms/dub_soap/table.sql b/contrib/forms/dub_soap/table.sql new file mode 100644 index 000000000..f62327657 --- /dev/null +++ b/contrib/forms/dub_soap/table.sql @@ -0,0 +1,229 @@ +CREATE TABLE IF NOT EXISTS `form_dub_soap` ( + /* both extended and encounter forms need a last modified date */ + date datetime default NULL comment 'last modified date', + /* these fields are common to all encounter forms. */ + id bigint(20) NOT NULL auto_increment, + pid bigint(20) NOT NULL default 0, + user varchar(255) default NULL, + groupname varchar(255) default NULL, + authorized tinyint(4) default NULL, + activity tinyint(4) default NULL, + menstrual_history varchar(255), + previous_sonogram varchar(255), + previous_blood_work varchar(255), + previous_needs_rx varchar(255), + other TEXT, + dub_objective varchar(255), + a_dub varchar(255), + plan_lab_work varchar(255), + plan_tests_procedures varchar(255), + plan_medications varchar(255), + PRIMARY KEY (id) +) ENGINE=InnoDB; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='DUB_Menstrual_History', + title='DUB Menstrual History'; +INSERT IGNORE INTO list_options SET list_id='DUB_Menstrual_History', + option_id='1', + title='Bleeding Interval', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='DUB_Menstrual_History', + option_id='2', + title='Duration', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='DUB_Menstrual_History', + option_id='3', + title='Flow', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='DUB_Menstrual_History', + option_id='4', + title='Menorrhagia', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='DUB_Menstrual_History', + option_id='5', + title='Menometrorrhagia', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='DUB_Menstrual_History', + option_id='6', + title='IM Bleeding', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='DUB_Menstrual_History', + option_id='7', + title='IM Pain', + seq='7'; +INSERT IGNORE INTO list_options SET list_id='DUB_Menstrual_History', + option_id='8', + title='Dysmenorrhea', + seq='8'; +INSERT IGNORE INTO list_options SET list_id='DUB_Menstrual_History', + option_id='9', + title='Dyspareunia', + seq='9'; +INSERT IGNORE INTO list_options SET list_id='DUB_Menstrual_History', + option_id='10', + title='Other', + seq='10'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='DUB_Objective', + title='DUB Objective'; +INSERT IGNORE INTO list_options SET list_id='DUB_Objective', + option_id='1', + title='Abdomen', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='DUB_Objective', + option_id='2', + title='Uterus', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='DUB_Objective', + option_id='3', + title='Adnexae', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='DUB_Objective', + option_id='4', + title='Cervix', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='DUB_Objective', + option_id='5', + title='Other', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='DUB_Diagnosis', + title='DUB Diagnosis'; +INSERT IGNORE INTO list_options SET list_id='DUB_Diagnosis', + option_id='1', + title='DUB', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='DUB_Diagnosis', + option_id='2', + title='Fibroids', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='DUB_Diagnosis', + option_id='3', + title='Oral Contraception Breakthrough', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='DUB_Diagnosis', + option_id='4', + title='Dysmenorrhea', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='DUB_Diagnosis', + option_id='5', + title='Endometriosis', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='DUB_Diagnosis', + option_id='6', + title='Polyps', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='DUB_Diagnosis', + option_id='7', + title='Perimenopause', + seq='7'; +INSERT IGNORE INTO list_options SET list_id='DUB_Diagnosis', + option_id='8', + title='PMB', + seq='8'; +INSERT IGNORE INTO list_options SET list_id='DUB_Diagnosis', + option_id='9', + title='PCOS', + seq='9'; +INSERT IGNORE INTO list_options SET list_id='DUB_Diagnosis', + option_id='10', + title='Other', + seq='10'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='DUB_Lab_Work', + title='DUB Lab Work'; +INSERT IGNORE INTO list_options SET list_id='DUB_Lab_Work', + option_id='1', + title='CBC', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='DUB_Lab_Work', + option_id='2', + title='TSH', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='DUB_Lab_Work', + option_id='3', + title='CA125', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='DUB_Lab_Work', + option_id='4', + title='FSH/Estradiol(E2)', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='DUB_Lab_Work', + option_id='5', + title='PCOS Panel', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='DUB_Lab_Work', + option_id='6', + title='beta-hcG', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='DUB_Lab_Work', + option_id='7', + title='Other', + seq='7'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='DUB_Tests_Procedures', + title='DUB Tests Procedures'; +INSERT IGNORE INTO list_options SET list_id='DUB_Tests_Procedures', + option_id='1', + title='Sonogram', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='DUB_Tests_Procedures', + option_id='2', + title='Endometria', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='DUB_Tests_Procedures', + option_id='3', + title='D and C', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='DUB_Tests_Procedures', + option_id='4', + title='Ablation', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='DUB_Tests_Procedures', + option_id='5', + title='Hysteroscopy', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='DUB_Tests_Procedures', + option_id='6', + title='Myomectomy', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='DUB_Tests_Procedures', + option_id='7', + title='Other', + seq='7'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='DUB_Medications', + title='DUB Tests Procedures'; +INSERT IGNORE INTO list_options SET list_id='DUB_Medications', + option_id='1', + title='Provera/Prometrium', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='DUB_Medications', + option_id='2', + title='Oral Contraception', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='DUB_Medications', + option_id='3', + title='Lupron', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='DUB_Medications', + option_id='4', + title='Anti-inflammatories', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='DUB_Medications', + option_id='5', + title='Lysteda', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='DUB_Medications', + option_id='6', + title='Mirena', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='DUB_Medications', + option_id='7', + title='Change OCs', + seq='7'; +INSERT IGNORE INTO list_options SET list_id='DUB_Medications', + option_id='8', + title='Other', + seq='8'; + diff --git a/contrib/forms/dub_soap/view.php b/contrib/forms/dub_soap/view.php new file mode 100644 index 000000000..323b6d4d1 --- /dev/null +++ b/contrib/forms/dub_soap/view.php @@ -0,0 +1,245 @@ + tag */ + +/** CHANGE THIS - name of the database table associated with this form **/ +$table_name = 'form_dub_soap'; + +/** CHANGE THIS name to the name of your form. **/ +$form_name = 'DUB/Pain'; + +/** CHANGE THIS to match the folder you created for this form. **/ +$form_folder = 'dub_soap'; + +/* Check the access control lists to ensure permissions to this page */ +$thisauth = acl_check('patients', 'med'); +if (!$thisauth) { + die($form_name.': Access Denied.'); +} +/* perform a squad check for pages touching patients, if we're in 'athletic team' mode */ +if ($GLOBALS['athletic_team']!='false') { + $tmp = getPatientData($pid, 'squad'); + if ($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) + $thisauth = 0; +} + +if ($thisauth != 'write' && $thisauth != 'addonly') + die($form_name.': Adding is not authorized.'); +/* Use the formFetch function from api.inc to load the saved record */ +$xyzzy = formFetch($table_name, $_GET['id']); + +/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'menstrual_history' => + array( 'field_id' => 'menstrual_history', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Menstrual_History' ), + 'previous_sonogram' => + array( 'field_id' => 'previous_sonogram', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'previous_blood_work' => + array( 'field_id' => 'previous_blood_work', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'previous_needs_rx' => + array( 'field_id' => 'previous_needs_rx', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'dub_objective' => + array( 'field_id' => 'dub_objective', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Objective' ), + 'a_dub' => + array( 'field_id' => 'a_dub', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Diagnosis' ), + 'plan_lab_work' => + array( 'field_id' => 'plan_lab_work', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Lab_Work' ), + 'plan_tests_procedures' => + array( 'field_id' => 'plan_tests_procedures', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Tests_Procedures' ), + 'plan_medications' => + array( 'field_id' => 'plan_medications', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'DUB_Medications' ) + ); +$submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=update&return=encounter&id='.$_GET['id']; +if ($_GET['mode']) { + if ($_GET['mode']=='noencounter') { + $submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=new&return=show&id='.$_GET['id']; + $returnurl = 'show.php'; + } +} +else +{ + $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; +} + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('View '.$form_name); ?> + + + + +
+ + +() + +
+ +
+ + +
+
+ + + +
+
+ + +
+
+ + + + + + + +
+ + + + + +
+
+ +
+
+ +
+
+ + + +
+
+ +
+
+ + +
+
+ + + +
+
+
+ + + + diff --git a/contrib/forms/gyn_ros/Makefile b/contrib/forms/gyn_ros/Makefile new file mode 100755 index 000000000..3cd522dc8 --- /dev/null +++ b/contrib/forms/gyn_ros/Makefile @@ -0,0 +1,58 @@ +# the input file. normally, you will call make with 'make INFILE=my_xml_file_here.xml', to override this. +INFILE=gyn_ros.xml + +# The xslt processor. We can use xalan or xsltproc standalone. to use libxslt in php5, see xmlformthrough. + +# Uncomment this block to use xsltproc +XSLTPROC=/usr/bin/xsltproc +INOPT= +XSLOPT= + +## Uncomment this block to use xalan +#XSLTPROC=/usr/bin/xalan +#INOPT=-in +#XSLOPT=-xsl + +# detect the name of the directory to create for storing the files generated from the input xml document. +DIRNAME=$(shell ${XSLTPROC} ${XSLOPT} xslt/safename.xslt ${INOPT} ${INFILE}) + +# building rules + +all: ${DIRNAME} ${DIRNAME}/info.txt ${DIRNAME}/table.sql ${DIRNAME}/style.css ${DIRNAME}/new.php ${DIRNAME}/print.php ${DIRNAME}/report.php ${DIRNAME}/view.php ${DIRNAME}/save.php ${DIRNAME}/show.php + +${DIRNAME}: + mkdir ${DIRNAME} + +${DIRNAME}/%.txt: xslt/%.txt.xslt ${INFILE} + ${XSLTPROC} ${XSLOPT} xslt/info.txt.xslt ${INOPT} ${INFILE} > $@ + +${DIRNAME}/%.sql: xslt/%.sql.xslt ${INFILE} + ${XSLTPROC} ${XSLOPT} xslt/$*.sql.xslt ${INOPT} ${INFILE} > $@ + +${DIRNAME}/%.css: xslt/%.css.xslt ${INFILE} + ${XSLTPROC} ${XSLOPT} xslt/$*.css.xslt ${INOPT} ${INFILE} > $@ + +${DIRNAME}/%.php: xslt/%.php.xslt ${INFILE} + ${XSLTPROC} ${XSLOPT} xslt/$*.php.xslt ${INOPT} ${INFILE} > $@ + +clean: + rm -rf ${DIRNAME} + +formscript.pl: formscript.pl.orig + cat formscript.pl.orig | tr -d '\r' > formscript.pl + chmod 755 formscript.pl + +#additional dependancies, to regenerate output when the developer is editing code. + +${DIRNAME}/new.php: xslt/field_objects.xslt xslt/common_objects.xslt + +${DIRNAME}/print.php: xslt/field_objects.xslt xslt/common_objects.xslt + +${DIRNAME}/show.php: xslt/field_objects.xslt xslt/common_objects.xslt xslt/report_objects.xslt + +${DIRNAME}/view.php: xslt/field_objects.xslt xslt/common_objects.xslt + +${DIRNAME}/save.php: xslt/common_objects.xslt + +${DIRNAME}/report.php: xslt/common_objects.xslt + diff --git a/contrib/forms/gyn_ros/README b/contrib/forms/gyn_ros/README new file mode 100755 index 000000000..5f7c2ad0d --- /dev/null +++ b/contrib/forms/gyn_ros/README @@ -0,0 +1,4 @@ +xml form generator + +See following wiki link for details/instructions: +http://www.openmedsoftware.org/wiki/OpenEMR_Xml_Form_Generator diff --git a/contrib/forms/gyn_ros/gyn_ros.xml b/contrib/forms/gyn_ros/gyn_ros.xml new file mode 100755 index 000000000..cc6225a89 --- /dev/null +++ b/contrib/forms/gyn_ros/gyn_ros.xml @@ -0,0 +1,109 @@ + + + +
+ form_gyn_ros
+ Gyn Review of Systems + gyn_ros + + med + + + + + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + + + + + +
+
+ + + + + + + + + + + + +
+
+ + + + + + + +
+
+ + + + + + + + + + + diff --git a/contrib/forms/gyn_ros/info.txt b/contrib/forms/gyn_ros/info.txt new file mode 100644 index 000000000..cbcab8436 --- /dev/null +++ b/contrib/forms/gyn_ros/info.txt @@ -0,0 +1,2 @@ +Gyn Review of Systems + diff --git a/contrib/forms/gyn_ros/new.php b/contrib/forms/gyn_ros/new.php new file mode 100644 index 000000000..14e17c00a --- /dev/null +++ b/contrib/forms/gyn_ros/new.php @@ -0,0 +1,452 @@ + tag */ + +/** CHANGE THIS name to the name of your form. **/ +$form_name = 'Gyn Review of Systems'; + +/** CHANGE THIS to match the folder you created for this form. **/ +$form_folder = 'gyn_ros'; + +/* Check the access control lists to ensure permissions to this page */ +$thisauth = acl_check('patients', 'med'); +if (!$thisauth) { + die($form_name.': Access Denied.'); +} +/* perform a squad check for pages touching patients, if we're in 'athletic team' mode */ +if ($GLOBALS['athletic_team']!='false') { + $tmp = getPatientData($pid, 'squad'); + if ($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) + $thisauth = 0; +} + +if ($thisauth != 'write' && $thisauth != 'addonly') + die($form_name.': Adding is not authorized.'); +/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'cardio_reviewed' => + array( 'field_id' => 'cardio_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'cardio_note' => + array( 'field_id' => 'cardio_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Described the results of the review', + 'list_id' => '' ), + 'gastro_reviewed' => + array( 'field_id' => 'gastro_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'gastro_note' => + array( 'field_id' => 'gastro_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the results of the review', + 'list_id' => '' ), + 'Urinary_reviewed' => + array( 'field_id' => 'Urinary_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'Urinary_note' => + array( 'field_id' => 'Urinary_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the results of the review', + 'list_id' => '' ), + 'cns_reviewed' => + array( 'field_id' => 'cns_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'cns_note' => + array( 'field_id' => 'cns_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the results of the review', + 'list_id' => '' ), + 'other_reviewed' => + array( 'field_id' => 'other_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'other_note' => + array( 'field_id' => 'other_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe system reviewed and the results of the review', + 'list_id' => '' ), + 'complications_reviewed' => + array( 'field_id' => 'complications_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'complications_note' => + array( 'field_id' => 'complications_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the complication', + 'list_id' => '' ), + 'lmpdate' => + array( 'field_id' => 'lmpdate', + 'data_type' => '4', + 'fld_length' => '0', + 'description' => 'When was the the first day of your last menstrual period?', + 'list_id' => '' ), + 'cycle_int' => + array( 'field_id' => 'cycle_int', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => 'What is the Interval of your Flow?', + 'list_id' => 'menses_cycle' ), + 'cycle_int_note' => + array( 'field_id' => 'cycle_int_note', + 'data_type' => '3', + 'fld_length' => '100', + 'max_length' => '1', + 'description' => 'Enter any addtional interval information', + 'list_id' => '' ), + 'flowfhcount' => + array( 'field_id' => 'flowfhcount', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '2', + 'description' => 'How many tampons/pads per day', + 'list_id' => '' ), + 'flowhrs' => + array( 'field_id' => 'flowhrs', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '2', + 'description' => 'How many between tampons/pads changes', + 'list_id' => '' ), + 'pmb' => + array( 'field_id' => 'pmb', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_discharge' => + array( 'field_id' => 'vag_discharge', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'vag_discharge_note' => + array( 'field_id' => 'vag_discharge_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the color and amount', + 'list_id' => '' ), + 'vag_itching' => + array( 'field_id' => 'vag_itching', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_itching_note' => + array( 'field_id' => 'vag_itching_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'vag_odor' => + array( 'field_id' => 'vag_odor', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_odor_note' => + array( 'field_id' => 'vag_odor_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'vag_irratation' => + array( 'field_id' => 'vag_irratation', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_irratation_note' => + array( 'field_id' => 'vag_irratation_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'vag_spotting' => + array( 'field_id' => 'vag_spotting', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_spotting_note' => + array( 'field_id' => 'vag_spotting_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'priortreatment' => + array( 'field_id' => 'priortreatment', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'Have you tried to treat the symptoms prior to this visit', + 'list_id' => 'yesno' ), + 'priortreatment_note' => + array( 'field_id' => 'priortreatment_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'pain_menses' => + array( 'field_id' => 'pain_menses', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => 'Pain with or between menses?', + 'list_id' => 'menses_pain' ), + 'pain_level' => + array( 'field_id' => 'pain_level', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '2', + 'description' => 'Level of pain 1-10', + 'list_id' => '' ), + 'pain_location' => + array( 'field_id' => 'pain_location', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => 'Select Quadrant', + 'list_id' => 'menses_pain_location' ), + 'pain_lenth' => + array( 'field_id' => 'pain_lenth', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '30', + 'description' => 'Enter Months, Years etc', + 'list_id' => '' ), + 'pain_drug_resp' => + array( 'field_id' => 'pain_drug_resp', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '30', + 'description' => 'Is the pain responsive to OTC drugs? Which?', + 'list_id' => '' ), + 'pain_intercourse' => + array( 'field_id' => 'pain_intercourse', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'pain_intercourse_time' => + array( 'field_id' => 'pain_intercourse_time', + 'data_type' => '3', + 'fld_length' => '120', + 'max_length' => '1', + 'description' => 'How Long, etc?', + 'list_id' => '' ) + ); +$submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=new&return=encounter'; +/* no get logic here */ +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('New '.$form_name); ?> + + + + + + +
+ + +
+
+ + +
+
+ + +
+
+ + + + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + + + + +
+ (yyyy-mm-dd): + + + [?] + +
+
+ + + + + + +
+
+ + + + +
+
+ +
+
+ + +
+
+ + +
+
+
+ + + + diff --git a/contrib/forms/gyn_ros/print.php b/contrib/forms/gyn_ros/print.php new file mode 100644 index 000000000..c1a1dc8fd --- /dev/null +++ b/contrib/forms/gyn_ros/print.php @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('Print '.$form_name); ?> + + + + + + +
+
+ + + + +
+ + + + diff --git a/contrib/forms/gyn_ros/report.php b/contrib/forms/gyn_ros/report.php new file mode 100644 index 000000000..df8d80cab --- /dev/null +++ b/contrib/forms/gyn_ros/report.php @@ -0,0 +1,143 @@ + 'checkbox_list', + 'cardio_note' => 'textarea', + 'gastro_reviewed' => 'checkbox_list', + 'gastro_note' => 'textarea', + 'Urinary_reviewed' => 'checkbox_list', + 'Urinary_note' => 'textarea', + 'cns_reviewed' => 'checkbox_list', + 'cns_note' => 'textarea', + 'other_reviewed' => 'checkbox_list', + 'other_note' => 'textarea', + 'complications_reviewed' => 'checkbox_list', + 'complications_note' => 'textarea', + 'lmpdate' => 'date', + 'cycle_int' => 'dropdown_list', + 'cycle_int_note' => 'textarea', + 'flowfhcount' => 'textfield', + 'flowhrs' => 'textfield', + 'pmb' => 'checkbox_list', + 'vag_discharge' => 'checkbox_list', + 'vag_discharge_note' => 'textarea', + 'vag_itching' => 'checkbox_list', + 'vag_itching_note' => 'textarea', + 'vag_odor' => 'checkbox_list', + 'vag_odor_note' => 'textarea', + 'vag_irratation' => 'checkbox_list', + 'vag_irratation_note' => 'textarea', + 'vag_spotting' => 'checkbox_list', + 'vag_spotting_note' => 'textarea', + 'priortreatment' => 'checkbox_list', + 'priortreatment_note' => 'textarea', + 'pain_menses' => 'dropdown_list', + 'pain_level' => 'textfield', + 'pain_location' => 'dropdown_list', + 'pain_lenth' => 'textfield', + 'pain_drug_resp' => 'textfield', + 'pain_intercourse' => 'checkbox_list', + 'pain_intercourse_time' => 'textarea'); + +/* an array of the lists the fields may draw on. */ +$lists = array("menses_pain","menses_cycle","menses_pain_location"); + $data = formFetch($table_name, $id); + if ($data) { + + echo ''; + + foreach($data as $key => $value) { + if ($key == 'id' || $key == 'pid' || $key == 'user' || + $key == 'groupname' || $key == 'authorized' || + $key == 'activity' || $key == 'date' || + $value == '' || $value == '0000-00-00 00:00:00' || + $value == 'n') + { + /* skip built-in fields and "blank data". */ + continue; + } + + /* display 'yes' instead of 'on'. */ + if ($value == 'on') { + $value = 'yes'; + } + + /* remove the time-of-day from the 'date' fields. */ + if ($field_names[$key] == 'date') + if ($value != '') { + $dateparts = split(' ', $value); + $value = $dateparts[0]; + } + + // print $field_names[$key] . '=' . $value . "
\n"; //debug + + // Lists + if ($key == 'cycle_int') { + if ($value != '') { + $value = get_list_options('menses_cycle', $value); + } + } + + if ($key == 'pain_menses') { + if ($value != '') { + $value = get_list_options('menses_pain', $value); + } + } + + if ($key == 'pain_location') { + if ($value != '') { + $value = get_list_options('menses_pain_location', $value); + } + } + + /* replace underscores with spaces, and uppercase all words. */ + /* this is a primitive form of converting the column names into something displayable. */ + $key=ucwords(str_replace('_',' ',$key)); + $mykey = $key; + $myval = $value; + echo ''; + + $count++; + if ($count == $cols) { + $count = 0; + echo '' . PHP_EOL; + } + + } + } + echo '
'.xl("$mykey").': '.xl("$myval").'

'; +} + +// Get list Options +function get_list_options($list_id='',$option_id='',$field='title') +{ + +// @TODO this is not working for some reason +// $row = sqlQuery("SELECT ? FROM list_options " . +// "WHERE list_id = ? AND option_id = ?", array($field,$list_id,$option_id) ); + + $row = sqlQuery("SELECT title FROM list_options " . + "WHERE list_id = '$list_id' AND option_id = '$option_id'"); + + // print var_dump($row[$field]) . "
"; //debug + + return($row[$field]); +} + +?> + diff --git a/contrib/forms/gyn_ros/save.php b/contrib/forms/gyn_ros/save.php new file mode 100644 index 000000000..dd633af76 --- /dev/null +++ b/contrib/forms/gyn_ros/save.php @@ -0,0 +1,136 @@ + 'checkbox_list','cardio_note' => 'textarea','gastro_reviewed' => 'checkbox_list','gastro_note' => 'textarea','Urinary_reviewed' => 'checkbox_list','Urinary_note' => 'textarea','cns_reviewed' => 'checkbox_list','cns_note' => 'textarea','other_reviewed' => 'checkbox_list','other_note' => 'textarea','complications_reviewed' => 'checkbox_list','complications_note' => 'textarea','lmpdate' => 'date','cycle_int' => 'dropdown_list','cycle_int_note' => 'textarea','flowfhcount' => 'textfield','flowhrs' => 'textfield','pmb' => 'checkbox_list','vag_discharge' => 'checkbox_list','vag_discharge_note' => 'textarea','vag_itching' => 'checkbox_list','vag_itching_note' => 'textarea','vag_odor' => 'checkbox_list','vag_odor_note' => 'textarea','vag_irratation' => 'checkbox_list','vag_irratation_note' => 'textarea','vag_spotting' => 'checkbox_list','vag_spotting_note' => 'textarea','priortreatment' => 'checkbox_list','priortreatment_note' => 'textarea','pain_menses' => 'dropdown_list','pain_level' => 'textfield','pain_location' => 'dropdown_list','pain_lenth' => 'textfield','pain_drug_resp' => 'textfield','pain_intercourse' => 'checkbox_list','pain_intercourse_time' => 'textarea'); +/* an array of the lists the fields may draw on. */ +$lists = array('cardio_reviewed' => 'yesno', 'gastro_reviewed' => 'yesno', 'Urinary_reviewed' => 'yesno', 'cns_reviewed' => 'yesno', 'other_reviewed' => 'yesno', 'complications_reviewed' => 'yesno', 'cycle_int' => 'menses_cycle', 'pmb' => 'yesno', 'vag_discharge' => 'yesno', 'vag_itching' => 'yesno', 'vag_odor' => 'yesno', 'vag_irratation' => 'yesno', 'vag_spotting' => 'yesno', 'priortreatment' => 'yesno', 'pain_menses' => 'menses_pain', 'pain_location' => 'menses_pain_location', 'pain_intercourse' => 'yesno'); + +/* get each field from $_POST[], storing them into $field_names associated with their names. */ +foreach($field_names as $key=>$val) +{ + $pos = ''; + $neg = ''; + if ($val == 'textbox' || $val == 'textarea' || $val == 'provider' || $val == 'textfield') + { + $field_names[$key]=$_POST['form_'.$key]; + } + if ($val == 'date') + { + $field_names[$key]=$_POST[$key]; + } + if (($val == 'checkbox_list')) + { + $field_names[$key]=''; + if (isset($_POST['form_'.$key]) && $_POST['form_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if (is_array($_POST['form_'.$key])) + { + if ($_POST['form_'.$key][$lrow[option_id]]) + { + if ($field_names[$key] != '') + $field_names[$key]=$field_names[$key].'|'; + $field_names[$key] = $field_names[$key].$lrow[option_id]; + } + } + } + } + } + if (($val == 'dropdown_list')) + { + $field_names[$key]=''; + if (isset($_POST['form_'.$key]) && $_POST['form_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if ($_POST['form_'.$key] == $lrow[option_id]) + { + $field_names[$key]=$lrow[option_id]; + break; + } + } + } + } +} + +/* at this point, field_names[] contains an array of name->value pairs of the fields we expected from the form. */ + +/* escape form data for entry to the database. */ +foreach ($field_names as $k => $var) { + $field_names[$k] = formDataCore($var); +} + +if ($encounter == '') $encounter = date('Ymd'); + +if ($_GET['mode'] == 'new') { + /* NOTE - for customization you can replace $_POST with your own array + * of key=>value pairs where 'key' is the table field name and + * 'value' is whatever it should be set to + * ex) $newrecord['parent_sig'] = $_POST['sig']; + * $newid = formSubmit($table_name, $newrecord, $_GET['id'], $userauthorized); + */ + + /* make sure we're at the beginning of the array */ + reset($field_names); + + /* save the data into the form's encounter-based table */ + $newid = formSubmit($table_name, $field_names, $_GET['id'], $userauthorized); + /* link this form into the encounter. */ + addForm($encounter, $form_name, $newid, $form_folder, $pid, $userauthorized); +} + +elseif ($_GET['mode'] == 'update') { + /* make sure we're at the beginning of the array */ + reset($field_names); + + /* update the data in the form's table */ + $success = formUpdate($table_name, $field_names, $_GET['id'], $userauthorized); + /* sqlInsert('update '.$table_name." set pid = {".$_SESSION['pid']."},groupname='".$_SESSION['authProvider']."',user='".$_SESSION['authUser']."',authorized=$userauthorized,activity=1,date = NOW(), where id=$id"); */ +} + + +$_SESSION['encounter'] = $encounter; + +formHeader('Redirecting....'); +/* defaults to the encounters page. */ +formJump(); + +formFooter(); +?> + diff --git a/contrib/forms/gyn_ros/show.php b/contrib/forms/gyn_ros/show.php new file mode 100644 index 000000000..a2b6ae039 --- /dev/null +++ b/contrib/forms/gyn_ros/show.php @@ -0,0 +1,391 @@ + + array( 'field_id' => 'cardio_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'cardio_note' => + array( 'field_id' => 'cardio_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Described the results of the review', + 'list_id' => '' ), + 'gastro_reviewed' => + array( 'field_id' => 'gastro_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'gastro_note' => + array( 'field_id' => 'gastro_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the results of the review', + 'list_id' => '' ), + 'Urinary_reviewed' => + array( 'field_id' => 'Urinary_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'Urinary_note' => + array( 'field_id' => 'Urinary_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the results of the review', + 'list_id' => '' ), + 'cns_reviewed' => + array( 'field_id' => 'cns_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'cns_note' => + array( 'field_id' => 'cns_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the results of the review', + 'list_id' => '' ), + 'other_reviewed' => + array( 'field_id' => 'other_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'other_note' => + array( 'field_id' => 'other_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe system reviewed and the results of the review', + 'list_id' => '' ), + 'complications_reviewed' => + array( 'field_id' => 'complications_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'complications_note' => + array( 'field_id' => 'complications_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the complication', + 'list_id' => '' ), + 'lmpdate' => + array( 'field_id' => 'lmpdate', + 'data_type' => '4', + 'fld_length' => '0', + 'description' => 'When was the the first day of your last menstrual period?', + 'list_id' => '' ), + 'cycle_int' => + array( 'field_id' => 'cycle_int', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => 'What is the Interval of your Flow?', + 'list_id' => 'menses_cycle' ), + 'cycle_int_note' => + array( 'field_id' => 'cycle_int_note', + 'data_type' => '3', + 'fld_length' => '100', + 'max_length' => '1', + 'description' => 'Enter any addtional interval information', + 'list_id' => '' ), + 'flowfhcount' => + array( 'field_id' => 'flowfhcount', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '2', + 'description' => 'How many tampons/pads per day', + 'list_id' => '' ), + 'flowhrs' => + array( 'field_id' => 'flowhrs', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '2', + 'description' => 'How many between tampons/pads changes', + 'list_id' => '' ), + 'pmb' => + array( 'field_id' => 'pmb', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_discharge' => + array( 'field_id' => 'vag_discharge', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'vag_discharge_note' => + array( 'field_id' => 'vag_discharge_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the color and amount', + 'list_id' => '' ), + 'vag_itching' => + array( 'field_id' => 'vag_itching', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_itching_note' => + array( 'field_id' => 'vag_itching_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'vag_odor' => + array( 'field_id' => 'vag_odor', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_odor_note' => + array( 'field_id' => 'vag_odor_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'vag_irratation' => + array( 'field_id' => 'vag_irratation', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_irratation_note' => + array( 'field_id' => 'vag_irratation_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'vag_spotting' => + array( 'field_id' => 'vag_spotting', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_spotting_note' => + array( 'field_id' => 'vag_spotting_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'priortreatment' => + array( 'field_id' => 'priortreatment', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'Have you tried to treat the symptoms prior to this visit', + 'list_id' => 'yesno' ), + 'priortreatment_note' => + array( 'field_id' => 'priortreatment_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'pain_menses' => + array( 'field_id' => 'pain_menses', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => 'Pain with or between menses?', + 'list_id' => 'menses_pain' ), + 'pain_level' => + array( 'field_id' => 'pain_level', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '2', + 'description' => 'Level of pain 1-10', + 'list_id' => '' ), + 'pain_location' => + array( 'field_id' => 'pain_location', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => 'Select Quadrant', + 'list_id' => 'menses_pain_location' ), + 'pain_lenth' => + array( 'field_id' => 'pain_lenth', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '30', + 'description' => 'Enter Months, Years etc', + 'list_id' => '' ), + 'pain_drug_resp' => + array( 'field_id' => 'pain_drug_resp', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '30', + 'description' => 'Is the pain responsive to OTC drugs? Which?', + 'list_id' => '' ), + 'pain_intercourse' => + array( 'field_id' => 'pain_intercourse', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'pain_intercourse_time' => + array( 'field_id' => 'pain_intercourse_time', + 'data_type' => '3', + 'fld_length' => '120', + 'max_length' => '1', + 'description' => 'How Long, etc?', + 'list_id' => '' ) + ); + +/* since we have no-where to return, abuse returnurl to link to the 'edit' page */ +/* FIXME: pass the ID, create blank rows if necissary. */ +$returnurl = "../../forms/$form_folder/view.php?mode=noencounter"; + +/* remove the time-of-day from all date fields */ +if ($xyzzy['lmpdate'] != '') { + $dateparts = split(' ', $xyzzy['lmpdate']); + $xyzzy['lmpdate'] = $dateparts[0]; +} + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Date(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('Show '.$form_name); ?> + + + + +
+ + + + + + +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
 
 
 
 
 
 
 
 
 
 
 
 
+ + +
+ +
+ +
+ + + + diff --git a/contrib/forms/gyn_ros/style.css b/contrib/forms/gyn_ros/style.css new file mode 100644 index 000000000..7feab16db --- /dev/null +++ b/contrib/forms/gyn_ros/style.css @@ -0,0 +1,114 @@ +/* This CSS is used ONLY by the form defined in this same folder + * customize it as you see fit for your specific form + */ + +/* turn off borders for fieldsets, to make them invisible */ +fieldset { +border: none; +} + +/* links should be undersized */ +.link { + font-size: 80%; +} + +/* links should grow when clicked */ +.link_submit { + font-size: 120%; +} + + +/* give section objects blue borders, bold cell labels, */ +.section { + border: solid; + border-width: 1px; + border-color: #0000ff; + margin: 0 0 0 10pt; + padding: 5pt; +} + +/* prevent the checkboxes on our sections from bunching up. */ +span.sectionlabel { +page-break-after: always; +} + +/* disappear the top button bar */ +.top_buttons { + display: none; +} + +/* center the bottom button bar */ +.button_bar { +text-align: center; +} + +/* section labels should be visible, and bold in view, new, ??...*/ +.sectionlabel { + font-family: sans-serif; + font-weight: bold; +} + +/* section labels on the show page. turn them green, and bold. */ +#show .sectionlabel { + color: #080; + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + height: 2em; +} + + +/* field labels should also be visible, and bold. */ +.fieldlabel { + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + height: 2em; +} + +/* field labels on the show page. turn them bold. */ +#show .fieldlabel { + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + width: 25%; +} + +/* Put some spacing around the edges of the form. */ +body { + padding: 5pt 5pt 5pt 5pt; +} + +/* Use a single font style for most objects in this page. */ +body, td, select { + font-family: Arial, Helvetica, sans-serif; +} + +input { + font-family: Arial, Helvetica, sans-serif; +} + +.save { + margin-left: 2pt; + margin-right: 2pt; +} + +.dontsave { + margin-left: 2pt; + margin-right: 2pt; +} + +.print { + margin-left: 2pt; + margin-right: 2pt; +} + +/* HACK: keep textareas at an eight point font, so they don't get too wide for our 750px 'view' and 'new' pages. */ +textarea { + font-size: 8pt; +} + + diff --git a/contrib/forms/gyn_ros/table.sql b/contrib/forms/gyn_ros/table.sql new file mode 100644 index 000000000..631043b57 --- /dev/null +++ b/contrib/forms/gyn_ros/table.sql @@ -0,0 +1,50 @@ +# Modified from the original XMLForm Generated table +# do not regenerate +CREATE TABLE IF NOT EXISTS `form_gyn_ros` ( + date datetime default NULL comment 'last modified date', + id bigint(20) NOT NULL auto_increment, + pid bigint(20) NOT NULL default 0, + user varchar(255) default NULL, + groupname varchar(255) default NULL, + authorized tinyint(4) default NULL, + activity tinyint(4) default NULL, + cardio_reviewed varchar(255), + cardio_note TEXT, + gastro_reviewed varchar(255), + gastro_note TEXT, + Urinary_reviewed varchar(255), + Urinary_note TEXT, + cns_reviewed varchar(255), + cns_note TEXT, + other_reviewed varchar(255), + other_note TEXT, + complications_reviewed varchar(255), + complications_note TEXT, + lmpdate datetime default NULL, + cycle_int varchar(30), + cycle_int_note TEXT, + flowfhcount tinyint(2), + flowhrs tinyint(2), + pmb varchar(255), + vag_discharge varchar(255), + vag_discharge_note TEXT, + vag_itching varchar(255), + vag_itching_note TEXT, + vag_odor varchar(255), + vag_odor_note TEXT, + vag_irratation varchar(255), + vag_irratation_note TEXT, + vag_spotting varchar(255), + vag_spotting_note TEXT, + priortreatment varchar(255), + priortreatment_note TEXT, + pain_menses varchar(25), + pain_level varchar(2), + pain_location varchar(30), + pain_lenth varchar(30), + pain_drug_resp varchar(30), + pain_intercourse varchar(255), + pain_intercourse_time TEXT, + PRIMARY KEY (id) +) ENGINE=MyISAM; + diff --git a/contrib/forms/gyn_ros/view.php b/contrib/forms/gyn_ros/view.php new file mode 100644 index 000000000..ea827881c --- /dev/null +++ b/contrib/forms/gyn_ros/view.php @@ -0,0 +1,471 @@ + tag */ + +/** CHANGE THIS - name of the database table associated with this form **/ +$table_name = 'form_gyn_ros'; + +/** CHANGE THIS name to the name of your form. **/ +$form_name = 'Gyn Review of Systems'; + +/** CHANGE THIS to match the folder you created for this form. **/ +$form_folder = 'gyn_ros'; + +/* Check the access control lists to ensure permissions to this page */ +$thisauth = acl_check('patients', 'med'); +if (!$thisauth) { + die($form_name.': Access Denied.'); +} +/* perform a squad check for pages touching patients, if we're in 'athletic team' mode */ +if ($GLOBALS['athletic_team']!='false') { + $tmp = getPatientData($pid, 'squad'); + if ($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) + $thisauth = 0; +} + +if ($thisauth != 'write' && $thisauth != 'addonly') + die($form_name.': Adding is not authorized.'); +/* Use the formFetch function from api.inc to load the saved record */ +$xyzzy = formFetch($table_name, $_GET['id']); + +/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'cardio_reviewed' => + array( 'field_id' => 'cardio_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'cardio_note' => + array( 'field_id' => 'cardio_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Described the results of the review', + 'list_id' => '' ), + 'gastro_reviewed' => + array( 'field_id' => 'gastro_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'gastro_note' => + array( 'field_id' => 'gastro_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the results of the review', + 'list_id' => '' ), + 'Urinary_reviewed' => + array( 'field_id' => 'Urinary_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'Urinary_note' => + array( 'field_id' => 'Urinary_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the results of the review', + 'list_id' => '' ), + 'cns_reviewed' => + array( 'field_id' => 'cns_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'cns_note' => + array( 'field_id' => 'cns_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the results of the review', + 'list_id' => '' ), + 'other_reviewed' => + array( 'field_id' => 'other_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'other_note' => + array( 'field_id' => 'other_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe system reviewed and the results of the review', + 'list_id' => '' ), + 'complications_reviewed' => + array( 'field_id' => 'complications_reviewed', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'complications_note' => + array( 'field_id' => 'complications_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the complication', + 'list_id' => '' ), + 'lmpdate' => + array( 'field_id' => 'lmpdate', + 'data_type' => '4', + 'fld_length' => '0', + 'description' => 'When was the the first day of your last menstrual period?', + 'list_id' => '' ), + 'cycle_int' => + array( 'field_id' => 'cycle_int', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => 'What is the Interval of your Flow?', + 'list_id' => 'menses_cycle' ), + 'cycle_int_note' => + array( 'field_id' => 'cycle_int_note', + 'data_type' => '3', + 'fld_length' => '100', + 'max_length' => '1', + 'description' => 'Enter any addtional interval information', + 'list_id' => '' ), + 'flowfhcount' => + array( 'field_id' => 'flowfhcount', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '2', + 'description' => 'How many tampons/pads per day', + 'list_id' => '' ), + 'flowhrs' => + array( 'field_id' => 'flowhrs', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '2', + 'description' => 'How many between tampons/pads changes', + 'list_id' => '' ), + 'pmb' => + array( 'field_id' => 'pmb', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_discharge' => + array( 'field_id' => 'vag_discharge', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'If CHECKED you must include a note', + 'list_id' => 'yesno' ), + 'vag_discharge_note' => + array( 'field_id' => 'vag_discharge_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe the color and amount', + 'list_id' => '' ), + 'vag_itching' => + array( 'field_id' => 'vag_itching', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_itching_note' => + array( 'field_id' => 'vag_itching_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'vag_odor' => + array( 'field_id' => 'vag_odor', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_odor_note' => + array( 'field_id' => 'vag_odor_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'vag_irratation' => + array( 'field_id' => 'vag_irratation', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_irratation_note' => + array( 'field_id' => 'vag_irratation_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'vag_spotting' => + array( 'field_id' => 'vag_spotting', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'vag_spotting_note' => + array( 'field_id' => 'vag_spotting_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'priortreatment' => + array( 'field_id' => 'priortreatment', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => 'Have you tried to treat the symptoms prior to this visit', + 'list_id' => 'yesno' ), + 'priortreatment_note' => + array( 'field_id' => 'priortreatment_note', + 'data_type' => '3', + 'fld_length' => '160', + 'max_length' => '3', + 'description' => 'Describe', + 'list_id' => '' ), + 'pain_menses' => + array( 'field_id' => 'pain_menses', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => 'Pain with or between menses?', + 'list_id' => 'menses_pain' ), + 'pain_level' => + array( 'field_id' => 'pain_level', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '2', + 'description' => 'Level of pain 1-10', + 'list_id' => '' ), + 'pain_location' => + array( 'field_id' => 'pain_location', + 'data_type' => '1', + 'fld_length' => '0', + 'description' => 'Select Quadrant', + 'list_id' => 'menses_pain_location' ), + 'pain_lenth' => + array( 'field_id' => 'pain_lenth', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '30', + 'description' => 'Enter Months, Years etc', + 'list_id' => '' ), + 'pain_drug_resp' => + array( 'field_id' => 'pain_drug_resp', + 'data_type' => '2', + 'fld_length' => '10', + 'max_length' => '30', + 'description' => 'Is the pain responsive to OTC drugs? Which?', + 'list_id' => '' ), + 'pain_intercourse' => + array( 'field_id' => 'pain_intercourse', + 'data_type' => '21', + 'fld_length' => '0', + 'description' => '', + 'list_id' => 'yesno' ), + 'pain_intercourse_time' => + array( 'field_id' => 'pain_intercourse_time', + 'data_type' => '3', + 'fld_length' => '120', + 'max_length' => '1', + 'description' => 'How Long, etc?', + 'list_id' => '' ) + ); +$submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=update&return=encounter&id='.$_GET['id']; +if ($_GET['mode']) { + if ($_GET['mode']=='noencounter') { + $submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=new&return=show&id='.$_GET['id']; + $returnurl = 'show.php'; + } +} +else +{ + $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; +} + +/* remove the time-of-day from all date fields */ +if ($xyzzy['lmpdate'] != '') { + $dateparts = split(' ', $xyzzy['lmpdate']); + $xyzzy['lmpdate'] = $dateparts[0]; +} + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Date(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('View '.$form_name); ?> + + + + + + +
+ + +
+
+ + + +
+
+ + +
+
+ + + + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + + + + +
+ (yyyy-mm-dd): + + + [?] + +
+
+ + + + + + +
+
+ + + + +
+
+ +
+
+ + +
+
+ + +
+
+
+ + + + diff --git a/contrib/forms/pelvic_soap/info.txt b/contrib/forms/pelvic_soap/info.txt new file mode 100644 index 000000000..5bb8a9645 --- /dev/null +++ b/contrib/forms/pelvic_soap/info.txt @@ -0,0 +1,2 @@ +POP + diff --git a/contrib/forms/pelvic_soap/new.php b/contrib/forms/pelvic_soap/new.php new file mode 100644 index 000000000..cfcf101b0 --- /dev/null +++ b/contrib/forms/pelvic_soap/new.php @@ -0,0 +1,199 @@ + tag */ + +/** CHANGE THIS name to the name of your form. **/ +$form_name = 'POP'; + +/** CHANGE THIS to match the folder you created for this form. **/ +$form_folder = 'pelvic_soap'; + +/* Check the access control lists to ensure permissions to this page */ +$thisauth = acl_check('patients', 'med'); +if (!$thisauth) { + die($form_name.': Access Denied.'); +} +/* perform a squad check for pages touching patients, if we're in 'athletic team' mode */ +if ($GLOBALS['athletic_team']!='false') { + $tmp = getPatientData($pid, 'squad'); + if ($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) + $thisauth = 0; +} + +if ($thisauth != 'write' && $thisauth != 'addonly') + die($form_name.': Adding is not authorized.'); +/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'pelvic_complaints' => + array( 'field_id' => 'pelvic_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Complaints' ), + 'pelvic_exam' => + array( 'field_id' => 'pelvic_exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Exam' ), + 'pelvic_assessment' => + array( 'field_id' => 'pelvic_assessment', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Assessment' ), + 'pelvic_plan' => + array( 'field_id' => 'pelvic_plan', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Plan' ), + 'plan_discussion' => + array( 'field_id' => 'plan_discussion', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ) + ); +$submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=new&return=encounter'; +/* no get logic here */ +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('New '.$form_name); ?> + + + + + + +
+ + +
+
+ + +
+
+ + +
+
+ + + + + + + +
+ +
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+
+ + + + diff --git a/contrib/forms/pelvic_soap/print.php b/contrib/forms/pelvic_soap/print.php new file mode 100644 index 000000000..70c898e23 --- /dev/null +++ b/contrib/forms/pelvic_soap/print.php @@ -0,0 +1,143 @@ + + array( 'field_id' => 'pelvic_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Complaints' ), + 'pelvic_exam' => + array( 'field_id' => 'pelvic_exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Exam' ), + 'pelvic_assessment' => + array( 'field_id' => 'pelvic_assessment', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Assessment' ), + 'pelvic_plan' => + array( 'field_id' => 'pelvic_plan', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Plan' ), + 'plan_discussion' => + array( 'field_id' => 'plan_discussion', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ) + ); + +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('Print '.$form_name); ?> + + + + + + +
+
+ + + + +
+ + + + diff --git a/contrib/forms/pelvic_soap/report.php b/contrib/forms/pelvic_soap/report.php new file mode 100644 index 000000000..1c6b8adb9 --- /dev/null +++ b/contrib/forms/pelvic_soap/report.php @@ -0,0 +1,106 @@ + 'checkbox_combo_list','pelvic_exam' => 'checkbox_combo_list','pelvic_assessment' => 'checkbox_combo_list','pelvic_plan' => 'checkbox_combo_list','plan_discussion' => 'textarea');/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'pelvic_complaints' => + array( 'field_id' => 'pelvic_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Complaints' ), + 'pelvic_exam' => + array( 'field_id' => 'pelvic_exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Exam' ), + 'pelvic_assessment' => + array( 'field_id' => 'pelvic_assessment', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Assessment' ), + 'pelvic_plan' => + array( 'field_id' => 'pelvic_plan', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Plan' ), + 'plan_discussion' => + array( 'field_id' => 'plan_discussion', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ) + ); +/* an array of the lists the fields may draw on. */ +$lists = array(); + $data = formFetch($table_name, $id); + if ($data) { + + echo ''; + + foreach($data as $key => $value) { + if ($key == 'id' || $key == 'pid' || $key == 'user' || + $key == 'groupname' || $key == 'authorized' || + $key == 'activity' || $key == 'date' || + $value == '' || $value == '0000-00-00 00:00:00' || + $value == 'n') + { + /* skip built-in fields and "blank data". */ + continue; + } + + /* display 'yes' instead of 'on'. */ + if ($value == 'on') { + $value = 'yes'; + } + + /* remove the time-of-day from the 'date' fields. */ + if ($field_names[$key] == 'date') + if ($value != '') { + $dateparts = split(' ', $value); + $value = $dateparts[0]; + } + + if ( $field_names[$key] == 'checkbox_combo_list' ) { + $value = generate_display_field( $manual_layouts[$key], $value ); + } + + /* replace underscores with spaces, and uppercase all words. */ + /* this is a primitive form of converting the column names into something displayable. */ + $key=ucwords(str_replace('_',' ',$key)); + $mykey = $key; + $myval = $value; + echo ''; + + + $count++; + if ($count == $cols) { + $count = 0; + echo '' . PHP_EOL; + } + } + } + echo '
'.xl("$mykey").': '.xl("$myval").'

'; +} +?> + diff --git a/contrib/forms/pelvic_soap/save.php b/contrib/forms/pelvic_soap/save.php new file mode 100644 index 000000000..3f892ae0e --- /dev/null +++ b/contrib/forms/pelvic_soap/save.php @@ -0,0 +1,156 @@ + 'checkbox_combo_list','pelvic_exam' => 'checkbox_combo_list','pelvic_assessment' => 'checkbox_combo_list','pelvic_plan' => 'checkbox_combo_list','plan_discussion' => 'textarea'); +/* an array of the lists the fields may draw on. */ +$lists = array('pelvic_complaints' => 'Pelvic_Complaints', 'pelvic_exam' => 'Pelvic_Exam', 'pelvic_assessment' => 'Pelvic_Assessment', 'pelvic_plan' => 'Pelvic_Plan'); + +/* get each field from $_POST[], storing them into $field_names associated with their names. */ +foreach($field_names as $key=>$val) +{ + $pos = ''; + $neg = ''; + if ($val == 'textbox' || $val == 'textarea' || $val == 'provider' || $val == 'textfield') + { + $field_names[$key]=$_POST['form_'.$key]; + } + if ($val == 'date') + { + $field_names[$key]=$_POST[$key]; + } + if (($val == 'checkbox_list' )) + { + $field_names[$key]=''; + if (isset($_POST['form_'.$key]) && $_POST['form_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if (is_array($_POST['form_'.$key])) + { + if ($_POST['form_'.$key][$lrow[option_id]]) + { + if ($field_names[$key] != '') + $field_names[$key]=$field_names[$key].'|'; + $field_names[$key] = $field_names[$key].$lrow[option_id]; + } + } + } + } + } + if (($val == 'checkbox_combo_list')) + { + $field_names[$key]=''; + if (isset($_POST['check_'.$key]) && $_POST['check_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if (is_array($_POST['check_'.$key])) + { + if ($_POST['check_'.$key][$lrow[option_id]]) + { + if ($field_names[$key] != '') + $field_names[$key]=$field_names[$key].'|'; + $field_names[$key] = $field_names[$key].$lrow[option_id].":xx".$_POST['form_'.$key][$lrow[option_id]]; + } + } + } + } + } + if (($val == 'dropdown_list')) + { + $field_names[$key]=''; + if (isset($_POST['form_'.$key]) && $_POST['form_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if ($_POST['form_'.$key] == $lrow[option_id]) + { + $field_names[$key]=$lrow[option_id]; + break; + } + } + } + } +} + +/* at this point, field_names[] contains an array of name->value pairs of the fields we expected from the form. */ + +/* escape form data for entry to the database. */ +foreach ($field_names as $k => $var) { + $field_names[$k] = formDataCore($var); +} + +if ($encounter == '') $encounter = date('Ymd'); + +if ($_GET['mode'] == 'new') { + /* NOTE - for customization you can replace $_POST with your own array + * of key=>value pairs where 'key' is the table field name and + * 'value' is whatever it should be set to + * ex) $newrecord['parent_sig'] = $_POST['sig']; + * $newid = formSubmit($table_name, $newrecord, $_GET['id'], $userauthorized); + */ + + /* make sure we're at the beginning of the array */ + reset($field_names); + + /* save the data into the form's encounter-based table */ + $newid = formSubmit($table_name, $field_names, $_GET['id'], $userauthorized); + /* link this form into the encounter. */ + addForm($encounter, $form_name, $newid, $form_folder, $pid, $userauthorized); +} + +elseif ($_GET['mode'] == 'update') { + /* make sure we're at the beginning of the array */ + reset($field_names); + + /* update the data in the form's table */ + $success = formUpdate($table_name, $field_names, $_GET['id'], $userauthorized); + /* sqlInsert('update '.$table_name." set pid = {".$_SESSION['pid']."},groupname='".$_SESSION['authProvider']."',user='".$_SESSION['authUser']."',authorized=$userauthorized,activity=1,date = NOW(), where id=$id"); */ +} + + +$_SESSION['encounter'] = $encounter; + +formHeader('Redirecting....'); +/* defaults to the encounters page. */ +formJump(); + +formFooter(); +?> + diff --git a/contrib/forms/pelvic_soap/show.php b/contrib/forms/pelvic_soap/show.php new file mode 100644 index 000000000..a6a93056d --- /dev/null +++ b/contrib/forms/pelvic_soap/show.php @@ -0,0 +1,163 @@ + + array( 'field_id' => 'pelvic_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Complaints' ), + 'pelvic_exam' => + array( 'field_id' => 'pelvic_exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Exam' ), + 'pelvic_assessment' => + array( 'field_id' => 'pelvic_assessment', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Assessment' ), + 'pelvic_plan' => + array( 'field_id' => 'pelvic_plan', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Plan' ), + 'plan_discussion' => + array( 'field_id' => 'plan_discussion', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ) + ); + +/* since we have no-where to return, abuse returnurl to link to the 'edit' page */ +/* FIXME: pass the ID, create blank rows if necissary. */ +$returnurl = "../../forms/$form_folder/view.php?mode=noencounter"; + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('Show '.$form_name); ?> + + + + +
+ + + + + + +
+ +
+ + +
+ +
+ + + + + + + + +
 
+ + +
+ +
+ + +
+
+ +
+
+ +
+ + + + diff --git a/contrib/forms/pelvic_soap/style.css b/contrib/forms/pelvic_soap/style.css new file mode 100644 index 000000000..7feab16db --- /dev/null +++ b/contrib/forms/pelvic_soap/style.css @@ -0,0 +1,114 @@ +/* This CSS is used ONLY by the form defined in this same folder + * customize it as you see fit for your specific form + */ + +/* turn off borders for fieldsets, to make them invisible */ +fieldset { +border: none; +} + +/* links should be undersized */ +.link { + font-size: 80%; +} + +/* links should grow when clicked */ +.link_submit { + font-size: 120%; +} + + +/* give section objects blue borders, bold cell labels, */ +.section { + border: solid; + border-width: 1px; + border-color: #0000ff; + margin: 0 0 0 10pt; + padding: 5pt; +} + +/* prevent the checkboxes on our sections from bunching up. */ +span.sectionlabel { +page-break-after: always; +} + +/* disappear the top button bar */ +.top_buttons { + display: none; +} + +/* center the bottom button bar */ +.button_bar { +text-align: center; +} + +/* section labels should be visible, and bold in view, new, ??...*/ +.sectionlabel { + font-family: sans-serif; + font-weight: bold; +} + +/* section labels on the show page. turn them green, and bold. */ +#show .sectionlabel { + color: #080; + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + height: 2em; +} + + +/* field labels should also be visible, and bold. */ +.fieldlabel { + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + height: 2em; +} + +/* field labels on the show page. turn them bold. */ +#show .fieldlabel { + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + width: 25%; +} + +/* Put some spacing around the edges of the form. */ +body { + padding: 5pt 5pt 5pt 5pt; +} + +/* Use a single font style for most objects in this page. */ +body, td, select { + font-family: Arial, Helvetica, sans-serif; +} + +input { + font-family: Arial, Helvetica, sans-serif; +} + +.save { + margin-left: 2pt; + margin-right: 2pt; +} + +.dontsave { + margin-left: 2pt; + margin-right: 2pt; +} + +.print { + margin-left: 2pt; + margin-right: 2pt; +} + +/* HACK: keep textareas at an eight point font, so they don't get too wide for our 750px 'view' and 'new' pages. */ +textarea { + font-size: 8pt; +} + + diff --git a/contrib/forms/pelvic_soap/table.sql b/contrib/forms/pelvic_soap/table.sql new file mode 100644 index 000000000..f64aa6360 --- /dev/null +++ b/contrib/forms/pelvic_soap/table.sql @@ -0,0 +1,154 @@ +CREATE TABLE IF NOT EXISTS `form_pelvic_soap` ( + /* both extended and encounter forms need a last modified date */ + date datetime default NULL comment 'last modified date', + /* these fields are common to all encounter forms. */ + id bigint(20) NOT NULL auto_increment, + pid bigint(20) NOT NULL default 0, + user varchar(255) default NULL, + groupname varchar(255) default NULL, + authorized tinyint(4) default NULL, + activity tinyint(4) default NULL, + pelvic_complaints varchar(255), + pelvic_exam varchar(255), + pelvic_assessment varchar(255), + pelvic_plan varchar(255), + plan_discussion TEXT, + PRIMARY KEY (id) +) ENGINE=InnoDB; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Pelvic_Complaints', + title='Pelvic Complaints'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Complaints', + option_id='1', + title='Pressure', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Complaints', + option_id='2', + title='Something Down There', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Complaints', + option_id='3', + title='Bladder Changes', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Complaints', + option_id='4', + title='Bleeding', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Complaints', + option_id='5', + title='Pain', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Complaints', + option_id='6', + title='Other', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Pelvic_Exam', + title='Pelvic Exam'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Exam', + option_id='1', + title='Apical', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Exam', + option_id='2', + title='Cystocele', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Exam', + option_id='3', + title='Rectocele', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Exam', + option_id='4', + title='POP Q', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Exam', + option_id='5', + title='Urethra', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Exam', + option_id='6', + title='Kegels', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Exam', + option_id='7', + title='Other', + seq='7'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Pelvic_Assessment', + title='Pelvic Assessment'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Assessment', + option_id='1', + title='POP', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Assessment', + option_id='2', + title='Cystocele', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Assessment', + option_id='3', + title='Rectocele', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Assessment', + option_id='4', + title='Apical Prolapse', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Assessment', + option_id='5', + title='Hypermobile Urethra', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Assessment', + option_id='6', + title='Other', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Pelvic_Plan', + title='Pelvic Plan'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Plan', + option_id='1', + title='Anterior Repair Elevate', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Plan', + option_id='2', + title='Posterior Repair Elevate', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Plan', + option_id='3', + title='Robotic ASC', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Plan', + option_id='4', + title='Mini-arc', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Plan', + option_id='5', + title='Transobterator', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Plan', + option_id='6', + title='Transvaginal Tape (TVT)', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Plan', + option_id='7', + title='Sonogram', + seq='7'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Plan', + option_id='8', + title='Cystoscopy', + seq='8'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Plan', + option_id='9', + title='Cystometrogram', + seq='9'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Plan', + option_id='10', + title='Pessary', + seq='10'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Plan', + option_id='11', + title='Kegels', + seq='11'; +INSERT IGNORE INTO list_options SET list_id='Pelvic_Plan', + option_id='12', + title='Other', + seq='12'; + diff --git a/contrib/forms/pelvic_soap/view.php b/contrib/forms/pelvic_soap/view.php new file mode 100644 index 000000000..e04b55286 --- /dev/null +++ b/contrib/forms/pelvic_soap/view.php @@ -0,0 +1,207 @@ + tag */ + +/** CHANGE THIS - name of the database table associated with this form **/ +$table_name = 'form_pelvic_soap'; + +/** CHANGE THIS name to the name of your form. **/ +$form_name = 'POP'; + +/** CHANGE THIS to match the folder you created for this form. **/ +$form_folder = 'pelvic_soap'; + +/* Check the access control lists to ensure permissions to this page */ +$thisauth = acl_check('patients', 'med'); +if (!$thisauth) { + die($form_name.': Access Denied.'); +} +/* perform a squad check for pages touching patients, if we're in 'athletic team' mode */ +if ($GLOBALS['athletic_team']!='false') { + $tmp = getPatientData($pid, 'squad'); + if ($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) + $thisauth = 0; +} + +if ($thisauth != 'write' && $thisauth != 'addonly') + die($form_name.': Adding is not authorized.'); +/* Use the formFetch function from api.inc to load the saved record */ +$xyzzy = formFetch($table_name, $_GET['id']); + +/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'pelvic_complaints' => + array( 'field_id' => 'pelvic_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Complaints' ), + 'pelvic_exam' => + array( 'field_id' => 'pelvic_exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Exam' ), + 'pelvic_assessment' => + array( 'field_id' => 'pelvic_assessment', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Assessment' ), + 'pelvic_plan' => + array( 'field_id' => 'pelvic_plan', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Pelvic_Plan' ), + 'plan_discussion' => + array( 'field_id' => 'plan_discussion', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ) + ); +$submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=update&return=encounter&id='.$_GET['id']; +if ($_GET['mode']) { + if ($_GET['mode']=='noencounter') { + $submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=new&return=show&id='.$_GET['id']; + $returnurl = 'show.php'; + } +} +else +{ + $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; +} + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('View '.$form_name); ?> + + + + + + +
+ + +
+
+ + + +
+
+ + +
+
+ + + + + + + +
+ +
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ + + +
+
+
+ + + + diff --git a/contrib/forms/urinary_soap/info.txt b/contrib/forms/urinary_soap/info.txt new file mode 100644 index 000000000..17ab0d270 --- /dev/null +++ b/contrib/forms/urinary_soap/info.txt @@ -0,0 +1,2 @@ +Urinary Symptoms + diff --git a/contrib/forms/urinary_soap/new.php b/contrib/forms/urinary_soap/new.php new file mode 100644 index 000000000..9c618dbc4 --- /dev/null +++ b/contrib/forms/urinary_soap/new.php @@ -0,0 +1,215 @@ + tag */ + +/** CHANGE THIS name to the name of your form. **/ +$form_name = 'Urinary Symptoms'; + +/** CHANGE THIS to match the folder you created for this form. **/ +$form_folder = 'urinary_soap'; + +/* Check the access control lists to ensure permissions to this page */ +$thisauth = acl_check('patients', 'med'); +if (!$thisauth) { + die($form_name.': Access Denied.'); +} +/* perform a squad check for pages touching patients, if we're in 'athletic team' mode */ +if ($GLOBALS['athletic_team']!='false') { + $tmp = getPatientData($pid, 'squad'); + if ($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) + $thisauth = 0; +} + +if ($thisauth != 'write' && $thisauth != 'addonly') + die($form_name.': Adding is not authorized.'); +/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'urinary_complaints' => + array( 'field_id' => 'urinary_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Complaints' ), + 'previous_cultures' => + array( 'field_id' => 'previous_cultures', + 'data_type' => '2', + 'fld_length' => '151', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'duration' => + array( 'field_id' => 'duration', + 'data_type' => '2', + 'fld_length' => '140', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exam' => + array( 'field_id' => 'exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Exam' ), + 'diagnosis' => + array( 'field_id' => 'diagnosis', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Diagnosis' ), + 'plan' => + array( 'field_id' => 'plan', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Plans' ) + ); +$submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=new&return=encounter'; +/* no get logic here */ +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('New '.$form_name); ?> + + + + + + +
+ + +
+
+ + +
+
+ + +
+
+ + + + + + + +
+ + + + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ + +
+
+
+ + + + diff --git a/contrib/forms/urinary_soap/print.php b/contrib/forms/urinary_soap/print.php new file mode 100644 index 000000000..851ac78de --- /dev/null +++ b/contrib/forms/urinary_soap/print.php @@ -0,0 +1,159 @@ + + array( 'field_id' => 'urinary_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Complaints' ), + 'previous_cultures' => + array( 'field_id' => 'previous_cultures', + 'data_type' => '2', + 'fld_length' => '151', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'duration' => + array( 'field_id' => 'duration', + 'data_type' => '2', + 'fld_length' => '140', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exam' => + array( 'field_id' => 'exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Exam' ), + 'diagnosis' => + array( 'field_id' => 'diagnosis', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Diagnosis' ), + 'plan' => + array( 'field_id' => 'plan', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Plans' ) + ); + +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('Print '.$form_name); ?> + + + + + + +
+
+ + + + +
+ + + + diff --git a/contrib/forms/urinary_soap/report.php b/contrib/forms/urinary_soap/report.php new file mode 100644 index 000000000..1b0354d56 --- /dev/null +++ b/contrib/forms/urinary_soap/report.php @@ -0,0 +1,120 @@ + 'checkbox_combo_list','previous_cultures' => 'textfield','other' => 'textarea','duration' => 'textfield','exam' => 'checkbox_combo_list','diagnosis' => 'checkbox_combo_list','plan' => 'checkbox_combo_list');/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'urinary_complaints' => + array( 'field_id' => 'urinary_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Complaints' ), + 'previous_cultures' => + array( 'field_id' => 'previous_cultures', + 'data_type' => '2', + 'fld_length' => '151', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'duration' => + array( 'field_id' => 'duration', + 'data_type' => '2', + 'fld_length' => '140', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exam' => + array( 'field_id' => 'exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Exam' ), + 'diagnosis' => + array( 'field_id' => 'diagnosis', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Diagnosis' ), + 'plan' => + array( 'field_id' => 'plan', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Plans' ) + ); +/* an array of the lists the fields may draw on. */ +$lists = array(); + $data = formFetch($table_name, $id); + if ($data) { + + echo ''; + + foreach($data as $key => $value) { + if ($key == 'id' || $key == 'pid' || $key == 'user' || + $key == 'groupname' || $key == 'authorized' || + $key == 'activity' || $key == 'date' || + $value == '' || $value == '0000-00-00 00:00:00' || + $value == 'n') + { + /* skip built-in fields and "blank data". */ + continue; + } + + /* display 'yes' instead of 'on'. */ + if ($value == 'on') { + $value = 'yes'; + } + + /* remove the time-of-day from the 'date' fields. */ + if ($field_names[$key] == 'date') + if ($value != '') { + $dateparts = split(' ', $value); + $value = $dateparts[0]; + } + + if ( $field_names[$key] == 'checkbox_combo_list' ) { + $value = generate_display_field( $manual_layouts[$key], $value ); + } + + /* replace underscores with spaces, and uppercase all words. */ + /* this is a primitive form of converting the column names into something displayable. */ + $key=ucwords(str_replace('_',' ',$key)); + $mykey = $key; + $myval = $value; + echo ''; + + + $count++; + if ($count == $cols) { + $count = 0; + echo '' . PHP_EOL; + } + } + } + echo '
'.xl("$mykey").': '.xl("$myval").'

'; +} +?> + diff --git a/contrib/forms/urinary_soap/save.php b/contrib/forms/urinary_soap/save.php new file mode 100644 index 000000000..12c4d49e0 --- /dev/null +++ b/contrib/forms/urinary_soap/save.php @@ -0,0 +1,156 @@ + 'checkbox_combo_list','previous_cultures' => 'textfield','other' => 'textarea','duration' => 'textfield','exam' => 'checkbox_combo_list','diagnosis' => 'checkbox_combo_list','plan' => 'checkbox_combo_list'); +/* an array of the lists the fields may draw on. */ +$lists = array('urinary_complaints' => 'Urinary_Complaints', 'exam' => 'Urinary_Exam', 'diagnosis' => 'Urinary_Diagnosis', 'plan' => 'Urinary_Plans'); + +/* get each field from $_POST[], storing them into $field_names associated with their names. */ +foreach($field_names as $key=>$val) +{ + $pos = ''; + $neg = ''; + if ($val == 'textbox' || $val == 'textarea' || $val == 'provider' || $val == 'textfield') + { + $field_names[$key]=$_POST['form_'.$key]; + } + if ($val == 'date') + { + $field_names[$key]=$_POST[$key]; + } + if (($val == 'checkbox_list' )) + { + $field_names[$key]=''; + if (isset($_POST['form_'.$key]) && $_POST['form_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if (is_array($_POST['form_'.$key])) + { + if ($_POST['form_'.$key][$lrow[option_id]]) + { + if ($field_names[$key] != '') + $field_names[$key]=$field_names[$key].'|'; + $field_names[$key] = $field_names[$key].$lrow[option_id]; + } + } + } + } + } + if (($val == 'checkbox_combo_list')) + { + $field_names[$key]=''; + if (isset($_POST['check_'.$key]) && $_POST['check_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if (is_array($_POST['check_'.$key])) + { + if ($_POST['check_'.$key][$lrow[option_id]]) + { + if ($field_names[$key] != '') + $field_names[$key]=$field_names[$key].'|'; + $field_names[$key] = $field_names[$key].$lrow[option_id].":xx".$_POST['form_'.$key][$lrow[option_id]]; + } + } + } + } + } + if (($val == 'dropdown_list')) + { + $field_names[$key]=''; + if (isset($_POST['form_'.$key]) && $_POST['form_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if ($_POST['form_'.$key] == $lrow[option_id]) + { + $field_names[$key]=$lrow[option_id]; + break; + } + } + } + } +} + +/* at this point, field_names[] contains an array of name->value pairs of the fields we expected from the form. */ + +/* escape form data for entry to the database. */ +foreach ($field_names as $k => $var) { + $field_names[$k] = formDataCore($var); +} + +if ($encounter == '') $encounter = date('Ymd'); + +if ($_GET['mode'] == 'new') { + /* NOTE - for customization you can replace $_POST with your own array + * of key=>value pairs where 'key' is the table field name and + * 'value' is whatever it should be set to + * ex) $newrecord['parent_sig'] = $_POST['sig']; + * $newid = formSubmit($table_name, $newrecord, $_GET['id'], $userauthorized); + */ + + /* make sure we're at the beginning of the array */ + reset($field_names); + + /* save the data into the form's encounter-based table */ + $newid = formSubmit($table_name, $field_names, $_GET['id'], $userauthorized); + /* link this form into the encounter. */ + addForm($encounter, $form_name, $newid, $form_folder, $pid, $userauthorized); +} + +elseif ($_GET['mode'] == 'update') { + /* make sure we're at the beginning of the array */ + reset($field_names); + + /* update the data in the form's table */ + $success = formUpdate($table_name, $field_names, $_GET['id'], $userauthorized); + /* sqlInsert('update '.$table_name." set pid = {".$_SESSION['pid']."},groupname='".$_SESSION['authProvider']."',user='".$_SESSION['authUser']."',authorized=$userauthorized,activity=1,date = NOW(), where id=$id"); */ +} + + +$_SESSION['encounter'] = $encounter; + +formHeader('Redirecting....'); +/* defaults to the encounters page. */ +formJump(); + +formFooter(); +?> + diff --git a/contrib/forms/urinary_soap/show.php b/contrib/forms/urinary_soap/show.php new file mode 100644 index 000000000..90a7d5498 --- /dev/null +++ b/contrib/forms/urinary_soap/show.php @@ -0,0 +1,179 @@ + + array( 'field_id' => 'urinary_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Complaints' ), + 'previous_cultures' => + array( 'field_id' => 'previous_cultures', + 'data_type' => '2', + 'fld_length' => '151', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'duration' => + array( 'field_id' => 'duration', + 'data_type' => '2', + 'fld_length' => '140', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exam' => + array( 'field_id' => 'exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Exam' ), + 'diagnosis' => + array( 'field_id' => 'diagnosis', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Diagnosis' ), + 'plan' => + array( 'field_id' => 'plan', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Plans' ) + ); + +/* since we have no-where to return, abuse returnurl to link to the 'edit' page */ +/* FIXME: pass the ID, create blank rows if necissary. */ +$returnurl = "../../forms/$form_folder/view.php?mode=noencounter"; + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('Show '.$form_name); ?> + + + + +
+ + + + + + +
+ +
+ + +
+ +
+ + + + + + + + + + +
 
 
 
+ + +
+ +
+ + +
+
+ +
+
+ +
+ + + + diff --git a/contrib/forms/urinary_soap/style.css b/contrib/forms/urinary_soap/style.css new file mode 100644 index 000000000..7feab16db --- /dev/null +++ b/contrib/forms/urinary_soap/style.css @@ -0,0 +1,114 @@ +/* This CSS is used ONLY by the form defined in this same folder + * customize it as you see fit for your specific form + */ + +/* turn off borders for fieldsets, to make them invisible */ +fieldset { +border: none; +} + +/* links should be undersized */ +.link { + font-size: 80%; +} + +/* links should grow when clicked */ +.link_submit { + font-size: 120%; +} + + +/* give section objects blue borders, bold cell labels, */ +.section { + border: solid; + border-width: 1px; + border-color: #0000ff; + margin: 0 0 0 10pt; + padding: 5pt; +} + +/* prevent the checkboxes on our sections from bunching up. */ +span.sectionlabel { +page-break-after: always; +} + +/* disappear the top button bar */ +.top_buttons { + display: none; +} + +/* center the bottom button bar */ +.button_bar { +text-align: center; +} + +/* section labels should be visible, and bold in view, new, ??...*/ +.sectionlabel { + font-family: sans-serif; + font-weight: bold; +} + +/* section labels on the show page. turn them green, and bold. */ +#show .sectionlabel { + color: #080; + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + height: 2em; +} + + +/* field labels should also be visible, and bold. */ +.fieldlabel { + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + height: 2em; +} + +/* field labels on the show page. turn them bold. */ +#show .fieldlabel { + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + width: 25%; +} + +/* Put some spacing around the edges of the form. */ +body { + padding: 5pt 5pt 5pt 5pt; +} + +/* Use a single font style for most objects in this page. */ +body, td, select { + font-family: Arial, Helvetica, sans-serif; +} + +input { + font-family: Arial, Helvetica, sans-serif; +} + +.save { + margin-left: 2pt; + margin-right: 2pt; +} + +.dontsave { + margin-left: 2pt; + margin-right: 2pt; +} + +.print { + margin-left: 2pt; + margin-right: 2pt; +} + +/* HACK: keep textareas at an eight point font, so they don't get too wide for our 750px 'view' and 'new' pages. */ +textarea { + font-size: 8pt; +} + + diff --git a/contrib/forms/urinary_soap/table.sql b/contrib/forms/urinary_soap/table.sql new file mode 100644 index 000000000..fe9788676 --- /dev/null +++ b/contrib/forms/urinary_soap/table.sql @@ -0,0 +1,128 @@ +CREATE TABLE IF NOT EXISTS `form_urinary_soap` ( + /* both extended and encounter forms need a last modified date */ + date datetime default NULL comment 'last modified date', + /* these fields are common to all encounter forms. */ + id bigint(20) NOT NULL auto_increment, + pid bigint(20) NOT NULL default 0, + user varchar(255) default NULL, + groupname varchar(255) default NULL, + authorized tinyint(4) default NULL, + activity tinyint(4) default NULL, + urinary_complaints varchar(255), + previous_cultures varchar(255), + other TEXT, + duration varchar(255), + exam varchar(255), + diagnosis varchar(255), + plan varchar(255), + PRIMARY KEY (id) +) ENGINE=InnoDB; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Urinary_Complaints', + title='Urinary Complaints'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Complaints', + option_id='1', + title='Frequency', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Complaints', + option_id='2', + title='Urgency', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Complaints', + option_id='3', + title='Incontinence', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Complaints', + option_id='4', + title='Dysuria', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Complaints', + option_id='5', + title='Other', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Urinary_Exam', + title='Urinary Exam'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Exam', + option_id='1', + title='Vulvar', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Exam', + option_id='2', + title='Vaginal', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Exam', + option_id='3', + title='Cervix', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Exam', + option_id='4', + title='Uterus', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Exam', + option_id='5', + title='Adnexae', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Exam', + option_id='6', + title='Rectal', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Exam', + option_id='7', + title='Other', + seq='7'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Urinary_Diagnosis', + title='Urinary Diagnosis'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Diagnosis', + option_id='1', + title='UTI', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Diagnosis', + option_id='2', + title='Hematuria', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Diagnosis', + option_id='3', + title='Chronic/Recurrent Cystitis', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Diagnosis', + option_id='4', + title='Duration', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Diagnosis', + option_id='5', + title='OAB (Overactive Bladder)', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Diagnosis', + option_id='6', + title='Other', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Urinary_Plans', + title='Urinary Plans'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Plans', + option_id='1', + title='Antibiotics', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Plans', + option_id='2', + title='Urine Cultire and Sensitivity', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Plans', + option_id='3', + title='Cystoscopy and Cystometrogram', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Plans', + option_id='4', + title='Anticholinergic', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Plans', + option_id='5', + title='Behavior Modification', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='Urinary_Plans', + option_id='6', + title='Other', + seq='6'; + diff --git a/contrib/forms/urinary_soap/view.php b/contrib/forms/urinary_soap/view.php new file mode 100644 index 000000000..251f13666 --- /dev/null +++ b/contrib/forms/urinary_soap/view.php @@ -0,0 +1,223 @@ + tag */ + +/** CHANGE THIS - name of the database table associated with this form **/ +$table_name = 'form_urinary_soap'; + +/** CHANGE THIS name to the name of your form. **/ +$form_name = 'Urinary Symptoms'; + +/** CHANGE THIS to match the folder you created for this form. **/ +$form_folder = 'urinary_soap'; + +/* Check the access control lists to ensure permissions to this page */ +$thisauth = acl_check('patients', 'med'); +if (!$thisauth) { + die($form_name.': Access Denied.'); +} +/* perform a squad check for pages touching patients, if we're in 'athletic team' mode */ +if ($GLOBALS['athletic_team']!='false') { + $tmp = getPatientData($pid, 'squad'); + if ($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) + $thisauth = 0; +} + +if ($thisauth != 'write' && $thisauth != 'addonly') + die($form_name.': Adding is not authorized.'); +/* Use the formFetch function from api.inc to load the saved record */ +$xyzzy = formFetch($table_name, $_GET['id']); + +/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'urinary_complaints' => + array( 'field_id' => 'urinary_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Complaints' ), + 'previous_cultures' => + array( 'field_id' => 'previous_cultures', + 'data_type' => '2', + 'fld_length' => '151', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'duration' => + array( 'field_id' => 'duration', + 'data_type' => '2', + 'fld_length' => '140', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'exam' => + array( 'field_id' => 'exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Exam' ), + 'diagnosis' => + array( 'field_id' => 'diagnosis', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Diagnosis' ), + 'plan' => + array( 'field_id' => 'plan', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Urinary_Plans' ) + ); +$submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=update&return=encounter&id='.$_GET['id']; +if ($_GET['mode']) { + if ($_GET['mode']=='noencounter') { + $submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=new&return=show&id='.$_GET['id']; + $returnurl = 'show.php'; + } +} +else +{ + $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; +} + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('View '.$form_name); ?> + + + + + + +
+ + +
+
+ + + +
+
+ + +
+
+ + + + + + + +
+ + + + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ + + +
+
+
+ + + + diff --git a/contrib/forms/vaginitis_soap/info.txt b/contrib/forms/vaginitis_soap/info.txt new file mode 100644 index 000000000..d8a96b7ab --- /dev/null +++ b/contrib/forms/vaginitis_soap/info.txt @@ -0,0 +1,2 @@ +Vaginitis Complaints + diff --git a/contrib/forms/vaginitis_soap/new.php b/contrib/forms/vaginitis_soap/new.php new file mode 100644 index 000000000..505d6d836 --- /dev/null +++ b/contrib/forms/vaginitis_soap/new.php @@ -0,0 +1,230 @@ + tag */ + +/** CHANGE THIS name to the name of your form. **/ +$form_name = 'Vaginitis Complaints'; + +/** CHANGE THIS to match the folder you created for this form. **/ +$form_folder = 'vaginitis_soap'; + +/* Check the access control lists to ensure permissions to this page */ +$thisauth = acl_check('patients', 'med'); +if (!$thisauth) { + die($form_name.': Access Denied.'); +} +/* perform a squad check for pages touching patients, if we're in 'athletic team' mode */ +if ($GLOBALS['athletic_team']!='false') { + $tmp = getPatientData($pid, 'squad'); + if ($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) + $thisauth = 0; +} + +if ($thisauth != 'write' && $thisauth != 'addonly') + die($form_name.': Adding is not authorized.'); +/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'vaginitis_complaints' => + array( 'field_id' => 'vaginitis_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Complaints' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'duration' => + array( 'field_id' => 'duration', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'objective_exam' => + array( 'field_id' => 'objective_exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Exam' ), + 'vaginitis' => + array( 'field_id' => 'vaginitis', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Diagnosis' ), + 'plan_medications' => + array( 'field_id' => 'plan_medications', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Medications' ), + 'plan_behavior_modification' => + array( 'field_id' => 'plan_behavior_modification', + 'data_type' => '3', + 'fld_length' => '40', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'plan_cultures' => + array( 'field_id' => 'plan_cultures', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Cultures' ), + 'plan_other' => + array( 'field_id' => 'plan_other', + 'data_type' => '3', + 'fld_length' => '40', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ) + ); +$submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=new&return=encounter'; +/* no get logic here */ +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('New '.$form_name); ?> + + + + + + +
+ + +
+
+ + +
+
+ + +
+
+ + + + + + + +
+ + + +
+
+ +
+
+ +
+
+ + + + +
+
+ +
+
+ + +
+
+ + +
+
+
+ + + + diff --git a/contrib/forms/vaginitis_soap/print.php b/contrib/forms/vaginitis_soap/print.php new file mode 100644 index 000000000..30250f70b --- /dev/null +++ b/contrib/forms/vaginitis_soap/print.php @@ -0,0 +1,174 @@ + + array( 'field_id' => 'vaginitis_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Complaints' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'duration' => + array( 'field_id' => 'duration', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'objective_exam' => + array( 'field_id' => 'objective_exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Exam' ), + 'vaginitis' => + array( 'field_id' => 'vaginitis', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Diagnosis' ), + 'plan_medications' => + array( 'field_id' => 'plan_medications', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Medications' ), + 'plan_behavior_modification' => + array( 'field_id' => 'plan_behavior_modification', + 'data_type' => '3', + 'fld_length' => '40', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'plan_cultures' => + array( 'field_id' => 'plan_cultures', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Cultures' ), + 'plan_other' => + array( 'field_id' => 'plan_other', + 'data_type' => '3', + 'fld_length' => '40', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ) + ); + +$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('Print '.$form_name); ?> + + + + + + +
+
+ + + + +
+ + + + diff --git a/contrib/forms/vaginitis_soap/report.php b/contrib/forms/vaginitis_soap/report.php new file mode 100644 index 000000000..48b8903dd --- /dev/null +++ b/contrib/forms/vaginitis_soap/report.php @@ -0,0 +1,133 @@ + 'checkbox_combo_list','other' => 'textarea','duration' => 'textfield','objective_exam' => 'checkbox_combo_list','vaginitis' => 'checkbox_combo_list','plan_medications' => 'checkbox_combo_list','plan_behavior_modification' => 'textarea','plan_cultures' => 'checkbox_combo_list','plan_other' => 'textarea');/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'vaginitis_complaints' => + array( 'field_id' => 'vaginitis_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Complaints' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'duration' => + array( 'field_id' => 'duration', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'objective_exam' => + array( 'field_id' => 'objective_exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Exam' ), + 'vaginitis' => + array( 'field_id' => 'vaginitis', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Diagnosis' ), + 'plan_medications' => + array( 'field_id' => 'plan_medications', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Medications' ), + 'plan_behavior_modification' => + array( 'field_id' => 'plan_behavior_modification', + 'data_type' => '3', + 'fld_length' => '40', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'plan_cultures' => + array( 'field_id' => 'plan_cultures', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Cultures' ), + 'plan_other' => + array( 'field_id' => 'plan_other', + 'data_type' => '3', + 'fld_length' => '40', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ) + ); +/* an array of the lists the fields may draw on. */ +$lists = array(); + $data = formFetch($table_name, $id); + if ($data) { + + echo ''; + + foreach($data as $key => $value) { + if ($key == 'id' || $key == 'pid' || $key == 'user' || + $key == 'groupname' || $key == 'authorized' || + $key == 'activity' || $key == 'date' || + $value == '' || $value == '0000-00-00 00:00:00' || + $value == 'n') + { + /* skip built-in fields and "blank data". */ + continue; + } + + /* display 'yes' instead of 'on'. */ + if ($value == 'on') { + $value = 'yes'; + } + + /* remove the time-of-day from the 'date' fields. */ + if ($field_names[$key] == 'date') + if ($value != '') { + $dateparts = split(' ', $value); + $value = $dateparts[0]; + } + + if ( $field_names[$key] == 'checkbox_combo_list' ) { + $value = generate_display_field( $manual_layouts[$key], $value ); + } + + /* replace underscores with spaces, and uppercase all words. */ + /* this is a primitive form of converting the column names into something displayable. */ + $key=ucwords(str_replace('_',' ',$key)); + $mykey = $key; + $myval = $value; + echo ''; + + + $count++; + if ($count == $cols) { + $count = 0; + echo '' . PHP_EOL; + } + } + } + echo '
'.xl("$mykey").': '.xl("$myval").'

'; +} +?> + diff --git a/contrib/forms/vaginitis_soap/save.php b/contrib/forms/vaginitis_soap/save.php new file mode 100644 index 000000000..119635206 --- /dev/null +++ b/contrib/forms/vaginitis_soap/save.php @@ -0,0 +1,156 @@ + 'checkbox_combo_list','other' => 'textarea','duration' => 'textfield','objective_exam' => 'checkbox_combo_list','vaginitis' => 'checkbox_combo_list','plan_medications' => 'checkbox_combo_list','plan_behavior_modification' => 'textarea','plan_cultures' => 'checkbox_combo_list','plan_other' => 'textarea'); +/* an array of the lists the fields may draw on. */ +$lists = array('vaginitis_complaints' => 'Vaginitis_Complaints', 'objective_exam' => 'Vaginitis_Exam', 'vaginitis' => 'Vaginitis_Diagnosis', 'plan_medications' => 'Vaginitis_Medications', 'plan_cultures' => 'Vaginitis_Cultures'); + +/* get each field from $_POST[], storing them into $field_names associated with their names. */ +foreach($field_names as $key=>$val) +{ + $pos = ''; + $neg = ''; + if ($val == 'textbox' || $val == 'textarea' || $val == 'provider' || $val == 'textfield') + { + $field_names[$key]=$_POST['form_'.$key]; + } + if ($val == 'date') + { + $field_names[$key]=$_POST[$key]; + } + if (($val == 'checkbox_list' )) + { + $field_names[$key]=''; + if (isset($_POST['form_'.$key]) && $_POST['form_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if (is_array($_POST['form_'.$key])) + { + if ($_POST['form_'.$key][$lrow[option_id]]) + { + if ($field_names[$key] != '') + $field_names[$key]=$field_names[$key].'|'; + $field_names[$key] = $field_names[$key].$lrow[option_id]; + } + } + } + } + } + if (($val == 'checkbox_combo_list')) + { + $field_names[$key]=''; + if (isset($_POST['check_'.$key]) && $_POST['check_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if (is_array($_POST['check_'.$key])) + { + if ($_POST['check_'.$key][$lrow[option_id]]) + { + if ($field_names[$key] != '') + $field_names[$key]=$field_names[$key].'|'; + $field_names[$key] = $field_names[$key].$lrow[option_id].":xx".$_POST['form_'.$key][$lrow[option_id]]; + } + } + } + } + } + if (($val == 'dropdown_list')) + { + $field_names[$key]=''; + if (isset($_POST['form_'.$key]) && $_POST['form_'.$key] != 'none' ) /* if the form submitted some entries selected in that field */ + { + $lres=sqlStatement("select * from list_options where list_id = '".$lists[$key]."' ORDER BY seq, title"); + while ($lrow = sqlFetchArray($lres)) + { + if ($_POST['form_'.$key] == $lrow[option_id]) + { + $field_names[$key]=$lrow[option_id]; + break; + } + } + } + } +} + +/* at this point, field_names[] contains an array of name->value pairs of the fields we expected from the form. */ + +/* escape form data for entry to the database. */ +foreach ($field_names as $k => $var) { + $field_names[$k] = formDataCore($var); +} + +if ($encounter == '') $encounter = date('Ymd'); + +if ($_GET['mode'] == 'new') { + /* NOTE - for customization you can replace $_POST with your own array + * of key=>value pairs where 'key' is the table field name and + * 'value' is whatever it should be set to + * ex) $newrecord['parent_sig'] = $_POST['sig']; + * $newid = formSubmit($table_name, $newrecord, $_GET['id'], $userauthorized); + */ + + /* make sure we're at the beginning of the array */ + reset($field_names); + + /* save the data into the form's encounter-based table */ + $newid = formSubmit($table_name, $field_names, $_GET['id'], $userauthorized); + /* link this form into the encounter. */ + addForm($encounter, $form_name, $newid, $form_folder, $pid, $userauthorized); +} + +elseif ($_GET['mode'] == 'update') { + /* make sure we're at the beginning of the array */ + reset($field_names); + + /* update the data in the form's table */ + $success = formUpdate($table_name, $field_names, $_GET['id'], $userauthorized); + /* sqlInsert('update '.$table_name." set pid = {".$_SESSION['pid']."},groupname='".$_SESSION['authProvider']."',user='".$_SESSION['authUser']."',authorized=$userauthorized,activity=1,date = NOW(), where id=$id"); */ +} + + +$_SESSION['encounter'] = $encounter; + +formHeader('Redirecting....'); +/* defaults to the encounters page. */ +formJump(); + +formFooter(); +?> + diff --git a/contrib/forms/vaginitis_soap/show.php b/contrib/forms/vaginitis_soap/show.php new file mode 100644 index 000000000..326049dfa --- /dev/null +++ b/contrib/forms/vaginitis_soap/show.php @@ -0,0 +1,194 @@ + + array( 'field_id' => 'vaginitis_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Complaints' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'duration' => + array( 'field_id' => 'duration', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'objective_exam' => + array( 'field_id' => 'objective_exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Exam' ), + 'vaginitis' => + array( 'field_id' => 'vaginitis', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Diagnosis' ), + 'plan_medications' => + array( 'field_id' => 'plan_medications', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Medications' ), + 'plan_behavior_modification' => + array( 'field_id' => 'plan_behavior_modification', + 'data_type' => '3', + 'fld_length' => '40', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'plan_cultures' => + array( 'field_id' => 'plan_cultures', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Cultures' ), + 'plan_other' => + array( 'field_id' => 'plan_other', + 'data_type' => '3', + 'fld_length' => '40', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ) + ); + +/* since we have no-where to return, abuse returnurl to link to the 'edit' page */ +/* FIXME: pass the ID, create blank rows if necissary. */ +$returnurl = "../../forms/$form_folder/view.php?mode=noencounter"; + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('Show '.$form_name); ?> + + + + +
+ + + + + + +
+ +
+ + +
+ +
+ + + + + + + + + + + + +
 
 
 
 
 
+ + +
+ +
+ + +
+
+ +
+
+ +
+ + + + diff --git a/contrib/forms/vaginitis_soap/style.css b/contrib/forms/vaginitis_soap/style.css new file mode 100644 index 000000000..7feab16db --- /dev/null +++ b/contrib/forms/vaginitis_soap/style.css @@ -0,0 +1,114 @@ +/* This CSS is used ONLY by the form defined in this same folder + * customize it as you see fit for your specific form + */ + +/* turn off borders for fieldsets, to make them invisible */ +fieldset { +border: none; +} + +/* links should be undersized */ +.link { + font-size: 80%; +} + +/* links should grow when clicked */ +.link_submit { + font-size: 120%; +} + + +/* give section objects blue borders, bold cell labels, */ +.section { + border: solid; + border-width: 1px; + border-color: #0000ff; + margin: 0 0 0 10pt; + padding: 5pt; +} + +/* prevent the checkboxes on our sections from bunching up. */ +span.sectionlabel { +page-break-after: always; +} + +/* disappear the top button bar */ +.top_buttons { + display: none; +} + +/* center the bottom button bar */ +.button_bar { +text-align: center; +} + +/* section labels should be visible, and bold in view, new, ??...*/ +.sectionlabel { + font-family: sans-serif; + font-weight: bold; +} + +/* section labels on the show page. turn them green, and bold. */ +#show .sectionlabel { + color: #080; + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + height: 2em; +} + + +/* field labels should also be visible, and bold. */ +.fieldlabel { + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + height: 2em; +} + +/* field labels on the show page. turn them bold. */ +#show .fieldlabel { + font-family: sans-serif; + font-weight: bold; + font-size: 9pt; + padding-right: 5px; + width: 25%; +} + +/* Put some spacing around the edges of the form. */ +body { + padding: 5pt 5pt 5pt 5pt; +} + +/* Use a single font style for most objects in this page. */ +body, td, select { + font-family: Arial, Helvetica, sans-serif; +} + +input { + font-family: Arial, Helvetica, sans-serif; +} + +.save { + margin-left: 2pt; + margin-right: 2pt; +} + +.dontsave { + margin-left: 2pt; + margin-right: 2pt; +} + +.print { + margin-left: 2pt; + margin-right: 2pt; +} + +/* HACK: keep textareas at an eight point font, so they don't get too wide for our 750px 'view' and 'new' pages. */ +textarea { + font-size: 8pt; +} + + diff --git a/contrib/forms/vaginitis_soap/table.sql b/contrib/forms/vaginitis_soap/table.sql new file mode 100644 index 000000000..c00f56de8 --- /dev/null +++ b/contrib/forms/vaginitis_soap/table.sql @@ -0,0 +1,177 @@ +CREATE TABLE IF NOT EXISTS `form_vaginitis_soap` ( + /* both extended and encounter forms need a last modified date */ + date datetime default NULL comment 'last modified date', + /* these fields are common to all encounter forms. */ + id bigint(20) NOT NULL auto_increment, + pid bigint(20) NOT NULL default 0, + user varchar(255) default NULL, + groupname varchar(255) default NULL, + authorized tinyint(4) default NULL, + activity tinyint(4) default NULL, + vaginitis_complaints varchar(255), + other TEXT, + duration varchar(255), + objective_exam varchar(255), + vaginitis varchar(255), + plan_medications varchar(255), + plan_behavior_modification TEXT, + plan_cultures varchar(255), + plan_other TEXT, + PRIMARY KEY (id) +) ENGINE=InnoDB; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Vaginitis_Complaints', + title='Vaginitis Complaints'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Complaints', + option_id='1', + title='Itching (pruritus)', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Complaints', + option_id='2', + title='Discharge (leukorrhea)', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Complaints', + option_id='3', + title='Odor', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Complaints', + option_id='4', + title='Pain', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Complaints', + option_id='6', + title='Previous Cultures', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Complaints', + option_id='7', + title='Previous Prescriptions', + seq='7'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Complaints', + option_id='8', + title='Other', + seq='8'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Vaginitis_Exam', + title='Vaginitis Exam'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Exam', + option_id='1', + title='Vulvar', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Exam', + option_id='2', + title='Vaginal', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Exam', + option_id='3', + title='Cervix', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Exam', + option_id='4', + title='Uterus', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Exam', + option_id='5', + title='Adnexae', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Exam', + option_id='6', + title='Rectal', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Exam', + option_id='7', + title='Other', + seq='7'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Vaginitis_Diagnosis', + title='Vaginitis Diagnosis'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Diagnosis', + option_id='1', + title='Affirm', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Diagnosis', + option_id='2', + title='Yeast', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Diagnosis', + option_id='3', + title='Bacterial Vaginosis', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Diagnosis', + option_id='4', + title='Vulvar Vaginitis', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Diagnosis', + option_id='5', + title='Lichen Schlerosis', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Diagnosis', + option_id='6', + title='Atrophic Vaginitis', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Diagnosis', + option_id='7', + title='Other', + seq='7'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Vaginitis_Medications', + title='Vaginitis Medications'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Medications', + option_id='1', + title='Estrace Cream', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Medications', + option_id='2', + title='Flagyl', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Medications', + option_id='3', + title='Terazol-3', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Medications', + option_id='4', + title='Terazol-7', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Medications', + option_id='5', + title='Diflucan', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Medications', + option_id='6', + title='Lotrisone', + seq='6'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Medications', + option_id='7', + title='Tindamax', + seq='7'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Medications', + option_id='8', + title='Other', + seq='8'; +INSERT IGNORE INTO list_options SET list_id='lists', + option_id='Vaginitis_Cultures', + title='Vaginitis Cultures'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Cultures', + option_id='1', + title='Affirm', + seq='1'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Cultures', + option_id='2', + title='GC/CT', + seq='2'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Cultures', + option_id='3', + title='Ureaplasma/Mycoplasma', + seq='3'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Cultures', + option_id='4', + title='Genital', + seq='4'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Cultures', + option_id='5', + title='Viral', + seq='5'; +INSERT IGNORE INTO list_options SET list_id='Vaginitis_Cultures', + option_id='6', + title='Other', + seq='6'; + diff --git a/contrib/forms/vaginitis_soap/view.php b/contrib/forms/vaginitis_soap/view.php new file mode 100644 index 000000000..783e299cc --- /dev/null +++ b/contrib/forms/vaginitis_soap/view.php @@ -0,0 +1,238 @@ + tag */ + +/** CHANGE THIS - name of the database table associated with this form **/ +$table_name = 'form_vaginitis_soap'; + +/** CHANGE THIS name to the name of your form. **/ +$form_name = 'Vaginitis Complaints'; + +/** CHANGE THIS to match the folder you created for this form. **/ +$form_folder = 'vaginitis_soap'; + +/* Check the access control lists to ensure permissions to this page */ +$thisauth = acl_check('patients', 'med'); +if (!$thisauth) { + die($form_name.': Access Denied.'); +} +/* perform a squad check for pages touching patients, if we're in 'athletic team' mode */ +if ($GLOBALS['athletic_team']!='false') { + $tmp = getPatientData($pid, 'squad'); + if ($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) + $thisauth = 0; +} + +if ($thisauth != 'write' && $thisauth != 'addonly') + die($form_name.': Adding is not authorized.'); +/* Use the formFetch function from api.inc to load the saved record */ +$xyzzy = formFetch($table_name, $_GET['id']); + +/* in order to use the layout engine's draw functions, we need a fake table of layout data. */ +$manual_layouts = array( + 'vaginitis_complaints' => + array( 'field_id' => 'vaginitis_complaints', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Complaints' ), + 'other' => + array( 'field_id' => 'other', + 'data_type' => '3', + 'fld_length' => '151', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'duration' => + array( 'field_id' => 'duration', + 'data_type' => '2', + 'fld_length' => '163', + 'max_length' => '255', + 'description' => '', + 'list_id' => '' ), + 'objective_exam' => + array( 'field_id' => 'objective_exam', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Exam' ), + 'vaginitis' => + array( 'field_id' => 'vaginitis', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Diagnosis' ), + 'plan_medications' => + array( 'field_id' => 'plan_medications', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Medications' ), + 'plan_behavior_modification' => + array( 'field_id' => 'plan_behavior_modification', + 'data_type' => '3', + 'fld_length' => '40', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ), + 'plan_cultures' => + array( 'field_id' => 'plan_cultures', + 'data_type' => '25', + 'fld_length' => '140', + 'description' => '', + 'list_id' => 'Vaginitis_Cultures' ), + 'plan_other' => + array( 'field_id' => 'plan_other', + 'data_type' => '3', + 'fld_length' => '40', + 'max_length' => '4', + 'description' => '', + 'list_id' => '' ) + ); +$submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=update&return=encounter&id='.$_GET['id']; +if ($_GET['mode']) { + if ($_GET['mode']=='noencounter') { + $submiturl = $GLOBALS['rootdir'].'/forms/'.$form_folder.'/save.php?mode=new&return=show&id='.$_GET['id']; + $returnurl = 'show.php'; + } +} +else +{ + $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php'; +} + + +/* define check field functions. used for translating from fields to html viewable strings */ + +function chkdata_Txt(&$record, $var) { + return htmlspecialchars($record{"$var"},ENT_QUOTES); +} + +?> + + + + + + + + + + + + + + + + + + + + + +<?php echo htmlspecialchars('View '.$form_name); ?> + + + + + + +
+ + +
+
+ + + +
+
+ + +
+
+ + + + + + + +
+ + + +
+
+ +
+
+ +
+
+ + + + +
+
+ +
+
+ + +
+
+ + + +
+
+
+ + + + -- 2.11.4.GIT