private void init() {
    request = requests.anamnesisCheckRequest();

    if (anamnesisCheck == null) {
      AnamnesisCheckProxy anamnesisCheck = request.create(AnamnesisCheckProxy.class);
      this.anamnesisCheck = anamnesisCheck;
      view.setEditTitle(false);
    } else {
      // cannot be set via editor...
      view.setEditTitle(true);
    }

    //		GWT.log("$$$$$$$$$$$$$$$$ anamnesisCheck be
    // title="+anamnesisCheck.getAnamnesisCheckTitle().getText());
    //		GWT.log("$$$$$$$$$$$$$$$$ anamnesisCheck be sort oder="+anamnesisCheck.getSort_order());
    anamnesisCheckBefore = anamnesisCheck;

    Log.info("edit");

    Log.info("persist");

    request.persist().using(anamnesisCheck);
    editorDriver.edit(anamnesisCheck, request);

    Log.info("flush");
    //		editorDriver.flush();
    Log.debug("Create für: " + anamnesisCheck.getId());

    // manually update value fields... (no editor support)

    view.update(anamnesisCheck);

    initInsideTitle();
    if (place.getOperation() == Operation.EDIT) {
      getQuestionsByselected(anamnesisCheck.getAnamnesisCheckTitle());
    } else if (place.getOperation() == Operation.CREATE) {
      requests
          .anamnesisCheckTitleRequest()
          .findAnamnesisCheckTitle(Long.valueOf(place.getTitleId()))
          .fire(
              new Receiver<AnamnesisCheckTitleProxy>() {

                @Override
                public void onSuccess(AnamnesisCheckTitleProxy response) {
                  getQuestionsByselected(response);
                }
              });
    }
  }
Ejemplo n.º 2
0
  @SuppressWarnings("deprecation")
  @Override
  public void start(AcceptsOneWidget panel, EventBus eventBus) {

    Log.info("ClinicDetailsActivity.start()");
    ClinicDetailsView ClinicDetailsView = new ClinicDetailsViewImpl();
    ClinicDetailsView.setPresenter(this);

    this.widget = panel;
    this.view = ClinicDetailsView;
    widget.setWidget(ClinicDetailsView.asWidget());

    view.setDelegate(this);
    loadDisplaySettings();

    requests
        .find(place.getProxyId())
        .fire(
            new Receiver<Object>() {

              public void onFailure(ServerFailure error) {
                Log.error(error.getMessage());
              }

              @Override
              public void onSuccess(Object response) {

                if (response instanceof ClinicProxy) {
                  Log.info(((ClinicProxy) response).getName());
                  init((ClinicProxy) response);
                }
              }
            });
  }
Ejemplo n.º 3
0
  /** change Filter Title ListBox selectedValue */
  @SuppressWarnings("deprecation")
  @Override
  public void changeFilterTitleShown(String selectedtTitle) {
    Log.debug("###########this is changeFilterTitleShown");

    //		Window.alert("getSelectedFilterTitle() = " + getSelectedFilterTitle());
    requests
        .anamnesisCheckRequest()
        .findTitlesContatisAnamnesisChecksWithSearching(
            place.getSearchStr(), getSelectedFilterTitle())
        .fire(
            new Receiver<List<AnamnesisCheckTitleProxy>>() {

              @Override
              public void onSuccess(List<AnamnesisCheckTitleProxy> response) {
                Log.debug("????????in changeFilterTitleShown response = " + response.size());
                view.getAnamnesisCheckPanel().clear();
                if ((place.getSearchStr() == null || place.getSearchStr().equals(""))
                    && getSelectedFilterTitle() == null) {
                  view.loadAnamnesisCheckPanel(response, false);
                } else {
                  view.loadAnamnesisCheckPanel(response, true);
                }
              }
            });
  }
Ejemplo n.º 4
0
  @Override
  public void editTitle(AnamnesisCheckTitleProxy title, UIObject refObj) {
    //		if (titlePopupView != null && titlePopupView.isShowing()) {
    //			titlePopupView.hide();
    //			titlePopupView = null;
    //		}
    editedTitle = title;
    titlePopupView = new AnamnesisCheckTitlePopupViewImpl(refObj);
    titleEditorDriver = titlePopupView.createEditorDriver();
    titlePopupView.setDelegate(this);
    requests
        .anamnesisCheckTitleRequest()
        .findAnamnesisCheckTitle(title.getId())
        .fire(
            new OSCEReceiver<AnamnesisCheckTitleProxy>() {

              @Override
              public void onSuccess(AnamnesisCheckTitleProxy response) {
                AnamnesisCheckTitleRequest request = requests.anamnesisCheckTitleRequest();
                request.persist().using(response);
                titleEditorDriver.edit(response, request);
                titleEditorDriver.flush();
              }
            });
  }
  @SuppressWarnings("deprecation")
  @Override
  public void changePreviousQuestion(
      final AnamnesisCheckTypes anamnesisCheckType, String seletedTitleId) {

    if (seletedTitleId != null && !seletedTitleId.equals("") && seletedTitleId.length() != 0) {
      requests
          .anamnesisCheckTitleRequest()
          .findAnamnesisCheckTitle(Long.valueOf(seletedTitleId))
          .fire(
              new Receiver<AnamnesisCheckTitleProxy>() {
                public void onFailure(ServerFailure error) {
                  Log.error(error.getMessage());
                }

                @Override
                public void onSuccess(AnamnesisCheckTitleProxy response) {

                  getQuestionsByselected(response);
                }
              });
    }
    //		else{
    //			getQuestionsByselected(null);
    //		}

  }
Ejemplo n.º 6
0
 @SuppressWarnings("deprecation")
 private void getTitlesBySearchStringAndFilter() {
   requests
       .anamnesisCheckRequest()
       .findTitlesContatisAnamnesisChecksWithSearching(
           view.getSearchBox().getText(), getSelectedFilterTitle())
       .fire(new FilteredTitleReceiver());
 }
Ejemplo n.º 7
0
 // find check value by title
 protected void fireCheckValueRequest(
     String searchValue, AnamnesisCheckProxy title, Receiver<List<AnamnesisCheckProxy>> callback) {
   requests
       .anamnesisCheckRequest()
       .findAnamnesisChecksByTitle(searchValue, title)
       .with(view.getPaths())
       .fire(callback);
 }
Ejemplo n.º 8
0
 public AnamnesisCheckActivity(
     OsMaRequestFactory requests, PlaceController placeController, AnamnesisCheckPlace place) {
   this.requests = requests;
   this.placeController = placeController;
   anamnesisCheckDetailsActivityMapper =
       new AnamnesisCheckDetailsActivityMapper(requests, placeController);
   this.activityManger =
       new ActivityManager(anamnesisCheckDetailsActivityMapper, requests.getEventBus());
   this.place = place;
 }
Ejemplo n.º 9
0
 public void registerLoading() {
   ApplicationLoadingScreenEvent.register(
       requests.getEventBus(),
       new ApplicationLoadingScreenHandler() {
         @Override
         public void onEventReceived(ApplicationLoadingScreenEvent event) {
           Log.info(" ApplicationLoadingScreenEvent onEventReceived Called");
           event.display();
         }
       });
 }
  private void reSorting(AnamnesisCheckTitleProxy anamnesisCheckTitle, Integer sortOder) {
    requests
        .anamnesisCheckRequest()
        .reSorting(anamnesisCheckTitle, sortOder + 1)
        .fire(
            new Receiver<Void>() {

              @Override
              public void onSuccess(Void response) {
                GWT.log("!!!!!!!!!!!!!!!!!!!!!!!! reSorting sucess");
              }
            });
  }
  private void saveOrEditAnamnesisCheckTitleInSpportal(AnamnesisCheckProxy anamnesisCheck) {
    requests
        .anamnesisCheckRequest()
        .saveOrEditAnamnesisCheck(anamnesisCheck)
        .fire(
            new OSCEReceiver<Boolean>() {

              @Override
              public void onSuccess(Boolean response) {
                if (response == false) {
                  showErrorMessageToUser("System could not save AnamnesisCheck Data for spportal");
                }
              }
            });
  }
Ejemplo n.º 12
0
  /**
   * Used to fill table and search field after creating new entity.
   *
   * @param entityId
   */
  private void getSearchStringByEntityProxyId(EntityProxyId<AnamnesisCheckProxy> entityId) {
    requests
        .find(entityId)
        .with("anamnesisCheckTitle")
        .fire(
            new OSCEReceiver<AnamnesisCheckProxy>() {

              @Override
              public void onSuccess(AnamnesisCheckProxy proxy) {
                if (proxy != null) {
                  //                    view.getSearchBox().setText(proxy.getText());
                  view.filterTitle(proxy.getAnamnesisCheckTitle());
                  performSearch();
                }
              }
            });
  }
  @SuppressWarnings("deprecation")
  private void getQuestionsByselected(final AnamnesisCheckTitleProxy title) {

    //		if(anamnesisChecktype!=null&&anamnesisChecktype==AnamnesisCheckTypes.QUESTION_TITLE){
    //
    //	requests.anamnesisCheckRequest().findAnamnesisChecksByType(AnamnesisCheckTypes.QUESTION_TITLE).with("anamnesisForm","title").fire(new Receiver<List<AnamnesisCheckProxy>>() {
    //				public void onFailure(ServerFailure error) {
    //					GWT.log("in AnamnesisCheckEditActivity findAnamnesisChecksByType error = "+error);
    //				}
    //
    //				@Override
    //				public void onSuccess(List<AnamnesisCheckProxy> response) {
    //					initPreviousQuestion(response);
    //
    //				}
    //			});
    //		}else if(title!=null){
    //			requests.anamnesisCheckRequest().findAnamnesisChecksByTitle("",
    // title).with("anamnesisForm","title").fire(new Receiver<List<AnamnesisCheckProxy>>() {
    //				public void onFailure(ServerFailure error) {
    //					GWT.log("in AnamnesisCheckEditActivity findAnamnesisChecksByType error = "+error);
    //				}
    //
    //				@Override
    //				public void onSuccess(List<AnamnesisCheckProxy> response) {
    //					List<AnamnesisCheckProxy> previousQuestions = new ArrayList<AnamnesisCheckProxy>();
    //					previousQuestions.add(title);
    //					previousQuestions.addAll(response);
    //					initPreviousQuestion(previousQuestions);
    //
    //				}
    //			});
    //		}
    requests
        .anamnesisCheckRequest()
        .findAnamnesisChecksBySearchWithAnamnesisCheckTitle("", title)
        .fire(
            new Receiver<List<AnamnesisCheckProxy>>() {

              @Override
              public void onSuccess(List<AnamnesisCheckProxy> response) {
                initPreviousQuestion(response);
              }
            });
  }
Ejemplo n.º 14
0
  @SuppressWarnings("deprecation")
  @Override
  public void setQuestionTableData(AnamnesisCheckTitleProxy title) {
    if (mapTitlesToProviders.size() < 1) {
      Log.warn("No data providers!?");
    }

    ListDataProvider<AnamnesisCheckProxy> dataProvider = mapTitlesToProviders.get(title);

    if (dataProvider.getList() != null) {
      Log.debug("view.getSearchBoxShown() = " + view.getSearchBoxShown());
      requests
          .anamnesisCheckRequest()
          .findAnamnesisChecksBySearchWithAnamnesisCheckTitle(view.getSearchBoxShown(), title)
          .with("anamnesisCheckTitle")
          .fire(new AnamnesisCheckReceiver(dataProvider));
    }
  }
Ejemplo n.º 15
0
  /** The activity has started */
  @Override
  public void start(AcceptsOneWidget panel, EventBus eventBus) {
    Log.info("SystemStartActivity.start()");
    AnamnesisCheckView systemStartView = new AnamnesisCheckViewImpl();
    innerSystemStartView = systemStartView;
    //        AnamnesisCheckView systemStartView = getAnamnesisCheckView();
    systemStartView.setPresenter(this);
    this.widget = panel;
    this.view = systemStartView;

    MenuClickEvent.register(requests.getEventBus(), (AnamnesisCheckViewImpl) view);

    widget.setWidget(systemStartView.asWidget());
    init();

    activityManger.setDisplay(view.getDetailsPanel());
    placeChangeHandlerRegistration =
        eventBus.addHandler(
            PlaceChangeEvent.TYPE,
            new PlaceChangeEvent.Handler() {

              @Override
              public void onPlaceChange(PlaceChangeEvent event) {
                if (event.getNewPlace() instanceof AnamnesisCheckDetailsPlace) {
                  requests.getEventBus().fireEvent(new ApplicationLoadingScreenEvent(true));
                  view.setDetailPanel(true);
                  requests.getEventBus().fireEvent(new ApplicationLoadingScreenEvent(false));
                  AnamnesisCheckDetailsPlace place =
                      (AnamnesisCheckDetailsPlace) event.getNewPlace();
                  if (place.getOperation() == Operation.NEW) {
                    requests.getEventBus().fireEvent(new ApplicationLoadingScreenEvent(false));
                    getSearchStringByEntityProxyId(
                        (EntityProxyId<AnamnesisCheckProxy>) place.getProxyId());
                  }
                } else if (event.getNewPlace() instanceof AnamnesisCheckPlace) {
                  view.setDetailPanel(false);
                  AnamnesisCheckPlace place = (AnamnesisCheckPlace) event.getNewPlace();
                  if (place.getToken().contains("!DELETED")) {
                    //                        initSearch();
                  }
                }
              }
            });
  }
  @Override
  public void start(AcceptsOneWidget panel, EventBus eventBus) {

    Log.info("AnamnesisCheckEditActivity.start()");
    AnamnesisCheckEditView anamnesisCheckEditView = new AnamnesisCheckEditViewImpl();

    this.widget = panel;
    this.view = anamnesisCheckEditView;

    editorDriver = view.createEditorDriver();

    view.setDelegate(this);

    if (this.place.getOperation() == Operation.EDIT) {
      Log.info("edit");
      requests
          .find(place.getProxyId())
          .with("anamnesisForm", "anamnesisCheckTitle")
          .fire(
              new Receiver<Object>() {
                public void onFailure(ServerFailure error) {
                  Log.error(error.getMessage());
                }

                @Override
                public void onSuccess(Object response) {
                  if (response instanceof AnamnesisCheckProxy) {
                    Log.info(((AnamnesisCheckProxy) response).getId().toString());
                    // init((AnamnesisCheckProxy) response);
                    anamnesisCheck = (AnamnesisCheckProxy) response;
                    init();
                  }
                }
              });
    } else {

      Log.info("new AnamnesisCheck");
      // anamnesisCheckPlace.setProxyId(anamnesisCheck.stableId());
      init();
    }
    // view.initialiseDriver(requests);
    widget.setWidget(anamnesisCheckEditView.asWidget());
    // setTable(view.getTable());
  }
  @SuppressWarnings("deprecation")
  private void initInsideTitle() {

    requests
        .anamnesisCheckTitleRequest()
        .findAllAnamnesisCheckTitles()
        .fire(
            new Receiver<List<AnamnesisCheckTitleProxy>>() {

              @Override
              public void onSuccess(List<AnamnesisCheckTitleProxy> response) {
                GWT.log("find titles sucess response size = " + response.size());
                view.setInsideTitleListBox(response);

                if (place.getOperation() == Operation.EDIT
                    && anamnesisCheck.getAnamnesisCheckTitle() != null) {
                  // Issue # 122 : Replace pull down with autocomplete.
                  // view.setSeletedInsideTitle(String.valueOf(anamnesisCheck.getAnamnesisCheckTitle().getId()));
                  view.setSeletedInsideTitle(anamnesisCheck.getAnamnesisCheckTitle());
                  // Issue # 122 : Replace pull down with autocomplete.
                } else if (place.getOperation() == Operation.CREATE && place.getTitleId() != null) {
                  requests
                      .anamnesisCheckTitleRequest()
                      .findAnamnesisCheckTitle(Long.parseLong(place.getTitleId()))
                      .fire(
                          new Receiver<AnamnesisCheckTitleProxy>() {

                            @Override
                            public void onSuccess(AnamnesisCheckTitleProxy response) {
                              // TODO Auto-generated method stub
                              view.setSeletedInsideTitle(response);
                            }
                          });
                  // Issue # 122 : Replace pull down with autocomplete.
                  // view.setSeletedInsideTitle(String.valueOf(place.getTitleId()));
                  // view.setSeletedInsideTitle(String.valueOf(place.getTitleId()));
                  // Issue # 122 : Replace pull down with autocomplete.

                }
              }
            });
  }
Ejemplo n.º 18
0
  @Override
  public void orderEdited(final AnamnesisCheckProxy proxy, String sortOrderStr) {
    try {
      requests
          .anamnesisCheckRequest()
          .changeSortOrder(Integer.parseInt(sortOrderStr))
          .using(proxy)
          .fire(
              new OSCEReceiver<Void>() {

                @Override
                public void onSuccess(Void response) {
                  // TODO Auto-generated method stub
                  view.filterTitle(proxy.getAnamnesisCheckTitle());
                  performSearch();
                }
              });
    } catch (Exception e) {
      Log.error(e.getMessage());
    }
  }
Ejemplo n.º 19
0
  @SuppressWarnings("deprecation")
  @Override
  public void deleteClicked() {
    if (!Window.confirm("Really delete this entry? You cannot undo this change.")) {
      return;
    }
    requests
        .clinicRequest()
        .remove()
        .using(clinicProxy)
        .fire(
            new Receiver<Void>() {

              public void onSuccess(Void ignore) {
                if (widget == null) {
                  return;
                }
                placeController.goTo(new ClinicPlace("ClinicPlace!DELETED"));
              }
            });
  }
Ejemplo n.º 20
0
  @SuppressWarnings("deprecation")
  @Override
  public void deleteTitle(final AnamnesisCheckTitleProxy title) {

    deletedTitle = title;

    requests
        .anamnesisCheckTitleRequest()
        .deleteTitleFromSpPortal(deletedTitle.getId())
        .fire(
            new OSCEReceiver<Boolean>() {

              @Override
              public void onSuccess(Boolean response) {
                if (response == null) {
                  showErrorMessageToUser(
                      "System could not delete AnamnesisCheckTitle from SpPortal for id : "
                          + deletedTitle.getId());
                } else {

                  requests
                      .anamnesisCheckTitleRequest()
                      .remove()
                      .using(title)
                      .fire(
                          new OSCEReceiver<Void>() {

                            @Override
                            public void onSuccess(Void response) {

                              removeDataProvider(title);
                              view.filterTitle(null);
                              fireGetAllTitlesRequest(new FilterTitleReceiver());
                              getTitlesBySearchStringAndFilter();
                            }
                          });
                }
              }
            });
  }
  private void initPreviousQuestion(List<AnamnesisCheckProxy> anamnesisCheckList) {
    AnamnesisCheckProxy deleteAnamnesisCheckProxy = null;
    for (AnamnesisCheckProxy anamnesisCheckProxy : anamnesisCheckList) {
      if (anamnesisCheck.getId() != null
          && String.valueOf(anamnesisCheckProxy.getId())
              .equals(String.valueOf(anamnesisCheck.getId()))) {
        deleteAnamnesisCheckProxy = anamnesisCheckProxy;
      }
    }
    if (deleteAnamnesisCheckProxy != null) {
      anamnesisCheckList.remove(deleteAnamnesisCheckProxy);
    }
    view.setPreviousQuestionListBox(anamnesisCheckList);

    if (anamnesisCheck.getSort_order() != null
        && anamnesisCheck.getSort_order() > 1
        && anamnesisCheck.getAnamnesisCheckTitle() != null) {
      requests
          .anamnesisCheckRequest()
          .findPreviousAnamnesisCheck(
              anamnesisCheck.getSort_order(), anamnesisCheck.getAnamnesisCheckTitle())
          .fire(
              new Receiver<AnamnesisCheckProxy>() {

                @Override
                public void onSuccess(AnamnesisCheckProxy response) {
                  Log.info("inside success" + response);
                  if (response != null && response.getSort_order() != null) {
                    // Issue # 122 : Replace pull down with autocomplete.
                    // view.setSeletedPreviousQuestion(String.valueOf(response.getSort_order()));
                    view.setSeletedPreviousQuestion(response);
                    // Issue # 122 : Replace pull down with autocomplete.
                    Log.info("inside success if " + response);
                  }
                }
              });
    }
  }
Ejemplo n.º 22
0
  @SuppressWarnings("deprecation")
  private void init(ClinicProxy ClinicProxy) {

    Log.info("response size ");
    this.clinicProxy = ClinicProxy;
    Log.info("Clinic ID ::: " + clinicProxy.getId());

    requests
        .clinicRequestNonRoo()
        .findAllDoctorsId(clinicProxy.getId())
        .with("doctars", "doctors.specialisation")
        .fire(
            new OSCEReceiver<List<ClinicProxy>>() {

              @Override
              public void onSuccess(List<ClinicProxy> response) {
                Log.info("inside Success ");

                stackIndex = 0;

                if (response != null && response.size() > 0) {

                  clinicProxyList = response;

                  Iterator<ClinicProxy> clinicList = response.iterator();

                  clinicProxy = response.get(0);

                  while (clinicList.hasNext()) {

                    Log.info("into next value");
                    ClinicProxy clinicProxy = clinicList.next();

                    Log.info("Size of Doctors " + clinicProxy.getDoctors().size());

                    List<DoctorProxy> l = new ArrayList<DoctorProxy>(clinicProxy.getDoctors());

                    final ClinicSubView clinicSubView = new ClinicSubViewImpl();

                    clinicSubView.setDelegate(clinicDetailsActivity);
                    String clinicLable = "";
                    if (l.get(0) != null && l.get(0).getSpecialisation() != null) {

                      Log.info("Data is  available");

                      clinicLable = l.get(0).getSpecialisation().getName();
                    }

                    //	view.setValue(ClinicProxy);

                    // view.getSpecialTabPanel().insert(clinicSubView, stackIndex);
                    view.getSpecialTabPanel().add((Widget) clinicSubView, clinicLable, true);

                    Log.info("clinicID::::" + clinicProxy.getId());

                    requests
                        .clinicRequest()
                        .findClinic(clinicProxy.getId())
                        .with(
                            "doctors",
                            "doctors.specialisation",
                            "doctors.specialisation.oscePostBlueprint",
                            "doctors.specialisation.oscePostBlueprint.osce")
                        .fire(
                            new OSCEReceiver<ClinicProxy>() {

                              @Override
                              public void onSuccess(
                                  ch.unibas.medizin.osce.client.managed.request.ClinicProxy
                                      response) {
                                Log.info("response" + response.getDoctors().size());
                                List<DoctorProxy> doctors = new ArrayList<DoctorProxy>();
                                doctors.addAll(response.getDoctors());
                                clinicSubView.getTable().setRowData(doctors);
                                Log.info("Array count" + arrarycount);
                              }
                            });
                    stackIndex++;

                    Log.info("Stack value:::::" + stackIndex);
                  }
                }
              }
            });

    view.setValue(clinicProxy);
    view.setDelegate(this);
  }
  @SuppressWarnings("deprecation")
  private void sortOderByPrevious() {

    int previousSortOder = 0;
    if (view.getSelectedPreviousQuestion() != null
        && !view.getSelectedPreviousQuestion().equals("")
        && view.getSelectedPreviousQuestion().length() != 0) {

      // System.out.println("inside if--"+view.getSelectedPreviousQuestion());
      // System.out.println("inside if--"+Integer.valueOf(view.getSelectedPreviousQuestion()));
      // TODO: If remove comment then null pointer exceptin occurs from server side. Need to check
      // in detail.
      /*previousSortOder = Integer.valueOf(view
      .getSelectedPreviousQuestion());*/

    }
    // GWT.log("@@@@@@@@@@@@@@@@@@anamnesisCheckBefore =
    // "+anamnesisCheckBefore.getAnamnesisCheckTitle().getText());
    if (place.getOperation() == Operation.EDIT
        && anamnesisCheckBefore != null
        && anamnesisCheck != null
        && anamnesisCheckBefore.getAnamnesisCheckTitle() != null
        && anamnesisCheck.getAnamnesisCheckTitle() != null
        && anamnesisCheckBefore.getAnamnesisCheckTitle().getId()
            == anamnesisCheck.getAnamnesisCheckTitle().getId()) {
      GWT.log("################call oderByPreviousAnamnesisCheck ");
      requests
          .anamnesisCheckRequest()
          .oderByPreviousAnamnesisCheck(previousSortOder)
          .using(anamnesisCheck)
          .fire(
              new Receiver<Void>() {

                @Override
                public void onSuccess(Void response) {
                  GWT.log(">>>>>>>>>>>>>>>>>>> oderByPreviousAnamnesisCheck success !");
                  placeController.goTo(
                      new AnamnesisCheckDetailsPlace(anamnesisCheck.stableId(), Operation.NEW));
                }
              });
    } else {
      GWT.log("################call insertAnamnesisCheck ");
      // System.out.println("sort order--"+previousSortOder);
      // System.out.println("id--"+anamnesisCheck.getId());

      requests
          .anamnesisCheckRequest()
          .insertAnamnesisCheck(previousSortOder)
          .using(anamnesisCheck)
          .fire(
              new Receiver<Void>() {

                @Override
                public void onSuccess(Void response) {
                  GWT.log(">>>>>>>>>>>>>>>>>>> insertAnamnesisCheck success !");
                  if (place.getOperation() == Operation.EDIT
                      && anamnesisCheckBefore != null
                      && anamnesisCheckBefore.getAnamnesisCheckTitle() != null
                      && anamnesisCheckBefore.getSort_order() != null) {

                    GWT.log(">>>>>>>>>>>>>>>>>>> reSorting call !");
                    requests
                        .anamnesisCheckRequest()
                        .reSorting(
                            anamnesisCheckBefore.getAnamnesisCheckTitle(),
                            anamnesisCheckBefore.getSort_order() + 1)
                        .fire(
                            new Receiver<Void>() {

                              @Override
                              public void onSuccess(Void response) {
                                GWT.log(">>>>>>>>>>>>>>>>>>> reSorting success !");
                                placeController.goTo(
                                    new AnamnesisCheckDetailsPlace(
                                        anamnesisCheck.stableId(), Operation.NEW));
                              }
                            });

                  } else {
                    placeController.goTo(
                        new AnamnesisCheckDetailsPlace(anamnesisCheck.stableId(), Operation.NEW));
                  }
                }
              });
    }
  }
Ejemplo n.º 24
0
  @SuppressWarnings("deprecation")
  @Override
  public void addNewTitleClicked(String titleText) {
    // Log.info("saveClicked");
    // Log.info("Map Size: " + view.getAnamnesisCheckTitleMap().size());

    sort_order = 0;
    title = titleText;
    requests
        .anamnesisCheckTitleRequest()
        .findMaxSortOrder()
        .fire(
            new OSCEReceiver<Integer>() {
              @SuppressWarnings("deprecation")
              @Override
              public void onSuccess(Integer response) {
                if (response == null) {
                  sort_order = 0;
                } else {
                  sort_order = response;
                }

                if (title.trim().equals("")) title = null;

                AnamnesisCheckTitleRequest request = requests.anamnesisCheckTitleRequest();
                final AnamnesisCheckTitleProxy anamnesisCheckTitle =
                    request.create(AnamnesisCheckTitleProxy.class);
                anamnesisCheckTitle.setText(title);
                anamnesisCheckTitle.setSort_order((sort_order + 1));

                // Highlight onViolation
                request
                    .persist()
                    .using(anamnesisCheckTitle)
                    .fire(
                        new OSCEReceiver<Void>(view.getAnamnesisCheckTitleMap()) {
                          // E Highlight onViolation
                          @SuppressWarnings("deprecation")
                          @Override
                          public void onSuccess(Void response) {
                            // Create Anamnisis check title in spportal
                            requests
                                .anamnesisCheckTitleRequest()
                                .saveAnamnesisCheckTitleInSpPortal(anamnesisCheckTitle)
                                .fire(
                                    new OSCEReceiver<Boolean>() {

                                      @Override
                                      public void onSuccess(Boolean response) {
                                        if (response == null) {
                                          showErrorMessageToUser(
                                              "System could not create AnamnesisCheckTitle in Spportal");
                                        } else {
                                          Log.info(
                                              "AnamnesisCheck title is created in sp portal successfully");
                                        }
                                      }
                                    });

                            view.filterTitle(null);
                            fireGetAllTitlesRequest(new FilterTitleReceiver());
                            getTitlesBySearchStringAndFilter();
                          }
                        });
              }
            });
  }
  @SuppressWarnings("deprecation")
  @Override
  public void saveClicked() {

    Log.info("saveClicked");
    request = (AnamnesisCheckRequest) editorDriver.flush();
    anamnesisCheck = request.edit(anamnesisCheck);

    anamnesisCheck.setValue(view.getValue());

    Long selectedInsideTitle = -1L;
    if (view.getSelectedInsideTitle() != null
        && !view.getSelectedInsideTitle().equals("")
        && view.getSelectedInsideTitle().length() != 0) {
      selectedInsideTitle = Long.valueOf(view.getSelectedInsideTitle());
    }
    if (selectedInsideTitle != -1L) {
      requests
          .anamnesisCheckTitleRequest()
          .findAnamnesisCheckTitle(selectedInsideTitle)
          .fire(
              new Receiver<AnamnesisCheckTitleProxy>() {
                public void onFailure(ServerFailure error) {
                  Log.error(error.getMessage());
                }

                @Override
                public void onSuccess(AnamnesisCheckTitleProxy response) {

                  // GWT.log("$$$$$$$$$$$$$$$$$$$$ anamnesisCheck.getAnamnesisCheckTitle().getText()
                  // = "+anamnesisCheck.getAnamnesisCheckTitle().getText());
                  // GWT.log("$$$$$$$$$$$$$$$$$$$$ response.getText() = "+response.getText());

                  // if(anamnesisCheckTitleBefore != null &&
                  // anamnesisCheckTitleBefore.getId() ==
                  // response.getId()){
                  // isTitleChange = false ;
                  // }else{
                  // isTitleChange = true ;
                  // }
                  // GWT.log("$$$$$$$$$$$$$$$$$$$$ isTitleChange = "+isTitleChange);
                  anamnesisCheck.setAnamnesisCheckTitle(response);

                  // if(isTitleChange == true && place.getOperation()
                  // == Operation.EDIT){
                  // reSorting(anamnesisCheckTitleBefore,
                  // anamnesisCheck.getSort_order());
                  // }else{
                  // saveData();
                  // }

                  // save data
                  // Highlight onViolation
                  Log.info("Map Size: " + view.getAnamnesisCheckMap().size());
                  request.fire(
                      new OSCEReceiver<Void>(view.getAnamnesisCheckMap()) {
                        // E Highlight onViolation

                        public void onFailure(ServerFailure error) {
                          Log.error(error.getMessage());
                        }

                        // Highlight onViolation
                        /*@Override
                        public void onViolation(Set<Violation> errors) {
                        	Iterator<Violation> iter = errors
                        			.iterator();
                        	String message = "";
                        	while (iter.hasNext()) {
                        		message += iter.next().getMessage()
                        				+ "<br>";
                        	}
                        	Log.warn(" in AnamnesisCheck -" + message);

                        }*/
                        // E Highlight onViolation

                        @Override
                        public void onSuccess(Void response) {
                          Log.info("AnamnesisCheck successfully saved.");

                          save = true;

                          saveOrEditAnamnesisCheckTitleInSpportal(anamnesisCheck);
                          sortOderByPrevious();
                          // placeController.goTo(new
                          // AnamnesisCheckDetailsPlace(anamnesisCheck.stableId(),
                          // Operation.NEW));
                        }
                      });
                }
              });
    } else {
      Window.alert("Please choose a title!");
    }
  }
Ejemplo n.º 26
0
 @Override
 public void moveUpTitle(AnamnesisCheckTitleProxy proxy) {
   requests.anamnesisCheckTitleRequest().moveUp().using(proxy).fire(new TitleMovedReceiver());
 }
Ejemplo n.º 27
0
 @Override
 public void moveDown(final AnamnesisCheckTitleProxy title, AnamnesisCheckProxy proxy) {
   requests.anamnesisCheckRequest().moveDown().using(proxy).fire(new MoveProxyReceiver(title));
 }
Ejemplo n.º 28
0
 protected Request<java.util.List<AnamnesisCheckProxy>> createRangeRequest(
     String q, AnamnesisCheckProxy title, Range range) {
   return requests
       .anamnesisCheckRequest()
       .findAnamnesisChecksBySearchWithTitle(q, title, range.getStart(), range.getLength());
 }
Ejemplo n.º 29
0
 protected void fireCountRequest(String q, AnamnesisCheckProxy title, Receiver<Long> callback) {
   requests.anamnesisCheckRequest().countAnamnesisChecksBySearchWithTitle(q, title).fire(callback);
 }
Ejemplo n.º 30
0
 protected void fireGetAllTitlesRequest(Receiver<List<AnamnesisCheckTitleProxy>> callback) {
   requests.anamnesisCheckTitleRequest().findAllAnamnesisCheckTitles().fire(callback);
 }