Example #1
0
  private void populateDemoData() {

    DynamicGridColumn columnDescription =
        form.lyrPain()
            .tabPagePainAssessment()
            .dyngrdPain()
            .getColumns()
            .newColumn("Pain Nurse Check", new Integer(1));
    columnDescription.setWidth(350);
    DynamicGridColumn columnDate1 =
        form.lyrPain()
            .tabPagePainAssessment()
            .dyngrdPain()
            .getColumns()
            .newColumn("20/02/2010", new Integer(2));
    columnDate1.setWidth(80);
    DynamicGridColumn columnDate2 =
        form.lyrPain()
            .tabPagePainAssessment()
            .dyngrdPain()
            .getColumns()
            .newColumn("17/03/2010", new Integer(3));
    columnDate2.setWidth(80);
    DynamicGridColumn columnDate3 =
        form.lyrPain()
            .tabPagePainAssessment()
            .dyngrdPain()
            .getColumns()
            .newColumn("30/03/2010", new Integer(4));
    columnDate3.setWidth(80);
    // DynamicGridColumn columnDate4 =
    // form.lyrPain().tabPagePainAssessment().dyngrdPain().getColumns().newColumn("Datix Report",new
    // Integer(4));
    // columnDate3.setWidth(80);

    DynamicGridRow newRow = form.lyrPain().tabPagePainAssessment().dyngrdPain().getRows().newRow();
    newRow.setSelectable(false);
    newRow.setExpanded(true);
    DynamicGridCell newCell = newRow.getCells().newCell(columnDescription, DynamicCellType.STRING);
    newCell.setValue("Problems");
    DynamicGridRow newChild = newRow.getRows().newRow();
    newChild.setSelectable(false);
    newCell = newChild.getCells().newCell(columnDescription, DynamicCellType.STRING);
    newCell.setValue("Nausea/Vomiting");
    newCell.setTooltip("Nausea comment 1");
    newCell = newChild.getCells().newCell(columnDate1, DynamicCellType.BOOL);
    newCell.setValue(true);
    newCell.setTooltip("Nausea comment 1");
    newCell = newChild.getCells().newCell(columnDate2, DynamicCellType.BOOL);
    newCell = newChild.getCells().newCell(columnDate3, DynamicCellType.BOOL);

    newChild = newRow.getRows().newRow();
    newChild.setSelectable(false);
    newCell = newChild.getCells().newCell(columnDescription, DynamicCellType.STRING);
    newCell.setValue("Hypotension");
    newCell = newChild.getCells().newCell(columnDate1, DynamicCellType.BOOL);

    newCell = newChild.getCells().newCell(columnDate2, DynamicCellType.BOOL);
    newCell.setValue(true);
    newCell = newChild.getCells().newCell(columnDate3, DynamicCellType.BOOL);
    newCell.setValue(true);

    newRow = form.lyrPain().tabPagePainAssessment().dyngrdPain().getRows().newRow();
    newRow.setSelectable(false);
    newCell = newRow.getCells().newCell(columnDescription, DynamicCellType.STRING);
    newCell.setValue("Interventions");

    newChild = newRow.getRows().newRow();
    newChild.setSelectable(false);
    newCell = newChild.getCells().newCell(columnDescription, DynamicCellType.STRING);
    newCell.setValue("Antiemetic");
    newCell = newChild.getCells().newCell(columnDate1, DynamicCellType.BOOL);
    newCell.setValue(true);
    newCell = newChild.getCells().newCell(columnDate2, DynamicCellType.BOOL);
    newCell.setValue(true);
    newCell = newChild.getCells().newCell(columnDate3, DynamicCellType.BOOL);

    /*newRow = form.lyrPain().tabPagePainAssessment().dyngrdPain().getRows().newRow();
    newRow.setSelectable(false);
    newCell = newRow.getCells().newCell(columnDescription,DynamicCellType.STRING);
    newCell.setValue("Pain Nurse Checks");

    newChild = newRow.getRows().newRow();
    newChild.setSelectable(false);
    newCell = newChild.getCells().newCell(columnDescription, DynamicCellType.STRING);
    newCell.setValue("Datix Report");
    newCell = newChild.getCells().newCell(columnDate1,DynamicCellType.BOOL);
    newCell.setValue(true);
    newCell = newChild.getCells().newCell(columnDate2,DynamicCellType.BOOL);
    newCell.setValue(true);
    newCell = newChild.getCells().newCell(columnDate3,DynamicCellType.BOOL);*/

    form.lyrPain().tabPageACutePainRefDet().chklistPcaMorphine().newRow("1", "Pca Morphine 1");
    form.lyrPain().tabPageACutePainRefDet().chklistPcaMorphine().newRow("2", "Pca Morphine 2");
    form.lyrPain().tabPageACutePainRefDet().chklistPcaMorphine().newRow("3", "Pca Morphine 3");

    form.lyrPain().tabPagePainAssessment().cmbSelected().newRow("20/02/2010", "20/02/2010");
    form.lyrPain().tabPagePainAssessment().cmbSelected().newRow("17/03/2010", "17/03/2010");
    form.lyrPain().tabPagePainAssessment().cmbSelected().newRow("30/03/2010", "30/03/2010");
  }
  private boolean addDoseRow(
      DynamicGridRow row, MedicationDose voDose, boolean bHideDiscontinued, Color objColor) {
    if (voDose == null || row == null)
      throw new CodingRuntimeException("Dose or Row not sent - Coding Error");

    if ((bHideDiscontinued)
        && (voDose.getIsStoppedIsNotNull())
        && (voDose.getIsStopped().booleanValue())) return false;

    DynamicGridRow childRow = row.getRows().newRow();
    DynamicGridCell cell1 =
        childRow.getCells().newCell(getColByIdentifier(COL_DOSE_DOSE), DynamicCellType.LABEL);
    cell1.setValue(voDose.getDoseIsNotNull() ? voDose.getDose() : "");
    cell1.setIdentifier(voDose.getDose());
    cell1.setTooltip(voDose.getDiscontinuedTooltip());

    DynamicGridCell cell2 =
        childRow.getCells().newCell(getColByIdentifier(COL_DOSE_ROUTE), DynamicCellType.LABEL);
    cell2.setValue(voDose.getAdminRouteIsNotNull() ? voDose.getAdminRoute().toString() : "");
    cell2.setIdentifier(voDose.getAdminRoute());
    cell2.setTooltip(voDose.getDiscontinuedTooltip());

    DynamicGridCell cell3 =
        childRow.getCells().newCell(getColByIdentifier(COL_DOSE_TIMES), DynamicCellType.LABEL);
    cell3.setValue(
        voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : "");
    cell3.setTooltip(
        voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : "");
    cell3.setIdentifier(voDose.getAdminTimes());
    cell3.setTooltip(voDose.getDiscontinuedTooltip());

    DynamicGridCell cell4 =
        childRow
            .getCells()
            .newCell(getColByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.LABEL);
    cell4.setValue(voDose.getDoseStartHcpIsNotNull() ? voDose.getDoseStartHcp().toString() : "");
    cell4.setIdentifier(voDose.getDose());
    cell4.setTooltip(voDose.getDiscontinuedTooltip());

    DynamicGridCell cell5 =
        childRow
            .getCells()
            .newCell(getColByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.LABEL);
    cell5.setValue(voDose.getDoseStartDateIsNotNull() ? voDose.getDoseStartDate().toString() : "");
    cell5.setIdentifier(voDose.getDose());
    cell5.setTooltip(voDose.getDiscontinuedTooltip());

    // WDEV-20591
    DynamicGridCell cell6 =
        childRow.getCells().newCell(getColByIdentifier(COL_DOSE_COMMENT), DynamicCellType.LABEL);
    cell6.setValue(voDose.getCommentIsNotNull() ? voDose.getComment().toString() : "");
    cell6.setIdentifier(voDose.getComment());
    cell6.setTooltip(voDose.getDiscontinuedTooltip());

    childRow.setValue(voDose);

    childRow.setExpanded(true);
    childRow.setSelectable(false);
    childRow.setBackColor(objColor);
    childRow.setExpandedImage(this.tabletdoseImage);
    childRow.setCollapsedImage(this.tabletdoseImage);

    if ((voDose.getIsStoppedIsNotNull()) && (voDose.getIsStopped().booleanValue()))
      childRow.setBold(false);
    else childRow.setBold(true);

    return true;
  }