Modified:
branches/bmas-staging/data/report/DailyPostedDoctorOrderSchedule_en_US.jrxml
branches/bmas-staging/data/report/DoseHold_en_US.jrxml
branches/bmas-staging/data/report/ToxicologyReport_en_US.jrxml
branches/bmas-staging/data/schema/mysql/reporting/report_DailyPostedDoctorOrderSchedule.sql
branches/bmas-staging/data/schema/mysql/reporting/report_DispensaryAttendenceChecklist.sql
branches/bmas-staging/data/schema/mysql/reporting/report_DoseHold.sql
branches/bmas-staging/lib/org/freemedsoftware/module/DosingStation.class.php
branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/CloseDosingStationScreen.java
Log:
Changes for Feature #70:
Changed the Dispensary Attendance Checklist report to include per facility check.
Changed the Pending Doctors Orders Register report to include per facility check.
Changed the Dose Hold report to include per facility check.
Changed Toxicology Report to include the test status(complete or missed)
Implemented the check to find out if there is no open dosing station for the facility only then print the report.
Modified: branches/bmas-staging/data/report/DailyPostedDoctorOrderSchedule_en_US.jrxml
===================================================================
--- branches/bmas-staging/data/report/DailyPostedDoctorOrderSchedule_en_US.jrxml 2010-03-11 15:56:06 UTC (rev 5270)
+++ branches/bmas-staging/data/report/DailyPostedDoctorOrderSchedule_en_US.jrxml 2010-03-11 16:36:59 UTC (rev 5271)
@@ -5,8 +5,9 @@
<style name="Column header" isDefault="false" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
<style name="Detail" isDefault="false" fontName="Arial" fontSize="12"/>
<parameter name="param0" class="java.util.Date"/>
+ <parameter name="param1" class="java.lang.Integer"/>
<queryString language="SQL">
- <![CDATA[call report_DailyPostedDoctorOrderSchedule_en_US($P{param0});]]>
+ <![CDATA[call report_DailyPostedDoctorOrderSchedule_en_US($P{param0},$P{param1});]]>
</queryString>
<field name="ID" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
Modified: branches/bmas-staging/data/report/DoseHold_en_US.jrxml
===================================================================
--- branches/bmas-staging/data/report/DoseHold_en_US.jrxml 2010-03-11 15:56:06 UTC (rev 5270)
+++ branches/bmas-staging/data/report/DoseHold_en_US.jrxml 2010-03-11 16:36:59 UTC (rev 5271)
@@ -5,8 +5,9 @@
<style name="Column header" isDefault="false" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
<style name="Detail" isDefault="false" fontName="Arial" fontSize="12"/>
<parameter name="param0" class="java.util.Date"/>
+ <parameter name="param1" class="java.lang.Integer"/>
<queryString language="SQL">
- <![CDATA[call report_DoseHold_en_US($P{param0});]]>
+ <![CDATA[call report_DoseHold_en_US($P{param0},$P{param1});]]>
</queryString>
<field name="Client" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
Modified: branches/bmas-staging/data/report/ToxicologyReport_en_US.jrxml
===================================================================
--- branches/bmas-staging/data/report/ToxicologyReport_en_US.jrxml 2010-03-11 15:56:06 UTC (rev 5270)
+++ branches/bmas-staging/data/report/ToxicologyReport_en_US.jrxml 2010-03-11 16:36:59 UTC (rev 5271)
@@ -41,7 +41,7 @@
<textFieldExpression class="java.lang.String"><![CDATA[$F{fname}]]></textFieldExpression>
</textField>
<staticText>
- <reportElement style="Title" x="0" y="25" width="243" height="30"/>
+ <reportElement style="Title" x="0" y="25" width="232" height="30"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" isBold="false"/>
</textElement>
@@ -69,7 +69,7 @@
<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField pattern="yyyy-MM-dd">
- <reportElement style="Column header" x="243" y="25" width="256" height="30"/>
+ <reportElement style="Column header" x="456" y="25" width="256" height="30"/>
<textElement>
<font fontName="Arial" size="26" isBold="false"/>
</textElement>
@@ -87,6 +87,24 @@
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
+ <staticText>
+ <reportElement x="232" y="25" width="224" height="30">
+ <printWhenExpression><![CDATA[$P{param2} == 1]]></printWhenExpression>
+ </reportElement>
+ <textElement>
+ <font fontName="Arial" size="26"/>
+ </textElement>
+ <text><![CDATA[(Completed)]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="232" y="25" width="224" height="30">
+ <printWhenExpression><![CDATA[$P{param2} == 0]]></printWhenExpression>
+ </reportElement>
+ <textElement>
+ <font fontName="Arial" size="26"/>
+ </textElement>
+ <text><![CDATA[(Pending/Skipped)]]></text>
+ </staticText>
</band>
</title>
<pageHeader>
Modified: branches/bmas-staging/data/schema/mysql/reporting/report_DailyPostedDoctorOrderSchedule.sql
===================================================================
--- branches/bmas-staging/data/schema/mysql/reporting/report_DailyPostedDoctorOrderSchedule.sql 2010-03-11 15:56:06 UTC (rev 5270)
+++ branches/bmas-staging/data/schema/mysql/reporting/report_DailyPostedDoctorOrderSchedule.sql 2010-03-11 16:36:59 UTC (rev 5271)
@@ -30,7 +30,7 @@
#
# Daily Posted Doctor's Order Register
#
-CREATE PROCEDURE report_DailyPostedDoctorOrderSchedule_en_US ( IN currDate DATE)
+CREATE PROCEDURE report_DailyPostedDoctorOrderSchedule_en_US ( IN currDate DATE,IN fid INT)
BEGIN
SET @sql = CONCAT(
"SELECT ",
@@ -51,7 +51,8 @@
"LEFT JOIN patient ON doseplan.doseplanpatient=patient.id ",
"LEFT JOIN user ON doseplan.user=user.id ",
"WHERE ",
- "doseplaneffectivedate='",currDate,"'"
+ "doseplan.doseplaneffectivedate='",currDate,"' AND "
+ "patient.ptprimaryfacility=",fid
);
PREPARE s FROM @sql ;
EXECUTE s ;
@@ -88,9 +89,9 @@
'jasper',
'inventory_report',
'report_DailyPostedDoctorOrderSchedule_en_US',
- 1,
- 'Select Report Date',
- 'Date',
- '0',
+ 2,
+ 'Select Report Date,Facility',
+ 'Date,Facility',
+ '0,0',
'DailyPostedDoctorOrderSchedule_en_US'
);
Modified: branches/bmas-staging/data/schema/mysql/reporting/report_DispensaryAttendenceChecklist.sql
===================================================================
--- branches/bmas-staging/data/schema/mysql/reporting/report_DispensaryAttendenceChecklist.sql 2010-03-11 15:56:06 UTC (rev 5270)
+++ branches/bmas-staging/data/schema/mysql/reporting/report_DispensaryAttendenceChecklist.sql 2010-03-11 16:36:59 UTC (rev 5271)
@@ -49,7 +49,8 @@
"LEFT JOIN user u ON u.id=",uid," ",
"LEFT JOIN facility f ON f.id=",fid," "
"WHERE ",
- "doseplanstartdate='",currDate,"' ",
+ "doseplan.doseplanstartdate='",currDate,"' AND ",
+ "patient.ptprimaryfacility=",fid," "
"HAVING takehome = 0 "
);
PREPARE s FROM @sql ;
Modified: branches/bmas-staging/data/schema/mysql/reporting/report_DoseHold.sql
===================================================================
--- branches/bmas-staging/data/schema/mysql/reporting/report_DoseHold.sql 2010-03-11 15:56:06 UTC (rev 5270)
+++ branches/bmas-staging/data/schema/mysql/reporting/report_DoseHold.sql 2010-03-11 16:36:59 UTC (rev 5271)
@@ -30,7 +30,7 @@
# Dosehold Report
#
-CREATE PROCEDURE report_DoseHold_en_US (IN currDate DATE)
+CREATE PROCEDURE report_DoseHold_en_US (IN currDate DATE,IN fid INT)
BEGIN
SET @sql = CONCAT(
"SELECT ",
@@ -44,7 +44,9 @@
"LEFT JOIN patient ON dosehold.doseholdpatient = patient.id ",
"LEFT JOIN user ON dosehold.doseholduser = user.id ",
"WHERE ",
- "DATE(doseholdstamp)='",currDate,"' AND doseholdstatus = 1 ORDER BY ptid"
+ "DATE(doseholdstamp)='",currDate,"' AND ",
+ "patient.ptprimaryfacility=",fid,
+ " AND doseholdstatus = 1 ORDER BY ptid "
);
PREPARE s FROM @sql ;
EXECUTE s ;
@@ -80,9 +82,9 @@
'jasper',
'inventory_report',
'report_DoseHold_en_US',
- 1,
- 'Select Report Date',
- 'Date',
- '0',
+ 2,
+ 'Select Report Date,Facility',
+ 'Date,Facility',
+ '0,0',
'DoseHold_en_US'
);
\ No newline at end of file
Modified: branches/bmas-staging/lib/org/freemedsoftware/module/DosingStation.class.php
===================================================================
--- branches/bmas-staging/lib/org/freemedsoftware/module/DosingStation.class.php 2010-03-11 15:56:06 UTC (rev 5270)
+++ branches/bmas-staging/lib/org/freemedsoftware/module/DosingStation.class.php 2010-03-11 16:36:59 UTC (rev 5271)
@@ -140,7 +140,14 @@
syslog(LOG_INFO, $q);
return $GLOBALS['sql']->queryAll( $q );
} // end method GetAllOpenDosingStation
-
+
+ public function GetOpenDosingStationCount ( ) {
+ $q = "SELECT count(*) AS 'cn' FROM dosingstation WHERE dsfacility=".((int)HTTP_Session2::get('facility_id'))." AND dsopen='open'";
+ $result = $GLOBALS['sql']->queryRow( $q );
+ syslog(LOG_INFO, $q);
+ return $result['cn']+0;
+ } // end method GetAllOpenDosingStation
+
public function getStationsByType($type)
{
switch ($type) {
Modified: branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/CloseDosingStationScreen.java
===================================================================
--- branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/CloseDosingStationScreen.java 2010-03-11 15:56:06 UTC (rev 5270)
+++ branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/CloseDosingStationScreen.java 2010-03-11 16:36:59 UTC (rev 5271)
@@ -410,8 +410,7 @@
Util.generateReportToPrinter("Dispensing Log Recap by Dose", "pdf", reportParams);
JsonUtil.debug("1-->before getting bottle and lot id");
getBottleAndLotIDForDosingStation();
- }
-
+ }
}
}
});
@@ -478,7 +477,7 @@
try{
if(recWidget.validateReconciliation()){
recWidget.saveReconciliation();
- closeScreen();
+ getOpenDosingStationCount();
}
}
catch(Exception e){
@@ -780,6 +779,69 @@
}
}
+
+ private void getOpenDosingStationCount() {
+ /////////////////
+
+ if (Util.getProgramMode() == ProgramMode.JSONRPC){
+ String[] params = {};
+
+ RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,URL.encode(Util.getJsonRequest("org.freemedsoftware.module.DosingStation.GetOpenDosingStationCount",params)));
+
+ try {
+ builder.sendRequest(null, new RequestCallback() {
+ public void onError(com.google.gwt.http.client.Request request,Throwable ex) {
+ GWT.log("Exception", ex);
+ }
+ @SuppressWarnings("unchecked")
+ public void onResponseReceived(
+ com.google.gwt.http.client.Request request,com.google.gwt.http.client.Response response) {
+ if (200 == response.getStatusCode()) {
+ if (Util.checkValidSessionResponse(response
+ .getText())) {
+ Integer openStattionCount = (Integer) JsonUtil
+ .shoehornJson(JSONParser.parse(response
+ .getText()), "Integer");
+ // alreadyDose = new Integer(tempAlreadyDose);
+ if (openStattionCount == 0) {
+ if(Window.confirm("Do you want to print other reports as well"))
+ {
+ List<String> reportParams = new ArrayList<String>();
+ reportParams.add(Util.getSQLDate(new Date()));
+ reportParams.add("1");
+ reportParams.add("1");
+ Util.generateReportToPrinter("Dispensary Attendance Checklist", "pdf", reportParams);
+ reportParams.clear();
+ reportParams.add(Util.getSQLDate(new Date()));
+ Util.generateReportToPrinter("Daily Posted Doctor's Order Register", "pdf", reportParams);
+ reportParams.clear();
+ reportParams.add(Util.getSQLDate(new Date()));
+ Util.generateReportToPrinter("Dosehold Report", "pdf", reportParams);
+ reportParams.clear();
+ reportParams.add(Util.getSQLDate(new Date()));
+ reportParams.add("1");
+ reportParams.add("1");
+ Util.generateReportToPrinter("Toxicology Report", "pdf", reportParams);
+ reportParams.add("1");
+ reportParams.add("0");
+ Util.generateReportToPrinter("Toxicology Report", "pdf", reportParams);
+ }
+ }
+ closeScreen();
+
+ }
+ }
+ }
+ });
+ } catch (RequestException e) {
+ GWT.log("Exception", e);
+ }
+
+ }
+
+ ///////////////////
+ }
+
private class ButtonHandler implements ClickHandler{
@Override
public void onClick(ClickEvent event) {