示例#1
0
  protected void onFormDialogClosed(FormName formName, DialogResult result)
      throws PresentationLogicException {
    if (form.getForms().RefMan.ElectiveListAddLaterDialog.equals(formName)) {
      if (DialogResult.OK.equals(result)) {
        PatientElectiveListAddLaterVo electiveListLater =
            form.getGlobalContext().RefMan.getPatientElectiveListAddLaterVo();
        if (electiveListLater != null) {
          try {
            domain.savePatientElectiveList(electiveListLater);
          } catch (StaleObjectException e) {
            engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
          } catch (UniqueKeyViolationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            engine.showMessage(e.getMessage());
          }

          open();
        }
      } else if (DialogResult.ABORT.equals(result)) {
        open();
      } else if (DialogResult.CANCEL.equals(result)) // WDEV-22488
      {
        open();
      }
    }
  }
  private boolean save() {
    if (!populateDataFromScreen()) return false;

    MassageVo voMassage = form.getLocalContext().getCurrentMassageVo();
    String[] messages = voMassage.validate();

    if (messages != null) {
      engine.showErrors("Validation Errors for MassageVo", messages);
      return false;
    }
    try {
      form.getLocalContext().setCurrentMassageVo(domain.saveMassageVo(voMassage));
    } catch (StaleObjectException e) {
      engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      open();
      return false;
    } catch (UniqueKeyViolationException e) {
      engine.showMessage(
          "A Massage record already exists for this Clinical Contact. " + e.getMessage());
      open();
      return false;
    } catch (DomainRuntimeException e) {
      engine.showMessage(e.getMessage());
      open();
      return false;
    }
    return true;
  }
  protected void onBtnSaveClick() throws PresentationLogicException {
    GaitReEducationVo voGait = form.getLocalContext().getGaitEducation();
    if (voGait == null) voGait = new GaitReEducationVo();
    voGait.setAuthoringCP(form.qmbAuthoringCP().getValue());
    voGait.setAuthoringDateTime(form.dtimAuthoring().getValue());

    if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
      voGait.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());

    voGait.setDetails(form.txtDetails().getValue());

    voGait.setGaitAspect(populateDataFromGrdAspect());

    String[] uiErrors = getUiErrors();
    String[] message = voGait.validate(uiErrors);
    if (message != null) {
      engine.showErrors("Validation errors", message);
      return;
    }

    try {
      domain.saveGaitReEducation(voGait);
    } catch (StaleObjectException e) {
      engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      open();
      return;
    } catch (UniqueKeyViolationException e) {
      engine.showMessage("A Gait Re-Education record already exists. " + e.getMessage());
      open();
      return;
    }

    open();
  }
  private boolean save() {
    ActualPlanDetailsVo record = populateDataFromScreen();

    String[] uiErrors = getUiErrors();

    String[] errors = record.validate(uiErrors);
    if (errors != null && errors.length > 0) {
      engine.showErrors(errors);
      return false;
    }
    try {
      record = domain.saveRecord(record);
    } catch (StaleObjectException e) {
      engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      ActualPlanDetailsVo updatedRecord =
          getAndDisplayRecord(form.getGlobalContext().Core.getCurrentCareContext());
      updateRowRecord(updatedRecord);
      return false;
    } catch (DomainInterfaceException e) {
      e.printStackTrace();
      return false;
    }

    form.getLocalContext().seteditedRecord(record);
    return true;
  }
示例#5
0
  public boolean save() throws ims.framework.exceptions.PresentationLogicException {

    ManchesterTriageProtocolConfigVo TriageToSave =
        populateDataFromScreen(form.getLocalContext().getSelectedTriageProtocol());

    String[] errors = TriageToSave.validate();
    if (errors != null && errors.length > 0) {
      engine.showErrors(errors);
      return false;
    }

    if (form.cmbStatus().getValue().equals(PreActiveActiveInactiveStatus.ACTIVE)) {
      ManchesterTriageProtocolConfigLiteVoCollection TriageProtocol =
          domain.checkAlreadyActive(TriageToSave);

      if (TriageProtocol != null
          && TriageProtocol.getActiveCount() != 0
          && !TriageProtocol.contains(TriageToSave)) {
        engine.showMessage(
            "An active Triage Protocol already exists for the selected Problem.",
            "",
            MessageButtons.OK,
            MessageIcon.WARNING);
        return false;
      }
    }

    try {
      TriageToSave = domain.saveTriage(TriageToSave);
    } catch (StaleObjectException e) {
      engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      open();
      return false;
    } catch (UniqueKeyViolationException e) {
      engine.showMessage(e.getMessage());
      return false;
    }

    form.getLocalContext().setSelectedTriageProtocol(TriageToSave);

    form.txtName().setValue(TriageToSave.getProtocolName());
    form.qmbProblemSearch()
        .newRow(TriageToSave.getProblem(), TriageToSave.getProblem().getPCName());
    form.qmbProblemSearch().setValue(TriageToSave.getProblem());
    form.cmbStatusSearch().setValue(TriageToSave.getActiveStatus());

    return true;
  }
  private boolean deActivateGlobalContextHCP() {
    Hcp voHcp = form.getGlobalContext().getHcpIsNotNull() ? form.getGlobalContext().getHcp() : null;
    if (voHcp == null) return false;

    voHcp.setIsActive(Boolean.FALSE);
    voHcp.validate();

    try {
      domain.saveHCP(voHcp);
    } catch (StaleObjectException e) {
      engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      return false;
    }

    return true;
  }
  private boolean save() {
    PlanOfCareActionsVoCollection recordColl = populateDataFromScreen();
    PlanOfCareNotingVo recordNoting = populateDataFromScreenForNoting(recordColl);

    String[] uiErrors = getUiErrors();
    String[] errors = recordNoting.validate(uiErrors);
    if (errors != null && errors.length > 0) {
      engine.showErrors(errors);
      return false;
    }

    try {
      domain.saveActionsReview(recordColl, recordNoting);
    } catch (StaleObjectException e) {
      engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());

      return false;
    }

    return true;
  }
  protected void onBSaveClick() throws ims.framework.exceptions.PresentationLogicException {
    populateDataFromScreen();

    OPDGenNotesVo voOPDGenNotes = form.getLocalContext().getvoOPDGenNotes();
    try {
      String[] messages = voOPDGenNotes.validate();
      if (messages != null) {
        engine.showErrors("Validation Errors", messages);
        return;
      }
      domain.saveOPDGenNotesVo(voOPDGenNotes);
    } catch (DomainInterfaceException e) {
      engine.showMessage(e.getMessage());
      return;
    } catch (StaleObjectException e) {
      engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      open();
      return;
    }

    open();
  }
  @Override
  protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException {
    PatientCustomListVo voWorkList =
        domain.getPatientCustomList(form.grdCustomList().getSelectedRow().getValue());

    if (voWorkList != null
        && domain.checkIfPatientIsAlreadyOnList(
            form.getGlobalContext().Core.getPatientShort(), voWorkList)) {
      engine.showMessage("Your patient is already on the chosen Custom List");
      return;
    }

    if (voWorkList == null) {
      voWorkList = new PatientCustomListVo();
      voWorkList.setCustomList(form.grdCustomList().getSelectedRow().getValue());
      voWorkList.setListEntry(new PatientCustomItemVoCollection());
    }

    PatientCustomItemVo voItem = new PatientCustomItemVo();
    voItem.setPatient(form.getGlobalContext().Core.getPatientShort());
    voItem.setAddedBy((MemberOfStaffLiteVo) domain.getMosUser());
    voItem.setAddedDateTime(new DateTime());

    voWorkList.getListEntry().add(voItem);

    String[] errors = voWorkList.validate();
    if (errors != null) {
      engine.showErrors(errors);
      return;
    }

    try {
      domain.savePatientCustomList(voWorkList);
    } catch (StaleObjectException e) {
      engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      return;
    }
    engine.close(DialogResult.OK);
  }
示例#10
0
  private boolean removeBed(TrackingAttendanceStatusVo newStatus) {
    try {
      if (form.getLocalContext().getcurrentTrackingIsNotNull()) {
        form.getLocalContext().getcurrentTracking().setCurrentStatus(newStatus);

        PendingEmergencyAdmissionShortVo temppend = null;
        if (form.getLocalContext()
            .getcurrentTracking()
            .getAssociatedPendingEmergencyAdmissionIsNotNull()) {
          temppend =
              form.getLocalContext().getcurrentTracking().getAssociatedPendingEmergencyAdmission();
          temppend.setAdmissionStatus(EmergencyAdmissionStatus.CANCELLED);
          temppend.setAllocatedWard(null);
        }

        form.getLocalContext().getcurrentTracking().setBedAvailability(null);
        form.getLocalContext().getcurrentTracking().getAttendance().setConclusionDateTime(null);
        form.getLocalContext().getcurrentTracking().getAttendance().setBedTypeRequested(null);

        String[] errors = form.getLocalContext().getcurrentTracking().validate();
        if (errors != null && errors.length > 0) {
          engine.showErrors(errors);
          return false;
        }

        domain.save(null, form.getLocalContext().getcurrentTracking());

        return true;
      }
    } catch (StaleObjectException e) {
      engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      return true;
    } catch (UniqueKeyViolationException e) {
      engine.showMessage(e.getMessage());
      return false;
    }

    return false;
  }
示例#11
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);
  }
示例#12
0
  public ims.core.vo.PatientNoAlertInfoForTriageVo savePatientNoAlertInfo(
      ims.core.vo.PatientNoAlertInfoForTriageVo patientNoAlertInfo)
      throws ims.domain.exceptions.StaleObjectException,
          ims.domain.exceptions.UniqueKeyViolationException {
    if (patientNoAlertInfo == null)
      throw new CodingRuntimeException("Cannot save a null PatientNoAlertInfo.");

    if (!patientNoAlertInfo.isValidated())
      throw new CodingRuntimeException("PatientNoAlertInfo is not validated");

    DomainFactory factory = getDomainFactory();

    PatientNoAlertInfo doPatientNoAlertInfo =
        PatientNoAlertInfoForTriageVoAssembler.extractPatientNoAlertInfo(
            factory, patientNoAlertInfo);

    try {
      factory.save(doPatientNoAlertInfo);
    } catch (UnqViolationUncheckedException e) {
      throw new UniqueKeyViolationException(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
    }

    return PatientNoAlertInfoForTriageVoAssembler.create(doPatientNoAlertInfo);
  }
示例#13
0
  @Override
  protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException {
    SessionTheatreDelayAndDebriefTimesVo session = form.getLocalContext().getSessionDelay();

    session = populateDataFromScreen(session);

    String[] arrErrors = session.validate(validateUI());
    if (arrErrors != null) {
      engine.showErrors(arrErrors);
      return;
    }

    try {
      domain.saveSessionDelay(session);
    } catch (StaleObjectException e) {
      engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      form.getLocalContext()
          .setSessionDelay(
              domain.getSessionDelay(form.getGlobalContext().Scheduling.getTheatreSession()));
      populateScreenFromData();
      return;
    }
    engine.close(DialogResult.OK);
  }
示例#14
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();
  }
示例#15
0
  private boolean save() {
    // WDEV-17251
    SentToXrayVo XRayClone =
        (form.getLocalContext().getselectedSendToXRay() != null
            ? (SentToXrayVo) form.getLocalContext().getselectedSendToXRay().clone()
            : null);
    SentToXrayVo sentToXRayToSave = populateInstanceDataFromScreen(XRayClone);

    String[] errors = sentToXRayToSave.validate(getUIErrors()); // 	WDEV-15334

    if (errors != null && errors.length > 0) {
      engine.showErrors(errors);
      return false;
    }

    // Check SOE
    if (sentToXRayToSave.getID_SentToXrayIsNotNull() && domain.isStale(sentToXRayToSave)) {
      engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      if (form.getLocalContext().getselectedSendToXRayIsNotNull()) {
        form.getLocalContext()
            .setselectedSendToXRay(
                domain.getSentToXRay(form.getLocalContext().getselectedSendToXRay()));
      }
      if (form.getLocalContext().getcurrentTracking() != null) {
        form.getLocalContext()
            .setcurrentTracking(domain.getTracking(form.getLocalContext().getcurrentTracking()));
      }
      open();
      return false;
    }

    TrackingForSendToXRayVo trackingToSave = null;
    if (form.getLocalContext().getcurrentTracking().getCurrentAreaIsNotNull()
        && !Boolean.TRUE.equals(form.getLocalContext().getcurrentTracking().getIsDischarged())) {
      trackingToSave = form.getLocalContext().getcurrentTracking();

      // WDEV-17251
      if (sentToXRayToSave.getReturnedDateTime() == null
          && (sentToXRayToSave.getID_SentToXray() == null
              || form.getLocalContext().getselectedSendToXRay() != null
                  && form.getLocalContext().getselectedSendToXRay().getReturnedDateTime()
                      != null)) {
        TrackingAttendanceStatusVo trackingStatusToSave =
            populateTrackingAttendanceStatus(ims.emergency.vo.lookups.TrackingStatus.SENT_TO_XRAY);
        trackingToSave.setIsCurrentlyInXray(true);
        trackingToSave.setCurrentStatus(trackingStatusToSave);

      } else if (sentToXRayToSave.getReturnedDateTimeIsNotNull()) {
        trackingToSave.setIsCurrentlyInXray(false);

        if (form.cmbSetCurrentStatus().getValue() != null) {
          TrackingAttendanceStatusVo trackingStatusToSave =
              populateTrackingAttendanceStatus(form.cmbSetCurrentStatus().getValue());
          trackingToSave.setCurrentStatus(trackingStatusToSave);
        }
      }
    }

    try {
      if (trackingToSave != null) {
        String[] errors1 = trackingToSave.validate();

        if (errors1 != null && errors1.length > 0) {
          engine.showErrors(errors1);
          return false;
        }
        form.getLocalContext().setselectedSendToXRay(domain.save(sentToXRayToSave, trackingToSave));
        form.getLocalContext().setcurrentTracking(domain.getTracking(trackingToSave));
      } else {
        if (!domain.isMostRecentRecordReturned(
            form.getGlobalContext().Core.getCurrentCareContext())) {
          engine.showMessage(
              "You cannot create a new record Send To XRay if the most recent record is not marked as returned!");
          open();
          return false;
        }
        form.getLocalContext().setselectedSendToXRay(domain.save(sentToXRayToSave, null));
      }
    } catch (StaleObjectException e) {
      engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      if (form.getLocalContext().getselectedSendToXRay() != null) {
        form.getLocalContext()
            .setselectedSendToXRay(
                domain.getSentToXRay(form.getLocalContext().getselectedSendToXRay()));
      }
      if (trackingToSave != null) {
        form.getLocalContext().setcurrentTracking(domain.getTracking(trackingToSave));
      }
      open();
      return false;
    }

    return true;
  }
示例#16
0
  private boolean save(boolean bSave) {
    BedAvailabilityVo bedAvailabilityToSave = null; // 	WDEV-15162

    bedAvailabilityToSave =
        populateDataFromScreen(form.getLocalContext().getcurrentBedAvailability());

    String[] errors = bedAvailabilityToSave.validate(getUIErrors());
    if (errors != null && errors.length > 0) {
      engine.showErrors(errors);
      return false;
    }

    // Check SOE
    if (bedAvailabilityToSave.getID_BedAvailabilityIsNotNull()
        && domain.isStale(bedAvailabilityToSave)) {
      engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      engine.close(DialogResult.ABORT);
      return false;
    }

    try {
      TrackingForBedAvailabilityVo trackingToSave = form.getLocalContext().getcurrentTracking();

      // Create new current status (Decision To Admit) for tracking
      TrackingAttendanceStatusVo newStatus = new TrackingAttendanceStatusVo();

      newStatus.setPatient(trackingToSave.getPatient());
      newStatus.setEpisode(form.getGlobalContext().Core.getEpisodeofCareShort());
      newStatus.setAttendance(form.getGlobalContext().Core.getCurrentCareContext());
      newStatus.setTrackingArea(trackingToSave.getCurrentArea());
      newStatus.setStatusDatetime(new DateTime());
      newStatus.setCreatedBy((MemberOfStaffRefVo) domain.getMosUser());
      newStatus.setStatus(TrackingStatus.DECISION_TO_ADMIT);

      newStatus.setPrevStatus(
          (trackingToSave != null && trackingToSave.getCurrentStatus() != null)
              ? trackingToSave.getCurrentStatus().getStatus()
              : null);
      newStatus.setPrevTrackingArea(
          (trackingToSave != null && trackingToSave.getCurrentStatus() != null)
              ? trackingToSave.getCurrentStatus().getTrackingArea()
              : null);

      trackingToSave.setCurrentStatus(newStatus);
      trackingToSave.getAttendance().setConclusionDateTime(form.dtimAwaitingBed().getValue());
      trackingToSave.getAttendance().setBedTypeRequested(form.cmbDTABedType().getValue());

      trackingToSave.setBedAvailability(bedAvailabilityToSave);

      trackingToSave.setAssociatedPendingEmergencyAdmission(
          populatePendingAdmission(trackingToSave));

      String[] errors1 = trackingToSave.validate();

      if (errors1 != null && errors1.length > 0) {
        engine.showErrors(errors1);
        return false;
      }

      form.getLocalContext().setcurrentBedAvailability(domain.save(null, trackingToSave));
    } catch (StaleObjectException e) {
      engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
      engine.close(DialogResult.ABORT);
      return false;
    } catch (UniqueKeyViolationException e) {
      engine.showMessage("There can only be one BedAvailability record for an attendance!");
      engine.close(DialogResult.ABORT);
      return false;
    }

    return true;
  }