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;
  }
Beispiel #2
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 void addMedicationRow(
      PatientMedicationVo voMed, boolean bHideDiscontinued, Color objColor) {
    if (voMed == null)
      throw new CodingRuntimeException("Coding Error voSnapShot is null addMedicationRow()");

    if ((bHideDiscontinued)
        && (voMed.getIsDiscontinuedIsNotNull())
        && (voMed.getIsDiscontinued().booleanValue())) return;

    boolean bAllDosesAreDiscontinued = true;
    MedicationDose voDose = null;

    // Loop thru to see if collection has any non-discontinued Doses - i.e. current ones.
    for (int k = 0; k < voMed.getPrescribedDoses().size(); k++) {
      voDose = voMed.getPrescribedDoses().get(k);
      if ((voDose.getIsStopped() == null)
          || (voDose.getIsStoppedIsNotNull() && (voDose.getIsStopped().booleanValue() == false)))
        bAllDosesAreDiscontinued = false;
    }

    // If we are not hiding Discontinued Meds and doses the ignore the bAllDosesAreDiscontinued
    // boolean.
    if (!bHideDiscontinued) bAllDosesAreDiscontinued = false;

    if (!bAllDosesAreDiscontinued) {
      DynamicGridRow row = this.grid.getRows().newRow();
      DynamicGridCell cell1 =
          row.getCells().newCell(getColByIdentifier(COL_MED_DESC_OR_DOSE), DynamicCellType.LABEL);
      cell1.setValue(voMed.getOtherMedicationText());
      cell1.setIdentifier(voMed.getOtherMedicationText());
      // WDEV-1204 - add tooltip
      cell1.setTooltip(voMed.getDiscontinuedTooltip());

      DynamicGridCell cell2 =
          row.getCells().newCell(getColByIdentifier(COL_MED_FREQ_OR_TIMES), DynamicCellType.LABEL);
      cell2.setValue(voMed.getFrequencyIsNotNull() ? voMed.getFrequency().toString() : "");
      cell2.setIdentifier(voMed.getFrequency());
      cell2.setTooltip(voMed.getDiscontinuedTooltip());

      if (hasDischargeInfo()) {
        DynamicGridCell cellDo =
            row.getCells().newCell(getColByIdentifier(COL_MED_DO), DynamicCellType.IMAGE);
        cellDo.setValue(
            voMed.getIsInTTOIsNotNull() && voMed.getIsInTTO().booleanValue() ? doImage : null);

        DynamicGridCell cellDays =
            row.getCells().newCell(getColByIdentifier(COL_MED_DAYS), DynamicCellType.INT);
        cellDays.setValue(voMed.getNoDaysSupply());
      }

      DynamicGridCell cell3 =
          row.getCells().newCell(getColByIdentifier(COL_MED_COMMENCED_BY), DynamicCellType.LABEL);
      cell3.setValue(voMed.getHcpCommencedIsNotNull() ? voMed.getHcpCommenced().toString() : "");
      cell3.setIdentifier(voMed.getFrequency());
      cell3.setTooltip(voMed.getDiscontinuedTooltip());

      DynamicGridCell cell4 =
          row.getCells().newCell(getColByIdentifier(COL_MED_COMMENCED_DATE), DynamicCellType.LABEL);
      cell4.setValue(voMed.getCommencedDateIsNotNull() ? voMed.getCommencedDate().toString() : "");
      cell4.setIdentifier(voMed.getFrequency());
      cell4.setTooltip(voMed.getDiscontinuedTooltip());

      DynamicGridCell cellAudit =
          row.getCells().newCell(getColByIdentifier(COL_AUDIT), DynamicCellType.IMAGE);
      if (voMed.getSysInfoIsNotNull() && voMed.getSysInfo().getLastupdateUser() != null) {
        cellAudit.setValue(this.imgAudit);
        cellAudit.setTooltip("This record had been updated.");
      }

      if (this.checkColumn) {
        DynamicGridCell cellChecked =
            row.getCells().newCell(getColByIdentifier(COL_COPY), DynamicCellType.BOOL);
        cellChecked.setValue(Boolean.TRUE);
        cellChecked.setIdentifier(null);
      }

      // WDEV-20591
      DynamicGridCell cell5 =
          row.getCells().newCell(getColByIdentifier(COL_MED_COMMENT), DynamicCellType.LABEL);
      cell5.setValue(voMed.getCommentIsNotNull() ? voMed.getComment() : "");
      cell5.setIdentifier(voMed.getFrequency());
      cell5.setTooltip(voMed.getDiscontinuedTooltip());

      row.setValue(voMed);

      for (int i = 0; i < voMed.getPrescribedDoses().size(); i++)
        addDoseRow(row, voMed.getPrescribedDoses().get(i), bHideDiscontinued, objColor);

      row.setExpanded(true);
      row.setSelectable(true);
      row.setBackColor(objColor);
      row.setExpandedImage(this.blisterpackImage);

      if ((voMed.getIsDiscontinuedIsNotNull()) && (voMed.getIsDiscontinued().booleanValue()))
        row.setBold(false);
      else row.setBold(true);
    }
  }