r5026 - in branches/bmas-staging: data/report lib/org/freemedsoftware/module ui/gwt/src/org/freemedsoftware/gwt/client/screen ui/gwt/src/org/freemedsoftware/gwt/client/widget

0 views
Skip to first unread message

subve...@svn.freemedsoftware.org

unread,
Feb 8, 2010, 11:22:54 AM2/8/10
to freemed-d...@googlegroups.com
Author: sadnan
Date: 2010-02-08 11:22:54 -0500 (Mon, 08 Feb 2010)
New Revision: 5026

Added:
branches/bmas-staging/data/report/MonthlyMedicationUsage_en_US.jrxml
branches/bmas-staging/data/report/ReconciliationBottles_en_US.jrxml
branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/widget/BottleSelectionWidget.java
Modified:
branches/bmas-staging/lib/org/freemedsoftware/module/Reporting.class.php
branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/InventoryReportScreen.java
Log:
Added Reconciliation Bottles Report and Monthly Medication Usage Report

Added: branches/bmas-staging/data/report/MonthlyMedicationUsage_en_US.jrxml
===================================================================
--- branches/bmas-staging/data/report/MonthlyMedicationUsage_en_US.jrxml (rev 0)
+++ branches/bmas-staging/data/report/MonthlyMedicationUsage_en_US.jrxml 2010-02-08 16:22:54 UTC (rev 5026)
@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="MonthlyMedicationUsage_en_US" language="groovy" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
+ <style name="Title" isDefault="false" fontName="Arial" fontSize="26" isBold="true" pdfFontName="Helvetica-Bold"/>
+ <style name="SubTitle" isDefault="false" forecolor="#666666" fontName="Arial" fontSize="18"/>
+ <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.lang.Long"/>
+ <queryString language="SQL">
+ <![CDATA[call report_MonthlyMedicationUsage_en_US($P{param0});]]>
+ </queryString>
+ <field name="totalunits" class="java.math.BigDecimal">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="ddate" class="java.sql.Date">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="WeekNo" class="java.lang.Integer">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <variable name="WeekTotal" class="java.lang.Long" resetType="Group" resetGroup="WeekNo" calculation="Sum">
+ <variableExpression><![CDATA[$F{totalunits}]]></variableExpression>
+ </variable>
+ <variable name="MonthTotal" class="java.lang.Long" resetType="Column" calculation="Sum">
+ <variableExpression><![CDATA[$F{totalunits}]]></variableExpression>
+ </variable>
+ <group name="WeekNo">
+ <groupExpression><![CDATA[$F{WeekNo}]]></groupExpression>
+ <groupHeader>
+ <band/>
+ </groupHeader>
+ <groupFooter>
+ <band height="40">
+ <textField>
+ <reportElement style="SubTitle" x="50" y="9" width="10" height="24" forecolor="#000000"/>
+ <textElement>
+ <font size="16" isBold="true"/>
+ </textElement>
+ <textFieldExpression class="java.lang.Integer"><![CDATA[$F{WeekNo}]]></textFieldExpression>
+ </textField>
+ <staticText>
+ <reportElement x="60" y="9" width="55" height="24"/>
+ <textElement>
+ <font fontName="Arial" size="16" isBold="true"/>
+ </textElement>
+ <text><![CDATA[ Total ]]></text>
+ </staticText>
+ <line>
+ <reportElement x="278" y="0" width="132" height="1"/>
+ </line>
+ <staticText>
+ <reportElement x="1" y="9" width="49" height="24"/>
+ <textElement>
+ <font fontName="Arial" size="16" isBold="true"/>
+ </textElement>
+ <text><![CDATA[Week ]]></text>
+ </staticText>
+ <textField evaluationTime="Group" evaluationGroup="WeekNo" pattern="">
+ <reportElement x="278" y="9" width="132" height="24"/>
+ <textElement textAlignment="Right" verticalAlignment="Middle">
+ <font fontName="Arial" size="16" isBold="true"/>
+ </textElement>
+ <textFieldExpression class="java.lang.Long"><![CDATA[$V{WeekTotal}]]></textFieldExpression>
+ </textField>
+ <textField evaluationTime="Group" evaluationGroup="WeekNo" pattern="">
+ <reportElement x="278" y="9" width="132" height="24"/>
+ <textElement textAlignment="Right" verticalAlignment="Middle">
+ <font fontName="Arial" size="16" isBold="true"/>
+ </textElement>
+ <textFieldExpression class="java.lang.Long"><![CDATA[$V{WeekTotal}]]></textFieldExpression>
+ </textField>
+ <line>
+ <reportElement x="277" y="39" width="132" height="1"/>
+ </line>
+ </band>
+ </groupFooter>
+ </group>
+ <background>
+ <band splitType="Stretch"/>
+ </background>
+ <title>
+ <band height="70" splitType="Stretch">
+ <staticText>
+ <reportElement style="Title" x="1" y="13" width="337" height="33"/>
+ <textElement verticalAlignment="Middle">
+ <font fontName="Arial" isBold="false"/>
+ </textElement>
+ <text><![CDATA[Monthly Medication Usage]]></text>
+ </staticText>
+ <textField pattern="MMMMM-yy">
+ <reportElement style="Column header" x="1" y="48" width="197" height="22"/>
+ <textElement>
+ <font size="18" isBold="false"/>
+ </textElement>
+ <textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
+ </textField>
+ </band>
+ </title>
+ <pageHeader>
+ <band splitType="Stretch"/>
+ </pageHeader>
+ <columnHeader>
+ <band height="36" splitType="Stretch">
+ <line>
+ <reportElement positionType="FixRelativeToBottom" x="0" y="35" width="555" height="1"/>
+ <graphicElement>
+ <pen lineWidth="0.5" lineColor="#999999"/>
+ </graphicElement>
+ </line>
+ <staticText>
+ <reportElement style="Column header" x="278" y="20" width="277" height="15"/>
+ <textElement/>
+ <text><![CDATA[Total Dispensed]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="1" y="20" width="277" height="15"/>
+ <textElement/>
+ <text><![CDATA[Date]]></text>
+ </staticText>
+ </band>
+ </columnHeader>
+ <detail>
+ <band height="16" splitType="Stretch">
+ <line>
+ <reportElement positionType="FixRelativeToBottom" x="0" y="15" width="555" height="1"/>
+ <graphicElement>
+ <pen lineWidth="0.5" lineColor="#999999"/>
+ </graphicElement>
+ </line>
+ <textField pattern="EEE, MMM d">
+ <reportElement style="Detail" x="0" y="1" width="274" height="15"/>
+ <textElement/>
+ <textFieldExpression class="java.util.Date"><![CDATA[$F{ddate}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement style="Detail" x="277" y="1" width="133" height="15"/>
+ <textElement textAlignment="Right"/>
+ <textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{totalunits}]]></textFieldExpression>
+ </textField>
+ </band>
+ </detail>
+ <columnFooter>
+ <band height="45" splitType="Stretch">
+ <line>
+ <reportElement positionType="FixRelativeToBottom" x="0" y="3" width="555" height="1"/>
+ <graphicElement>
+ <pen lineWidth="0.5" lineColor="#999999"/>
+ </graphicElement>
+ </line>
+ <textField pattern="">
+ <reportElement x="278" y="11" width="132" height="24"/>
+ <textElement textAlignment="Right" verticalAlignment="Middle">
+ <font fontName="Arial" size="16" isBold="true"/>
+ </textElement>
+ <textFieldExpression class="java.lang.Long"><![CDATA[$V{MonthTotal}]]></textFieldExpression>
+ </textField>
+ <staticText>
+ <reportElement x="1" y="11" width="120" height="24"/>
+ <textElement>
+ <font fontName="Arial" size="16" isBold="true"/>
+ </textElement>
+ <text><![CDATA[Monthly Total]]></text>
+ </staticText>
+ </band>
+ </columnFooter>
+ <pageFooter>
+ <band height="20" splitType="Stretch">
+ <textField>
+ <reportElement style="Column header" x="433" y="0" width="80" height="20"/>
+ <textElement textAlignment="Right">
+ <font size="10" isBold="false"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
+ </textField>
+ <textField evaluationTime="Report">
+ <reportElement style="Column header" x="513" y="0" width="40" height="20"/>
+ <textElement>
+ <font size="10" isBold="false"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
+ </textField>
+ <textField pattern="EEEEE dd MMMMM yyyy">
+ <reportElement style="Column header" x="0" y="0" width="197" height="20"/>
+ <textElement>
+ <font size="10" isBold="false"/>
+ </textElement>
+ <textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
+ </textField>
+ </band>
+ </pageFooter>
+ <summary>
+ <band splitType="Stretch"/>
+ </summary>
+</jasperReport>


Property changes on: branches/bmas-staging/data/report/MonthlyMedicationUsage_en_US.jrxml
___________________________________________________________________
Added: svn:keywords
+ Id Author Date Revision
Added: svn:eol-style
+ native

Added: branches/bmas-staging/data/report/ReconciliationBottles_en_US.jrxml
===================================================================
--- branches/bmas-staging/data/report/ReconciliationBottles_en_US.jrxml (rev 0)
+++ branches/bmas-staging/data/report/ReconciliationBottles_en_US.jrxml 2010-02-08 16:22:54 UTC (rev 5026)
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="ReconciliationBottles_en_US" language="groovy" pageWidth="800" pageHeight="842" columnWidth="760" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
+ <style name="Title" isDefault="false" fontName="Arial" fontSize="26" isBold="true" pdfFontName="Helvetica-Bold"/>
+ <style name="SubTitle" isDefault="false" forecolor="#666666" fontName="Arial" fontSize="18"/>
+ <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.lang.Long"/>
+ <queryString language="SQL">
+ <![CDATA[call report_ReconciliationBottles_en_US($P{param0});]]>
+ </queryString>
+ <field name="rec_qty_initial" class="java.lang.Long">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="rec_qty_tr_out" class="java.lang.Long">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="rec_qty_tr_in" class="java.lang.Long">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="net_available" class="java.math.BigInteger">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="rec_qty_disp" class="java.lang.Long">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="rec_qty_disp_takehome" class="java.lang.Long">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="rec_qty_spill" class="java.lang.Long">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="rec_empty_wt" class="java.lang.Long">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="rec_qty_final_expected" class="java.lang.Long">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="rec_qty_final_actual" class="java.lang.Long">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="Difference" class="java.math.BigInteger">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <field name="rec_reason" class="java.lang.String">
+ <fieldDescription><![CDATA[]]></fieldDescription>
+ </field>
+ <background>
+ <band splitType="Stretch"/>
+ </background>
+ <title>
+ <band height="70" splitType="Stretch">
+ <staticText>
+ <reportElement style="Title" x="0" y="18" width="298" height="33"/>
+ <textElement verticalAlignment="Middle">
+ <font fontName="Arial" isBold="false"/>
+ </textElement>
+ <text><![CDATA[Reconciliation Bottles]]></text>
+ </staticText>
+ </band>
+ </title>
+ <pageHeader>
+ <band splitType="Stretch"/>
+ </pageHeader>
+ <detail>
+ <band height="439" splitType="Stretch">
+ <textField>
+ <reportElement style="Detail" x="293" y="63" width="100" height="15"/>
+ <textElement textAlignment="Right"/>
+ <textFieldExpression class="java.lang.Long"><![CDATA[$F{rec_qty_initial}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement style="Detail" x="293" y="91" width="100" height="15"/>
+ <textElement textAlignment="Right"/>
+ <textFieldExpression class="java.lang.Long"><![CDATA[$F{rec_qty_tr_out}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement style="Detail" x="293" y="117" width="100" height="15"/>
+ <textElement textAlignment="Right"/>
+ <textFieldExpression class="java.lang.Long"><![CDATA[$F{rec_qty_tr_in}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement style="Detail" x="293" y="161" width="100" height="15"/>
+ <textElement textAlignment="Right"/>
+ <textFieldExpression class="java.lang.Number"><![CDATA[$F{net_available}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement style="Detail" x="293" y="187" width="100" height="15"/>
+ <textElement textAlignment="Right"/>
+ <textFieldExpression class="java.lang.Long"><![CDATA[$F{rec_qty_disp}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement style="Detail" x="293" y="213" width="100" height="15"/>
+ <textElement textAlignment="Right"/>
+ <textFieldExpression class="java.lang.Long"><![CDATA[$F{rec_qty_disp_takehome}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement style="Detail" x="293" y="238" width="100" height="15"/>
+ <textElement textAlignment="Right"/>
+ <textFieldExpression class="java.lang.Long"><![CDATA[$F{rec_qty_spill}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement style="Detail" x="293" y="263" width="100" height="15"/>
+ <textElement textAlignment="Right"/>
+ <textFieldExpression class="java.lang.Long"><![CDATA[$F{rec_empty_wt}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement style="Detail" x="293" y="299" width="100" height="15"/>
+ <textElement textAlignment="Right"/>
+ <textFieldExpression class="java.lang.Long"><![CDATA[$F{rec_qty_final_expected}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement style="Detail" x="293" y="324" width="100" height="15"/>
+ <textElement textAlignment="Right"/>
+ <textFieldExpression class="java.lang.Long"><![CDATA[$F{rec_qty_final_actual}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement style="Detail" x="293" y="362" width="100" height="15"/>
+ <textElement textAlignment="Right"/>
+ <textFieldExpression class="java.lang.Number"><![CDATA[$F{Difference}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement style="Detail" x="293" y="398" width="431" height="41"/>
+ <textElement/>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{rec_reason}]]></textFieldExpression>
+ </textField>
+ <staticText>
+ <reportElement x="10" y="30" width="158" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="14" isBold="true"/>
+ </textElement>
+ <text><![CDATA[Computer Amounts:]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="43" y="63" width="141" height="15"/>
+ <textElement/>
+ <text><![CDATA[Initial Bottle Contents :]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="43" y="91" width="219" height="15"/>
+ <textElement/>
+ <text><![CDATA[Amount Transferred to Other Bottles :]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="43" y="117" width="233" height="15"/>
+ <textElement/>
+ <text><![CDATA[Amount Transferred from Other Bottles :]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="43" y="161" width="181" height="15"/>
+ <textElement/>
+ <text><![CDATA[Net Amount Available for Use :]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="43" y="187" width="181" height="15"/>
+ <textElement/>
+ <text><![CDATA[Amount Dispensed Today :]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="43" y="213" width="250" height="15"/>
+ <textElement/>
+ <text><![CDATA[Amount Dispensed For Take-Home Doses :]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="43" y="238" width="107" height="15"/>
+ <textElement/>
+ <text><![CDATA[Waste (spillage) :]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="43" y="263" width="154" height="15"/>
+ <textElement/>
+ <text><![CDATA[Empty Container Weight :]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="43" y="299" width="196" height="15"/>
+ <textElement/>
+ <text><![CDATA[Net Amount Remaining in Bottle :]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="43" y="324" width="196" height="15"/>
+ <textElement/>
+ <text><![CDATA[Actual Amount Measured :]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="43" y="362" width="78" height="15"/>
+ <textElement/>
+ <text><![CDATA[Difference:]]></text>
+ </staticText>
+ <staticText>
+ <reportElement style="Column header" x="43" y="398" width="181" height="15"/>
+ <textElement/>
+ <text><![CDATA[Adjustment Posted Reason :]]></text>
+ </staticText>
+ <line>
+ <reportElement x="293" y="147" width="100" height="1"/>
+ </line>
+ <line>
+ <reportElement x="293" y="288" width="100" height="1"/>
+ </line>
+ <line>
+ <reportElement x="293" y="349" width="100" height="1"/>
+ </line>
+ <staticText>
+ <reportElement x="11" y="0" width="213" height="20"/>
+ <textElement/>
+ <text><![CDATA[Note: All Amounts are in Milligrams]]></text>
+ </staticText>
+ </band>
+ </detail>
+ <columnFooter>
+ <band height="45" splitType="Stretch">
+ <line>
+ <reportElement positionType="FixRelativeToBottom" x="0" y="3" width="555" height="1"/>
+ <graphicElement>
+ <pen lineWidth="0.5" lineColor="#999999"/>
+ </graphicElement>
+ </line>
+ </band>
+ </columnFooter>
+ <pageFooter>
+ <band height="20" splitType="Stretch">
+ <textField>
+ <reportElement style="Column header" x="640" y="0" width="80" height="20"/>
+ <textElement textAlignment="Right">
+ <font size="10" isBold="false"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
+ </textField>
+ <textField evaluationTime="Report">
+ <reportElement style="Column header" x="720" y="0" width="40" height="20"/>
+ <textElement>
+ <font size="10" isBold="false"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
+ </textField>
+ <textField pattern="EEEEE dd MMMMM yyyy">
+ <reportElement style="Column header" x="0" y="0" width="197" height="20"/>
+ <textElement>
+ <font size="10" isBold="false"/>
+ </textElement>
+ <textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
+ </textField>
+ </band>
+ </pageFooter>
+ <summary>
+ <band splitType="Stretch"/>
+ </summary>
+</jasperReport>


Property changes on: branches/bmas-staging/data/report/ReconciliationBottles_en_US.jrxml
___________________________________________________________________
Added: svn:keywords
+ Id Author Date Revision
Added: svn:eol-style
+ native

Modified: branches/bmas-staging/lib/org/freemedsoftware/module/Reporting.class.php
===================================================================
--- branches/bmas-staging/lib/org/freemedsoftware/module/Reporting.class.php 2010-02-08 16:01:30 UTC (rev 5025)
+++ branches/bmas-staging/lib/org/freemedsoftware/module/Reporting.class.php 2010-02-08 16:22:54 UTC (rev 5026)
@@ -239,7 +239,54 @@
}
} // end method GenerateReport

-
+ public function GenerateJasperReport ( $uuid, $format, $param ) {
+ freemed::acl_enforce( 'reporting', 'generate' );
+
+ $report = $this->GetReportParameters( $uuid, false );
+
+ // Sanity checking
+ if (!$report['report_name']) { return false; }
+
+ $s = CreateObject('org.freemedsoftware.api.Scheduler');
+ $i=0;
+ foreach ($report['params'] AS $k => $v) {
+ if ( !$v['optional'] and !$param[$k] ) {
+ syslog(LOG_INFO, get_class($this)."| parameter $k failed for report $uuid");
+ return false;
+ }
+
+
+ switch ($v['type']) {
+ case 'Date':
+ $pass['param'.$i] = $GLOBALS['sql']->quote( $s->ImportDate( $param[$k] ) );
+ break;
+
+ case 'Facility':
+ $pass['param'.$i] = $GLOBALS['sql']->quote( ((int) HTTP_Session2::get('facility_id')));
+ break;
+
+ case 'User':
+ $pass['param'.$i] = freemed::user_cache()->user_number+0;
+ break;
+
+ default:
+ $pass['param'.$i] = $GLOBALS['sql']->quote( $param[$k] );
+ break;
+ }
+ $i=$i+1;
+ }
+
+ // Form query
+ $query = "CALL ".$report['report_sp']." ( ". @join( ', ', $pass )." ); ";
+
+ //print_r($result); die();
+
+ // Handle graphing, or at least non-standard, reports
+ if ( $report['report_type'] != 'standard' ) {
+ return call_user_func_array( array( &$this, 'GenerateReport_'.ucfirst($report['report_type']) ), array( $report, $format, $query, $pass ) );
+ }
+ $this->GenerateReport_Jasper( $report, $format, $query,$pass);
+ } // end method GenerateReport
//----- Pluggable methods go below -----

// Method: GenerateReport_Graph

Modified: branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/InventoryReportScreen.java
===================================================================
--- branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/InventoryReportScreen.java 2010-02-08 16:01:30 UTC (rev 5025)
+++ branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/InventoryReportScreen.java 2010-02-08 16:22:54 UTC (rev 5026)
@@ -36,10 +36,12 @@
import org.freemedsoftware.gwt.client.Module.ReportingAsync;
import org.freemedsoftware.gwt.client.Util.ProgramMode;
import org.freemedsoftware.gwt.client.i18n.AppConstants;
+import org.freemedsoftware.gwt.client.widget.BottleSelectionWidget;
import org.freemedsoftware.gwt.client.widget.CustomDatePicker;
import org.freemedsoftware.gwt.client.widget.CustomTable;
import org.freemedsoftware.gwt.client.widget.PatientWidget;
import org.freemedsoftware.gwt.client.widget.SupportModuleWidget;
+import org.freemedsoftware.gwt.client.widget.BottleSelectionWidget.BottleNoHandler;
import org.freemedsoftware.gwt.client.widget.CustomTable.TableRowClickHandler;

import com.google.gwt.core.client.GWT;
@@ -227,7 +229,7 @@

// Open window for request
Window.open(Util.getJsonRequest(
- "org.freemedsoftware.module.Reporting.GenerateReport",
+ "org.freemedsoftware.module.Reporting.GenerateJasperReport",
new String[] { thisReportUUID, type,
JsonUtil.jsonify(getParameters()) }), "Report", "");
}
@@ -358,6 +360,14 @@
.getSource()).getValue().toString());
}
});
+ } else if (type.compareToIgnoreCase("BottleID") == 0) {
+ w = new BottleSelectionWidget();
+ ((BottleSelectionWidget) w).setBottleNoHandler(new BottleNoHandler(){
+ public void handleValueChange(String bottleId){
+ reportParameters.put(i, bottleId);
+ }
+ });
+
} else if (type.compareToIgnoreCase("Facility") == 0) {
reportParameters.put(i, "1");
}

Added: branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/widget/BottleSelectionWidget.java
===================================================================
--- branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/widget/BottleSelectionWidget.java (rev 0)
+++ branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/widget/BottleSelectionWidget.java 2010-02-08 16:22:54 UTC (rev 5026)
@@ -0,0 +1,229 @@
+package org.freemedsoftware.gwt.client.widget;
+
+import java.util.HashMap;
+
+import org.freemedsoftware.gwt.client.JsonUtil;
+import org.freemedsoftware.gwt.client.Util;
+import org.freemedsoftware.gwt.client.Util.ProgramMode;
+import org.freemedsoftware.gwt.client.widget.CustomTable.TableRowClickHandler;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.RequestCallback;
+import com.google.gwt.http.client.RequestException;
+import com.google.gwt.http.client.URL;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class BottleSelectionWidget extends Composite{
+
+ public interface BottleNoHandler{
+ public void handleValueChange(String bottleId);
+ }
+ protected TextBox tbBottleNo;
+ protected BottleNoHandler bottleNoHandler=null;
+ protected TextBox tbLotNo;
+
+ protected Popup lotInfoPopUp;
+ protected String bottleId;
+ protected String selectedBottle;
+
+ protected FlexTable flexTableStep = new FlexTable();
+ protected Popup bottleInfoPopUp;
+ protected CustomTextArea tbAdjusmentPostReason;
+ protected int quantityRemaining=0;
+ protected CustomTable lotTable;
+ String lotNo="";
+ String selectedLot="";
+ protected CustomTable bottleTable;
+ public BottleSelectionWidget() {
+
+ VerticalPanel vPanel=new VerticalPanel();
+ initWidget(vPanel);
+ vPanel.setWidth("100%");
+ vPanel.setVisible(true);
+ flexTableStep.clear();
+
+
+
+
+
+ Label lbBottleNo=new Label("Bottle No :");
+ Label lbLotNo = new Label("Lot No :");
+ tbBottleNo=new TextBox();
+ tbBottleNo.setText("");
+ tbBottleNo.setEnabled(false);
+ tbLotNo=new TextBox();
+ tbLotNo.setText("");
+ tbLotNo.setEnabled(false);
+ HTML htmlSelectBottleLabel = new HTML("<a href=\"javascript:undefined;\" style='color:blue'>Select Bottle</a>");
+ htmlSelectBottleLabel.setStyleName("label_small");
+ htmlSelectBottleLabel
+ .addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent arg0) {
+ JsonUtil.debug("On click start");
+ lotInfoPopUp=new Popup();
+ lotInfoPopUp.setPixelSize(500, 20);
+ PopupView viewInfo=new PopupView(createLotSelectionTable());
+ populateLotMagt();
+ lotInfoPopUp.setNewWidget(viewInfo);
+ lotInfoPopUp.initialize();
+ }
+ });
+
+
+ flexTableStep.setWidget(0, 0, lbBottleNo);
+ flexTableStep.setWidget(0, 1, tbBottleNo);
+ flexTableStep.setWidget(1, 0, lbLotNo);
+ flexTableStep.setWidget(1, 1, tbLotNo);
+ flexTableStep.setWidget(2, 1, htmlSelectBottleLabel);
+
+ vPanel.add(flexTableStep);
+ }
+
+ public void setBottleNo(String bid)
+ {
+ bottleId=bid;
+ }
+
+
+ private CustomTable createLotSelectionTable(){
+ lotTable = new CustomTable();
+ //lotMagtTable.setAllowSelection(false);
+ lotTable.setIndexName("Id");
+ lotTable.setSize("100%", "100%");
+ lotTable.addColumn("Date", "lot_created_date");
+ lotTable.addColumn("Lot Number", "lot_rec_no");
+ lotTable.addColumn("Date Received", "loc_rec_date");
+ lotTable.addColumn("Total Bottle Manufactured","total_bottles");
+ lotTable.setTableRowClickHandler(new TableRowClickHandler(){
+
+ @Override
+ public void handleRowClick(HashMap<String, String> data, int col) {
+ lotNo=data.get("Id");
+ selectedLot=data.get("lot_rec_no");
+ tbLotNo.setText(selectedLot);
+ lotInfoPopUp.setVisible(false);
+ bottleInfoPopUp=new Popup();
+ bottleInfoPopUp.setPixelSize(500, 20);
+ PopupView viewInfo=new PopupView(createBottleSelectionTable());
+ populateBottleSelectionTable();
+ bottleInfoPopUp.setNewWidget(viewInfo);
+ bottleInfoPopUp.initialize();
+ //createStep4();
+ }});
+
+ return lotTable;
+ }
+
+ private CustomTable createBottleSelectionTable(){
+ bottleTable = new CustomTable();
+ bottleTable.setIndexName("Id");
+ bottleTable.setSize("100%", "100%");
+ bottleTable.addColumn("Lot Number", "Lot_no");
+ bottleTable.addColumn("Bottle No ", "Bottle_NO");
+ bottleTable.addColumn("Initial Bottle Amt", "initial_bottle_amnt");
+ bottleTable.addColumn("Current Bottle Amt","bottle_qty_remain");
+ bottleTable.setTableRowClickHandler(new TableRowClickHandler(){
+
+ @Override
+ public void handleRowClick(HashMap<String, String> data, int col) {
+ bottleId=data.get("Id");
+ selectedBottle=data.get("Bottle_NO");
+ tbBottleNo.setText(selectedBottle);
+ if(bottleNoHandler!=null)
+ bottleNoHandler.handleValueChange(bottleId);
+ bottleInfoPopUp.setVisible(false);
+ }});
+
+
+ return bottleTable;
+ }
+
+ public void populateBottleSelectionTable( ) {
+
+ if (Util.getProgramMode() == ProgramMode.STUBBED) {
+ // TODO: handle stubbed
+ } else if (Util.getProgramMode() == ProgramMode.JSONRPC) {
+ String[] params = {JsonUtil.jsonify(selectedLot)};
+
+ RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,URL.encode(Util.getJsonRequest("org.freemedsoftware.module.MethadoneLotRegistration.GetLotInfo",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()) {
+ HashMap<String, String>[] result = (HashMap<String, String>[]) JsonUtil.shoehornJson(JSONParser.parse(response.getText()),"HashMap<String,String>[]");
+ if (result != null) {
+ bottleTable.loadData(result);
+ } else {
+ }
+ } else {
+ }
+ }
+ });
+ } catch (RequestException e) {
+ GWT.log("Exception", e);
+ }
+ } else {
+
+ }
+ }
+ public void populateLotMagt() {
+ if (Util.getProgramMode() == ProgramMode.STUBBED) {
+ // TODO: handle stubbed
+ } else if (Util.getProgramMode() == ProgramMode.JSONRPC) {
+ String[] params = {};
+
+ RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,URL.encode(Util.getJsonRequest("org.freemedsoftware.module.MethadoneLotRegistration.GetAllRecieved",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()) {
+ HashMap<String, String>[] result = (HashMap<String, String>[]) JsonUtil.shoehornJson(JSONParser.parse(response.getText()),"HashMap<String,String>[]");
+ if (result != null) {
+ lotTable.loadData(result);
+ } else {
+ }
+ } else {
+ }
+ }
+ });
+ } catch (RequestException e) {
+ GWT.log("Exception", e);
+ }
+ } else {
+
+ }
+ }
+
+ public BottleNoHandler getBottleNoHandler() {
+ return bottleNoHandler;
+ }
+
+ public void setBottleNoHandler(BottleNoHandler bottleNoHandler) {
+ this.bottleNoHandler = bottleNoHandler;
+ }
+
+}


Property changes on: branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/widget/BottleSelectionWidget.java
___________________________________________________________________
Added: svn:keywords
+ Id Author Date Revision
Added: svn:eol-style
+ native

Reply all
Reply to author
Forward
0 new messages