Exemple #1
0
  private void setPatientIntoContext(Patient patient) {
    PatientShort patientShort =
        new PatientShortHelper().getPatientShort(patient.DataCollection.get(0));

    ims.core.vo.PatientShort voPatient = null;

    if (patientShort != null) {
      try {
        voPatient = domain.getPatient(patientShort);
      } catch (StaleObjectException e) {
        engine.showMessage(e.getMessage());
      }
    }

    form.getGlobalContext().Core.setPatientShort(voPatient);
  }
  // wdev-13343
  public ims.dto.client.Patient getCCODTOPatient(String pkey) throws DomainInterfaceException {
    if (pkey == null) throw new DomainRuntimeException("Cannot get Patient for null pkey");

    ims.dto.client.Patient patient =
        (ims.dto.client.Patient) getDTOInstance(ims.dto.client.Patient.class);
    patient.Filter.clear();
    patient.Filter.Pkey = pkey;

    Result result = patient.get();
    if (result != null) {
      if (result.getId() == -2)
        throw new DomainInterfaceException("Error Getting Patient Details for pkey = " + pkey);

      throw new DomainInterfaceException(result.getMessage());
    }

    if (patient.DataCollection.count() != 1)
      throw new DomainInterfaceException("Failed to get patient record.");

    return patient;
  }