Added:
branches/bmas-staging/data/schema/mysql/treatment_discharge.sql
branches/bmas-staging/lib/org/freemedsoftware/module/TreatmentDischarge.class.php
branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/IntensifiedTreatmentPlanNotes.java
Modified:
branches/bmas-staging/data/schema/mysql/clinical_assessment_notes.sql
branches/bmas-staging/lib/org/freemedsoftware/module/ClinicalAssessmentNotes.class.php
branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/PatientScreen.java
branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/ClinicalAssessmentNotes.java
branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/CounselorIntakeEntry.java
branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/IntakeInitialContactEntry.java
branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/TreatmentDischargeForm.java
Log:
* Completed Treatment Discharge Form.
* completed previous occurrences of Clinical Assesment Form.
* Now working on Intensified Treatment Form.
Modified: branches/bmas-staging/data/schema/mysql/clinical_assessment_notes.sql
===================================================================
--- branches/bmas-staging/data/schema/mysql/clinical_assessment_notes.sql 2010-02-05 21:33:51 UTC (rev 5024)
+++ branches/bmas-staging/data/schema/mysql/clinical_assessment_notes.sql 2010-02-08 16:01:30 UTC (rev 5025)
@@ -31,7 +31,7 @@
, canmissedposmethnegativetoxic INT UNSIGNED
, canprobbehavloitverbabuse INT UNSIGNED
, canmedical INT UNSIGNED
- , cancuroccurancedate Date
+ , cancuroccurrencedate Date
, canassesmentexplaination VARCHAR (250)
, canbillingmanagernotified VARCHAR (1)
, canassessmentrevieweddate Date
Added: branches/bmas-staging/data/schema/mysql/treatment_discharge.sql
===================================================================
--- branches/bmas-staging/data/schema/mysql/treatment_discharge.sql (rev 0)
+++ branches/bmas-staging/data/schema/mysql/treatment_discharge.sql 2010-02-08 16:01:30 UTC (rev 5025)
@@ -0,0 +1,136 @@
+# $Id$
+#
+# Authors:
+# Jeff Buchbinder <je...@freemedsoftware.org>
+#
+# FreeMED Electronic Medical Record and Practice Management System
+# Copyright (C) 1999-2009 FreeMED Software Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+SOURCE data/schema/mysql/patient.sql
+SOURCE data/schema/mysql/patient_emr.sql
+SOURCE data/schema/mysql/physician.sql
+
+CREATE TABLE IF NOT EXISTS `treatment_discharge` (
+ patient INT UNSIGNED
+ , tddischargedt DATE
+ , tdlastfc2fccontactdt DATE
+ , tdsarectime VARCHAR (20)
+ , tddischargereason VARCHAR (35)
+ , tddischargereferral VARCHAR (20)
+ , tdnoofarrests VARCHAR (100)
+ , tdresarrangements VARCHAR (25)
+ , tdemploymentstatus VARCHAR (20)
+ , tdemploymenttype VARCHAR (15)
+ , tdgafscore VARCHAR (50)
+ , tdsaprimary INT UNSIGNED
+ , tdsaprimaryfreq VARCHAR (20)
+ , tdsasecondary INT UNSIGNED
+ , tdsasecondaryfreq VARCHAR (20)
+ , tdsatertiary INT UNSIGNED
+ , tdsatertiaryfreq VARCHAR (20)
+ , tdexpdeschargecondition VARCHAR (250)
+ , tdclinicaldiagsmrygen VARCHAR (250)
+ , tdclinicaldiagsmrymh VARCHAR (250)
+ , tddiagnosessynth VARCHAR (250)
+ , tdtreatmentstrategies VARCHAR (250)
+ , tdptkeepappointments VARCHAR (250)
+ , tdptprovideurine VARCHAR (250)
+ , tdstrengthsdesc VARCHAR (250)
+ , tdneedsdesc VARCHAR (250)
+ , tdabilitiesdesc VARCHAR (250)
+ , tdpreferencesdesc VARCHAR (250)
+ , tdptcurmedications VARCHAR (250)
+ , tdphycommentsandrecmd VARCHAR (250)
+ , tdcouncelorrecmds VARCHAR (250)
+ , asamplacemetsd1 VARCHAR (1)
+ , asamplacemetsd2 VARCHAR (1)
+ , asamplacemetsd3 VARCHAR (1)
+ , asamplacemetsd4 VARCHAR (1)
+ , asamplacemetsd5 VARCHAR (1)
+ , asamplacemetsd6 VARCHAR (1)
+ , tdindicatedcarelevel VARCHAR (10)
+ , tdptaftercareplan VARCHAR (250)
+ , tdptprognosis VARCHAR (250)
+ , tdcounselor INT UNSIGNED
+ , tdcounselordt DATE
+ , tdsupervisor INT UNSIGNED
+ , tdsupervisordt DATE
+
+ , stamp TIMESTAMP (14) NOT NULL DEFAULT NOW()
+ , user INT UNSIGNED
+ , iso VARCHAR (15)
+ , locked INT UNSIGNED NOT NULL DEFAULT 0
+ , active ENUM ( 'active', 'inactive' ) NOT NULL DEFAULT 'active'
+ , id SERIAL
+
+ # Define keys
+ ,PRIMARY KEY (id)
+);
+
+DROP PROCEDURE IF EXISTS treatment_discharge_Upgrade;
+DELIMITER //
+CREATE PROCEDURE treatment_discharge_Upgrade ( )
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+
+ #----- Remove triggers
+ DROP TRIGGER treatment_discharge_Delete;
+ DROP TRIGGER treatment_discharge_Insert;
+ DROP TRIGGER treatment_discharge_Update;
+
+ #----- Upgrades
+ CALL FreeMED_Module_GetVersion( 'treatment_discharge', @V );
+
+ IF @V < 1 THEN
+ ALTER IGNORE TABLE treatment_discharge ADD COLUMN iso VARCHAR (15) AFTER user ;
+ ALTER IGNORE TABLE treatment_discharge ADD COLUMN locked INT UNSIGNED NOT NULL DEFAULT 0 AFTER iso;
+ ALTER IGNORE TABLE treatment_discharge ADD COLUMN active ENUM ( 'active', 'inactive' ) NOT NULL DEFAULT 'active' AFTER user;
+ END IF;
+
+ CALL FreeMED_Module_UpdateVersion( 'treatment_discharge', 1 );
+END
+//
+DELIMITER ;
+CALL treatment_discharge_Upgrade( );
+
+#----- Triggers
+
+DELIMITER //
+
+CREATE TRIGGER treatment_discharge_Delete
+ AFTER DELETE ON treatment_discharge
+ FOR EACH ROW BEGIN
+ DELETE FROM `patient_emr` WHERE module='treatment_discharge' AND oid=OLD.id;
+ END;
+//
+
+CREATE TRIGGER treatment_discharge_Insert
+ AFTER INSERT ON treatment_discharge
+ FOR EACH ROW BEGIN
+ INSERT INTO `patient_emr` ( module, patient, oid, stamp, locked, provider, user, status ) VALUES ( 'treatment_discharge', NEW.patient, NEW.id, NEW.stamp, NEW.locked, NEW.tdcounselor, NEW.user, NEW.active );
+ END;
+//
+
+CREATE TRIGGER treatment_discharge_Update
+ AFTER UPDATE ON treatment_discharge
+ FOR EACH ROW BEGIN
+ UPDATE `patient_emr` SET stamp=NEW.stamp, patient=NEW.patient, provider=NEW.tdcounselor, locked=NEW.locked, user=NEW.user, status=NEW.active WHERE module='treatment_discharge' AND oid=NEW.id;
+ END;
+//
+
+DELIMITER ;
+
Property changes on: branches/bmas-staging/data/schema/mysql/treatment_discharge.sql
___________________________________________________________________
Added: svn:keywords
+ Id Author Revision Date
Added: svn:eol-style
+ native
Modified: branches/bmas-staging/lib/org/freemedsoftware/module/ClinicalAssessmentNotes.class.php
===================================================================
--- branches/bmas-staging/lib/org/freemedsoftware/module/ClinicalAssessmentNotes.class.php 2010-02-05 21:33:51 UTC (rev 5024)
+++ branches/bmas-staging/lib/org/freemedsoftware/module/ClinicalAssessmentNotes.class.php 2010-02-08 16:01:30 UTC (rev 5025)
@@ -44,7 +44,7 @@
, 'canmissedposmethnegativetoxic'
, 'canprobbehavloitverbabuse'
, 'canmedical'
- , 'cancuroccurancedate'
+ , 'cancuroccurrencedate'
, 'canassesmentexplaination'
, 'canbillingmanagernotified'
, 'canassessmentrevieweddate'
@@ -67,14 +67,14 @@
public function GetPatientAllRecords($patient){
$patient = $GLOBALS['sql']->quote($patient);
- $q = "select can.id,can.cancuroccurancedate as dateoccurance,can.stamp as dateentered, u.userdescrip as enteredby from clinical_assessment_notes can left join user u on u.id=can.user where can.patient=$patient";
+ $q = "select can.id,can.cancuroccurrencedate as dateoccurrence,can.stamp as dateentered, u.userdescrip as enteredby from clinical_assessment_notes can left join user u on u.id=can.user where can.patient=$patient";
return $GLOBALS['sql']->queryAll( $q );
}
public function GetPreviousOccurances($patient,$bycol){
$patient = $GLOBALS['sql']->quote($patient);
- $q = "select can.cancuroccurancedate as prevdate from clinical_assessment_notes can where can.patient = $patient and $bycol=1";
-
+ $q = "select can.cancuroccurrencedate as prevdate from clinical_assessment_notes can where can.patient = $patient and can.".$bycol."=1";
+
$result = $GLOBALS['sql']->queryRow( $q );
$return = "";
foreach($result as $r){
Added: branches/bmas-staging/lib/org/freemedsoftware/module/TreatmentDischarge.class.php
===================================================================
--- branches/bmas-staging/lib/org/freemedsoftware/module/TreatmentDischarge.class.php (rev 0)
+++ branches/bmas-staging/lib/org/freemedsoftware/module/TreatmentDischarge.class.php 2010-02-08 16:01:30 UTC (rev 5025)
@@ -0,0 +1,132 @@
+<?php
+ // $Id: TreatmentDischarge.class.php 5009 2010-02-02 14:00:38Z jeff $
+ //
+ // Authors:
+ // Jeff Buchbinder <je...@freemedsoftware.org>
+ //
+ // FreeMED Electronic Medical Record and Practice Management System
+ // Copyright (C) 1999-2009 FreeMED Software Foundation
+ //
+ // This program is free software; you can redistribute it and/or modify
+ // it under the terms of the GNU General Public License as published by
+ // the Free Software Foundation; either version 2 of the License, or
+ // (at your option) any later version.
+ //
+ // This program is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ // GNU General Public License for more details.
+ //
+ // You should have received a copy of the GNU General Public License
+ // along with this program; if not, write to the Free Software
+ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+LoadObjectDependency('org.freemedsoftware.core.EMRModule');
+
+class TreatmentDischarge extends EMRModule {
+
+ var $MODULE_NAME = "Treatment Discharge";
+ var $MODULE_VERSION = "0.1";
+ var $MODULE_FILE = __FILE__;
+ var $MODULE_UID = "24e8b7aa-df80-44bc-bd91-9aac54146e6e";
+
+ var $PACKAGE_MINIMUM_VERSION = '0.7.2';
+
+ var $record_name = "Treatment Discharge";
+ var $table_name = 'treatment_discharge';
+
+ // 'stamp' - removed and allowed to set the default
+ // will set to the current timestamp
+ var $variables = array (
+ 'patient'
+ , 'tddischargedt'
+ , 'tdlastfc2fccontactdt'
+ , 'tdsarectime'
+ , 'tddischargereason'
+ , 'tddischargereferral'
+ , 'tdnoofarrests'
+ , 'tdresarrangements'
+ , 'tdemploymentstatus'
+ , 'tdemploymenttype'
+ , 'tdgafscore'
+ , 'tdsaprimary'
+ , 'tdsaprimaryfreq'
+ , 'tdsasecondary'
+ , 'tdsasecondaryfreq'
+ , 'tdsatertiary'
+ , 'tdsatertiaryfreq'
+ , 'tdexpdeschargecondition'
+ , 'tdclinicaldiagsmrygen'
+ , 'tdclinicaldiagsmrymh'
+ , 'tddiagnosessynth'
+ , 'tdtreatmentstrategies'
+ , 'tdptkeepappointments'
+ , 'tdptprovideurine'
+ , 'tdstrengthsdesc'
+ , 'tdneedsdesc'
+ , 'tdabilitiesdesc'
+ , 'tdpreferencesdesc'
+ , 'tdptcurmedications'
+ , 'tdphycommentsandrecmd'
+ , 'tdcouncelorrecmds'
+ , 'tdasamplacemetsd1'
+ , 'tdasamplacemetsd2'
+ , 'tdasamplacemetsd3'
+ , 'tdasamplacemetsd4'
+ , 'tdasamplacemetsd5'
+ , 'tdasamplacemetsd6'
+ , 'tdindicatedcarelevel'
+ , 'tdptaftercareplan'
+ , 'tdptprognosis'
+ , 'tdcounselor'
+ , 'tdcounselordt'
+ , 'tdsupervisor'
+ , 'tdsupervisordt'
+ , 'user'
+ );
+
+ public function __construct () {
+ // call parent constructor
+ parent::__construct( );
+ } // end constructor
+
+ protected function add_pre ( &$data ) {
+ unset($data['stamp']);
+ $data['user'] = freemed::user_cache()->user_number;
+ }
+
+ protected function mod_pre ( &$data ) {
+ $data['user'] = freemed::user_cache()->user_number;
+ }
+
+ public function GetPatientAllRecords($patient){
+ $patient = $GLOBALS['sql']->quote($patient);
+ $q = "select td.id,td.tddischargedt as dischargedate,td.stamp as dateentered, u.userdescrip as enteredby from treatment_discharge td left join user u on u.id=td.user where td.patient=$patient";
+ return $GLOBALS['sql']->queryAll( $q );
+ }
+
+ public function GetPatientRecord($patient){
+ $patient = $GLOBALS['sql']->quote($patient);
+
+ $q = "SELECT sa.iisarectime AS tdsarectime, sa.iinoarrests AS tdnoofarrests,sa.iiresarngmt AS tdresarrangements, sa.iiemplstatus AS tdemploymentstatus "
+ .",sa.iiempltype AS tdemploymenttype,mh.pdggafscore as tdgafscore "
+ .",ps.saprimary as tdsaprimary ,ps.sasecondary as tdsasecondary ,ps.satertiary as tdsatertiary "
+ .",ps.saprimaryfreq as tdsaprimaryfreq ,ps.sasecondaryfreq as tdsasecondaryfreq ,ps.satertiaryfreq as tdsatertiaryfreq "
+ .",d5.strengthsdesc as tdstrengthsdesc,d5.needsdesc as tdneedsdesc,d5.abilitiesdesc as tdabilitiesdesc,d5.preferencesdesc as tdpreferencesdesc "
+ .",d6.indicatedcarelevel as tdindicatedcarelevel, d6.tdasamplacemetsd1 as asamplacemetsd1 , d6.tdasamplacemetsd2 as asamplacemetsd2 , d6.tdasamplacemetsd3 as asamplacemetsd3 "
+ .", d6.tdasamplacemetsd4 as asamplacemetsd4 , d6.tdasamplacemetsd5 as asamplacemetsd5 , d6.tdasamplacemetsd6 as asamplacemetsd6 "
+ ."FROM sa_intake sa "
+ ."LEFT JOIN mhdx mh on mh.pdgpatient = $patient and mh.pdggafscore>0 "
+ ."LEFT JOIN patient_substance ps on ps.sapatient = $patient and ps.saprimary>0 "
+ ."LEFT JOIN treatment_counselor_intake_d5 d5 on d5.patient = $patient "
+ ."LEFT JOIN treatment_counselor_intake_d6 d6 on d6.patient = $patient "
+ ."WHERE sa.iipatient=$patient order by sa.iisarectime desc";
+ return $GLOBALS['sql']->queryRow( $q );
+
+ }
+
+} // end class TreatmentDischarge
+
+register_module ("TreatmentDischarge");
+
+?>
Modified: branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/PatientScreen.java
===================================================================
--- branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/PatientScreen.java 2010-02-05 21:33:51 UTC (rev 5024)
+++ branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/PatientScreen.java 2010-02-08 16:01:30 UTC (rev 5025)
@@ -53,6 +53,7 @@
import org.freemedsoftware.gwt.client.screen.patient.ProgressNoteEntry;
import org.freemedsoftware.gwt.client.screen.patient.ReferralEntry;
import org.freemedsoftware.gwt.client.screen.patient.SummaryScreen;
+import org.freemedsoftware.gwt.client.screen.patient.TreatmentDischargeForm;
import org.freemedsoftware.gwt.client.screen.patient.TreatmentPlanNotes;
import org.freemedsoftware.gwt.client.screen.patient.VitalsEntry;
import org.freemedsoftware.gwt.client.widget.PatientInfoBar;
@@ -279,8 +280,17 @@
clinicalAssessmentNotes, getObject());
clinicalAssessmentNotes.populateAvailableData();
}
- });
+ });
+ menuBar_4.addItem("Treatment Discharge Form", new Command() {
+ public void execute() {
+ TreatmentDischargeForm treatmentDischargeForm = new TreatmentDischargeForm();
+ Util.spawnTabPatient("Treatment Discharge Form",
+ treatmentDischargeForm, getObject());
+ treatmentDischargeForm.populateAvailableData();
+ }
+ });
+
menuBar.addItem("Treatment Plan", menuBar_4);
}
Modified: branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/ClinicalAssessmentNotes.java
===================================================================
--- branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/ClinicalAssessmentNotes.java 2010-02-05 21:33:51 UTC (rev 5024)
+++ branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/ClinicalAssessmentNotes.java 2010-02-08 16:01:30 UTC (rev 5025)
@@ -24,9 +24,7 @@
package org.freemedsoftware.gwt.client.screen.patient;
-import java.util.Date;
import java.util.HashMap;
-import java.util.Iterator;
import org.freemedsoftware.gwt.client.CurrentState;
import org.freemedsoftware.gwt.client.JsonUtil;
@@ -34,17 +32,16 @@
import org.freemedsoftware.gwt.client.Util;
import org.freemedsoftware.gwt.client.Util.ProgramMode;
import org.freemedsoftware.gwt.client.widget.CustomDatePicker;
-import org.freemedsoftware.gwt.client.widget.CustomListBox;
import org.freemedsoftware.gwt.client.widget.CustomRadioButtonGroup;
import org.freemedsoftware.gwt.client.widget.CustomTable;
-import org.freemedsoftware.gwt.client.widget.ProviderWidget;
-import org.freemedsoftware.gwt.client.widget.SupportModuleWidget;
import org.freemedsoftware.gwt.client.widget.Toaster;
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.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
@@ -52,7 +49,6 @@
import com.google.gwt.http.client.Response;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.FlexTable;
@@ -61,12 +57,9 @@
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TabPanel;
import com.google.gwt.user.client.ui.TextArea;
-import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
-import eu.future.earth.gwt.client.TimeBox;
-
public class ClinicalAssessmentNotes extends PatientEntryScreenInterface {
@@ -104,8 +97,12 @@
protected final Button wSubmit;
protected final Button wDelete;
- protected FlexTable prevOccurancesDates;
-
+ protected FlexTable prevOccurrencesDates;
+ protected CheckBox patternOfMissedCounceling;
+ protected CheckBox changeInBehavior;
+ protected CheckBox missedPositiveMethadone;
+ protected CheckBox probLoitVerbAbuse;
+ protected CheckBox medical;
public ClinicalAssessmentNotes() {
final VerticalPanel containerAllVerticalPanel = new VerticalPanel();
@@ -209,27 +206,82 @@
clinicalAssessmentNotesEntryLabel.setVisible(false);
containerClinicalAssessmentNotesForm.add(clinicalAssessmentNotesEntryLabel);
- final CheckBox patternOfMissedCounceling = new CheckBox();
+ patternOfMissedCounceling = new CheckBox();
+ patternOfMissedCounceling.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
+ @Override
+ public void onValueChange(ValueChangeEvent<Boolean> arg0) {
+ if(arg0.getValue()){
+ getPreviousOccurrences("canptrnofmissedCounceling", 0, patternOfMissedCounceling.getText());
+ }else{
+ prevOccurrencesDates.setText(0, 0, "");
+ prevOccurrencesDates.setText(0, 1, "");
+ }
+ }
+ });
patternOfMissedCounceling.setText("Pattern of missed counseling sessions");
containerClinicalAssessmentNotesForm.add(patternOfMissedCounceling);
containerClinicalAssessmentNotesFormFields.put("canptrnofmissedCounceling", patternOfMissedCounceling);
- final CheckBox changeInBehavior = new CheckBox();
+ changeInBehavior = new CheckBox();
+ changeInBehavior.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
+ @Override
+ public void onValueChange(ValueChangeEvent<Boolean> arg0) {
+ if(arg0.getValue()){
+ getPreviousOccurrences("canchangeinbehavappmh", 1, changeInBehavior.getText());
+ }else{
+ prevOccurrencesDates.setText(1, 0, "");
+ prevOccurrencesDates.setText(1, 1, "");
+ }
+ }
+ });
changeInBehavior.setText("Change in Behavior, Appearance, Mental Status");
containerClinicalAssessmentNotesForm.add(changeInBehavior);
containerClinicalAssessmentNotesFormFields.put("canchangeinbehavappmh", changeInBehavior);
- final CheckBox missedPositiveMethadone = new CheckBox();
+ missedPositiveMethadone = new CheckBox();
+ missedPositiveMethadone.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
+ @Override
+ public void onValueChange(ValueChangeEvent<Boolean> arg0) {
+ if(arg0.getValue()){
+ getPreviousOccurrences("canmissedposmethnegativetoxic", 2, missedPositiveMethadone.getText());
+ }else{
+ prevOccurrencesDates.setText(2, 0, "");
+ prevOccurrencesDates.setText(2, 1, "");
+ }
+ }
+ });
missedPositiveMethadone.setText("Missed, Positive, Methadone Negative toxicology");
containerClinicalAssessmentNotesForm.add(missedPositiveMethadone);
containerClinicalAssessmentNotesFormFields.put("canmissedposmethnegativetoxic", missedPositiveMethadone);
- final CheckBox probLoitVerbAbuse = new CheckBox();
+ probLoitVerbAbuse = new CheckBox();
+ probLoitVerbAbuse.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
+ @Override
+ public void onValueChange(ValueChangeEvent<Boolean> arg0) {
+ if(arg0.getValue()){
+ getPreviousOccurrences("canprobbehavloitverbabuse", 3, probLoitVerbAbuse.getText());
+ }else{
+ prevOccurrencesDates.setText(3, 0, "");
+ prevOccurrencesDates.setText(3, 1, "");
+ }
+ }
+ });
probLoitVerbAbuse.setText("Problematic Behaviors: Loitering, Verbal Abuse, Violent Actions");
containerClinicalAssessmentNotesForm.add(probLoitVerbAbuse);
containerClinicalAssessmentNotesFormFields.put("canprobbehavloitverbabuse", probLoitVerbAbuse);
- final CheckBox medical = new CheckBox();
+ medical = new CheckBox();
+ medical.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
+ @Override
+ public void onValueChange(ValueChangeEvent<Boolean> arg0) {
+ if(arg0.getValue()){
+ getPreviousOccurrences("canmedical", 4, medical.getText());
+ }else{
+ prevOccurrencesDates.setText(4, 0, "");
+ prevOccurrencesDates.setText(4, 1, "");
+ }
+ }
+ });
medical.setText("Medical");
containerClinicalAssessmentNotesForm.add(medical);
containerClinicalAssessmentNotesFormFields.put("canmedical", medical);
@@ -240,15 +292,18 @@
final Label occurDateLabel = new Label("Occurrence Date:");
horizontalPanel.add(occurDateLabel);
final CustomDatePicker occurDate = new CustomDatePicker();
- containerClinicalAssessmentNotesFormFields.put("cancuroccurancedate", occurDate);
+ containerClinicalAssessmentNotesFormFields.put("cancuroccurrencedate", occurDate);
horizontalPanel.add(occurDate);
- final Label prevOccurDateLabel = new Label("Dates of previous occurances:");
- containerClinicalAssessmentNotesForm.add(prevOccurDateLabel);
- prevOccurancesDates = new FlexTable();
- prevOccurancesDates.setWidth("70%");
- containerClinicalAssessmentNotesForm.add(prevOccurancesDates);
+ horizontalPanel = new HorizontalPanel();
+ containerClinicalAssessmentNotesForm.add(horizontalPanel);
+ final Label prevOccurDateLabel = new Label("Dates of previous occurrences:");
+ horizontalPanel.add(prevOccurDateLabel);
+ prevOccurrencesDates = new FlexTable();
+ prevOccurrencesDates.setWidth("100%");
+ horizontalPanel.add(prevOccurrencesDates);
+
final Label assesmentExplainationLabel = new Label("Brief Explanation of assessment and plan created with patient");
containerClinicalAssessmentNotesForm.add(assesmentExplainationLabel);
@@ -291,7 +346,7 @@
containerClinicalAssessmentNotesTable = new CustomTable();
containerClinicalAssessmentNotesTable.setWidth("100%");
containerClinicalAssessmentNotesListPanel.add(containerClinicalAssessmentNotesTable);
- containerClinicalAssessmentNotesTable.addColumn("Occurance Date", "dateoccurance");
+ containerClinicalAssessmentNotesTable.addColumn("Occurrence Date", "dateoccurrence");
containerClinicalAssessmentNotesTable.addColumn("Date Entered", "dateentered");
containerClinicalAssessmentNotesTable.addColumn("Entered By", "enteredby");
containerClinicalAssessmentNotesTable.setIndexName("id");
@@ -333,7 +388,12 @@
clinicalAssessmentNoteId = null;
wSubmit.setText("Add");
wDelete.setVisible(false);
+ for(int i=0;i<5;i++){
+ prevOccurrencesDates.setText(i, 0, "");
+ prevOccurrencesDates.setText(i, 1, "");
+ }
}
+
public void populateAvailableData(){
retrieveAndFillData(CLINICAL_ASSESSMENT_NOTES,"org.freemedsoftware.module."+CLINICAL_ASSESSMENT_NOTES+".GetPatientRecord",patientScreen.getPatient(), containerClinicalAssessmentNotesFormFields);
retrieveAndFillListData();
@@ -415,7 +475,16 @@
"HashMap<String,String>");
if (result != null) {
Util.populateForm(containerFormFields, result);
-
+ if(result.get("canptrnofmissedCounceling")!=null && result.get("canptrnofmissedCounceling").equalsIgnoreCase("1"))
+ getPreviousOccurrences("canptrnofmissedCounceling", 0, patternOfMissedCounceling.getText());
+ if(result.get("canchangeinbehavappmh")!=null && result.get("canchangeinbehavappmh").equalsIgnoreCase("1"))
+ getPreviousOccurrences("canchangeinbehavappmh", 1, changeInBehavior.getText());
+ if(result.get("canmissedposmethnegativetoxic")!=null && result.get("canmissedposmethnegativetoxic").equalsIgnoreCase("1"))
+ getPreviousOccurrences("canmissedposmethnegativetoxic", 2, missedPositiveMethadone.getText());
+ if(result.get("canprobbehavloitverbabuse")!=null && result.get("canprobbehavloitverbabuse").equalsIgnoreCase("1"))
+ getPreviousOccurrences("canprobbehavloitverbabuse", 3, probLoitVerbAbuse.getText());
+ if(result.get("canmedical")!=null && result.get("canmedical").equalsIgnoreCase("1"))
+ getPreviousOccurrences("canmedical", 4, medical.getText());
}
} else {
JsonUtil
@@ -498,7 +567,6 @@
} else if (Util.getProgramMode() == ProgramMode.JSONRPC) {
// JSON-RPC
String moduleURL = "org.freemedsoftware.module."+moduleName+ (isModify?".Mod":".Add");
- Window.alert(data.toString());
String[] params = { JsonUtil.jsonify(data) };
RequestBuilder builder = new RequestBuilder(
RequestBuilder.POST,
@@ -544,4 +612,61 @@
}
}
+ public void getPreviousOccurrences(String byCol,final int onResponseUpdateRow,final String onResponseheading){
+ if (Util.getProgramMode() == ProgramMode.STUBBED) {
+ // TODO: STUBBED
+ } else if (Util.getProgramMode() == ProgramMode.JSONRPC) {
+ // JSON-RPC
+ String[] params = { JsonUtil.jsonify(patientScreen.getPatient()),JsonUtil.jsonify(byCol) };
+ RequestBuilder builder = new RequestBuilder(
+ RequestBuilder.POST,
+ URL
+ .encode(Util
+ .getJsonRequest(
+ "org.freemedsoftware.module."+CLINICAL_ASSESSMENT_NOTES+".GetPreviousOccurances",
+ params)));
+ try {
+ builder.sendRequest(null, new RequestCallback() {
+ public void onError(Request request, Throwable ex) {
+ JsonUtil
+ .debug("Error on retrieving AppointmentTemplate");
+ }
+
+ @SuppressWarnings("unchecked")
+ public void onResponseReceived(Request request,
+ Response response) {
+ if (200 == response.getStatusCode()) {
+ if (response.getText().compareToIgnoreCase(
+ "false") != 0) {
+ String result = (String) JsonUtil
+ .shoehornJson(JSONParser
+ .parse(response.getText()),
+ "String");
+ if (result != null) {
+ Label label = new Label(onResponseheading+":");
+ prevOccurrencesDates.setWidget(onResponseUpdateRow, 0, label);
+ prevOccurrencesDates.setText(onResponseUpdateRow, 1, result);
+
+ }
+ } else {
+ JsonUtil
+ .debug("Received dummy response from JSON backend");
+ }
+ } else {
+ CurrentState.getToaster().addItem("ClinicalAssessmentNotes",
+ "Failed to get Clinical Assessment Notes items.",
+ Toaster.TOASTER_ERROR);
+ }
+ }
+ });
+ } catch (RequestException e) {
+ CurrentState.getToaster().addItem("ClinicalAssessmentNotes",
+ "Failed to get Clinical Assessment Notes items.",
+ Toaster.TOASTER_ERROR);
+ }
+ } else {
+ // GWT-RPC
+ }
+ }
+
}
Modified: branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/CounselorIntakeEntry.java
===================================================================
--- branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/CounselorIntakeEntry.java 2010-02-05 21:33:51 UTC (rev 5024)
+++ branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/CounselorIntakeEntry.java 2010-02-08 16:01:30 UTC (rev 5025)
@@ -36,7 +36,6 @@
import org.freemedsoftware.gwt.client.Util;
import org.freemedsoftware.gwt.client.Util.ProgramMode;
import org.freemedsoftware.gwt.client.widget.CustomDatePicker;
-import org.freemedsoftware.gwt.client.widget.CustomListBox;
import org.freemedsoftware.gwt.client.widget.CustomRadioButtonGroup;
import org.freemedsoftware.gwt.client.widget.CustomTable;
import org.freemedsoftware.gwt.client.widget.ProviderWidget;
@@ -68,8 +67,6 @@
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
-import eu.future.earth.gwt.client.TimeBox;
-
public class CounselorIntakeEntry extends PatientEntryScreenInterface {
Modified: branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/IntakeInitialContactEntry.java
===================================================================
--- branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/IntakeInitialContactEntry.java 2010-02-05 21:33:51 UTC (rev 5024)
+++ branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/IntakeInitialContactEntry.java 2010-02-08 16:01:30 UTC (rev 5025)
@@ -56,7 +56,6 @@
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.FlexTable;
@@ -1181,7 +1180,7 @@
noOfArrestslabel.setStyleName("label");
noOfArrestsPanel.add(noOfArrestslabel);
final TextBox noOfArrests = new TextBox();
- noOfArrests.setTitle("(enter '99' ifUnknown)");
+ noOfArrests.setTitle("(enter '99' if Unknown)");
substanceAbuseIntakeFormFields.put("iinoarrests", noOfArrests);
noOfArrestsPanel.add(noOfArrests);
@@ -1190,13 +1189,13 @@
noOfArrestsPanel.add(saRecoverylabel);
final CustomRadioButtonGroup saRecovery = new CustomRadioButtonGroup("saRecovery",true);
- saRecovery.addItem("NA (client is a MH client oniy)");
- saRecovery.addItem("None");
- saRecovery.addItem("1-3 times in past month");
- saRecovery.addItem("1-2 times in past week");
- saRecovery.addItem("3-6 times in past week");
- saRecovery.addItem("Daily");
- saRecovery.addItem("Unknown");
+ saRecovery.addItem("NA (client is a MH client oniy)","na");
+ saRecovery.addItem("None","none");
+ saRecovery.addItem("1-3 times in past month","1to3 time past month");
+ saRecovery.addItem("1-2 times in past week","1to2 time past week");
+ saRecovery.addItem("3-6 times in past week","3to6 time past week");
+ saRecovery.addItem("Daily","daily");
+ saRecovery.addItem("Unknown","unknown");
substanceAbuseIntakeFormFields.put("iisarectime", saRecovery);
noOfArrestsPanel.add(saRecovery);
@@ -1292,19 +1291,19 @@
resArrangePanel.add(resArrangeLabel);
- final CustomRadioButtonGroup resArrange = new CustomRadioButtonGroup("resArrange",true);
- resArrange.addItem("Private residencelhousehold");
- resArrange.addItem("Public HousinglSection 8");
- resArrange.addItem("Residential (e.g., grp home or supervised apt.)");
- resArrange.addItem("Assisted Living Facility");
- resArrange.addItem("Nursing Home");
- resArrange.addItem("Other Institutional Care (e.g., Long Term Hospital)");
- resArrange.addItem("Foster Home");
- resArrange.addItem("Incarcerated in Jail or Correctional Facility");
- resArrange.addItem("Sober Housing");
- resArrange.addItem("Shelter, transient, no permanent address");
- resArrange.addItem("Homeless, streeUoutdoors, park");
- resArrange.addItem("Unknown");
+ final CustomRadioButtonGroup resArrange = new CustomRadioButtonGroup("iiresarngmt",true);
+ resArrange.addItem("Private residence/household","private residence");
+ resArrange.addItem("Public Housing/Section 8","public housing");
+ resArrange.addItem("Residential (e.g., grp home or supervised apt.)","residential");
+ resArrange.addItem("Assisted Living Facility","assisted facility");
+ resArrange.addItem("Nursing Home","nursing home");
+ resArrange.addItem("Other Institutional Care (e.g., Long Term Hospital)","institutional");
+ resArrange.addItem("Foster Home","foster");
+ resArrange.addItem("Incarcerated in Jail or Correctional Facility","correctional facility");
+ resArrange.addItem("Sober Housing","sober housing");
+ resArrange.addItem("Shelter, transient, no permanent address","shelter transient");
+ resArrange.addItem("Homeless, street/outdoors, park","homeless");
+ resArrange.addItem("Unknown","unknown");
substanceAbuseIntakeFormFields.put("iiresarngmt", resArrange);
resArrangePanel.add(resArrange);
@@ -1353,19 +1352,19 @@
employmentPanel.add(employmentLabel);
- final CustomRadioButtonGroup employment = new CustomRadioButtonGroup("employment",true);
- employment.addItem("Employed: Full Time (35+ hours/week)");
- employment.addItem("Employed: Half Time (20-34 hours/week)");
- employment.addItem("Employed: Part Time (20 hours/week)");
- employment.addItem("Armed Forces");
- employment.addItem("Volunteer");
- employment.addItem("Unemployed (laid off or looking for work)");
- employment.addItem("School or Job Training");
- employment.addItem("Homemaker");
- employment.addItem("Inmate or Resident of Institution");
- employment.addItem("Retired");
- employment.addItem("Disabled");
- employment.addItem("Unknown");
+ final CustomRadioButtonGroup employment = new CustomRadioButtonGroup("iiemplstatus",true);
+ employment.addItem("Employed: Full Time (35+ hours/week)","35+h per week");
+ employment.addItem("Employed: Half Time (20-34 hours/week)","20-34h per week");
+ employment.addItem("Employed: Part Time (20 hours/week)","20h per week");
+ employment.addItem("Armed Forces","armed forces");
+ employment.addItem("Volunteer","volunteer");
+ employment.addItem("Unemployed (laid off or looking for work)","unemployed");
+ employment.addItem("School or Job Training","training");
+ employment.addItem("Homemaker","homemaker");
+ employment.addItem("Inmate or Resident of Institution","inmate");
+ employment.addItem("Retired","retired");
+ employment.addItem("Disabled","disabled");
+ employment.addItem("Unknown","unknown");
substanceAbuseIntakeFormFields.put("iiemplstatus", employment);
employmentPanel.add(employment);
@@ -1380,13 +1379,13 @@
employmentTypePanel.add(employmentTypeLabel);
- final CustomRadioButtonGroup employmentType = new CustomRadioButtonGroup("employmentType",true);
- employmentType.addItem("NA (not employed full, half, or part time)");
- employmentType.addItem("Competitive");
- employmentType.addItem("Supported");
- employmentType.addItem("Transitional");
- employmentType.addItem("Other");
- employmentType.addItem("Unknown");
+ final CustomRadioButtonGroup employmentType = new CustomRadioButtonGroup("iiempltype",true);
+ employmentType.addItem("NA (not employed full, half, or part time)","na");
+ employmentType.addItem("Competitive","competitive");
+ employmentType.addItem("Supported","supported");
+ employmentType.addItem("Transitional","transitional");
+ employmentType.addItem("Other","other");
+ employmentType.addItem("Unknown","unknown");
substanceAbuseIntakeFormFields.put("iiempltype", employmentType);
employmentTypePanel.add(employmentType);
@@ -1878,13 +1877,13 @@
flexTable.setWidget(row, 4, substanceUseFreqLabel);
CustomListBox substanceUseFreq = new CustomListBox();
- substanceUseFreq.addItem("NA (no substance of abuse)", "NA");
- substanceUseFreq.addItem("No past month use", "No past month use");
- substanceUseFreq.addItem("1-3 times in past month", "1-3 times in past month");
- substanceUseFreq.addItem("1-2 times per week", "1-2 times per week");
- substanceUseFreq.addItem("3-6 times per week", "3-6 times per week");
- substanceUseFreq.addItem("Daily", "Daily");
- substanceUseFreq.addItem("Unknown", "Unknown");
+ substanceUseFreq.addItem("NA (no substance of abuse at discharge)","na");
+ substanceUseFreq.addItem("None","none");
+ substanceUseFreq.addItem("1-3 times in past month","1to3 time past month");
+ substanceUseFreq.addItem("1-2 times in past week","1to2 time past week");
+ substanceUseFreq.addItem("3-6 times in past week","3to6 time past week");
+ substanceUseFreq.addItem("Daily","daily");
+ substanceUseFreq.addItem("Unknown","unknown");
patientSubstanceFormFields.put(value+"freq", substanceUseFreq);
flexTable.setWidget(row, 5, substanceUseFreq);
Added: branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/IntensifiedTreatmentPlanNotes.java
===================================================================
--- branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/IntensifiedTreatmentPlanNotes.java (rev 0)
+++ branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/IntensifiedTreatmentPlanNotes.java 2010-02-08 16:01:30 UTC (rev 5025)
@@ -0,0 +1,466 @@
+/*
+ * $Id: ClinicalAssessmentNotes.java 5017 2010-02-04 15:58:52Z hamid $
+ *
+ * Authors:
+ * Jeff Buchbinder <je...@freemedsoftware.org>
+ *
+ * FreeMED Electronic Medical Record and Practice Management System
+ * Copyright (C) 1999-2009 FreeMED Software Foundation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.freemedsoftware.gwt.client.screen.patient;
+
+import java.util.HashMap;
+
+import org.freemedsoftware.gwt.client.CurrentState;
+import org.freemedsoftware.gwt.client.JsonUtil;
+import org.freemedsoftware.gwt.client.PatientEntryScreenInterface;
+import org.freemedsoftware.gwt.client.Util;
+import org.freemedsoftware.gwt.client.Util.ProgramMode;
+import org.freemedsoftware.gwt.client.widget.CustomTable;
+import org.freemedsoftware.gwt.client.widget.Toaster;
+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.Request;
+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.Response;
+import com.google.gwt.http.client.URL;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.CheckBox;
+import com.google.gwt.user.client.ui.HasHorizontalAlignment;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.TabPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class IntensifiedTreatmentPlanNotes extends PatientEntryScreenInterface {
+
+
+ protected TabPanel tabPanel; //All forms container if tab view
+
+ protected VerticalPanel containerVerticalPanel; //All forms container if single page view
+
+ protected VerticalPanel containerIntensifiedTreatmentPlanNotesForm;
+
+ protected VerticalPanel containerIntensifiedTreatmentPlanNotesListPanel;
+
+ protected CustomTable containerIntensifiedTreatmentPlanNotesTable;
+
+
+ protected HashMap<String, Widget> containerIntensifiedTreatmentPlanNotesFormFields = new HashMap<String, Widget>();//container Form Fields Container
+
+
+
+ protected HashMap<String, Widget> nonEditableFormFields = new HashMap<String, Widget>();//patient table Fields Container
+
+ protected Integer intensifiedTreatmentPlanNoteId = null;
+
+ final protected String moduleName = "Intensified Treatment Plan Notes";
+
+ final protected String INTENSIFIED_TREATMENT_PLAN_NOTES= "IntensifiedTreatmentPlanNotes";
+
+ protected String patientIdName = "patient";
+
+ protected Label intensifiedTreatmentPlanNotesEntryLabel = new Label("Add");
+
+ protected Label intensifiedTreatmentPlanNotesListLabel = new Label("View");
+
+ //Creates only desired amount of instances if we follow this pattern otherwise we have public constructor as well
+
+ protected final Button wSubmit;
+ protected final Button wDelete;
+
+ public IntensifiedTreatmentPlanNotes() {
+
+ final VerticalPanel containerAllVerticalPanel = new VerticalPanel();
+ initWidget(containerAllVerticalPanel);
+
+ final HorizontalPanel tabViewPanel = new HorizontalPanel();
+ final CheckBox tabView = new CheckBox();
+ tabView.setText("Tab View");
+ tabView.setValue(true);
+ tabViewPanel.add(tabView);
+
+ tabView.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent arg0) {
+ switchView(tabView.getValue());
+ }
+ });
+
+ containerAllVerticalPanel.add(tabViewPanel);
+
+ final HorizontalPanel buttonBar = new HorizontalPanel();
+ buttonBar.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
+ wSubmit = new Button("Add");
+ buttonBar.add(wSubmit);
+ wSubmit.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent evt) {
+// submitForm();
+ HashMap<String, String> data;
+ data = Util.populateHashMap(containerIntensifiedTreatmentPlanNotesFormFields);
+
+ if(intensifiedTreatmentPlanNoteId!=null)
+ data.put("id", intensifiedTreatmentPlanNoteId.toString());
+ data.put("patient", patientScreen.getPatient().toString());
+ saveFormData(INTENSIFIED_TREATMENT_PLAN_NOTES,data,data.get("id")!=null?true:false);
+
+ resetForm();
+ populateAvailableData();
+ tabPanel.selectTab(1);
+ }
+ });
+ final Button wReset = new Button("Reset");
+ buttonBar.add(wReset);
+ wReset.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent evt) {
+ resetForm();
+ }
+ });
+ wDelete = new Button("Delete");
+ buttonBar.add(wDelete);
+ wDelete.setVisible(false);
+ wDelete.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent evt) {
+ deleteRecord(INTENSIFIED_TREATMENT_PLAN_NOTES, intensifiedTreatmentPlanNoteId);
+ }
+ });
+ tabPanel = new TabPanel();
+ containerAllVerticalPanel.add(tabPanel);
+
+ containerVerticalPanel = new VerticalPanel();
+ containerAllVerticalPanel.add(containerVerticalPanel);
+
+
+ containerAllVerticalPanel.add(buttonBar);
+
+ initIntensifiedTreatmentPlanNotesForm();
+
+ initIntensifiedTreatmentPlanNotesList();
+
+ tabPanel.selectTab(1);
+ }
+ public void switchView(boolean isTabView){
+ if(isTabView){
+ tabPanel.setVisible(true);
+ tabPanel.add(containerIntensifiedTreatmentPlanNotesForm, intensifiedTreatmentPlanNotesEntryLabel.getText());
+ intensifiedTreatmentPlanNotesEntryLabel.setVisible(false);
+
+ tabPanel.add(containerIntensifiedTreatmentPlanNotesListPanel, intensifiedTreatmentPlanNotesListLabel.getText());
+ intensifiedTreatmentPlanNotesListLabel.setVisible(false);
+ tabPanel.selectTab(0);
+ containerVerticalPanel.setVisible(false);
+
+ }else{
+ containerVerticalPanel.setVisible(true);
+
+ intensifiedTreatmentPlanNotesEntryLabel.setVisible(true);
+ containerVerticalPanel.add(containerIntensifiedTreatmentPlanNotesForm);
+
+ intensifiedTreatmentPlanNotesListLabel.setVisible(true);
+ containerVerticalPanel.add(containerIntensifiedTreatmentPlanNotesListPanel);
+
+ tabPanel.setVisible(false);
+ }
+ }
+
+ protected void initIntensifiedTreatmentPlanNotesForm(){
+ containerIntensifiedTreatmentPlanNotesForm= new VerticalPanel();
+ containerIntensifiedTreatmentPlanNotesForm.setStyleName("width100Perc");
+ tabPanel.add(containerIntensifiedTreatmentPlanNotesForm, intensifiedTreatmentPlanNotesEntryLabel.getText());
+
+ intensifiedTreatmentPlanNotesEntryLabel.setStyleName("medium-header-label");
+ intensifiedTreatmentPlanNotesEntryLabel.setVisible(false);
+ containerIntensifiedTreatmentPlanNotesForm.add(intensifiedTreatmentPlanNotesEntryLabel);
+
+
+
+
+ }
+
+ protected void initIntensifiedTreatmentPlanNotesList(){
+ containerIntensifiedTreatmentPlanNotesListPanel= new VerticalPanel();
+ containerIntensifiedTreatmentPlanNotesListPanel.setStyleName("width100Perc");
+ tabPanel.add(containerIntensifiedTreatmentPlanNotesListPanel, intensifiedTreatmentPlanNotesListLabel.getText());
+
+ intensifiedTreatmentPlanNotesListLabel.setStyleName("medium-header-label");
+ intensifiedTreatmentPlanNotesListLabel.setVisible(false);
+ containerIntensifiedTreatmentPlanNotesListPanel.add(intensifiedTreatmentPlanNotesListLabel);
+
+ containerIntensifiedTreatmentPlanNotesTable = new CustomTable();
+ containerIntensifiedTreatmentPlanNotesTable.setWidth("100%");
+ containerIntensifiedTreatmentPlanNotesListPanel.add(containerIntensifiedTreatmentPlanNotesTable);
+ containerIntensifiedTreatmentPlanNotesTable.addColumn("Occurrence Date", "dateoccurrence");
+ containerIntensifiedTreatmentPlanNotesTable.addColumn("Date Entered", "dateentered");
+ containerIntensifiedTreatmentPlanNotesTable.addColumn("Entered By", "enteredby");
+ containerIntensifiedTreatmentPlanNotesTable.setIndexName("id");
+
+ containerIntensifiedTreatmentPlanNotesTable.setTableRowClickHandler(new TableRowClickHandler() {
+ @Override
+ public void handleRowClick(HashMap<String, String> data, int col) {
+ try {
+ intensifiedTreatmentPlanNoteId = Integer.parseInt(data.get("id"));
+ retrieveAndFillData(INTENSIFIED_TREATMENT_PLAN_NOTES,"org.freemedsoftware.module."+INTENSIFIED_TREATMENT_PLAN_NOTES+".GetRecord",intensifiedTreatmentPlanNoteId, containerIntensifiedTreatmentPlanNotesFormFields);
+ wSubmit.setText("Modify");
+ wDelete.setVisible(true);
+ tabPanel.selectTab(0);
+
+ } catch (Exception e) {
+ GWT.log("Caught exception: ", e);
+ }
+ }
+ });
+
+
+ }
+
+ /**
+ * Internal method to load a template record into the current form.
+ *
+ * @param data
+ */
+ protected void loadTemplateData(HashMap<String, String> data) {
+
+ }
+
+ public String getModuleName() {
+ return moduleName;
+ }
+
+ public void resetForm() {
+ Util.resetWidgetMap(containerIntensifiedTreatmentPlanNotesFormFields);
+ intensifiedTreatmentPlanNoteId = null;
+ wSubmit.setText("Add");
+ wDelete.setVisible(false);
+ }
+
+ public void populateAvailableData(){
+ retrieveAndFillData(INTENSIFIED_TREATMENT_PLAN_NOTES,"org.freemedsoftware.module."+INTENSIFIED_TREATMENT_PLAN_NOTES+".GetPatientRecord",patientScreen.getPatient(), containerIntensifiedTreatmentPlanNotesFormFields);
+ retrieveAndFillListData();
+ }
+
+ public void deleteRecord(final String moduleName,Integer id){
+ if (Util.getProgramMode() == ProgramMode.STUBBED) {
+ // TODO: STUBBED
+ } else if (Util.getProgramMode() == ProgramMode.JSONRPC) {
+ // JSON-RPC
+ String moduleURL = "org.freemedsoftware.module."+moduleName+ ".Del";
+ String[] params = { JsonUtil.jsonify(id) };
+ RequestBuilder builder = new RequestBuilder(
+ RequestBuilder.POST,
+ URL
+ .encode(Util
+ .getJsonRequest(moduleURL
+ ,
+ params)));
+ try {
+ builder.sendRequest(null, new RequestCallback() {
+ public void onError(Request request, Throwable ex) {
+ }
+
+ public void onResponseReceived(Request request,
+ Response response) {
+ if (200 == response.getStatusCode()) {
+ Boolean b = (Boolean) JsonUtil.shoehornJson(
+ JSONParser.parse(response.getText()),
+ "Boolean");
+ if(b!=null && b.booleanValue()){
+ retrieveAndFillListData();
+ resetForm();
+ wDelete.setVisible(false);
+ tabPanel.selectTab(1);
+ }
+ } else {
+ CurrentState.getToaster().addItem(
+ "CounselorIntakeForm", "Counselor Intake Form failed.");
+ }
+ }
+ });
+ } catch (RequestException e) {
+ }
+ } else {
+ // GWT-RPC
+ }
+ }
+
+ public void retrieveAndFillData(final String moduleName,String moduleURL,Integer id,final HashMap<String, Widget> containerFormFields){
+ if (Util.getProgramMode() == ProgramMode.STUBBED) {
+ // TODO: STUBBED
+ } else if (Util.getProgramMode() == ProgramMode.JSONRPC) {
+ // JSON-RPC
+ String[] params = { JsonUtil.jsonify(id) };
+ RequestBuilder builder = new RequestBuilder(
+ RequestBuilder.POST,
+ URL
+ .encode(Util
+ .getJsonRequest(
+ moduleURL,
+ params)));
+ try {
+ builder.sendRequest(null, new RequestCallback() {
+ public void onError(Request request, Throwable ex) {
+ JsonUtil
+ .debug("Error on retrieving AppointmentTemplate");
+ }
+
+ @SuppressWarnings("unchecked")
+ public void onResponseReceived(Request request,
+ Response response) {
+ if (200 == response.getStatusCode()) {
+ if (response.getText().compareToIgnoreCase(
+ "false") != 0) {
+ HashMap<String, String> result = (HashMap<String, String>) JsonUtil
+ .shoehornJson(JSONParser
+ .parse(response.getText()),
+ "HashMap<String,String>");
+ if (result != null) {
+ Util.populateForm(containerFormFields, result);
+ }
+ } else {
+ JsonUtil
+ .debug("Received dummy response from JSON backend");
+ }
+ } else {
+ CurrentState.getToaster().addItem("ClinicalAssessmentNotes",
+ "Failed to get Clinical Assessment Notes items.",
+ Toaster.TOASTER_ERROR);
+ }
+ }
+ });
+ } catch (RequestException e) {
+ CurrentState.getToaster().addItem("ClinicalAssessmentNotes",
+ "Failed to get Clinical Assessment Notes items.",
+ Toaster.TOASTER_ERROR);
+ }
+ } else {
+ // GWT-RPC
+ }
+ }
+
+ public void retrieveAndFillListData(){
+ if (Util.getProgramMode() == ProgramMode.STUBBED) {
+ // TODO: STUBBED
+ } else if (Util.getProgramMode() == ProgramMode.JSONRPC) {
+ // JSON-RPC
+ String[] params = { JsonUtil.jsonify(patientScreen.getPatient()) };
+ RequestBuilder builder = new RequestBuilder(
+ RequestBuilder.POST,
+ URL
+ .encode(Util
+ .getJsonRequest(
+ "org.freemedsoftware.module."+INTENSIFIED_TREATMENT_PLAN_NOTES+".GetPatientAllRecords",
+ params)));
+ try {
+ builder.sendRequest(null, new RequestCallback() {
+ public void onError(Request request, Throwable ex) {
+ JsonUtil
+ .debug("Error on retrieving AppointmentTemplate");
+ }
+
+ @SuppressWarnings("unchecked")
+ public void onResponseReceived(Request request,
+ Response response) {
+ if (200 == response.getStatusCode()) {
+ if (response.getText().compareToIgnoreCase(
+ "false") != 0) {
+ HashMap<String, String>[] result = (HashMap<String, String>[]) JsonUtil
+ .shoehornJson(JSONParser
+ .parse(response.getText()),
+ "HashMap<String,String>[]");
+ if (result != null) {
+ containerIntensifiedTreatmentPlanNotesTable.loadData(result);
+
+ }
+ } else {
+ JsonUtil
+ .debug("Received dummy response from JSON backend");
+ }
+ } else {
+ CurrentState.getToaster().addItem("ClinicalAssessmentNotes",
+ "Failed to get Clinical Assessment Notes items.",
+ Toaster.TOASTER_ERROR);
+ }
+ }
+ });
+ } catch (RequestException e) {
+ CurrentState.getToaster().addItem("ClinicalAssessmentNotes",
+ "Failed to get Clinical Assessment Notes items.",
+ Toaster.TOASTER_ERROR);
+ }
+ } else {
+ // GWT-RPC
+ }
+ }
+ public void saveFormData(final String moduleName,HashMap<String, String> data,boolean isModify){
+ if (Util.getProgramMode() == ProgramMode.STUBBED) {
+ // TODO: STUBBED
+ } else if (Util.getProgramMode() == ProgramMode.JSONRPC) {
+ // JSON-RPC
+ String moduleURL = "org.freemedsoftware.module."+moduleName+ (isModify?".Mod":".Add");
+ String[] params = { JsonUtil.jsonify(data) };
+ RequestBuilder builder = new RequestBuilder(
+ RequestBuilder.POST,
+ URL
+ .encode(Util
+ .getJsonRequest(moduleURL
+ ,
+ params)));
+ try {
+ builder.sendRequest(null, new RequestCallback() {
+ public void onError(Request request, Throwable ex) {
+ }
+
+ public void onResponseReceived(Request request,
+ Response response) {
+ if (200 == response.getStatusCode()) {
+ Integer r = (Integer) JsonUtil.shoehornJson(
+ JSONParser.parse(response.getText()),
+ "Integer");
+ if (r != null) {
+ CurrentState.getToaster().addItem(
+ "ClinicalAssessmentNotes",
+ "Entry successfully added.");
+ }else{
+ Boolean b = (Boolean) JsonUtil.shoehornJson(
+ JSONParser.parse(response.getText()),
+ "Boolean");
+ if(b!=null)
+ CurrentState.getToaster().addItem(
+ "ClinicalAssessmentNotes",
+ "Entry successfully modified.");
+ }
+ } else {
+ CurrentState.getToaster().addItem(
+ "ClinicalAssessmentNotes", "Clinical Assessment Notes Form failed.");
+ }
+ }
+ });
+ } catch (RequestException e) {
+ }
+ } else {
+ // GWT-RPC
+ }
+ }
+
+}
Modified: branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/TreatmentDischargeForm.java
===================================================================
--- branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/TreatmentDischargeForm.java 2010-02-05 21:33:51 UTC (rev 5024)
+++ branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/TreatmentDischargeForm.java 2010-02-08 16:01:30 UTC (rev 5025)
@@ -64,8 +64,6 @@
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
-import eu.future.earth.gwt.client.TimeBox;
-
public class TreatmentDischargeForm extends PatientEntryScreenInterface {
@@ -167,9 +165,9 @@
containerAllVerticalPanel.add(buttonBar);
- initTreatmentPlanForm();
+ initTreatmentDischargeForm();
- initTreatmentPlanList();
+ initTreatmentDischargeList();
tabPanel.selectTab(1);
}
@@ -197,7 +195,7 @@
}
}
- protected void initTreatmentPlanForm(){
+ protected void initTreatmentDischargeForm(){
containerTreatmentDischargeForm= new VerticalPanel();
containerTreatmentDischargeForm.setStyleName("width100Perc");
tabPanel.add(containerTreatmentDischargeForm, treatmentDischargeEntryLabel.getText());
@@ -207,26 +205,562 @@
containerTreatmentDischargeForm.add(treatmentDischargeEntryLabel);
HorizontalPanel horizontalPanel = new HorizontalPanel();
+ horizontalPanel.setWidth("100%");
containerTreatmentDischargeForm.add(horizontalPanel);
VerticalPanel verticalPanel = new VerticalPanel();
horizontalPanel.add(verticalPanel);
- final Label dischargeDateLabel = new Label("DisCHARGE DATE (from current program):");
+ final Label dischargeDateLabel = new Label("Discharge Date (from current program):");
+ dischargeDateLabel.setStyleName("label_bold");
verticalPanel.add(dischargeDateLabel);
final CustomDatePicker dischargeDate = new CustomDatePicker(new Date());
verticalPanel.add(dischargeDate);
- containerTreatmentDischargeFormFields.put("dischargeDate", dischargeDate);
+ containerTreatmentDischargeFormFields.put("tddischargedt", dischargeDate);
- final Label lastFaceToFaceContactdtLabel = new Label("LAST FACE-TO-FACE CONTACT DATE (for current program):");
+ final Label lastFaceToFaceContactdtLabel = new Label("Last Face-To-Face Contact Date (for current program):");
+ lastFaceToFaceContactdtLabel.setStyleName("label_bold");
verticalPanel.add(lastFaceToFaceContactdtLabel);
final CustomDatePicker lastFaceToFaceContactdt = new CustomDatePicker();
verticalPanel.add(lastFaceToFaceContactdt);
- containerTreatmentDischargeFormFields.put("lastFaceToFaceContactdt", lastFaceToFaceContactdt);
+ containerTreatmentDischargeFormFields.put("tdlastfc2fccontactdt", lastFaceToFaceContactdt);
+ final Label saRecoverylabel = new Label("In 30 days prior to discharge ");
+ saRecoverylabel.setStyleName("label_bold");
+ verticalPanel.add(saRecoverylabel);
+
+ final Label saRecoveryDetaillabel = new Label("how often did the client "+
+ "attend avoluntary self help group for SA recovery?");
+ saRecoveryDetaillabel.setStyleName("label_bold");
+ verticalPanel.add(saRecoveryDetaillabel);
+
+ final CustomRadioButtonGroup saRecovery = new CustomRadioButtonGroup("sarectime",true);
+ saRecovery.addItem("NA (client is a MH client oniy)","na");
+ saRecovery.addItem("None","none");
+ saRecovery.addItem("1-3 times in past month","1to3 time past month");
+ saRecovery.addItem("1-2 times in past week","1to2 time past week");
+ saRecovery.addItem("3-6 times in past week","3to6 time past week");
+ saRecovery.addItem("Daily","daily");
+ saRecovery.addItem("Unknown","unknown");
+
+ containerTreatmentDischargeFormFields.put("tdsarectime", saRecovery);
+ verticalPanel.add(saRecovery);
+
+ verticalPanel = new VerticalPanel();
+ horizontalPanel.add(verticalPanel);
+
+ final Label dischargeReasonlabel = new Label("REASON FOR DISCHARGE?");
+ dischargeReasonlabel.setStyleName("label_bold");
+ verticalPanel.add(dischargeReasonlabel);
+
+ final CustomRadioButtonGroup dischargeReason = new CustomRadioButtonGroup("dischargereason",true);
+ dischargeReason.addItem("Completed treatment - no referral required","completed treatment");
+ dischargeReason.addItem("Internal transfer - to another program episode at agency","internal transfer to other program");
+ dischargeReason.addItem("External transfer - to another provider","external transfer to other program");
+ dischargeReason.addItem("Discharged, additional services advised","additional services advised");
+ dischargeReason.addItem("Client discharged before completed treatment / against advice / no contact within 30 days","discharge before completion");
+ dischargeReason.addItem("Discharged due to inability to pay for services","due to inability to pay");
+ dischargeReason.addItem("Discharged for other non-compliance issues (e.g., rule infractions)","rule infractions");
+ dischargeReason.addItem("Discharged to corrections due to Incarceration Client deceased","incarceration client diceased");
+ dischargeReason.addItem("Unknown","unknown");
+ containerTreatmentDischargeFormFields.put("tddischargereason", dischargeReason);
+ verticalPanel.add(dischargeReason);
+
+ verticalPanel = new VerticalPanel();
+ horizontalPanel.add(verticalPanel);
+
+ final Label dischargeReferralLabel = new Label("REFERRAL AT DISCHARGE");
+ dischargeReferralLabel.setStyleName("label_bold");
+ verticalPanel.add(dischargeReferralLabel);
+
+ final CustomRadioButtonGroup dischargeReferral = new CustomRadioButtonGroup("dischargereferral",true);
+ dischargeReferral.addItem("NA / None","na");
+ dischargeReferral.addItem("Mental Health Care Provider","mh care provider");
+ dischargeReferral.addItem("Substance Abuse Treatment provider","sa treatment provider");
+ dischargeReferral.addItem("Other Health Care Provider","other hc provider");
+ dischargeReferral.addItem("Federal or State Social Services Agency","federal agency");
+ dischargeReferral.addItem("Shelter for the Homeless / Abused","abused");
+ dischargeReferral.addItem("School System (e.g., counselor, Student Assistance Program, etc.)","school system");
+ dischargeReferral.addItem("Employer/Employee Assistance Program","emp system program");
+ dischargeReferral.addItem("Other Community Referral","community refferal");
+ dischargeReferral.addItem("Court/Criminal Justice System","court justice system");
+ dischargeReferral.addItem("Unknown","unknown");
+ containerTreatmentDischargeFormFields.put("tddischargereferral", dischargeReferral);
+ verticalPanel.add(dischargeReferral);
+
+ final Label noOfArrestslabel = new Label("No.of arrests in 30 days prior to discharge from program:");
+ noOfArrestslabel.setStyleName("label_bold");
+ verticalPanel.add(noOfArrestslabel);
+ final TextBox noOfArrests = new TextBox();
+ noOfArrests.setTitle("(enter '99' if Unknown)");
+ containerTreatmentDischargeFormFields.put("tdnoofarrests", noOfArrests);
+ verticalPanel.add(noOfArrests);
+
+ horizontalPanel = new HorizontalPanel();
+ horizontalPanel.setWidth("100%");
+ containerTreatmentDischargeForm.add(horizontalPanel);
+
+ verticalPanel = new VerticalPanel();
+ horizontalPanel.add(verticalPanel);
+
+ final Label resArrangeLabel = new Label("Residential Arrangements At Discharge");
+ resArrangeLabel.setStyleName("label_bold");
+ verticalPanel.add(resArrangeLabel);
+
+
+ final CustomRadioButtonGroup resArrange = new CustomRadioButtonGroup("resArrange",true);
+ resArrange.addItem("Private residence/household","private residence");
+ resArrange.addItem("Public Housing/Section 8","public housing");
+ resArrange.addItem("Residential (e.g., grp home or supervised apt.)","residential");
+ resArrange.addItem("Assisted Living Facility","assisted facility");
+ resArrange.addItem("Nursing Home","nursing home");
+ resArrange.addItem("Other Institutional Care (e.g., Long Term Hospital)","institutional");
+ resArrange.addItem("Foster Home","foster");
+ resArrange.addItem("Incarcerated in Jail or Correctional Facility","correctional facility");
+ resArrange.addItem("Sober Housing","sober housing");
+ resArrange.addItem("Shelter, transient, no permanent address","shelter transient");
+ resArrange.addItem("Homeless, street/outdoors, park","homeless");
+ resArrange.addItem("Unknown","unknown");
+
+ containerTreatmentDischargeFormFields.put("tdresarrangements", resArrange);
+ verticalPanel.add(resArrange);
+
+ verticalPanel = new VerticalPanel();
+ horizontalPanel.add(verticalPanel);
+
+ final Label employmentLabel = new Label("Employement Status At Discharge");
+ employmentLabel.setStyleName("label_bold");
+ verticalPanel.add(employmentLabel);
+
+
+ final CustomRadioButtonGroup employment = new CustomRadioButtonGroup("employmentstatus",true);
+ employment.addItem("Employed: Full Time (35+ hours/week)","35+h per week");
+ employment.addItem("Employed: Half Time (20-34 hours/week)","20-34h per week");
+ employment.addItem("Employed: Part Time (20 hours/week)","20h per week");
+ employment.addItem("Armed Forces","armed forces");
+ employment.addItem("Volunteer","volunteer");
+ employment.addItem("Unemployed (laid off or looking for work)","unemployed");
+ employment.addItem("School or Job Training","training");
+ employment.addItem("Homemaker","homemaker");
+ employment.addItem("Inmate or Resident of Institution","inmate");
+ employment.addItem("Retired","retired");
+ employment.addItem("Disabled","disabled");
+ employment.addItem("Unknown","unknown");
+
+ containerTreatmentDischargeFormFields.put("tdemploymentstatus", employment);
+ verticalPanel.add(employment);
+
+
+ verticalPanel = new VerticalPanel();
+ horizontalPanel.add(verticalPanel);
+
+ final Label employmentTypeLabel = new Label("Employement Type At Discharge");
+ employmentTypeLabel.setStyleName("label_bold");
+ verticalPanel.add(employmentTypeLabel);
+
+
+ final CustomRadioButtonGroup employmentType = new CustomRadioButtonGroup("tdemploymenttype",true);
+ employmentType.addItem("NA (not employed full, half, or part time)","na");
+ employmentType.addItem("Competitive","competitive");
+ employmentType.addItem("Supported","supported");
+ employmentType.addItem("Transitional","transitional");
+ employmentType.addItem("Other","other");
+ employmentType.addItem("Unknown","unknown");
+
+ containerTreatmentDischargeFormFields.put("tdemploymenttype", employmentType);
+ verticalPanel.add(employmentType);
+
+ final Label gafScorelabel = new Label("GAF SCORE at DISCHARGE:");
+ gafScorelabel.setStyleName("label_bold");
+ verticalPanel.add(gafScorelabel);
+ final TextBox gafScore = new TextBox();
+ gafScore.setTitle("((enter '0' if Unknown)");
+ containerTreatmentDischargeFormFields.put("tdgafscore", gafScore);
+ verticalPanel.add(gafScore);
+
+ FlexTable flexTable = new FlexTable();
+ containerTreatmentDischargeForm.add(flexTable);
+
+ int row=0;
+
+ final Label saprimaryLabel = new Label("Primary:");
+ saprimaryLabel.setStyleName("label_bold");
+ flexTable.setWidget(row, 0, saprimaryLabel);
+ final SupportModuleWidget saprimary = new SupportModuleWidget("Codes");
+ flexTable.setWidget(row, 1, saprimary);
+ containerTreatmentDischargeFormFields.put("tdsaprimary", saprimary);
+
+ final Label saPrimaryFreqLabel = new Label("Frequency Of Use:");
+ saPrimaryFreqLabel.setStyleName("label_bold");
+ flexTable.setWidget(row, 2, saPrimaryFreqLabel);
+
+ CustomListBox saPrimaryFreq = new CustomListBox();
+ saPrimaryFreq.addItem("NA (no substance of abuse at discharge)","na");
+ saPrimaryFreq.addItem("None","none");
+ saPrimaryFreq.addItem("1-3 times in past month","1to3 time past month");
+ saPrimaryFreq.addItem("1-2 times in past week","1to2 time past week");
+ saPrimaryFreq.addItem("3-6 times in past week","3to6 time past week");
+ saPrimaryFreq.addItem("Daily","daily");
+ saPrimaryFreq.addItem("Unknown","unknown");
+ containerTreatmentDischargeFormFields.put("tdsaprimaryfreq", saPrimaryFreq);
+ flexTable.setWidget(row, 3, saPrimaryFreq);
+
+ row++;
+
+ final Label saSecondayLabel = new Label("Secondary:");
+ saSecondayLabel.setStyleName("label_bold");
+ flexTable.setWidget(row, 0, saSecondayLabel);
+ final SupportModuleWidget saSeconday = new SupportModuleWidget("Codes");
+ flexTable.setWidget(row, 1, saSeconday);
+ containerTreatmentDischargeFormFields.put("tdsasecondary", saSeconday);
+
+ final Label saSecondayFreqLabel = new Label("Frequency Of Use:");
+ saSecondayFreqLabel.setStyleName("label_bold");
+ flexTable.setWidget(row, 2, saSecondayFreqLabel);
+
+ CustomListBox saSecondayFreq = new CustomListBox();
+ saSecondayFreq.addItem("NA (no substance of abuse at discharge)","na");
+ saSecondayFreq.addItem("None","none");
+ saSecondayFreq.addItem("1-3 times in past month","1to3 time past month");
+ saSecondayFreq.addItem("1-2 times in past week","1to2 time past week");
+ saSecondayFreq.addItem("3-6 times in past week","3to6 time past week");
+ saSecondayFreq.addItem("Daily","daily");
+ saSecondayFreq.addItem("Unknown","unknown");
+ containerTreatmentDischargeFormFields.put("tdsasecondaryfreq", saSecondayFreq);
+ flexTable.setWidget(row, 3, saSecondayFreq);
+
+ row++;
+
+ final Label saTertiaryLabel = new Label("Tertiary:");
+ saTertiaryLabel.setStyleName("label_bold");
+ flexTable.setWidget(row, 0, saTertiaryLabel);
+ final SupportModuleWidget saTertiary = new SupportModuleWidget("Codes");
+ flexTable.setWidget(row, 1, saTertiary);
+ containerTreatmentDischargeFormFields.put("tdsatertiary", saTertiary);
+
+ final Label saTertiaryFreqLabel = new Label("Frequency Of Use:");
+ saTertiaryFreqLabel.setStyleName("label_bold");
+ flexTable.setWidget(row, 2, saTertiaryFreqLabel);
+
+ CustomListBox saTertiaryFreq = new CustomListBox();
+ saTertiaryFreq.addItem("NA (no substance of abuse at discharge)","na");
+ saTertiaryFreq.addItem("None","none");
+ saTertiaryFreq.addItem("1-3 times in past month","1to3 time past month");
+ saTertiaryFreq.addItem("1-2 times in past week","1to2 time past week");
+ saTertiaryFreq.addItem("3-6 times in past week","3to6 time past week");
+ saTertiaryFreq.addItem("Daily","daily");
+ saTertiaryFreq.addItem("Unknown","unknown");
+ containerTreatmentDischargeFormFields.put("tdsatertiaryfreq", saTertiaryFreq);
+ flexTable.setWidget(row, 3, saTertiaryFreq);
+
+ horizontalPanel = new HorizontalPanel();
+ containerTreatmentDischargeForm.add(horizontalPanel);
+ final Label expDeschargeConditionLabel = new Label("Explain Discharge Condition ");
+ expDeschargeConditionLabel.setStyleName("label_bold");
+ horizontalPanel.add(expDeschargeConditionLabel);
+ final Label expDeschargeConditionDetailLabel = new Label("(Discharge Diagnostic Impressions)");
+ horizontalPanel.add(expDeschargeConditionDetailLabel);
+
+ final TextArea expDeschargeCondition = new TextArea();
+ expDeschargeCondition.setWidth("70%");
+ containerTreatmentDischargeForm.add(expDeschargeCondition);
+ containerTreatmentDischargeFormFields.put("tdexpdeschargecondition", expDeschargeCondition);
+
+ final Label clinicalDischargeSumryLabel = new Label("Clinical Diagnostic Summary:");
+ clinicalDischargeSumryLabel.setStyleName("label_bold");
+ containerTreatmentDischargeForm.add(clinicalDischargeSumryLabel);
+
+ horizontalPanel = new HorizontalPanel();
+ containerTreatmentDischargeForm.add(horizontalPanel);
+
+ final Label genralSumryLabel = new Label("General ");
+ genralSumryLabel.setStyleName("label_bold");
+ horizontalPanel.add(genralSumryLabel);
+ final Label genralSumryDetailLabel = new Label("(list significant changes in education, legal, marital/relationship, employment etc., if any):");
+ horizontalPanel.add(genralSumryDetailLabel);
+
+ final TextArea genralSumry = new TextArea();
+ genralSumry.setWidth("70%");
+ containerTreatmentDischargeForm.add(genralSumry);
+ containerTreatmentDischargeFormFields.put("tdclinicaldiagsmrygen", containerTreatmentDischargeForm);
+
+ horizontalPanel = new HorizontalPanel();
+ containerTreatmentDischargeForm.add(horizontalPanel);
+
+ final Label mentalStatusSumryLabel = new Label("Mental Status ");
+ mentalStatusSumryLabel.setStyleName("label_bold");
+ horizontalPanel.add(mentalStatusSumryLabel);
+ final Label mentalStatusSumryDetailLabel = new Label("(describe patient's mental status at time of discharge, changes, improvement, medication, etc.):");
+ horizontalPanel.add(mentalStatusSumryDetailLabel);
+
+ final TextArea mentalStatusSumry = new TextArea();
+ mentalStatusSumry.setWidth("70%");
+ containerTreatmentDischargeForm.add(mentalStatusSumry);
+ containerTreatmentDischargeFormFields.put("tdclinicaldiagsmrymh", mentalStatusSumry);
+
+ horizontalPanel = new HorizontalPanel();
+ containerTreatmentDischargeForm.add(horizontalPanel);
+
+ final Label diagnosesSynthLabel = new Label("Diagnostic Synthesis ");
+ diagnosesSynthLabel.setStyleName("label_bold");
+ horizontalPanel.add(diagnosesSynthLabel);
+ final Label diagnosesSynthDetailLabel = new Label("(explain current status of CD problem, changes, impact on quality of life. Is CD a contributing factor in other problems and/or do other, ongoing problems contribute to CD? Did drug use continue during treatment?):");
+ horizontalPanel.add(diagnosesSynthDetailLabel);
+
+ final TextArea diagnosesSynth = new TextArea();
+ diagnosesSynth.setWidth("70%");
+ containerTreatmentDischargeForm.add(diagnosesSynth);
+ containerTreatmentDischargeFormFields.put("tddiagnosessynth", diagnosesSynth);
+
+ horizontalPanel = new HorizontalPanel();
+ containerTreatmentDischargeForm.add(horizontalPanel);
+
+ final Label treatmentStrategiesLabel = new Label("Treatment Strategies & Associated Outcomes ");
+ treatmentStrategiesLabel.setStyleName("label_bold");
+ horizontalPanel.add(treatmentStrategiesLabel);
+ final Label treatmentStrategiesDetailLabel = new Label("(what treatment strategies/interventions were employed? Were they successful? Why/Why not? Did patient and counselor believe goals were met? What were the most successful strategies?):");
+ horizontalPanel.add(treatmentStrategiesDetailLabel);
+
+ final TextArea treatmentStrategies = new TextArea();
+ treatmentStrategies.setWidth("70%");
+ containerTreatmentDischargeForm.add(treatmentStrategies);
+ containerTreatmentDischargeFormFields.put("tdtreatmentstrategies", treatmentStrategies);
+
+ final Label adherTreatmentReqLabel = new Label("Adherence to Treatment Requirements:");
+ adherTreatmentReqLabel.setStyleName("label_bold");
+ containerTreatmentDischargeForm.add(adherTreatmentReqLabel);
+
+ horizontalPanel = new HorizontalPanel();
+ containerTreatmentDischargeForm.add(horizontalPanel);
+
+ final Label ptKeepAppointmentsLabel = new Label("Did the patient keep appointments ");
+ ptKeepAppointmentsLabel.setStyleName("label_bold");
+ horizontalPanel.add(ptKeepAppointmentsLabel);
+ final Label ptKeepAppointmentsDetailLabel = new Label("(how many were scheduled; how many were kept?):");
+ horizontalPanel.add(ptKeepAppointmentsDetailLabel);
+
+ final TextArea ptKeepAppointments = new TextArea();
+ ptKeepAppointments.setWidth("70%");
+ containerTreatmentDischargeForm.add(ptKeepAppointments);
+ containerTreatmentDischargeFormFields.put("tdptkeepappointments", containerTreatmentDischargeForm);
+
+ horizontalPanel = new HorizontalPanel();
+ containerTreatmentDischargeForm.add(horizontalPanel);
+
+ final Label ptProvideUrineLabel = new Label("Did the patient provide urines ");
+ ptProvideUrineLabel.setStyleName("label_bold");
+ horizontalPanel.add(ptProvideUrineLabel);
+ final Label ptProvideUrineDetailLabel = new Label("(how many were given; how many positive for unauthorized drugs?):");
+ horizontalPanel.add(ptProvideUrineDetailLabel);
+
+ final TextArea ptProvideUrine = new TextArea();
+ ptProvideUrine.setWidth("70%");
+ containerTreatmentDischargeForm.add(ptProvideUrine);
+ containerTreatmentDischargeFormFields.put("tdptprovideurine", ptProvideUrine);
+
+ flexTable = new FlexTable();
+ containerTreatmentDischargeForm.add(flexTable);
+
+ row=0;
+
+ final Label strengthsLabel = new Label("Strengths:");
+ strengthsLabel.setStyleName("label_bold");
+ flexTable.setWidget(row,0,strengthsLabel);
+
+ final TextArea strengthsDesc = new TextArea();
+ strengthsDesc.setWidth("200%");
+ flexTable.setWidget(row,1,strengthsDesc);
+ containerTreatmentDischargeFormFields.put("tdstrengthsdesc",strengthsDesc);
+
+ row++;
+
+ final Label needsLabel = new Label("Needs:");
+ needsLabel.setStyleName("label_bold");
+ flexTable.setWidget(row,0,needsLabel);
+
+ final TextArea needsDesc = new TextArea();
+ needsDesc.setWidth("200%");
+ flexTable.setWidget(row,1,needsDesc);
+ containerTreatmentDischargeFormFields.put("tdneedsdesc",needsDesc);
+
+ row++;
+
+ final Label abilitiesLabel = new Label("Abilities:");
+ abilitiesLabel.setStyleName("label_bold");
+ flexTable.setWidget(row,0,abilitiesLabel);
+
+ final TextArea abilitiesDesc = new TextArea();
+ abilitiesDesc.setWidth("200%");
+ flexTable.setWidget(row,1,abilitiesDesc);
+ containerTreatmentDischargeFormFields.put("tdabilitiesdesc",abilitiesDesc);
+
+ row++;
+
+ final Label preferencesLabel = new Label("Preferences:");
+ preferencesLabel.setStyleName("label_bold");
+ flexTable.setWidget(row,0,preferencesLabel);
+
+ final TextArea preferencesDesc = new TextArea();
+ preferencesDesc.setWidth("200%");
+ flexTable.setWidget(row,1,preferencesDesc);
+ containerTreatmentDischargeFormFields.put("tdpreferencesdesc",preferencesDesc);
+
+ horizontalPanel = new HorizontalPanel();
+ containerTreatmentDischargeForm.add(horizontalPanel);
+
+ final Label ptCurMedicationsLabel = new Label("Patient's Current Medications ");
+ ptCurMedicationsLabel.setStyleName("label_bold");
+ horizontalPanel.add(ptCurMedicationsLabel);
+ final Label ptCurMedicationsDetailLabel = new Label("(who will track after discharge?):");
+ horizontalPanel.add(ptCurMedicationsDetailLabel);
+
+ final TextArea ptCurMedications = new TextArea();
+ ptCurMedications.setWidth("70%");
+ containerTreatmentDischargeForm.add(ptCurMedications);
+ containerTreatmentDischargeFormFields.put("tdptcurmedications", ptCurMedications);
+
+ horizontalPanel = new HorizontalPanel();
+ containerTreatmentDischargeForm.add(horizontalPanel);
+
+ final Label phyCommentsAndRecmdLabel = new Label("Physician comments and recommendations ");
+ phyCommentsAndRecmdLabel.setStyleName("label_bold");
+ horizontalPanel.add(phyCommentsAndRecmdLabel);
+ final Label phyCommentsAndRecmdDetailLabel = new Label("(if appropriate):");
+ horizontalPanel.add(phyCommentsAndRecmdDetailLabel);
+
+ final TextArea phyCommentsAndRecmd = new TextArea();
+ phyCommentsAndRecmd.setWidth("70%");
+ containerTreatmentDischargeForm.add(phyCommentsAndRecmd);
+ containerTreatmentDischargeFormFields.put("tdphycommentsandrecmd", phyCommentsAndRecmd);
+
+ horizontalPanel = new HorizontalPanel();
+ containerTreatmentDischargeForm.add(horizontalPanel);
+
+ final Label councelorRecmdsLabel = new Label("Counselor Recommendations ");
+ councelorRecmdsLabel.setStyleName("label_bold");
+ horizontalPanel.add(councelorRecmdsLabel);
+ final Label councelorRecmdsDetailLabel = new Label("(why?):");
+ horizontalPanel.add(councelorRecmdsDetailLabel);
+
+ final TextArea councelorRecmds = new TextArea();
+ councelorRecmds.setWidth("70%");
+ containerTreatmentDischargeForm.add(councelorRecmds);
+ containerTreatmentDischargeFormFields.put("tdcouncelorrecmds", councelorRecmds);
+
+ final Label severtyIndexLabel = new Label("SEVERITY INDEX");
+ severtyIndexLabel.setStyleName("label_bold");
+ containerTreatmentDischargeForm.add(severtyIndexLabel);
+
+ flexTable = new FlexTable();
+ containerTreatmentDischargeForm.add(flexTable);
+
+ row=0;
+
+ HashMap<String, String> asamPlaceMap = new HashMap<String, String>();
+ asamPlaceMap.put("d1", "D1");
+ asamPlaceMap.put("d2", "D2");
+ asamPlaceMap.put("d3", "D3");
+ asamPlaceMap.put("d4", "D4");
+ asamPlaceMap.put("d5", "D5");
+ asamPlaceMap.put("d6", "D6");
+
+ Iterator<String> asamPlaceIterator = asamPlaceMap.keySet().iterator();
+ while(asamPlaceIterator.hasNext()){
+
+ String key = asamPlaceIterator.next();
+ String value = asamPlaceMap.get(key);
+
+ final Label asamPLabel = new Label(value);
+ asamPLabel.setStyleName("label_bold");
+ flexTable.setWidget(row, 0, asamPLabel);
+
+ final CustomRadioButtonGroup asamPlacements = new CustomRadioButtonGroup("tdasamplacemets"+key);
+ asamPlacements.addItem("Low","L");
+ asamPlacements.addItem("Medium","M");
+ asamPlacements.addItem("High","H");
+ flexTable.setWidget(row, 1, asamPlacements);
+ containerTreatmentDischargeFormFields.put("tdasamplacemets"+key, asamPlacements);
+
+ row++;
+ }
+
+ final Label indicatedCareLevelLabel = new Label("INDICATED LEVEL OF CARE");
+ indicatedCareLevelLabel.setStyleName("label_bold");
+ containerTreatmentDischargeForm.add(indicatedCareLevelLabel);
+
+ final CustomRadioButtonGroup indicatedCareLevel = new CustomRadioButtonGroup("indicatedcarelevel",true);
+ indicatedCareLevel.addItem("0.5 Early Intervention","0.5EI");
+ indicatedCareLevel.addItem("1.0 OP Treatment","1.0OPT");
+ indicatedCareLevel.addItem("2.1 Intensive OP {Social}","2.1IO");
+ indicatedCareLevel.addItem("2.5 Partial Hosp/support living","2.5PHL");
+ indicatedCareLevel.addItem("3.0 Med. Monitor Intense IP","3.0MMIIP");
+ indicatedCareLevel.addItem("4.0 Med Mngd Intense IP","4.0MMIIP");
+ indicatedCareLevel.addItem("ID Amb w/o Extend Onsite","IDAEO");
+ indicatedCareLevel.addItem("2D Amb -Extend Monitor","2DAEM");
+ indicatedCareLevel.addItem("3.2D Clin. Mngd Resident'l","3.2DCMR");
+ indicatedCareLevel.addItem("3.7 Med Monitored IP","3.7MMIP");
+ indicatedCareLevel.addItem("4D Med Managed IP","4DMMIP");
+ containerTreatmentDischargeForm.add(indicatedCareLevel);
+ containerTreatmentDischargeFormFields.put("tdindicatedcarelevel", indicatedCareLevel);
+
+ horizontalPanel = new HorizontalPanel();
+ containerTreatmentDischargeForm.add(horizontalPanel);
+
+ final Label ptAfterCarePlanLabel = new Label("Patient's After Care Plan ");
+ ptAfterCarePlanLabel.setStyleName("label_bold");
+ horizontalPanel.add(ptAfterCarePlanLabel);
+ final Label ptAfterCarePlanDetailLabel = new Label("(what will the patient do, specifically, to maintain recovery?):");
+ horizontalPanel.add(ptAfterCarePlanDetailLabel);
+
+ final TextArea ptAfterCarePlan = new TextArea();
+ ptAfterCarePlan.setWidth("70%");
+ containerTreatmentDischargeForm.add(ptAfterCarePlan);
+ containerTreatmentDischargeFormFields.put("tdptaftercareplan", ptAfterCarePlan);
+
+ final Label ptPrognosisLabel = new Label("Prognosis:");
+ containerTreatmentDischargeForm.add(ptPrognosisLabel);
+
+ final TextArea ptPrognosis = new TextArea();
+ ptPrognosis.setWidth("70%");
+ containerTreatmentDischargeForm.add(ptPrognosis);
+ containerTreatmentDischargeFormFields.put("tdptprognosis", ptPrognosis);
+
+ flexTable = new FlexTable();
+ containerTreatmentDischargeForm.add(flexTable);
+
+ row=0;
+
+ final Label counselorLabel = new Label("Counselor:");
+ flexTable.setWidget(row,0,counselorLabel);
+
+ final ProviderWidget counselor = new ProviderWidget();
+ flexTable.setWidget(row,1,counselor);
+ containerTreatmentDischargeFormFields.put("tdcounselor",counselor);
+
+ final Label counselorDateLabel = new Label("Date:");
+ flexTable.setWidget(row,2,counselorDateLabel);
+
+ final CustomDatePicker counselorDate = new CustomDatePicker();
+ flexTable.setWidget(row,3,counselorDate);
+ containerTreatmentDischargeFormFields.put("tdcounselordt",counselorDate);
+
+ final Label supervisorLabel = new Label("Supervisor:");
+ flexTable.setWidget(row,4,supervisorLabel);
+
+ final ProviderWidget supervisor = new ProviderWidget();
+ flexTable.setWidget(row,5,supervisor);
+ containerTreatmentDischargeFormFields.put("tdsupervisor",supervisor);
+
+ final Label supervisorDateLabel = new Label("Date:");
+ flexTable.setWidget(row,6,supervisorDateLabel);
+
+ final CustomDatePicker supervisorDate = new CustomDatePicker();
+ flexTable.setWidget(row,7,supervisorDate);
+ containerTreatmentDischargeFormFields.put("tdsupervisordt",supervisorDate);
+
}
- protected void initTreatmentPlanList(){
+ protected void initTreatmentDischargeList(){
containerTreatmentDischargesListPanel= new VerticalPanel();
containerTreatmentDischargesListPanel.setStyleName("width100Perc");
tabPanel.add(containerTreatmentDischargesListPanel, treatmentDischargesListLabel.getText());
@@ -239,7 +773,7 @@
containerTreatmentDischargesTable.setWidth("100%");
containerTreatmentDischargesListPanel.add(containerTreatmentDischargesTable);
containerTreatmentDischargesTable.addColumn("Date Entered", "dateentered");
- containerTreatmentDischargesTable.addColumn("Admission Date", "admissiondate");
+ containerTreatmentDischargesTable.addColumn("Discharge Date", "dischargedate");
containerTreatmentDischargesTable.addColumn("Entered By", "enteredby");
containerTreatmentDischargesTable.setIndexName("id");