-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #9 -Added new/established report
- Loading branch information
Showing
7 changed files
with
205 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div class="row-fluid"> | ||
<div class="offset3 span9"> | ||
<h3>${tableHeader}</h3> | ||
<table class="table table-striped" data-provides="rowlink"> | ||
<thead> | ||
<tr> | ||
<g:sortableColumn property="patientId" title="${message(code: 'patient.patientId.label')}"/> | ||
<g:sortableColumn property="dateOfBirth" title="${message(code: 'patient.dateOfBirth.label')}"/> | ||
<g:sortableColumn property="lastName" title="${message(code: 'patient.lastName.label')}"/> | ||
<g:sortableColumn property="firstName" title="${message(code: 'patient.firstName.label')}"/> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<g:each in="${patients}" var="patientInstance"> | ||
<tr> | ||
<td> | ||
<g:link action="show" id="${patientInstance.id}"> | ||
<f:display bean="${patientInstance}" property="patientId"/> | ||
</g:link> | ||
</td> | ||
<td><f:display bean="${patientInstance}" property="dateOfBirth"/></td> | ||
<td><f:display bean="${patientInstance}" property="lastName"/></td> | ||
<td><f:display bean="${patientInstance}" property="firstName"/></td> | ||
</tr> | ||
</g:each> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<%@ page import="org.sacredheart.report.VisitReport" %> | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta name="layout" content="bootstrap"> | ||
<title><g:message code="report.setup.label"/></title> | ||
<script type="text/javascript" src="https://www.google.com/jsapi"></script> | ||
</head> | ||
|
||
<body> | ||
<div class="row-fluid"> | ||
<g:render template="nav"/> | ||
<div class="span9"> | ||
<div class="page-header"> | ||
<h1> | ||
<g:message code="report.static.select.establishedReport"/>: | ||
<g:formatDate date="${startDate}" type="date" style="SHORT"/> - | ||
<g:formatDate date="${endDate}" type="date" style="SHORT"/> | ||
</h1> | ||
<table> | ||
<tr> | ||
<td>Total Visits: ${estVisits + newVisits}</td> | ||
</tr> | ||
<tr> | ||
<td>Total distinct patients: ${estPatients.size() + newPatients.size()}</td> | ||
</tr> | ||
</table> | ||
</div> | ||
<div class="span3"> | ||
<table class="table"> | ||
<tr> | ||
<td>New Patients:</td> | ||
<td>${newPatients.size()}</td> | ||
</tr> | ||
<tr> | ||
<td>Established Patients:</td> | ||
<td>${estPatients.size()}</td> | ||
</tr> | ||
<tr> | ||
<td>New Patients Visits:</td> | ||
<td>${newVisits}</td> | ||
</tr> | ||
<tr> | ||
<td>Established Patients Visits:</td> | ||
<td>${estVisits}</td> | ||
</tr> | ||
</table> | ||
</div> | ||
<div class="span6"> | ||
<div id="chart"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<g:render template="patientList" model="${[tableHeader:'New Patients', patients:newPatients]}"/> | ||
<g:render template="patientList" model="${[tableHeader:'Established Patients', patients:estPatients]}"/> | ||
|
||
<!--Load the AJAX API--> | ||
<r:script> | ||
// Load the Visualization API and the piechart package. | ||
google.load('visualization', '1.0', {'packages':['corechart']}); | ||
|
||
// Set a callback to run when the Google Visualization API is loaded. | ||
google.setOnLoadCallback(drawChart); | ||
|
||
function drawChart() { | ||
var data = google.visualization.arrayToDataTable([ | ||
['Type', 'Established', 'New' ], | ||
['Visits', ${estVisits}, ${newVisits}], | ||
['Patients', ${estPatients.size()}, ${newPatients.size()}] | ||
]); | ||
|
||
var options = { width: '100%', height: 200, | ||
legend: { | ||
position: 'top', | ||
maxLines: 3 | ||
}, | ||
bar: { | ||
groupWidth: '75%' | ||
}, | ||
isStacked: true | ||
}; | ||
// Instantiate and draw our chart, passing in some options. | ||
var chart = new google.visualization.BarChart(document.getElementById('chart')); | ||
chart.draw(data, options); | ||
} | ||
</r:script> | ||
</body> | ||
</html> |