Skip to content

Commit

Permalink
Nation Notes module contributed by Z&H Healthcare.
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob T.Paul <[email protected]>
  • Loading branch information
zhconsultancyservices authored and bradymiller committed Jul 30, 2011
1 parent dd1b972 commit 87fe55e
Show file tree
Hide file tree
Showing 677 changed files with 144,836 additions and 25 deletions.
13 changes: 11 additions & 2 deletions acl_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
// xl('Sensitivities')
$gacl->add_object_section('Placeholder' , 'placeholder' , 10, 0, 'ACO');
// xl('Placeholder')
$gacl->add_object_section('Nation Notes' , 'nationnotes' , 10, 0, 'ACO');
// xl('Nation Notes')

// Create Accounting ACOs.
//
Expand Down Expand Up @@ -158,6 +160,11 @@
//
$gacl->add_object('placeholder', 'Placeholder (Maintains empty ACLs)', 'filler', 10, 0, 'ACO');
// xl('Placeholder (Maintains empty ACLs)')

// Create ACO for nationnotes.
//
$gacl->add_object('nationnotes', 'Nation Notes Configure', 'nn_configure', 10, 0, 'ACO');
// xl('Nation Notes Configure')

// Create ARO groups.
//
Expand Down Expand Up @@ -208,7 +215,8 @@
'encounters'=>array('auth_a', 'coding_a', 'notes_a', 'date_a'),
'lists'=>array('default','state','country','language','ethrace'),
'patients'=>array('appt', 'demo', 'med', 'trans', 'docs', 'notes'),
'sensitivities'=>array('normal', 'high')
'sensitivities'=>array('normal', 'high'),
'nationnotes'=>array('nn_configure')
),
NULL, array($admin), NULL, NULL,
1, 1, 'write', 'Administrators can do anything'
Expand Down Expand Up @@ -310,7 +318,8 @@
'encounters'=>array('auth_a', 'coding_a', 'notes_a', 'date_a'),
'lists'=>array('default','state','country','language','ethrace'),
'patients'=>array('appt', 'demo', 'med', 'trans', 'docs', 'notes'),
'sensitivities'=>array('normal', 'high')
'sensitivities'=>array('normal', 'high'),
'nationnotes'=>array('nn_configure')
),
NULL, array($breakglass), NULL, NULL,
1, 1, 'write', 'Emergency Login user can do anything'
Expand Down
9 changes: 8 additions & 1 deletion acl_upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
addObjectSectionAcl('lists', 'Lists');
//Add 'Placeholder' object section (added in 3.0.2)
addObjectSectionAcl('placeholder', 'Placeholder');
//Add 'Nation Notes' object section (added in 4.1.0)
addObjectSectionAcl('nationnotes','Nation Notes');

//Add new Objects
echo "<BR/><B>Adding new objects</B><BR/>";
Expand Down Expand Up @@ -103,6 +105,8 @@
addObjectAcl('placeholder', 'Placeholder', 'filler', 'Placeholder (Maintains empty ACLs)');
//Add 'Sign Lab Results (write,addonly optional)' object (added in 3.3.0)
addObjectAcl('patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)');
//Add 'nationnotes' object (added in 4.1.0)
addObjectAcl('nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure');

//Update already existing Objects
echo "<BR/><B>Upgrading objects</B><BR/>";
Expand Down Expand Up @@ -228,7 +232,10 @@
updateAcl($emergency_write, 'Emergency Login', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
//Insert the 'sign' object from the 'patients' section into the Physicians group write ACL (added in 3.3.0)
updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)', 'write');

//Insert the 'sign' object from the 'nationnotes' section into the Administrators group write ACL (added in 3.3.0)
updateAcl($admin_write, 'Administrators','nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure','write');
//Insert the 'sign' object from the 'nationnotes' section into the Emergency Login group write ACL (added in 3.3.0)
updateAcl($emergency_write, 'Emergency Login','nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure','write');

//Function will return an array that contains the ACL ID number.
//It will also check to ensure the ACL exist and is not duplicated.
Expand Down
Binary file added images/b_edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/enter.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/paragraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/question.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 31 additions & 6 deletions interface/forms/LBF/new.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,40 @@ function end_group() {

<style type="text/css">@import url(../../../library/dynarch_calendar.css);</style>

<script type="text/javascript" src="../../../library/dialog.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />
<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script>
<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.1.3.2.js"></script>
<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/common.js"></script>
<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script>
<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-ui.js"></script>
<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.easydrag.handler.beta2.js"></script>
<script type="text/javascript" src="../../../library/textformat.js"></script>
<script type="text/javascript" src="../../../library/dynarch_calendar.js"></script>
<?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?>
<script type="text/javascript" src="../../../library/dynarch_calendar_setup.js"></script>
<script type="text/javascript" src="../../../library/js/jquery.js"></script>

<script language="JavaScript">

$(document).ready(function(){
// fancy box
if(window.enable_modals){
enable_modals();
}
if(window.tabbify){
tabbify();
}
// special size for
$(".iframe_medium").fancybox( {
'overlayOpacity' : 0.0,
'showCloseButton' : true,
'frameHeight' : 580,
'frameWidth' : 900
});

$(function(){
// add drag and drop functionality to fancybox
$("#fancy_outer").easydrag();
});
});
var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';

// Supports customizable forms.
Expand Down Expand Up @@ -291,7 +316,7 @@ function sel_related() {
echo "<div id='div_$group_seq' class='section' style='display:$display_style;'>\n";
}
// echo " <table border='0' cellpadding='0' width='100%'>\n";
echo " <table border='0' cellpadding='0'>\n";
echo " <table border='0' cellpadding='0' width='100%'>\n";
$display_style = 'none';

// Initialize historical data array and write date headers.
Expand Down Expand Up @@ -330,7 +355,7 @@ function sel_related() {
// Handle starting of a new label cell.
if ($titlecols > 0) {
end_cell();
echo "<td valign='top' colspan='$titlecols' nowrap";
echo "<td valign='top' colspan='$titlecols' width='1%' nowrap";
echo " class='";
echo ($frow['uor'] == 2) ? "required" : "bold";
if ($graphable) echo " graph";
Expand All @@ -356,7 +381,7 @@ function sel_related() {
// Handle starting of a new data cell.
if ($datacols > 0) {
end_cell();
echo "<td valign='top' align='right' colspan='$datacols' class='text'";
echo "<td valign='top' colspan='$datacols' class='text'";
if ($cell_count > 0) echo " style='padding-left:5pt'";
echo ">";

Expand Down
97 changes: 85 additions & 12 deletions interface/super/edit_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"31" => xl("Static Text"),
"32" => xl("Smoking Status"),
"33" => xl("Race and Ethnicity"),
"34" => xl("NationNotes"),
);

function nextGroupOrder($order) {
Expand Down Expand Up @@ -81,6 +82,7 @@ function nextGroupOrder($order) {
// specify its height (in rows). This kludge assigns a fixed height,
// but this GUI really needs to support max_length directly.
$max_length = $data_type == 3 ? 3 : 255;
$listval = $data_type == 34 ? formTrim($iter['contextName']) : formTrim($iter['list_id']);
if ($field_id) {
sqlStatement("UPDATE layout_options SET " .
"title = '" . formTrim($iter['title']) . "', " .
Expand All @@ -92,7 +94,7 @@ function nextGroupOrder($order) {
"titlecols = '" . formTrim($iter['titlecols']) . "', " .
"datacols = '" . formTrim($iter['datacols']) . "', " .
"data_type= '$data_type', " .
"list_id= '" . formTrim($iter['list_id']) . "', " .
"list_id= '" . $listval . "', " .
"edit_options = '" . formTrim($iter['edit_options']) . "', " .
"default_value = '" . formTrim($iter['default']) . "', " .
"description = '" . formTrim($iter['desc']) . "' " .
Expand All @@ -105,6 +107,7 @@ function nextGroupOrder($order) {
// Add a new field to a specific group
$data_type = formTrim($_POST['newdatatype']);
$max_length = $data_type == 3 ? 3 : 255;
$listval = $data_type == 34 ? formTrim($_POST['contextName']) : formTrim($_POST['newlistid']);
sqlStatement("INSERT INTO layout_options (" .
" form_id, field_id, title, group_name, seq, uor, fld_length" .
", titlecols, datacols, data_type, edit_options, default_value, description" .
Expand All @@ -124,7 +127,7 @@ function nextGroupOrder($order) {
",'" . formTrim($_POST['newdefault'] ) . "'" .
",'" . formTrim($_POST['newdesc'] ) . "'" .
",'$max_length'" .
",'" . formTrim($_POST['newlistid'] ) . "'" .
",'" . $listval . "'" .
" )");

if (substr($layout_id,0,3) != 'LBF') {
Expand Down Expand Up @@ -204,7 +207,7 @@ function nextGroupOrder($order) {

$data_type = formTrim($_POST['gnewdatatype']);
$max_length = $data_type == 3 ? 3 : 255;

$listval = $data_type == 34 ? formTrim($_POST['gcontextName']) : formTrim($_POST['gnewlistid']);
// add a new group to the layout, with the defined field
sqlStatement("INSERT INTO layout_options (" .
" form_id, field_id, title, group_name, seq, uor, fld_length" .
Expand All @@ -225,7 +228,7 @@ function nextGroupOrder($order) {
",'" . formTrim($_POST['gnewdefault'] ) . "'" .
",'" . formTrim($_POST['gnewdesc'] ) . "'" .
",'$max_length'" .
",'" . formTrim($_POST['gnewlistid'] ) . "'" .
",'" . $listval . "'" .
" )");

if (substr($layout_id,0,3) != 'LBF') {
Expand Down Expand Up @@ -386,7 +389,7 @@ function writeFieldLine($linedata) {
echo "</td>\n";

echo " <td align='center' class='optcell'>";
echo "<select name='fld[$fld_line_no][data_type]' id='fld[$fld_line_no][data_type]'>";
echo "<select name='fld[$fld_line_no][data_type]' id='fld[$fld_line_no][data_type]' onchange=NationNotesContext('".$fld_line_no."',this.value)>";
echo "<option value=''></option>";
GLOBAL $datatypes;
foreach ($datatypes as $key=>$value) {
Expand Down Expand Up @@ -418,12 +421,29 @@ function writeFieldLine($linedata) {
if ($linedata['data_type'] == 1 || $linedata['data_type'] == 21 ||
$linedata['data_type'] == 22 || $linedata['data_type'] == 23 ||
$linedata['data_type'] == 25 || $linedata['data_type'] == 26 ||
$linedata['data_type'] == 27 || $linedata['data_type'] == 33)
$linedata['data_type'] == 27 || $linedata['data_type'] == 33 ||
$linedata['data_type'] == 34)
{
echo "<input type='text' name='fld[$fld_line_no][list_id]' value='" .
htmlspecialchars($linedata['list_id'], ENT_QUOTES) . "'".
"size='6' maxlength='30' class='optin listid' style='cursor: pointer'".
$type = "";
$disp = "style='display:none'";
if($linedata['data_type'] == 34){
$type = "style='display:none'";
$disp = "";
}
echo "<input type='text' name='fld[$fld_line_no][list_id]' id='fld[$fld_line_no][list_id]' value='" .
htmlspecialchars($linedata['list_id'], ENT_QUOTES) . "'".$type.
" size='6' maxlength='30' class='optin listid' style='cursor: pointer'".
"title='". xl('Choose list') . "' />";

echo "<select name='fld[$fld_line_no][contextName]' id='fld[$fld_line_no][contextName]' ".$disp.">";
$res = sqlStatement("SELECT * FROM customlists WHERE cl_list_type=2 AND cl_deleted=0");
while($row = sqlFetchArray($res)){
$sel = '';
if ($linedata['list_id'] == $row['cl_list_item_long'])
$sel = 'selected';
echo "<option value='".htmlspecialchars($row['cl_list_item_long'],ENT_QUOTES)."' ".$sel.">".htmlspecialchars($row['cl_list_item_long'],ENT_QUOTES)."</option>";
}
echo "</select>";
}
else {
// all other data_types
Expand Down Expand Up @@ -718,7 +738,16 @@ function writeFieldLine($linedata) {
</select>
</td>
<td><input type="textbox" name="gnewlength" id="gnewlength" value="" size="1" maxlength="3"> </td>
<td><input type="textbox" name="gnewlistid" id="gnewlistid" value="" size="8" maxlength="31" class="listid"> </td>
<td><input type="textbox" name="gnewlistid" id="gnewlistid" value="" size="8" maxlength="31" class="listid">
<select name='gcontextName' id='gcontextName' style='display:none'>
<?php
$res = sqlStatement("SELECT * FROM customlists WHERE cl_list_type=2 AND cl_deleted=0");
while($row = sqlFetchArray($res)){
echo "<option value='".htmlspecialchars($row['cl_list_item_long'],ENT_QUOTES)."'>".htmlspecialchars($row['cl_list_item_long'],ENT_QUOTES)."</option>";
}
?>
</select>
</td>
<td><input type="textbox" name="gnewtitlecols" id="gnewtitlecols" value="" size="3" maxlength="3"> </td>
<td><input type="textbox" name="gnewdatacols" id="gnewdatacols" value="" size="3" maxlength="3"> </td>
<td><input type="textbox" name="gnewedit_options" id="gnewedit_options" value="" size="3" maxlength="36">
Expand Down Expand Up @@ -776,7 +805,16 @@ function writeFieldLine($linedata) {
</select>
</td>
<td><input type="textbox" name="newlength" id="newlength" value="" size="1" maxlength="3"> </td>
<td><input type="textbox" name="newlistid" id="newlistid" value="" size="8" maxlength="31" class="listid"> </td>
<td><input type="textbox" name="newlistid" id="newlistid" value="" size="8" maxlength="31" class="listid">
<select name='contextName' id='contextName' style='display:none'>
<?php
$res = sqlStatement("SELECT * FROM customlists WHERE cl_list_type=2 AND cl_deleted=0");
while($row = sqlFetchArray($res)){
echo "<option value='".htmlspecialchars($row['cl_list_item_long'],ENT_QUOTES)."'>".htmlspecialchars($row['cl_list_item_long'],ENT_QUOTES)."</option>";
}
?>
</select>
</td>
<td><input type="textbox" name="newtitlecols" id="newtitlecols" value="" size="3" maxlength="3"> </td>
<td><input type="textbox" name="newdatacols" id="newdatacols" value="" size="3" maxlength="3"> </td>
<td><input type="textbox" name="newedit_options" id="newedit_options" value="" size="3" maxlength="36">
Expand Down Expand Up @@ -837,7 +875,8 @@ function writeFieldLine($linedata) {
$(".savenewfield").click(function() { SaveNewField(this); });
$(".cancelnewfield").click(function() { CancelNewField(this); });
$("#newtitle").blur(function() { if ($("#newid").val() == "") $("#newid").val($("#newtitle").val()); });

$("#newdatatype").change(function() { ChangeList(this.value);});
$("#gnewdatatype").change(function() { ChangeListg(this.value);});
$(".listid").click(function() { ShowLists(this); });

// special class that skips the element
Expand Down Expand Up @@ -1086,9 +1125,43 @@ function writeFieldLine($linedata) {
var ShowGroups = function(btnObj) {
window.open("./show_groups_popup.php?layout_id=<?php echo $layout_id;?>", "groups", "width=300,height=300,scrollbars=yes");
};

// Show context DD for NationNotes
var ChangeList = function(btnObj){
if(btnObj==34){
$('#newlistid').hide();
$('#contextName').show();
}
else{
$('#newlistid').show();
$('#contextName').hide();
}
};
var ChangeListg = function(btnObj){
if(btnObj==34){
$('#gnewlistid').hide();
$('#gcontextName').show();
}
else{
$('#gnewlistid').show();
$('#gcontextName').hide();
}
};

});

function NationNotesContext(lineitem,val){
if(val==34){
document.getElementById("fld["+lineitem+"][contextName]").style.display='';
document.getElementById("fld["+lineitem+"][list_id]").style.display='none';
document.getElementById("fld["+lineitem+"][list_id]").value='';
}
else{
document.getElementById("fld["+lineitem+"][list_id]").style.display='';
document.getElementById("fld["+lineitem+"][contextName]").style.display='none';
document.getElementById("fld["+lineitem+"][list_id]").value='';
}
}
function SetList(listid) { $(selectedfield).val(listid); }


Expand Down
Loading

0 comments on commit 87fe55e

Please sign in to comment.