Skip to content

Commit

Permalink
modifications to the prescriptions
Browse files Browse the repository at this point in the history
 - fixed columns in list view
 - changed cursor to a hand for table rows (feels more natural)
 - stopped from from going to send screen after adding line item. Improves Work Flow
 - automatically checks line items created on the current encounter. Improves the flow
 - made print to html open in new window, works a bit better

Signed-off-by: Craig Bezuidenhout <[email protected]>
  • Loading branch information
tajemo authored and bradymiller committed Jun 15, 2012
1 parent 629fd39 commit 0d83012
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
7 changes: 4 additions & 3 deletions controllers/C_Prescription.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ function edit_action_process() {
processAmcCall('e_prescribe_amc', true, 'remove', $this->prescriptions[0]->get_patient_id(), 'prescriptions', $this->prescriptions[0]->id);
}

if ($this->prescriptions[0]->get_active() > 0) {
return $this->send_action($this->prescriptions[0]->id);
}
// TajEmo Work by CB 2012/05/29 02:58:29 PM to stop from going to send screen. Improves Work Flow
// if ($this->prescriptions[0]->get_active() > 0) {
// return $this->send_action($this->prescriptions[0]->id);
// }
$this->list_action($this->prescriptions[0]->get_patient_id());
exit;
}
Expand Down
5 changes: 5 additions & 0 deletions library/classes/Prescription.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,11 @@ function get_start_date() {
function set_start_date($date) {
return $this->start_date = $date;
}

// TajEmo work by CB 2012/05/30 01:56:32 PM added encounter for auto ticking of checkboxes
function set_encounter($enc) {
return $this->encounter = $enc;
}

function get_date_added() {
return $this->date_added;
Expand Down
31 changes: 23 additions & 8 deletions templates/prescription/general_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
}
else { //remove value from href
document.getElementById(id).href = document.getElementById(id).href.replace(myRegExp,'');
document.getElementById(id).target = '';
// TajEmo Work By CB 2012/06/14 02:17:16 PM remove the target change
//document.getElementById(id).target = '';
}
}

Expand Down Expand Up @@ -93,6 +94,14 @@
}
}

$(document).ready(function(){
$(":checkbox:checked").each(function () {
changeLinkHref('multiprint',this.checked, this.value);
changeLinkHref('multiprintcss',this.checked, this.value);
changeLinkHref('multiprintToFax',this.checked, this.value);
});
})

</script>

{/literal}
Expand All @@ -116,7 +125,8 @@
<a id="multiprint" href="{$CONTROLLER}prescription&multiprint&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Print'} ({xl t='PDF'})</span></a>
</td>
<td>
<a id="multiprintcss" href="{$CONTROLLER}prescription&multiprintcss&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Print'} ({xl t='HTML'})</span></a>
<!-- TajEmo work by CB 2012/06/14 02:16:32 PM target="_script" opens better -->
<a target="_script" id="multiprintcss" href="{$CONTROLLER}prescription&multiprintcss&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Print'} ({xl t='HTML'})</span></a>
</td>
<td style="border-style:none;">
<a id="multiprintToFax" href="{$CONTROLLER}prescription&multiprintfax&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Print'} ({xl t='Fax'})</span></a>
Expand Down Expand Up @@ -145,8 +155,10 @@


<table width="100%" class="showborder_head" cellspacing="0px" cellpadding="2px">
<tr>
<th width="8px">&nbsp;</th>
<tr>
<!-- TajEmo Changes 2012/06/14 02:01:43 PM by CB added Heading for checkbox column -->
<th width="8px">&nbsp;</th>
<th width="8px">&nbsp;</th>
<th width="180px">{xl t='Drug'}</th>
<th>{xl t='Created'}<br />{xl t='Changed'}</th>
<th>{xl t='Dosage'}</th>
Expand All @@ -155,15 +167,18 @@
<th>{xl t='Provider'}</th>
</tr>

{foreach from=$prescriptions item=prescription}
<tr id="{$prescription->id}" class="showborder onescript {if $prescription->active <= 0} inactive{/if}" title="{xl t='Click to view/edit'}">
<td align="center">
<input id="check_list" type="checkbox" value="{$prescription->id}" onclick="changeLinkHref('multiprint',this.checked, this.value);changeLinkHref('multiprintcss',this.checked, this.value);changeLinkHref('multiprintToFax',this.checked, this.value)" title="{xl t='Select for printing'}">
{foreach from=$prescriptions item=prescription}
<!-- TajEmo Changes 2012/06/14 02:03:17 PM by CB added cursor:pointer for easier user understanding -->
<tr style="cursor:pointer" id="{$prescription->id}" class="showborder onescript {if $prescription->active <= 0} inactive{/if}" title="{xl t='Click to view/edit'}">
<td align="center">
<input class="check_list" id="check_list" type="checkbox" value="{$prescription->id}" {if $prescription->encounter == $prescription->get_encounter() && $prescription->active > 0}checked="checked" {/if}onclick="changeLinkHref('multiprint',this.checked, this.value);changeLinkHref('multiprintcss',this.checked, this.value);changeLinkHref('multiprintToFax',this.checked, this.value)" title="{xl t='Select for printing'}">
</td>
{if $prescription->erx_source==0}
<td class="editscript" id="{$prescription->id}">
<a class='editscript css_button_small' id='{$prescription->id}' href="controller.php?prescription&edit&id={$prescription->id}" style="margin-top:-2px"><span>{xl t='Edit'}</span></a>
<!-- TajEmo Changes 2012/06/14 02:02:22 PM by CB commented out, to avoid duplicate display of drug name
{if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}&nbsp;
-->
</td>
<td class="editscript" id="{$prescription->id}">
{if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}&nbsp;
Expand Down

0 comments on commit 0d83012

Please sign in to comment.