예제 #1
0
	public void loadSelectedProcedureInfo() {
		if (Util.getProgramMode() == ProgramMode.STUBBED) {

		} else if (Util.getProgramMode() == ProgramMode.JSONRPC) {
			String[] params = { procs.toString() };
			RequestBuilder builder = new RequestBuilder(
					RequestBuilder.POST,
					URL
							.encode(Util
									.getJsonRequest(
											"org.freemedsoftware.api.ClaimLog.getProceduresInfo",
											params)));
			try {
				builder.sendRequest(null, new RequestCallback() {
					public void onError(Request request, Throwable ex) {
						Window.alert(ex.toString());
					}

					@SuppressWarnings("unchecked")
					public void onResponseReceived(Request request,
							Response response) {

						if (Util.checkValidSessionResponse(response.getText())) {
							if (200 == response.getStatusCode()) {
								try {
									HashMap<String, String>[] result = (HashMap<String, String>[]) JsonUtil
											.shoehornJson(JSONParser
													.parseStrict(response.getText()),
													"HashMap<String,String>[]");
									if (result != null) {
										if (result.length > 0) {
											proceduresInfoTable
													.loadData(result);
										}
									}
								} catch (Exception e) {

								}
							} else {
							}
						}
					}
				});
			} catch (RequestException e) {
				Window.alert(e.toString());
			}

		} else {
		}
	}
예제 #2
0
	public void postCheck(HashMap<String, String>[] maps) {
		final PostCheckWidget pcw = this;
		if (Util.getProgramMode() == ProgramMode.STUBBED) {

		} else if (Util.getProgramMode() == ProgramMode.JSONRPC) {
			// String[] params = { "" + payerWidget.getStoredValue(),
			// JsonUtil.jsonify(tbCheckNo.getText()),
			// JsonUtil.jsonify(maps) };
			String[] params = { "", JsonUtil.jsonify(tbCheckNo.getText()),
					JsonUtil.jsonify(maps) };
			RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,
					URL.encode(Util.getJsonRequest(
							"org.freemedsoftware.api.ClaimLog.post_check",
							params)));
			try {
				builder.sendRequest(null, new RequestCallback() {
					public void onError(Request request, Throwable ex) {
						Window.alert(ex.toString());
					}

					public void onResponseReceived(Request request,
							Response response) {

						if (Util.checkValidSessionResponse(response.getText())) {
							if (200 == response.getStatusCode()) {
								pcw.removeFromParent();
								callback.jsonifiedData("update");
							} else {
							}
						}
					}
				});
			} catch (RequestException e) {
				Window.alert(e.toString());
			}

		} else {
		}
	}