Example #1
0
  protected void onSearchClick() throws PresentationLogicException {
    form.PatientsGrid().getRows().clear();
    form.AppointmentsGrid().getRows().clear();
    form.LeftDate().setEnabled(false);
    form.RightDate().setEnabled(false);
    form.DateSelected().setValue(form.Date().getValue());

    ClearArrivalControls();
    EnableButtons(false);
    EnableArrivalControls(false);

    PatientShortCollection voPatients = null;

    String surname = form.Surname().getValue();
    String forname = form.Name().getValue();
    String hospNum = form.HospitalNumber().getValue();

    Date dob = form.DOB().getValue();
    if ((surname == null || surname.length() == 0)
        && (forname == null || forname.length() == 0)
        && (hospNum == null || hospNum.length() == 0)
        && (dob == null)) {
      engine.showMessage(
          "Please enter a partial Surname, Name, \nHospital number OR a Date of birth and Search again.");
      return;
    }

    // 08/04/2003 - Do a Get when Hospital Number provided - ignore the rest
    if (hospNum != null && hospNum.length() > 0) {
      // Clear the Patient name, surname, dob
      form.Surname().setValue("");
      form.Name().setValue("");
      form.DOB().setValue(null);
    }

    try {
      PatientFilter voFilter = new PatientFilter();

      voFilter.setSurname(surname != null ? surname.toUpperCase() : null);
      voFilter.setForename(forname != null ? forname.toUpperCase() : null);
      voFilter.setDob(dob != null ? new PartialDate(dob.toString(DateFormat.ISO)) : null);

      PatientId pid = new PatientId();
      pid.setType(PatIdType.HOSPNUM);
      pid.setValue(form.HospitalNumber().getValue());
      voFilter.setPersId(pid);

      voPatients = domain.listPatients(voFilter);
    } catch (DomainInterfaceException e) {
      engine.showMessage(e.getMessage());
      return;
    }

    if (voPatients.size() == 0) {
      engine.showMessage("There is no patient matching this search criteria.");
      return;
    }

    for (int i = 0; i < voPatients.size(); ++i) addPatientRow(voPatients.get(i));
  }
Example #2
0
  private void addRowToGrid(SurgicalOperationNotesListVo record) {
    if (record == null) return;
    grdSurgicalOPsRow newRow = form.grdSurgicalOPs().getRows().newRow();
    boolean episodeOfCareNotNull =
        record.getCareContextIsNotNull() && record.getCareContext().getEpisodeOfCareIsNotNull();
    newRow.setColumnPatient(
        episodeOfCareNotNull
                && record.getCareContext().getEpisodeOfCare().getCareSpellIsNotNull()
                && record.getCareContext().getEpisodeOfCare().getCareSpell().getPatientIsNotNull()
            ? record
                .getCareContext()
                .getEpisodeOfCare()
                .getCareSpell()
                .getPatient()
                .getISelectedPatientName()
            : null);
    // -----------------------------
    if (episodeOfCareNotNull
        && record.getCareContext().getEpisodeOfCare().getCareSpellIsNotNull()
        && record.getCareContext().getEpisodeOfCare().getCareSpell().getPatientIsNotNull()) {
      String strTemp = new String();
      for (PatientId temp :
          record.getCareContext().getEpisodeOfCare().getCareSpell().getPatient().getIdentifiers()) {
        strTemp = strTemp + temp.getType().toString() + '=' + temp.getValue();
        strTemp += ',';
      }
      if (strTemp.length() > 0) {
        int n = strTemp.lastIndexOf(',');
        strTemp = strTemp.substring(0, n); // take out the last ,
      }
      newRow.setTooltipForColumnPatient(strTemp);
    }
    // ------------------------------
    newRow.setColumnConsultant(
        episodeOfCareNotNull
                && record.getCareContext().getEpisodeOfCare().getResponsibleHCPIsNotNull()
            ? record.getCareContext().getEpisodeOfCare().getResponsibleHCP().getIMosName()
            : null);
    newRow.setColumnOpSurgeon(
        record.getProceduresPerformedIsNotNull()
                && record.getProceduresPerformed().size() > 0
                && (record.getProceduresPerformed().get(0) instanceof PatientProcedureSurgicalOpVo)
                && record.getProceduresPerformed().get(0).getPeformedByIsNotNull()
            ? record.getProceduresPerformed().get(0).getPeformedBy().getIMosName()
            : null);

    newRow.setColumnPrimProcedure(
        record.getMainProcedureIsNotNull() && record.getMainProcedure().getProcedureIsNotNull()
            ? record.getMainProcedure().getProcedure().getProcedureName()
            : null);
    newRow.setColumnSignoffDate(
        record.getSignOffDateTimeIsNotNull() ? record.getSignOffDateTime().getDate() : null);
    newRow.setColumnSignoffHcp(
        record.getSignOffHCPIsNotNull() ? record.getSignOffHCP().getIMosName() : null);
    newRow.setValue(record);
  }
  private void populateDemographicINfo() {
    PatientShort pat = form.getGlobalContext().Core.getPatientShort();

    if (pat == null) throw new DomainRuntimeException("No Patient Supplied");

    if (pat.getNameIsNotNull()) {
      form.lblSurname().setValue(pat.getName().getSurname());
      form.lblForename().setValue(pat.getName().getForename());
    }

    form.lblSex().setValue(pat.getSexIsNotNull() ? pat.getSex().toString() : "");
    form.lblDOB().setValue(pat.getDobIsNotNull() ? pat.getDob().toString() : "");

    PatientIdCollection identifers = pat.getIdentifiers();
    if (identifers != null) {
      for (int i = 0; i < identifers.size(); i++) {
        ims.core.vo.PatientId id = identifers.get(i);
        ims.RefMan.forms.daycaseadmissiondialog.GenForm.grdIdentifiersRow row =
            form.grdIdentifiers().getRows().newRow();
        bindColType(row, false);
        row.getcolIdType().setValue(id.getType());
        row.setcolIdValue(id.getValue());
        row.setValue(id);
        if (id.getVerifiedIsNotNull() && !id.getVerified() && id.getType().equals(PatIdType.NHSN)) {
          row.setBackColor(Color.Orange);
          row.setReadOnly(true);
        }
        if (id.getTypeIsNotNull()
            && id.getType().equals(PatIdType.NHSN)
            && !ConfigFlag.GEN.ALLOW_UPDATES_TO_NHS_NO.getValue()) row.setReadOnly(true);
      }
    }
  }