예제 #1
0
  protected void onDyngrdProceduresCellTextSubmited(DynamicGridCell cell) {
    // WDEV-10772 - starts here
    String availableProcedures = "";
    DynamicGridRow row = null;

    for (int i = 0; i < form.dyngrdProcedures().getRows().size(); i++) {
      row = form.dyngrdProcedures().getRows().get(i);

      if (row.getValue() instanceof ProcedureLiteVo)
        availableProcedures +=
            (availableProcedures.length() == 0 ? "" : ", ")
                + ((ProcedureLiteVo) row.getValue()).getID_Procedure();
    }
    // WDEV-10772 - ends here

    cell.getItems().clear();

    ProcedureLiteVoCollection procedures =
        domain.getAvailableProcedures(availableProcedures, cell.getTypedText());
    if (procedures != null && procedures.size() > 0) {
      for (int i = 0; i < procedures.size(); i++) {
        cell.getItems().newItem(procedures.get(i), procedures.get(i).getProcedureName());
      }
      if (procedures.size() == 1) {
        cell.setValue(procedures.get(0));
        onDyngrdProceduresCellValueChanged(cell);
      } else if (procedures.size() > 1) cell.showOpened();
    }
  }
예제 #2
0
 protected void onDyngrdResultsRowSelectionChanged(DynamicGridRow row)
     throws PresentationLogicException {
   updateControlsState();
   // WDEV-22823
   if (row != null && row.getValue() != null) {
     PatientShortListVo patient =
         ((PatientElectiveListForEndoscWorklistVo) row.getValue()).getPatient();
     form.getGlobalContext().Core.setPatientShort(domain.getPatientShort(patient));
   }
 }
예제 #3
0
  private void populatePanel(ProceduresPerformedByHCPVo pphcp) {
    clearPanel();
    if (pphcp == null) return;

    if (pphcp.getPerformingHCPIsNotNull()) {
      form.qmbHCPpanel().newRow(pphcp.getPerformingHCP(), pphcp.getPerformingHCP().getIHcpName());
      form.qmbHCPpanel().setValue(pphcp.getPerformingHCP());
    }
    if (pphcp.getServiceIsNotNull()) {
      form.cmbServicesPanel().newRow(pphcp.getService(), pphcp.getService().getServiceName());
      form.cmbServicesPanel().setValue(pphcp.getService());
    }
    if (pphcp.getProceduresIsNotNull())
      for (int i = 0; i < pphcp.getProcedures().size(); i++) {
        DynamicGridRow row = form.dyngrdProcedures().getRows().newRow();
        DynamicGridColumn col = form.dyngrdProcedures().getColumns().get(0);
        DynamicGridCell cell = row.getCells().newCell(col, DynamicCellType.QUERYCOMBOBOX);
        cell.getItems().newItem(pphcp.getProcedures().get(i));
        cell.setValue(pphcp.getProcedures().get(i));
      }
  }
예제 #4
0
  private void populateGreedFromList(PatientElectiveListForEndoscWorklistVoCollection record) {
    form.dyngrdResults().getRows().clear();
    if (record == null || record.size() == 0) {
      engine.showMessage("No Records found.");
      return;
    }
    for (int i = 0; i < record.size(); i++) {
      PatientElectiveListForEndoscWorklistVo patele = record.get(i);
      if (patele != null) {
        DynamicGridRow newRow = form.dyngrdResults().getRows().newRow();
        DynamicGridCell cellPatient =
            newRow.getCells().newCell(getColumnById(COLUMN_PATIENT_NAME), DynamicCellType.STRING);
        cellPatient.setReadOnly(true);
        cellPatient.setValue(
            patele.getPatient() != null && patele.getPatient() != null
                ? patele.getPatient().getName().toStringSurnameFirst()
                : null);
        cellPatient.setTooltip(
            patele.getPatient() != null && patele.getPatient().getName() != null
                ? patele.getPatient().getName().toStringSurnameFirst()
                : "");

        DynamicGridCell cellPatID =
            newRow.getCells().newCell(getColumnById(COLUMN_IDENTIFIER), DynamicCellType.STRING);
        cellPatID.setReadOnly(true);
        cellPatID.setValue(
            patele.getPatient() != null && patele.getPatient().getDisplayId() != null
                ? patele.getPatient().getDisplayId().getIdValue()
                : null);
        cellPatID.setTooltip(
            patele.getPatient() != null && patele.getPatient().getDisplayId() != null
                ? patele.getPatient().getDisplayId().getIdValue()
                : "");

        DynamicGridCell cellUrgency =
            newRow.getCells().newCell(getColumnById(COLUMN_URGENCY), DynamicCellType.STRING);
        cellUrgency.setReadOnly(true);
        cellUrgency.setValue(patele.getPriority() != null ? patele.getPriority().toString() : null);
        cellUrgency.setTooltip(patele.getPriority() != null ? patele.getPriority().toString() : "");

        DynamicGridCell cellDateOnList =
            newRow.getCells().newCell(getColumnById(COLUMN_DATE_ON_LIST), DynamicCellType.STRING);
        cellDateOnList.setReadOnly(true);
        cellDateOnList.setValue(
            patele.getDateOnList() != null ? patele.getDateOnList().toString() : null);
        cellDateOnList.setTooltip(
            patele.getDateOnList() != null ? patele.getDateOnList().toString() : "");

        DynamicGridCell cellRTTBreach =
            newRow.getCells().newCell(getColumnById(COLUMN_RTT_BREACH), DynamicCellType.STRING);
        cellRTTBreach.setReadOnly(true);
        cellRTTBreach.setValue(
            patele.getReferral() != null
                    && patele.getReferral().getReferralDetails() != null
                    && patele.getReferral().getReferralDetails().getEnd18WW() != null
                ? patele.getReferral().getReferralDetails().getEnd18WW().toString()
                : null);
        cellRTTBreach.setTooltip(
            patele.getReferral() != null
                    && patele.getReferral().getReferralDetails() != null
                    && patele.getReferral().getReferralDetails().getEnd18WW() != null
                ? patele.getReferral().getReferralDetails().getEnd18WW().toString()
                : "");

        DynamicGridCell cellProcedure =
            newRow.getCells().newCell(getColumnById(COLUMN_PROCEDURE), DynamicCellType.STRING);
        cellProcedure.setReadOnly(true);
        cellProcedure.setValue(
            patele.getPrimaryProcedure() != null
                    && patele.getPrimaryProcedure().getProcedureName() != null
                ? patele.getPrimaryProcedure().getProcedureName()
                : null);
        cellProcedure.setTooltip(
            patele.getPrimaryProcedure() != null
                    && patele.getPrimaryProcedure().getProcedureName() != null
                ? patele.getPrimaryProcedure().getProcedureName()
                : "");

        DynamicGridCell cellComments =
            newRow.getCells().newCell(getColumnById(COLUMN_COMMENTS), DynamicCellType.STRING);
        cellComments.setReadOnly(true);
        cellComments.setValue(patele.getComments());
        cellComments.setTooltip(patele.getComments());

        newRow.setValue(patele);
      }
    }
  }
예제 #5
0
  private void populatePanel(TreeNode node) {
    ProceduresPerformedByHCPVo proc = null;
    HcpLiteVo hcp = null;
    if (node != null)
      if (node.getValue() instanceof ProceduresPerformedByHCPVo) {
        proc = (ProceduresPerformedByHCPVo) node.getValue();
        hcp = proc.getPerformingHCP();
      } else if (node.getValue() instanceof HcpLiteVo) {
        hcp = (HcpLiteVo) node.getValue();
        if (node.getNodes().size() > 0)
          proc = (ProceduresPerformedByHCPVo) node.getNodes().get(0).getValue();
      }
    if (hcp != null) {
      form.qmbHCPpanel().newRow(hcp, hcp.getIHcpName());
      form.qmbHCPpanel().setEnabled(false);
      form.qmbHCPpanel().setValue(hcp);
      form.cmbServicesPanel().setEnabled(true);
      populateServicePanelCombo(form.getLocalContext().getAvailableServiceList());

      form.getContextMenus().Clinical.getProcedureGridADDPROCEDUREItem().setVisible(true);
    }
    if (proc != null) {
      if (proc.getPerformingHCPIsNotNull()) {
        form.qmbHCPpanel().setValue(proc.getPerformingHCP());
        form.qmbHCPpanel().newRow(proc.getPerformingHCP(), proc.getPerformingHCP().getIHcpName());
      }
      if (proc.getServiceIsNotNull()) form.cmbServicesPanel().setValue(proc.getService());
      if (proc.getProceduresIsNotNull() && proc.getProcedures().size() > 0) {
        form.dyngrdProcedures().getRows().clear();
        for (int i = 0; i < proc.getProcedures().size(); i++) {
          DynamicGridRow row = form.dyngrdProcedures().getRows().newRow();
          DynamicGridColumn col = form.dyngrdProcedures().getColumns().get(0);
          DynamicGridCell cell = row.getCells().newCell(col, DynamicCellType.QUERYCOMBOBOX);
          cell.getItems().newItem(proc.getProcedures().get(i));
          cell.setValue(proc.getProcedures().get(i));

          row.setValue(proc.getProcedures().get(i)); // WDEV-10772
        }
      }
    }
    if (form.getLocalContext().getIsNewProcedureIsNotNull()
        && form.getLocalContext().getIsNewProcedure()) {
      if (hcp != null) {
        form.qmbHCPpanel().newRow(hcp, hcp.getIHcpName());
        form.qmbHCPpanel().setValue(hcp);
        form.qmbHCPpanel().setEnabled(false);
      }
      if (proc != null) {
        form.cmbServicesPanel().newRow(proc.getService(), proc.getService().getServiceName());
        form.cmbServicesPanel().setValue(proc.getService());
        form.cmbServicesPanel().setEnabled(false);
        form.qmbHCPpanel().newRow(hcp, proc.getPerformingHCP().getIHcpName());
        form.qmbHCPpanel().setValue(proc.getPerformingHCP());
        form.qmbHCPpanel().setEnabled(false);
      }
    }
    if (form.getMode().equals(FormMode.EDIT)) {
      for (int i = 0; i < form.dyngrdProcedures().getRows().size(); i++) {
        DynamicGridRow row = form.dyngrdProcedures().getRows().get(i);
        DynamicGridCell cell = null;
        for (int j = 0; j < row.getCellArray().length; j++)
          if (row.getCellArray()[j] != null) cell = row.getCellArray()[j];
        if (cell != null) cell.setAutoPostBack(true);
      }
    }
  }
예제 #6
0
  @Override
  protected void onBtnSaveClick() throws PresentationLogicException {
    ProceduresPerformedByHCPVo proc = null;

    if (form.getLocalContext().getIsNewNodeIsNotNull() && form.getLocalContext().getIsNewNode()
        || form.getLocalContext().getIsNewServiceIsNotNull()
            && form.getLocalContext()
                .getIsNewService()) // &&form.getLocalContext().getIsNewProcedureIsNotNull()&&form.getLocalContext().getIsNewProcedure())
    proc = new ProceduresPerformedByHCPVo();
    else if (form.getLocalContext().getSelectedProcedurePerfIsNotNull())
      proc = form.getLocalContext().getSelectedProcedurePerf();

    ProcedureLiteVoCollection procedures = new ProcedureLiteVoCollection();
    if (form.qmbHCPpanel().getValue() != null) proc.setPerformingHCP(form.qmbHCPpanel().getValue());
    if (form.cmbServicesPanel().getValue() != null)
      proc.setService(form.cmbServicesPanel().getValue());

    if (form.dyngrdProcedures().getRows().size() != 0) {
      for (int i = 0; i < form.dyngrdProcedures().getRows().size(); i++) {
        DynamicGridRow row = form.dyngrdProcedures().getRows().get(i);
        DynamicGridColumn column =
            form.dyngrdProcedures().getColumns().getByIdentifier(COLUMN_PROC);
        DynamicGridCell cell = row.getCells().get(column);

        // WDEV-17779
        if (cell.getValue() == null && cell.getTypedText() != null) {
          engine.showMessage(
              "Please select a Procedure. '" + cell.getTypedText() + "' is not valid.");
          return;
        }

        procedures.add((ProcedureLiteVo) cell.getValue());
      }
    } else procedures = null;

    proc.setProcedures(procedures);

    try {
      String[] errors = proc.validate();
      if (errors != null) {
        engine.showErrors(errors);
        return;
      } else
        try {
          domain.saveProcedurePerformedByHCP(proc);
        } catch (DomainInterfaceException e) {
          e.printStackTrace();
          engine.showMessage("Error saving Procedure" + e.toString());
          return;
        }
    } catch (StaleObjectException e) {
      engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
    }

    form.setMode(FormMode.VIEW);

    ProceduresPerformedByHCPVoCollection hcpProcedures =
        domain.listProceduresPerformedByHCP(
            form.qmbHCP().getValue(), form.cmbServices().getValue());
    populateTree(hcpProcedures);
    initialize();
  }
예제 #7
0
  @Override
  protected void onContextMenuItemClick(int menuItemID, Control sender)
      throws PresentationLogicException {
    DynamicGridRow row;
    switch (menuItemID) {
      case GenForm.ContextMenus.ClinicalNamespace.ProcedurePerformedHCP
          .NewserviceandproceduresperformedbyHCP:
        clearPanel();
        if (form.getLocalContext().getAreHcpsAvailableIsNotNull()
            && !form.getLocalContext().getAreHcpsAvailable()) {
          engine.showMessage(
              "All the available HCP and Services are already in use or none exist",
              "Message",
              MessageButtons.OK);
          break;
        }

        form.setMode(FormMode.EDIT);
        form.getLocalContext().setIsNewNode(true);
        form.getLocalContext().setIsNewProcedure(false);
        form.getLocalContext().setIsNewService(false);
        populateServicePanelCombo(form.getLocalContext().getServiceList());
        form.treProcedures().setValue(null);
        form.getLocalContext().setSelectedProcedurePerf(new ProceduresPerformedByHCPVo());
        updateContextMenuStatus();
        break;

      case GenForm.ContextMenus.ClinicalNamespace.ProcedurePerformedHCP.ADDSERVICE:
        if (form.getLocalContext().getAreServicesAvailableIsNotNull()
            && !form.getLocalContext().getAreServicesAvailable()) {
          engine.showMessage(
              "There are no more available Services for this HCP", "Message", MessageButtons.OK);
          break;
        }
        form.setMode(FormMode.EDIT);
        form.getLocalContext().setIsNewNode(false);
        form.getLocalContext().setIsNewProcedure(false);
        form.getLocalContext().setIsNewService(true);
        form.getLocalContext()
            .setAvailableServiceList(
                domain.getAvailableServices(form.getLocalContext().getSelectedHcp().toHcpRefVo()));
        form.cmbServicesPanel().setEnabled(true);
        populatePanel(form.treProcedures().getSelectedNode());
        updateContextMenuStatus();
        form.dyngrdProcedures().getRows().clear();
        break;

      case GenForm.ContextMenus.ClinicalNamespace.ProcedurePerformedHCP.ADDPROCEDURES:
        form.setMode(FormMode.EDIT);
        form.getLocalContext().setIsNewNode(false);
        form.getLocalContext().setIsNewProcedure(true);
        form.getLocalContext().setIsNewService(false);
        populatePanel(form.treProcedures().getSelectedNode());
        updateContextMenuStatus();
        break;

      case GenForm.ContextMenus.ClinicalNamespace.ProcedurePerformedHCP.EDITHCP:
        form.setMode(FormMode.EDIT);
        form.getLocalContext().seteditHcp(true);
        form.getLocalContext().setAvailableServiceList(domain.listActiveServices());
        populatePanel(form.treProcedures().getSelectedNode());
        updateContextMenuStatus();

        break;

      case GenForm.ContextMenus.ClinicalNamespace.ProcedurePerformedHCP.REMOVEPROCEDURE:
        form.getLocalContext()
            .setMessageBox(
                engine.showMessage(
                    "Are you sure you want to remove this Procedure Performed by HCP?",
                    "Message",
                    MessageButtons.YESNO));
        break;

      case GenForm.ContextMenus.ClinicalNamespace.ProcedureGrid.ADDPROCEDURE:
        row = form.dyngrdProcedures().getRows().newRow();
        DynamicGridCell cell =
            row.getCells()
                .newCell(
                    form.dyngrdProcedures().getColumns().getByIdentifier(COLUMN_PROC),
                    DynamicCellType.QUERYCOMBOBOX);
        cell.setAutoPostBack(true);
        form.dyngrdProcedures().getRows();
        break;

      case GenForm.ContextMenus.ClinicalNamespace.ProcedureGrid.REMOVEPROCEDURE:
        form.dyngrdProcedures().getRows().remove(form.dyngrdProcedures().getSelectedRow());
        updateContextMenuStatus();
        break;
    }
  }
예제 #8
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;
  }
  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);
    }
  }