Example usage for com.google.gwt.user.client.ui FlexTable getFlexCellFormatter

List of usage examples for com.google.gwt.user.client.ui FlexTable getFlexCellFormatter

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui FlexTable getFlexCellFormatter.

Prototype

public FlexCellFormatter getFlexCellFormatter() 

Source Link

Document

Explicitly gets the FlexCellFormatter .

Usage

From source file:org.freemedsoftware.gwt.client.screen.patient.AllergyEntryScreen.java

License:Open Source License

public AllergyEntryScreen() {
    super(moduleName);
    final FlexTable flexTable = new FlexTable();
    initWidget(flexTable);/*from   ww  w.j  ava  2  s.co m*/

    final Label allergyLabel = new Label(_("Allergy"));
    flexTable.setWidget(0, 0, allergyLabel);
    allergyLabel.setDirectionEstimator(new AnyRtlDirectionEstimator());

    final Label reactionLabel = new Label(_("Reaction"));
    flexTable.setWidget(1, 0, reactionLabel);
    reactionLabel.setDirectionEstimator(new AnyRtlDirectionEstimator());

    final Label severityLabel = new Label(_("Severity"));
    flexTable.setWidget(2, 0, severityLabel);
    severityLabel.setDirectionEstimator(new AnyRtlDirectionEstimator());

    flexTable.setWidget(0, 1, allergyTextBox);
    flexTable.getFlexCellFormatter().setColSpan(0, 1, 2);
    allergyTextBox.setWidth("100%");

    flexTable.setWidget(1, 1, reactionTextBox);
    flexTable.getFlexCellFormatter().setColSpan(1, 1, 2);
    reactionTextBox.setWidth("100%");

    flexTable.setWidget(2, 1, severityTextBox);
    flexTable.getFlexCellFormatter().setColSpan(2, 1, 2);
    severityTextBox.setWidth("100%");

    final CustomButton saveButton = new CustomButton(_("Save"), AppConstants.ICON_ADD);
    flexTable.setWidget(3, 1, saveButton);
    saveButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent w) {
            // TODO add function to check input
            if (checkInput()) {
                saveButton.setEnabled(false);
                saveForm();
                // at the very end: close screen
                closeScreen();
            } else {
                Window.alert(_("Please fill in all fields!"));
            }
        }
    });

    final CustomButton resetButton = new CustomButton(_("Reset"), AppConstants.ICON_CLEAR);
    flexTable.setWidget(3, 2, resetButton);
    resetButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent w) {
            resetForm();
        }
    });
    Util.setFocus(allergyTextBox);
}

From source file:org.freemedsoftware.gwt.client.screen.patient.ClinicalOrdersEntry.java

License:Open Source License

public ClinicalOrdersEntry() {
    super(moduleName);
    final FlexTable flexTable = new FlexTable();
    initWidget(flexTable);/*from ww  w.  j a  v  a2  s .c  o m*/

    // Layout, master container, two rows

    panelA = createCategoryPanel();
    flexTable.setWidget(0, 0, panelA);
    panelB = new FlexTable();
    flexTable.setWidget(0, 1, panelB);
    panelB.setWidget(0, 0, new HTML("<em>" + _("Select orders to add") + "</em>"));
    wPossibleOrders.setVisibleItemCount(30);
    panelB.setWidget(1, 0, wPossibleOrders);
    wPossibleOrders.setEnabled(false);
    addOrderButton = new CustomButton("Add Order(s)", AppConstants.ICON_ADD);
    addOrderButton.addClickHandler(this);
    panelB.setWidget(2, 0, addOrderButton);
    addOrderButton.setEnabled(false);

    panelC = new FlexTable();
    wSelectedOrders.setVisibleItemCount(30);
    panelC.setWidget(0, 0, new HTML("<em>" + _("Choose an order to modify or remove") + "</em>"));
    panelC.setWidget(1, 0, wSelectedOrders);
    wSelectedOrders.setEnabled(false);

    removeOrderButton = new CustomButton(_("Remove"), AppConstants.ICON_DELETE);
    removeOrderButton.addClickHandler(this);
    panelC.setWidget(2, 0, removeOrderButton);
    removeOrderButton.setEnabled(false);

    flexTable.setWidget(0, 2, panelC);
    panelD = new FlexTable();
    // Last panel is hidden, much as first two panels will be
    panelD.setVisible(false);
    flexTable.setWidget(0, 3, panelD);

    final FlexTable actionPanel = new FlexTable();
    flexTable.setWidget(1, 0, actionPanel);
    flexTable.getFlexCellFormatter().setColSpan(1, 0, 4);

    final CustomButton saveButton = new CustomButton(_("Add"), AppConstants.ICON_ADD);
    actionPanel.setWidget(0, 0, saveButton);
    saveButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent w) {
            save();
        }
    });

    final CustomButton changePositionButton = new CustomButton("<-->", AppConstants.ICON_CHANGE);
    actionPanel.setWidget(0, 1, changePositionButton);
    changePositionButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent w) {
            switchPosition();
        }
    });

    final CustomButton resetButton = new CustomButton(_("Reset"), AppConstants.ICON_CLEAR);
    actionPanel.setWidget(0, 2, resetButton);
    resetButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent w) {
            resetForm();
        }
    });
    // Util.setFocus(wProvider);
}

From source file:org.freemedsoftware.gwt.client.screen.patient.ClinicalOrdersEntry.java

License:Open Source License

/**
 * Panel "A" creation routine.//w  w w .j a  va2s  . c om
 * 
 * @return
 */
protected FlexTable createCategoryPanel() {
    FlexTable f = new FlexTable();
    f.setWidget(0, 0, new HTML("<em>" + _("Category") + "</em>"));

    int pos = 0;

    pos++;
    cConsult = new CustomButton(_("Consult"));
    cConsult.addClickHandler(this);
    f.setWidget(0, pos, cConsult);
    f.getFlexCellFormatter().setAlignment(0, pos, HasHorizontalAlignment.ALIGN_CENTER,
            HasVerticalAlignment.ALIGN_MIDDLE);
    pos++;
    cRadiology = new CustomButton(_("Radiology"));
    cRadiology.addClickHandler(this);
    f.setWidget(0, pos, cRadiology);
    f.getFlexCellFormatter().setAlignment(0, pos, HasHorizontalAlignment.ALIGN_CENTER,
            HasVerticalAlignment.ALIGN_MIDDLE);
    pos++;
    cLab = new CustomButton(_("Lab"));
    cLab.addClickHandler(this);
    f.setWidget(0, pos, cLab);
    f.getFlexCellFormatter().setAlignment(0, pos, HasHorizontalAlignment.ALIGN_CENTER,
            HasVerticalAlignment.ALIGN_MIDDLE);
    pos++;
    cImmunization = new CustomButton(_("Immunization"));
    cImmunization.addClickHandler(this);
    f.setWidget(0, pos, cImmunization);
    f.getFlexCellFormatter().setAlignment(0, pos, HasHorizontalAlignment.ALIGN_CENTER,
            HasVerticalAlignment.ALIGN_MIDDLE);
    pos++;
    cProcedure = new CustomButton(_("Procedure"));
    cProcedure.addClickHandler(this);
    f.setWidget(0, pos, cProcedure);
    f.getFlexCellFormatter().setAlignment(0, pos, HasHorizontalAlignment.ALIGN_CENTER,
            HasVerticalAlignment.ALIGN_MIDDLE);
    pos++;
    cRx = new CustomButton(_("Prescription"));
    cRx.addClickHandler(this);
    f.setWidget(0, pos, cRx);
    f.getFlexCellFormatter().setAlignment(0, pos, HasHorizontalAlignment.ALIGN_CENTER,
            HasVerticalAlignment.ALIGN_MIDDLE);
    pos++;
    cTemplates = new CustomButton(_("Templates"));
    cTemplates.addClickHandler(this);
    f.setWidget(0, pos, cTemplates);
    f.getFlexCellFormatter().setAlignment(0, pos, HasHorizontalAlignment.ALIGN_CENTER,
            HasVerticalAlignment.ALIGN_MIDDLE);

    return f;
}

From source file:org.freemedsoftware.gwt.client.screen.patient.PrescriptionsScreen.java

License:Open Source License

public PrescriptionsScreen() {
    super(moduleName);
    final FlexTable flexTable = new FlexTable();
    initWidget(flexTable);/*from  w  ww . j a  v a  2s. c o  m*/

    final Label dateLabel = new Label(_("Starting Date"));
    flexTable.setWidget(0, 0, dateLabel);
    dateLabel.setDirection(Direction.RTL);

    final Label providerLabel = new Label(_("Provider"));
    flexTable.setWidget(1, 0, providerLabel);
    providerLabel.setDirection(Direction.RTL);

    final Label drugLabel = new Label(_("Drug"));
    flexTable.setWidget(2, 0, drugLabel);
    drugLabel.setDirection(Direction.RTL);

    final Label quantityLabel = new Label(_("Quantity"));
    flexTable.setWidget(3, 0, quantityLabel);
    quantityLabel.setDirection(Direction.RTL);

    final Label intervalLabel = new Label(_("Interval"));
    flexTable.setWidget(4, 0, intervalLabel);
    intervalLabel.setDirection(Direction.RTL);

    final Label substitutionsLabel = new Label(_("Substitutions"));
    flexTable.setWidget(5, 0, substitutionsLabel);
    substitutionsLabel.setDirection(Direction.RTL);

    final Label coverageStatusLabel = new Label(_("Coverage Status"));
    flexTable.setWidget(6, 0, coverageStatusLabel);
    coverageStatusLabel.setDirection(Direction.RTL);

    final Label refillsLabel = new Label(_("Refills"));
    flexTable.setWidget(7, 0, refillsLabel);
    refillsLabel.setDirection(Direction.RTL);

    final Label signatureLabel = new Label(_("Signature"));
    flexTable.setWidget(8, 0, signatureLabel);
    signatureLabel.setDirection(Direction.RTL);

    final Label noteLabel = new Label(_("Note"));
    flexTable.setWidget(9, 0, noteLabel);
    noteLabel.setDirection(Direction.RTL);

    final DateEditFieldWithPicker wDate = new DateEditFieldWithPicker();
    flexTable.setWidget(0, 1, wDate);
    flexTable.getFlexCellFormatter().setColSpan(0, 1, 2);

    flexTable.setWidget(1, 1, wProvider);
    flexTable.getFlexCellFormatter().setColSpan(1, 1, 2);

    flexTable.setWidget(2, 1, wDrug);
    flexTable.getFlexCellFormatter().setColSpan(2, 1, 2);

    flexTable.setWidget(3, 1, wQuantity);
    flexTable.getFlexCellFormatter().setColSpan(3, 1, 2);

    final TextBox wInterval = new TextBox();
    flexTable.setWidget(4, 1, wInterval);
    flexTable.getFlexCellFormatter().setColSpan(4, 1, 2);

    final TextBox wSubstitutions = new TextBox();
    flexTable.setWidget(5, 1, wSubstitutions);
    flexTable.getFlexCellFormatter().setColSpan(5, 1, 2);

    final TextBox wCoverageStatus = new TextBox();
    flexTable.setWidget(6, 1, wCoverageStatus);
    flexTable.getFlexCellFormatter().setColSpan(6, 1, 2);

    final TextBox wRefills = new TextBox();
    flexTable.setWidget(7, 1, wRefills);
    flexTable.getFlexCellFormatter().setColSpan(8, 1, 2);

    final TextBox tSignature = new TextBox();
    flexTable.setWidget(8, 1, tSignature);
    flexTable.getFlexCellFormatter().setColSpan(8, 1, 2);
    tSignature.setWidth("100%");
    flexTable.getFlexCellFormatter().setColSpan(9, 1, 2);

    final CustomButton saveButton = new CustomButton(_("Save"), AppConstants.ICON_ADD);
    flexTable.setWidget(10, 1, saveButton);
    saveButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent w) {
            savePrescription();
        }
    });

    final CustomButton resetButton = new CustomButton(_("Reset"), AppConstants.ICON_CLEAR);
    flexTable.setWidget(10, 2, resetButton);
    resetButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent w) {
            resetForm();
        }
    });
    Util.setFocus(wProvider);
}

From source file:org.freemedsoftware.gwt.client.screen.PatientTagSearchScreen.java

License:Open Source License

public PatientTagSearchScreen() {
    FlexTable layout = new FlexTable();
    initWidget(layout);// www. j a v  a 2s .c  o m

    Label tagLabel = new Label(_("Search for Tag") + " : ");
    layout.setWidget(0, 0, tagLabel);
    tagWidget = new PatientTagWidget();
    layout.setWidget(0, 2, tagWidget);
    tagWidget.addValueChangeHandler(new ValueChangeHandler<String>() {
        @Override
        public void onValueChange(ValueChangeEvent<String> evt) {
            PatientTagWidget w = (PatientTagWidget) evt.getSource();
            if (w.getValue().length() > 2) {
                searchForTag(w.getValue());
            }
        }
    });

    customSortableTable = new CustomTable();
    customSortableTable.setWidth("100%");
    layout.setWidget(1, 0, customSortableTable);
    layout.getFlexCellFormatter().setColSpan(1, 0, 4);

    customSortableTable.setIndexName("patient_record");
    customSortableTable.addColumn(_("Last Name"), "last_name");
    customSortableTable.addColumn(_("First Name"), "first_name");
    customSortableTable.addColumn(_("DOB"), "date_of_birth");
    customSortableTable.addColumn(_("Patient ID"), "patient_id");
    customSortableTable.setTableRowClickHandler(new TableRowClickHandler() {
        @Override
        public void handleRowClick(HashMap<String, String> data, int col) {
            Integer patientId = null;
            String patientName = null;
            try {
                patientId = Integer.parseInt(data.get("patient_record"));
                JsonUtil.debug("patientId = " + patientId.toString());
                patientName = data.get("last_name") + ", " + data.get("first_name") + " ["
                        + data.get("date_of_birth") + "] " + data.get("patient_id");
                JsonUtil.debug("patientName = " + patientName);
            } catch (Exception ex) {
                GWT.log("Exception", ex);
            } finally {
                PatientScreen s = new PatientScreen();
                s.setPatient(patientId);
                JsonUtil.debug("Spawn patient screen with patient = " + patientId.toString());
                GWT.log("Spawn patient screen with patient = " + patientId.toString(), null);
                Util.spawnTab(patientName, s);
            }

        }
    });
    Util.setFocus(tagWidget);
}

From source file:org.freemedsoftware.gwt.client.screen.UserManagementScreen.java

License:Open Source License

public UserManagementScreen() {
    super(moduleName);

    final VerticalPanel verticalPanel = new VerticalPanel();
    initWidget(verticalPanel);//ww  w .ja  v a2s  .  com

    tabPanel = new TabPanel();
    verticalPanel.add(tabPanel);

    addUserVPanel = new VerticalPanel();
    // Panel #1
    if (canWrite || canModify) {
        if (canWrite)
            tabPanel.add(addUserVPanel, _("Add User"));

        final FlexTable userAddTable = new FlexTable();
        addUserVPanel.add(userAddTable);

        int row = 0;

        final Label usernameLabel = new Label(_("User Name"));
        userAddTable.setWidget(row, 0, usernameLabel);

        tbUsername = new TextBox();
        userAddTable.setWidget(row, 1, tbUsername);
        userAddTable.getFlexCellFormatter().setColSpan(row, 1, 2);
        tbUsername.setWidth("20em");

        row++;

        final Label passwordLabel = new Label("Password");
        userAddTable.setWidget(row, 0, passwordLabel);

        tbPassword = new PasswordTextBox();
        userAddTable.setWidget(row, 1, tbPassword);
        userAddTable.getFlexCellFormatter().setColSpan(row, 1, 2);
        tbPassword.setWidth("20em");

        row++;

        final Label passwordverifyLabel = new Label(_("Password (Verify)"));
        userAddTable.setWidget(row, 0, passwordverifyLabel);

        final HorizontalPanel horizontalPanel = new HorizontalPanel();
        horizontalPanel.setWidth("100%");
        userAddTable.setWidget(row, 1, horizontalPanel);

        userAddTable.getFlexCellFormatter().setColSpan(row, 1, 2);

        tbPasswordverify = new PasswordTextBox();
        tbPasswordverify.setWidth("20em");
        horizontalPanel.add(tbPasswordverify);

        final String changePassString = "<a href='javascript:undefined'>" + _("Change Password") + "</a>";
        final String donotChangePassString = "<a href='javascript:undefined'>" + _("Don't Change Password")
                + "</a>";
        changePasswordLink = new HTML(changePassString);
        changePasswordLink.setVisible(false);
        changePasswordLink.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent arg0) {
                if (tbPassword.isEnabled()) {
                    tbPassword.setEnabled(false);
                    tbPasswordverify.setEnabled(false);
                    changePasswordLink.setHTML(changePassString);
                } else {
                    tbPassword.setEnabled(true);
                    tbPasswordverify.setEnabled(true);
                    changePasswordLink.setHTML(donotChangePassString);
                }
            }
        });
        horizontalPanel.add(changePasswordLink);

        row++;

        final Label descriptionLabel = new Label(_("Description"));
        userAddTable.setWidget(row, 0, descriptionLabel);

        tbDescription = new TextBox();
        userAddTable.setWidget(row, 1, tbDescription);
        userAddTable.getFlexCellFormatter().setColSpan(row, 1, 2);
        tbDescription.setWidth("100%");

        row++;

        final Label userfnameLabel = new Label(_("First Name"));
        userAddTable.setWidget(row, 0, userfnameLabel);

        tbUserFirstName = new TextBox();
        userAddTable.setWidget(row, 1, tbUserFirstName);
        userAddTable.getFlexCellFormatter().setColSpan(row, 1, 2);
        tbUserFirstName.setWidth("20em");

        row++;

        final Label userMiddlenameLabel = new Label(_("Middle Name"));
        userAddTable.setWidget(row, 0, userMiddlenameLabel);

        tbUserMiddleName = new TextBox();
        userAddTable.setWidget(row, 1, tbUserMiddleName);
        userAddTable.getFlexCellFormatter().setColSpan(row, 1, 2);
        tbUserMiddleName.setWidth("20em");

        row++;

        final Label userLastNameLabel = new Label(_("Last Name"));
        userAddTable.setWidget(row, 0, userLastNameLabel);

        tbUserLastName = new TextBox();
        userAddTable.setWidget(row, 1, tbUserLastName);
        userAddTable.getFlexCellFormatter().setColSpan(row, 1, 2);
        tbUserLastName.setWidth("20em");

        row++;

        final Label userTitleLabel = new Label(_("User Title"));
        userAddTable.setWidget(row, 0, userTitleLabel);

        tbUserTitle = new CustomRadioButtonGroup("title");
        tbUserTitle.addItem("Mr");
        tbUserTitle.addItem("Mrs");
        tbUserTitle.addItem("Ms");
        tbUserTitle.addItem("Dr");
        tbUserTitle.addItem("Fr");
        userAddTable.setWidget(row, 1, tbUserTitle);
        userAddTable.getFlexCellFormatter().setColSpan(row, 1, 2);
        tbUserTitle.setWidth("20em");

        row++;

        final Label userTypeLabel = new Label(_("User Type"));
        userAddTable.setWidget(row, 0, userTypeLabel);

        lbUserType = new CustomListBox();
        userAddTable.setWidget(row, 1, lbUserType);
        userAddTable.getFlexCellFormatter().setColSpan(row, 1, 2);
        lbUserType.addItem(_("Select User Type"), "null");
        lbUserType.addItem(_("Miscellaneous"), "misc");
        lbUserType.addItem(_("Provider"), "phy");

        row++;

        final Label actualPhysicianLabel = new Label(_("Actual Physician"));
        userAddTable.setWidget(row, 0, actualPhysicianLabel);
        actualPhysicianLabel.setVisible(false);

        lbActualPhysician = new SupportModuleWidget("ProviderModule");
        userAddTable.setWidget(row, 1, lbActualPhysician);
        userAddTable.getFlexCellFormatter().setColSpan(row, 1, 2);
        lbActualPhysician.setVisible(false);

        lbUserType.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent evt) {
                Widget sender = (Widget) evt.getSource();
                String value = ((CustomListBox) sender).getWidgetValue();
                if (value.compareTo("phy") == 0) {
                    // Is provider
                    lbActualPhysician.setVisible(true);
                    actualPhysicianLabel.setVisible(true);
                } else {
                    // Is not provider
                    lbActualPhysician.setVisible(false);
                    actualPhysicianLabel.setVisible(false);
                }
            }
        });

        row++;

        final Label facilityLabel = new Label(_("Facility"));
        userAddTable.setWidget(row, 0, facilityLabel);
        VerticalPanel facilityVPanel = new VerticalPanel();
        facilityVPanel.setStyleName("top-border-only");
        userAddTable.setWidget(row, 1, facilityVPanel);
        final FlexTable facilityTable = new FlexTable();
        facilityVPanel.add(facilityTable);
        Util.callModuleMethod("FacilityModule", "GetAll", (Integer) null, new CustomRequestCallback() {

            @Override
            public void onError() {
                // TODO Auto-generated method stub

            }

            @Override
            public void jsonifiedData(Object data) {
                // TODO Auto-generated method stub
                int tempRow = 0;
                int tempCol = 0;
                @SuppressWarnings("unchecked")
                HashMap<String, String>[] result = (HashMap<String, String>[]) data;
                for (int i = 0; i < result.length; i++) {
                    HashMap<String, String> facilityMap = result[i];
                    CheckBox checkBox = new CheckBox(facilityMap.get("psrname"));
                    Integer id = Integer.parseInt(facilityMap.get("id"));
                    facilitiesCheckBoxesMap.put(id, checkBox);
                    facilityTable.setWidget(tempRow, tempCol, checkBox);
                    tempCol++;
                    if (tempCol == 3) {
                        tempCol = 0;
                        tempRow++;
                    }

                }

            }

        }, "HashMap<String,String>[]");

        row++;

        final Label aclLabel = new Label(_("User Groups"));
        userAddTable.setWidget(row, 0, aclLabel);
        final VerticalPanel aclGroupsVpanel = new VerticalPanel();
        aclGroupsVpanel.setStyleName("top-border-only");
        aclGroupsVpanel.add(aclGroupsTable);
        userAddTable.setWidget(row, 1, aclGroupsVpanel);

        HorizontalPanel buttonsPanel = new HorizontalPanel();
        addUserButton = new CustomButton(_("Add User"), AppConstants.ICON_ADD_PERSON);
        addUserButton.addClickHandler(this);
        buttonsPanel.add(addUserButton);

        copyButton = new CustomButton(_("Copy"), AppConstants.ICON_ADD);
        copyButton.addClickHandler(this);
        copyButton.setVisible(false);
        buttonsPanel.add(copyButton);

        buttonsPanel.add(customizePermissionsLink);

        deleteUserButton = new CustomButton(_("Delete User"), AppConstants.ICON_REMOVE_PERSON);
        deleteUserButton.addClickHandler(this);
        deleteUserButton.setVisible(false);
        buttonsPanel.add(deleteUserButton);

        clearButton = new CustomButton(_("Reset"), AppConstants.ICON_CLEAR);
        clearButton.addClickHandler(this);
        buttonsPanel.add(clearButton);

        row++;

        userAddTable.setWidget(row, 1, buttonsPanel);
        getACLGroups();

        showEnhancedPermssions(false);
        customizePermissionsTable.removeTableStyle();
        addUserVPanel.add(customizePermissionsTable);

        customizePermissionsLink.addClickHandler(new ClickHandler() {
            boolean show = false;

            @Override
            public void onClick(ClickEvent arg0) {
                show = !show;
                showEnhancedPermssions(show);
            }//End onlick
        });//End customizePermissionsLink AddClick Handler
    }
    // Panel #2

    final FlexTable userListTable = new FlexTable();
    tabPanel.add(userListTable, _("List Users"));

    userListTable.setWidget(0, 0, wUsers);

    wUsers.setSize("100%", "100%");
    wUsers.addColumn(_("Username"), "username"); // col 0
    wUsers.addColumn(_("Description"), "userdescrip"); // col 1
    wUsers.addColumn(_("First Name"), "userfname"); // col 2
    wUsers.addColumn(_("Last Name"), "userlname"); // col 3
    wUsers.addColumn(_("Middle Name"), "usermname"); // col 4
    wUsers.addColumn(_("Title"), "usertitle"); // col 5
    wUsers.addColumn(_("Level"), "userlevel"); // col 6
    wUsers.addColumn(_("Type"), "usertype"); // col 7
    wUsers.setIndexName("id");

    wUsers.setTableRowClickHandler(new TableRowClickHandler() {
        @Override
        public void handleRowClick(HashMap<String, String> data, int col) {
            if (canWrite || canModify) {
                if (!canWrite) {
                    tabPanel.add(addUserVPanel, "Modify User");
                    tabPanel.selectTab(1);
                } else
                    tabPanel.selectTab(0);
                clearForm();
                userId = Integer.parseInt(data.get("id"));
                getUserDetails(userId);
                getUserGroup(userId);

                Util.callModuleMethod("ACL", "GetBlockedACOs", userId, new CustomRequestCallback() {
                    @Override
                    public void onError() {
                    }

                    @SuppressWarnings("unchecked")
                    @Override
                    public void jsonifiedData(Object data) {
                        HashMap<String, List> result = (HashMap<String, List>) data;
                        if (result != null && result.size() > 0) {
                            alreadyShowingEnhancedPermissions = true;
                            blockedPermissionsMap = (HashMap<String, List>) data;
                            alreadyShowingEnhancedPermissions = false;
                            //setCheckBoxesValue((HashMap<String, String[]>)data, false);
                        }
                        Util.callModuleMethod("ACL", "GetAllowedACOs", userId, new CustomRequestCallback() {
                            @Override
                            public void onError() {
                            }

                            @Override
                            public void jsonifiedData(Object data) {
                                HashMap<String, List> result = (HashMap<String, List>) data;
                                if (result != null && result.size() > 0) {
                                    allowedPermissionsMap = (HashMap<String, List>) data;
                                    alreadyShowingEnhancedPermissions = false;
                                    //setCheckBoxesValue((HashMap<String, String[]>)data, false);
                                }
                                if (blockedPermissionsMap != null && blockedPermissionsMap.size() > 0
                                        || allowedPermissionsMap != null && allowedPermissionsMap.size() > 0)
                                    showEnhancedPermssions(true);
                            }
                        }, "HashMap<String,List>");
                    }
                }, "HashMap<String,List>");

            }
        }
    });

    // TODO:Backend needs to be fixed first
    retrieveAllUsers();
    tabPanel.selectTab(0);
    Util.setFocus(tbUsername);
}

From source file:org.freemedsoftware.gwt.client.widget.ClaimDetailsWidget.java

License:Open Source License

public void createClaimDetailsPanel() {
    newClaimEventPanel.clear();//from   w  w w .  j ava 2s .c o m
    claimDetailsPanel.clear();
    newClaimEventPanel.setVisible(false);
    claimDetailsPanel.setVisible(true);
    FlexTable claimsInfoParentTable = new FlexTable();
    claimsInfoParentTable.setBorderWidth(1);
    claimsInfoParentTable.getElement().getStyle().setProperty("borderCollapse", "collapse");
    claimDetailsPanel.setWidth("100%");
    claimDetailsPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
    claimDetailsPanel.setSpacing(5);
    claimsInfoParentTable.setWidth("100%");
    claimDetailsPanel.add(claimsInfoParentTable);

    Label lbCovInfo = new Label(_("Coverage Information"));
    lbCovInfo.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    lbCovInfo.getElement().getStyle().setProperty("fontSize", "15px");
    lbCovInfo.getElement().getStyle().setProperty("textDecoration", "underline");
    lbCovInfo.getElement().getStyle().setProperty("fontWeight", "bold");

    FlexTable covInfoTable = new FlexTable();
    covInfoTable.setWidth("100%");
    final FlexTable covTypesTable = new FlexTable();
    covTypesTable.setWidth("100%");
    VerticalPanel covInfoVPanel = new VerticalPanel();
    covInfoVPanel.setSpacing(10);
    covInfoVPanel.setWidth("95%");

    covInfoVPanel.add(lbCovInfo);
    covInfoVPanel.add(covInfoTable);
    covInfoVPanel.add(covTypesTable);
    claimsInfoParentTable.setWidget(0, 0, covInfoVPanel);
    claimsInfoParentTable.getFlexCellFormatter().getElement(0, 0).setAttribute("width", "50%");
    claimsInfoParentTable.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);

    Label lbPatient = new Label(_("Patient") + ":");
    lbPatient.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    lbPatientVal = new Label();
    Label lbdob = new Label(_("Date of Birth") + ":");
    lbdob.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbdobVal = new Label();
    Label lbSSN = new Label(_("SSN") + ":");
    lbSSN.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbSSNVal = new Label();

    covInfoTable.setWidget(0, 0, lbPatient);
    covInfoTable.setWidget(0, 1, lbPatientVal);
    covInfoTable.setWidget(0, 2, lbdob);
    covInfoTable.setWidget(0, 3, lbdobVal);
    covInfoTable.setWidget(0, 4, lbSSN);
    covInfoTable.setWidget(0, 5, lbSSNVal);

    final Label lbRespParty = new Label(_("Resp. Party") + ":");
    lbRespParty.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbRespPartyVal = new Label();
    final Label lbRpDob = new Label(_("Date of Birth") + ":");
    lbRpDob.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbRpDobVal = new Label();
    final Label lbRpSSN = new Label(_("SSN") + ":");
    lbRpSSN.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbRpSSNVal = new Label();

    covInfoTable.setWidget(1, 0, lbRespParty);
    covInfoTable.setWidget(1, 1, lbRespPartyVal);
    covInfoTable.setWidget(1, 2, lbRpDob);
    covInfoTable.setWidget(1, 3, lbRpDobVal);
    covInfoTable.setWidget(1, 4, lbRpSSN);
    covInfoTable.setWidget(1, 5, lbRpSSNVal);

    final Label lbPrimary = new Label(_("Primary Coverage") + "/" + _("Location") + "/" + _("Ins. No.") + "/"
            + _("Copay") + "/" + _("Deductible"));
    lbPrimary.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbPrimaryVal = new Label();

    covTypesTable.setWidget(0, 0, lbPrimary);
    covTypesTable.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
    covTypesTable.setWidget(0, 1, lbPrimaryVal);
    covTypesTable.getFlexCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_TOP);

    final Label lbSecondary = new Label(_("Secondary Coverage") + "/" + _("Location") + "/" + _("Ins. No.")
            + "/" + _("Copay") + "/" + _("Deductible"));
    lbSecondary.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbSecondaryVal = new Label();

    covTypesTable.setWidget(1, 0, lbSecondary);
    covTypesTable.getFlexCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);
    covTypesTable.setWidget(1, 1, lbSecondaryVal);
    covTypesTable.getFlexCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);

    final Label lbTertiary = new Label(_("Tertiary Coverage") + "/" + _("Location") + "/" + _("Ins. No.") + "/"
            + _("Copay") + "/" + _("Deductible"));
    lbTertiary.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbTertiaryVal = new Label();

    covTypesTable.setWidget(2, 0, lbTertiary);
    covTypesTable.getFlexCellFormatter().setVerticalAlignment(2, 0, HasVerticalAlignment.ALIGN_TOP);
    covTypesTable.setWidget(2, 1, lbTertiaryVal);
    covTypesTable.getFlexCellFormatter().setVerticalAlignment(2, 0, HasVerticalAlignment.ALIGN_TOP);

    Label lbClaimInfo = new Label(_("Claim Information"));
    lbClaimInfo.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    lbClaimInfo.getElement().getStyle().setProperty("fontSize", "15px");
    lbClaimInfo.getElement().getStyle().setProperty("textDecoration", "underline");
    lbClaimInfo.getElement().getStyle().setProperty("fontWeight", "bold");

    final FlexTable clInfoTable = new FlexTable();
    clInfoTable.setWidth("100%");

    VerticalPanel clInfoVPanel = new VerticalPanel();
    clInfoVPanel.setSpacing(10);
    clInfoVPanel.setWidth("95%");

    clInfoVPanel.add(lbClaimInfo);
    clInfoVPanel.add(clInfoTable);
    claimsInfoParentTable.setWidget(0, 1, clInfoVPanel);
    claimsInfoParentTable.getFlexCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_TOP);

    Label lbDos = new Label(_("Date of Service") + ":");
    lbDos.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbDosVal = new Label();

    clInfoTable.setWidget(0, 0, lbDos);
    clInfoTable.setWidget(0, 1, lbDosVal);

    Label lbProvider = new Label(_("Provider") + ":");
    lbProvider.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbProviderVal = new Label();
    Label lbRefProv = new Label(_("Referring Provider") + ":");
    lbRefProv.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbRefProvVal = new Label();

    clInfoTable.setWidget(1, 0, lbProvider);
    clInfoTable.setWidget(1, 1, lbProviderVal);
    clInfoTable.setWidget(1, 2, lbRefProv);
    clInfoTable.setWidget(1, 3, lbRefProvVal);

    Label lbPOS = new Label(_("POS") + ":");
    lbPOS.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbPOSVal = new Label();
    Label lbCharges = new Label(_("Charges") + ":");
    lbCharges.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbChargesVal = new Label();

    clInfoTable.setWidget(2, 0, lbPOS);
    clInfoTable.setWidget(2, 1, lbPOSVal);
    clInfoTable.setWidget(2, 2, lbCharges);
    clInfoTable.setWidget(2, 3, lbChargesVal);

    Label lbCPT = new Label(_("CPT") + ":");
    lbCPT.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbCPTVal = new Label();
    Label lbPaid = new Label(_("Paid") + ":");
    lbPaid.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbPaidVal = new Label();

    clInfoTable.setWidget(3, 0, lbCPT);
    clInfoTable.setWidget(3, 1, lbCPTVal);
    clInfoTable.setWidget(3, 2, lbPaid);
    clInfoTable.setWidget(3, 3, lbPaidVal);

    Label lbICD = new Label(_("ICD") + ":");
    lbICD.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbICDVal = new Label();
    Label lbBalance = new Label(_("Balance") + ":");
    lbBalance.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD);
    final Label lbBalanceVal = new Label();

    clInfoTable.setWidget(4, 0, lbICD);
    clInfoTable.setWidget(4, 1, lbICDVal);
    clInfoTable.setWidget(4, 2, lbBalance);
    clInfoTable.setWidget(4, 3, lbBalanceVal);

    ArrayList<String> params = new ArrayList<String>();
    params.add("" + claimid);
    Util.callApiMethod("ClaimLog", "claim_information", params, new CustomRequestCallback() {
        @Override
        public void onError() {
        }

        @SuppressWarnings("unchecked")
        @Override
        public void jsonifiedData(Object data) {
            if (data != null) {
                HashMap<String, String> result = (HashMap<String, String>) data;
                if (result.get("patient") != null)
                    lbPatientVal.setText(result.get("patient"));
                if (result.get("rp_name") != null) {
                    lbRespPartyVal.setText(result.get("rp_name"));
                    if (result.get("rp_name").toString().equalsIgnoreCase("self")) {
                        lbRpDob.setVisible(false);
                        lbRpDobVal.setVisible(false);
                        lbRpSSN.setVisible(false);
                        lbRpSSNVal.setVisible(false);
                    }
                } else {
                    lbRespParty.setVisible(false);
                    lbRespPartyVal.setVisible(false);
                    lbRpDob.setVisible(false);
                    lbRpDobVal.setVisible(false);
                    lbRpSSN.setVisible(false);
                    lbRpSSNVal.setVisible(false);
                }
                if (result.get("patient_dob") != null)
                    lbdobVal.setText(result.get("patient_dob"));
                if (result.get("provider_name") != null)
                    lbProviderVal.setText(result.get("provider_name"));
                if (result.get("ssn") != null)
                    lbSSNVal.setText(result.get("ssn"));
                if (result.get("rp_ssn") != null)
                    lbRpSSNVal.setText(result.get("rp_ssn"));
                if (result.get("rp_dob") != null)
                    lbRpDobVal.setText(result.get("rp_dob"));
                if (result.get("ref_provider_name") != null)
                    lbRefProvVal.setText(result.get("ref_provider_name"));
                if (result.get("prim_cov") != null && !result.get("prim_cov").equals("")) {
                    lbPrimaryVal.setText(result.get("prim_cov"));
                    if (result.get("prim_copay") != null)
                        lbPrimaryVal.setText(lbPrimaryVal.getText() + "/" + result.get("prim_copay"));
                    if (result.get("prim_deduct") != null)
                        lbPrimaryVal.setText(lbPrimaryVal.getText() + "/" + result.get("prim_deduct"));
                } else {
                    lbPrimary.setVisible(false);
                    lbPrimaryVal.setVisible(false);
                }

                if (result.get("sec_cov") != null && !result.get("sec_cov").equals("")) {
                    lbSecondaryVal.setText(result.get("sec_cov"));
                    if (result.get("sec_copay") != null)
                        lbSecondaryVal.setText(lbSecondaryVal.getText() + "/" + result.get("sec_copay"));
                    if (result.get("sec_deduct") != null)
                        lbSecondaryVal.setText(lbSecondaryVal.getText() + "/" + result.get("sec_deduct"));
                } else {
                    lbSecondary.setVisible(false);
                    lbSecondaryVal.setVisible(false);
                }

                if (result.get("ter_cov") != null && !result.get("ter_cov").equals("")) {
                    lbTertiaryVal.setText(result.get("ter_cov"));
                    if (result.get("ter_copay") != null)
                        lbTertiaryVal.setText(lbTertiaryVal.getText() + "/" + result.get("ter_copay"));
                    if (result.get("ter_deduct") != null)
                        lbTertiaryVal.setText(lbTertiaryVal.getText() + "/" + result.get("ter_deduct"));
                } else {
                    lbTertiary.setVisible(false);
                    lbTertiaryVal.setVisible(false);
                }

                if (result.get("facility") != null)
                    lbPOSVal.setText(result.get("facility"));
                if (result.get("service_date") != null)
                    lbDosVal.setText(result.get("service_date"));
                if (result.get("diagnosis") != null)
                    lbICDVal.setText(result.get("diagnosis"));
                if (result.get("cpt_code") != null)
                    lbCPTVal.setText(result.get("cpt_code"));
                if (result.get("fee") != null)
                    lbChargesVal.setText(result.get("fee"));
                if (result.get("paid") != null)
                    lbPaidVal.setText(result.get("paid"));
                if (result.get("balance") != null)
                    lbBalanceVal.setText(result.get("balance"));
            }
        }
    }, "HashMap<String,String>");
    HorizontalPanel actionPanel = new HorizontalPanel();
    actionPanel.setSpacing(5);
    final Button addEventBtn = new Button(_("Add Event"));
    addEventBtn.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            createClaimLogEventEntryPanel();
        }

    });
    final Button editClaimBtn = new Button(_("Modify Claim"));
    editClaimBtn.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            PatientScreen p = new PatientScreen();
            p.setPatient(patientId);
            Util.spawnTab(patientName, p);
            ProcedureScreen ps = new ProcedureScreen();
            ps.setModificationRecordId(claimid);
            ps.setPatientId(patientId);
            ps.loadData();
            Util.spawnTabPatient(_("Manage Procedures"), ps, p);
            ps.loadData();
        }

    });
    final Button cancelBtn = new Button(_("Return to Search"));
    final ClaimDetailsWidget cdw = this;
    cancelBtn.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            cdw.removeFromParent();
            callback.jsonifiedData("cancel");
        }

    });

    final Button newSearchBtn = new Button(_("New Search"));
    newSearchBtn.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            cdw.removeFromParent();
            callback.jsonifiedData("new");
        }

    });
    actionPanel.add(addEventBtn);
    actionPanel.add(cancelBtn);
    actionPanel.add(newSearchBtn);
    actionPanel.add(editClaimBtn);
    claimDetailsPanel.add(actionPanel);

    final CustomTable claimsLogTable = new CustomTable();
    claimsLogTable.setAllowSelection(false);
    claimsLogTable.setSize("100%", "100%");
    claimsLogTable.addColumn(_("Date"), "date");
    claimsLogTable.addColumn(_("User"), "user");
    claimsLogTable.addColumn(_("Action"), "action");
    claimsLogTable.addColumn(_("Comment"), "comment");
    Util.callApiMethod("ClaimLog", "events_for_procedure", params, new CustomRequestCallback() {
        @Override
        public void onError() {
        }

        @SuppressWarnings("unchecked")
        @Override
        public void jsonifiedData(Object data) {
            if (data != null) {
                HashMap<String, String>[] result = (HashMap<String, String>[]) data;
                claimsLogTable.loadData(result);
            }
        }
    }, "HashMap<String,String>[]");
    claimDetailsPanel.add(claimsLogTable);
}

From source file:org.freemedsoftware.gwt.client.widget.EncounterWidget.java

License:Open Source License

private void createBillingInfoTab() {
    FlexTable billInfoTable = new FlexTable();
    int row = 0;/*from w  w w.ja  v a2 s .  co  m*/
    int loopCountMax = 0;
    if (sectionsFieldMap.containsKey("Sections")
            && sectionsFieldMap.containsKey("Sections#Billing Information"))
        loopCountMax = sectionsFieldMap.get("Sections#Billing Information").size();
    else if (sectionsFieldMap.containsKey("Sections")
            && !sectionsFieldMap.containsKey("Sections#Billing Information"))
        loopCountMax = 0;
    else
        loopCountMax = 1;
    List<String> secList = sectionsFieldMap.get("Sections#Billing Information");
    String widgetWidth = "325px";
    for (int i = 0; i < loopCountMax; i++) {
        if ((secList != null && secList.get(i).equals("Procedure Code"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbProcCode = new Label(_("Procedure Code"));
            procCodeWidget = new SupportModuleWidget("CptCodes");
            procCodeWidget.setWidth(widgetWidth);
            // procCodeWidget.setWidth(widgetWidth);
            if (templateValuesMap.containsKey("pnotestproccode")) {
                procCodeWidget.setValue(new Integer(templateValuesMap.get("pnotestproccode")));
            }
            billInfoTable.setWidget(row, 0, lbProcCode);
            billInfoTable.setWidget(row++, 1, procCodeWidget);
        }
        if ((secList != null && secList.get(i).equals("Diagnosis 1"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbDiag1 = new Label(_("Diagnosis 1"));
            diag1Widget = new SupportModuleWidget("IcdCodes");
            diag1Widget.setWidth(widgetWidth);
            if (templateValuesMap.containsKey("pnotestdiag1")) {
                diag1Widget.setValue(new Integer(templateValuesMap.get("pnotestdiag1")));
            }
            billInfoTable.setWidget(row, 0, lbDiag1);
            billInfoTable.setWidget(row++, 1, diag1Widget);
        }
        if ((secList != null && secList.get(i).equals("Diagnosis 2"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbDiag2 = new Label(_("Diagnosis 2"));
            diag2Widget = new SupportModuleWidget("IcdCodes");
            diag2Widget.setWidth(widgetWidth);
            if (templateValuesMap.containsKey("pnotestdiag2")) {
                diag2Widget.setValue(new Integer(templateValuesMap.get("pnotestdiag2")));
            }
            billInfoTable.setWidget(row, 0, lbDiag2);
            billInfoTable.setWidget(row++, 1, diag2Widget);
        }
        if ((secList != null && secList.get(i).equals("Diagnosis 3"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbDiag3 = new Label(_("Diagnosis 3"));
            diag3Widget = new SupportModuleWidget("IcdCodes");
            diag3Widget.setWidth(widgetWidth);
            if (templateValuesMap.containsKey("pnotestdiag3")) {
                diag3Widget.setValue(new Integer(templateValuesMap.get("pnotestdiag3")));
            }
            billInfoTable.setWidget(row, 0, lbDiag3);
            billInfoTable.setWidget(row++, 1, diag3Widget);
        }
        if ((secList != null && secList.get(i).equals("Diagnosis 4"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbDiag4 = new Label(_("Diagnosis 4"));
            diag4Widget = new SupportModuleWidget("IcdCodes");
            diag4Widget.setWidth(widgetWidth);
            if (templateValuesMap.containsKey("pnotestdiag4")) {
                diag4Widget.setValue(new Integer(templateValuesMap.get("pnotestdiag4")));
            }
            billInfoTable.setWidget(row, 0, lbDiag4);
            billInfoTable.setWidget(row++, 1, diag4Widget);
        }
        if ((secList != null && secList.get(i).equals("Modifier 1"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbMod1 = new Label(_("Modifier 1"));
            mod1Widget = new SupportModuleWidget("CptModifiers");
            mod1Widget.setWidth(widgetWidth);
            if (templateValuesMap.containsKey("pnotestmod1")) {
                mod1Widget.setValue(new Integer(templateValuesMap.get("pnotestmod1")));
            }
            billInfoTable.setWidget(row, 0, lbMod1);
            billInfoTable.setWidget(row++, 1, mod1Widget);
        }
        if ((secList != null && secList.get(i).equals("Modifier 2"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbMod2 = new Label(_("Modifier 2"));
            mod2Widget = new SupportModuleWidget("CptModifiers");
            mod2Widget.setWidth(widgetWidth);
            if (templateValuesMap.containsKey("pnotestmod2")) {
                mod2Widget.setValue(new Integer(templateValuesMap.get("pnotestmod2")));
            }
            billInfoTable.setWidget(row, 0, lbMod2);
            billInfoTable.setWidget(row++, 1, mod2Widget);
        }
        if ((secList != null && secList.get(i).equals("Modifier 3"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbMod3 = new Label(_("Modifier 3"));
            mod3Widget = new SupportModuleWidget("CptModifiers");
            mod3Widget.setWidth(widgetWidth);
            if (templateValuesMap.containsKey("pnotestmod3")) {
                mod3Widget.setValue(new Integer(templateValuesMap.get("pnotestmod3")));
            }
            billInfoTable.setWidget(row, 0, lbMod3);
            billInfoTable.setWidget(row++, 1, mod3Widget);
        }
        if ((secList != null && secList.get(i).equals("Place Of Service"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbPOS = new Label(_("Place Of Service"));
            posWidget = new SupportModuleWidget("FacilityModule");
            posWidget.setWidth(widgetWidth);
            if (templateValuesMap.containsKey("pnotestpos")) {
                posWidget.setValue(new Integer(templateValuesMap.get("pnotestpos")));
            }
            billInfoTable.setWidget(row, 0, lbPOS);
            billInfoTable.setWidget(row++, 1, posWidget);
        }
        if (((secList != null && secList.get(i).equals("Authorization"))
                && formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES)
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbAuth = new Label(_("Authorization"));
            listAuthorizations = new CustomListBox();
            listAuthorizations.addItem(_("NONE SELECTED"), "0");
            listAuthorizations.setWidth(widgetWidth);
            billInfoTable.setWidget(row, 0, lbAuth);
            billInfoTable.setWidget(row++, 1, listAuthorizations);
        }
        if (((secList != null && secList.get(i).equals("Primary Coverage"))
                && formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES)
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbPrimCov = new Label(_("Primary Coverage"));
            listPrimCov = new CustomListBox();
            listPrimCov.setWidth(widgetWidth);
            listPrimCov.addItem(_("NONE SELECTED"), "0");
            loadCoverage(1, listPrimCov);
            billInfoTable.setWidget(row, 0, lbPrimCov);
            billInfoTable.setWidget(row++, 1, listPrimCov);
        }
        if (((secList != null && secList.get(i).equals("Secondary Coverage"))
                && formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES)
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbSecCov = new Label(_("Secondary Coverage"));
            listSecCov = new CustomListBox();
            listSecCov.setWidth(widgetWidth);
            listSecCov.addItem(_("NONE SELECTED"), "0");
            loadCoverage(2, listSecCov);
            billInfoTable.setWidget(row, 0, lbSecCov);
            billInfoTable.setWidget(row++, 1, listSecCov);
        }
        if (((secList != null && secList.get(i).equals("Tertiary Coverage"))
                && formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES)
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbTertCov = new Label(_("Tertiary Coverage"));
            listTertCov = new CustomListBox();
            listTertCov.setWidth(widgetWidth);
            listTertCov.addItem(_("NONE SELECTED"), "0");
            loadCoverage(3, listTertCov);
            billInfoTable.setWidget(row, 0, lbTertCov);
            billInfoTable.setWidget(row++, 1, listTertCov);
        }
        if (((secList != null && secList.get(i).equals("Work Comp Coverage"))
                && formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES)
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbWorkCov = new Label(_("Work Comp"));
            listWorkCov = new CustomListBox();
            listWorkCov.setWidth(widgetWidth);
            listWorkCov.addItem(_("NONE SELECTED"), "0");
            loadCoverage(4, listWorkCov);
            billInfoTable.setWidget(row, 0, lbWorkCov);
            billInfoTable.setWidget(row++, 1, listWorkCov);
        }
        if ((secList != null && secList.get(i).equals("Procedural Units"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbProcUnits = new Label(_("Procedural Units"));
            tbProcUnits = new TextBox();
            if (templateValuesMap.containsKey("pnotestprocunits")) {
                tbProcUnits.setText(templateValuesMap.get("pnotestprocunits"));
            }
            billInfoTable.setWidget(row, 0, lbProcUnits);
            billInfoTable.setWidget(row++, 1, tbProcUnits);
        }
    }
    billInfoTable.getFlexCellFormatter().setWidth(0, 0, "155px");
    billingInfoPanel.add(billInfoTable);
}

From source file:org.freemedsoftware.gwt.client.widget.EncounterWidget.java

License:Open Source License

private void createSoapNoteTab() {
    FlexTable soapNoteTable = new FlexTable();
    int row = 0;//from www  .  j a v  a 2 s  .com
    int loopCountMax = 0;
    if (sectionsFieldMap.containsKey("Sections") && sectionsFieldMap.containsKey("Sections#SOAP Note"))
        loopCountMax = sectionsFieldMap.get("Sections#SOAP Note").size();
    else if (sectionsFieldMap.containsKey("Sections") && !sectionsFieldMap.containsKey("Sections#SOAP Note"))
        loopCountMax = 0;
    else
        loopCountMax = 1;
    List<String> secList = sectionsFieldMap.get("Sections#SOAP Note");
    for (int i = 0; i < loopCountMax; i++) {

        if ((secList != null && secList.get(i).equals("Subjective"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbSub = new Label(_("Subjective"));
            tbSub = new TextArea();
            tbSub.setSize("700px", "100px");
            if (templateValuesMap.containsKey("pnotes_S")) {
                tbSub.setText(templateValuesMap.get("pnotes_S"));
            } else if (templateValuesMap.containsKey("pnotest_S")) {
                tbSub.setText(templateValuesMap.get("pnotest_S"));
            }

            soapNoteTable.setWidget(row, 0, lbSub);
            soapNoteTable.setWidget(row++, 1, tbSub);
            soapNoteTable.getFlexCellFormatter().setWidth(0, 0, "155px");
            if (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES) {
                final CustomListBox listInsInfo = new CustomListBox();
                listInsInfo.addItem(_("Select information to insert"));
                listInsInfo.addItem("Treatments");
                listInsInfo.addItem("Previous Operations");
                listInsInfo.addItem("Chronic Problems");
                listInsInfo.addItem("Current Problems");
                listInsInfo.addItem("Medications");
                listInsInfo.addItem("Shots");
                listInsInfo.addItem("Vitals");
                listInsInfo.addItem("Allergies");
                listInsInfo.addItem("Lab Values");
                listInsInfo.addItem("Prescription");
                listInsInfo.addChangeHandler(new ChangeHandler() {
                    @Override
                    public void onChange(ChangeEvent arg0) {
                        if (listInsInfo.getSelectedIndex() != 0) {
                            String value = listInsInfo.getWidgetText();
                            tbSub.setText(tbSub.getText() + "\n\n" + value);
                            insertModuleText(listInsInfo.getWidgetText(), tbSub);
                        }
                    }
                });
                soapNoteTable.setWidget(row++, 1, listInsInfo);
            }

        }
        if (((secList != null && secList.get(i).equals("Objective"))
                && formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES)
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbObj = new Label(_("Objective"));
            listObj = new CustomListBox();
            listObj.addItem(_("NONE SELECTED"));
            soapNoteTable.setWidget(row, 0, lbObj);
            soapNoteTable.setWidget(row++, 1, listObj);
        }
        if ((secList != null && secList.get(i).equals("Assessment"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbAssess = new Label(_("Assessment"));
            tbAssess = new TextArea();
            tbAssess.setSize("700px", "100px");
            if (templateValuesMap.containsKey("pnotes_A")) {
                tbAssess.setText(templateValuesMap.get("pnotes_A"));
            } else if (templateValuesMap.containsKey("pnotest_A")) {
                tbAssess.setText(templateValuesMap.get("pnotest_A"));
            }
            soapNoteTable.setWidget(row, 0, lbAssess);
            soapNoteTable.setWidget(row++, 1, tbAssess);
        }
        if ((secList != null && secList.get(i).equals("Plan"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbPlan = new Label(_("Plan"));
            tbPlan = new TextArea();
            tbPlan.setSize("700px", "100px");
            if (templateValuesMap.containsKey("pnotes_P")) {
                tbPlan.setText(templateValuesMap.get("pnotes_P"));
            } else if (templateValuesMap.containsKey("pnotest_P")) {
                tbPlan.setText(templateValuesMap.get("pnotest_P"));
            }
            soapNoteTable.setWidget(row, 0, lbPlan);
            soapNoteTable.setWidget(row++, 1, tbPlan);
        }
    }
    soapNotePanel.add(soapNoteTable);
}

From source file:org.freemedsoftware.gwt.client.widget.EncounterWidget.java

License:Open Source License

private void createIERTab() {
    FlexTable ierTable = new FlexTable();
    int row = 0;// www.j  a va  2s  .  c  o  m
    int loopCountMax = 0;
    if (sectionsFieldMap.containsKey("Sections") && sectionsFieldMap.containsKey("Sections#IER"))
        loopCountMax = sectionsFieldMap.get("Sections#IER").size();
    else if (sectionsFieldMap.containsKey("Sections") && !sectionsFieldMap.containsKey("Sections#IER"))
        loopCountMax = 0;
    else
        loopCountMax = 1;
    List<String> secList = sectionsFieldMap.get("Sections#IER");
    for (int i = 0; i < loopCountMax; i++) {
        if ((secList != null && secList.get(i).equals("Interval"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbInt = new Label(_("Interval"));
            tbInterval = new TextArea();
            tbInterval.setSize("700px", "100px");
            if (templateValuesMap.containsKey("pnotes_I")) {
                tbInterval.setText(templateValuesMap.get("pnotes_I"));
            } else if (templateValuesMap.containsKey("pnotest_I")) {
                tbInterval.setText(templateValuesMap.get("pnotest_I"));
            }
            ierTable.setWidget(row, 0, lbInt);
            ierTable.setWidget(row++, 1, tbInterval);
        }
        if ((secList != null && secList.get(i).equals("Education"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbEducation = new Label(_("Education"));
            tbEducation = new TextArea();
            tbEducation.setSize("700px", "100px");
            if (templateValuesMap.containsKey("pnotes_E")) {
                tbEducation.setText(templateValuesMap.get("pnotes_E"));
            } else if (templateValuesMap.containsKey("pnotest_E")) {
                tbEducation.setText(templateValuesMap.get("pnotest_E"));
            }
            ierTable.setWidget(row, 0, lbEducation);
            ierTable.setWidget(row++, 1, tbEducation);
        }
        if ((secList != null && secList.get(i).equals("Rx"))
                || (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES && currTemplate.equals(""))) {
            Label lbRx = new Label(_("Rx"));
            tbRx = new TextArea();
            tbRx.setSize("700px", "100px");
            if (templateValuesMap.containsKey("pnotes_R")) {
                tbRx.setText(templateValuesMap.get("pnotes_R"));
            } else if (templateValuesMap.containsKey("pnotest_E")) {
                tbRx.setText(templateValuesMap.get("pnotest_R"));
            }

            ierTable.setWidget(row, 0, lbRx);
            ierTable.setWidget(row++, 1, tbRx);
            if (formtype == EncounterFormType.ENCOUNTER_NOTE_VALUES) {
                final CustomListBox listRx = new CustomListBox();
                listRx.addItem(_("Select information to insert"));
                listRx.addItem("Treatments");
                listRx.addItem("Previous Operations");
                listRx.addItem("Chronic Problems");
                listRx.addItem("Current Problems");
                listRx.addItem("Medications");
                listRx.addItem("Shots");
                listRx.addItem("Vitals");
                listRx.addItem("Allergies");
                listRx.addItem("Lab Values");
                listRx.addItem("Prescription");
                listRx.addChangeHandler(new ChangeHandler() {
                    @Override
                    public void onChange(ChangeEvent arg0) {
                        if (listRx.getSelectedIndex() != 0) {
                            String value = listRx.getWidgetText();
                            tbRx.setText(tbRx.getText() + "\n\n" + value);
                            insertModuleText(listRx.getWidgetText(), tbRx);
                        }
                    }
                });
                ierTable.setWidget(row++, 1, listRx);
            }
        }
    }
    ierTable.getFlexCellFormatter().setWidth(0, 0, "155px");
    ierPanel.add(ierTable);
}