Ejemplo n.º 1
0
 @Override
 protected void onMessageBoxClosed(int messageBoxId, DialogResult result)
     throws PresentationLogicException {
   if (form.getLocalContext().getMessageBoxIsNotNull())
     if (messageBoxId == form.getLocalContext().getMessageBox()
         && result.equals(DialogResult.YES)) {
       if (form.treProcedures().getSelectedNode() != null
           && form.treProcedures().getSelectedNode().getIdentifier() != null
           && form.treProcedures().getSelectedNode().getIdentifier()
               instanceof ProceduresPerformedByHCPVo)
         try {
           domain.removeProcedure(
               (ProceduresPerformedByHCPVo)
                   form.treProcedures().getSelectedNode().getIdentifier());
           populateTree(
               domain.listProceduresPerformedByHCP(
                   form.qmbHCP().getValue(), form.cmbServices().getValue()));
         } catch (ForeignKeyViolationException e) {
           e.printStackTrace();
         }
       initialize();
     }
 }
Ejemplo n.º 2
0
  protected void onBtnSaveClicked() throws ims.framework.exceptions.PresentationLogicException {

    NAESReferralNoteVo referralNote =
        populateDataFromScreen(form.getGlobalContext().Naes.getReferralNote());
    String[] errors = referralNote.validate();

    if (errors != null) {
      engine.showErrors(errors);
      return;
    }
    try {
      domain.save(referralNote);
    } catch (DomainInterfaceException e) {
      engine.showMessage(e.getMessage());
    } catch (StaleObjectException e) {
      engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
    } catch (ForeignKeyViolationException e) {
      engine.showMessage(e.getMessage());
    } catch (UniqueKeyViolationException e) {
      engine.showMessage(e.getMessage());
    }

    engine.close(DialogResult.OK);
  }
Ejemplo n.º 3
0
  private boolean saveAdmission(
      PatientElectiveListBedAdmissionVo patientElectiveList,
      PatientElectiveListBedAdmissionVoCollection differentPatientElectiveListForService) {
    PasEventVo voPasEvent = new PasEventVo();
    if (form.qmbConsultant().getValue() != null) {
      MedicWithMappingsLiteVo medLite =
          new MedicWithMappingsLiteVo(
              form.qmbConsultant().getValue().getID_Hcp(),
              form.qmbConsultant().getValue().getVersion_Hcp());
      voPasEvent.setConsultant(medLite);
    }

    voPasEvent.setEventDateTime(form.dtimAdmDateTime().getValue());
    voPasEvent.setEventType(PasEventType.INPATIENT);
    voPasEvent.setIsVip(false);
    voPasEvent.setLocation(form.cmbWard().getValue());
    voPasEvent.setPatient(form.getGlobalContext().Core.getPatientShort());
    voPasEvent.setSpecialty(form.cmbSpecialty().getValue());
    voPasEvent.setPasEventId(new DateTime().toString());

    InpatientEpisodeVo voInpatientEpis = new InpatientEpisodeVo();
    voInpatientEpis.setIsOnLeave(false);
    voInpatientEpis.setAdmissionDateTime(form.dtimAdmDateTime().getValue());
    voInpatientEpis.setEstDischargeDate(form.dteEstDischDate().getValue());
    voInpatientEpis.setPasEvent(voPasEvent);
    voInpatientEpis.setBedNo(form.txtBedNo().getValue());
    voInpatientEpis.setAdmissionType(AdmissionType.DAY_CASE);

    String[] arrErrors = voInpatientEpis.validate(validateUILogic());
    if (arrErrors != null) {
      engine.showErrors(arrErrors);
      return false;
    }

    arrErrors = form.getGlobalContext().Core.getPatientShort().validate(arrErrors);
    if (arrErrors != null) {
      engine.showErrors(arrErrors);
      return false;
    }
    try {
      // CatsReferralWizardVo voCats =
      // domain.getCatsReferralWizardVoForCareContext(form.getGlobalContext().Core.getCurrentCareContext());
      CatsReferralWizardVo voCats =
          domain.getCatsReferral(form.getGlobalContext().Scheduling.getBookingAppointmentRef());
      if (voCats.getRequiresDischargeRep() == null) {
        voCats.setRequiresDischargeRep(null);
        String[] errors2 = voCats.validate();
        if (errors2 != null && errors2.length > 0) {
          engine.showErrors(errors2);
          return false;
        }
      }

      CareContextShortVo voCC =
          domain.admitPatient(
              form.getGlobalContext().Core.getPatientShort(),
              voInpatientEpis,
              form.getGlobalContext().Scheduling.getBookingAppointmentRef(),
              voCats,
              patientElectiveList,
              differentPatientElectiveListForService);
      if (voCC != null) form.getGlobalContext().Core.setCurrentCareContext(voCC);

      return true;
    } catch (DomainInterfaceException e) {
      engine.showMessage(e.getMessage());
      return false;
    } catch (StaleObjectException e) {
      engine.showMessage(e.getMessage());
      return false;
    } catch (ForeignKeyViolationException e) {
      engine.showMessage(e.getMessage());
      return false;
    } catch (UniqueKeyViolationException e) {
      engine.showMessage(e.getMessage());
      return false;
    }
  }