예제 #1
0
  public Patient getPatient(final String URI) {
    JSONObject result = null;
    try {
      result = HttpHelper.httpGet(URI);
    } catch (Exception e) {
      return null;
    }
    try {
      id = result.getInt("id");
      // firstName = result.getString("first_name");
      lastName = result.getString("last_name");
      // cellNumber = result.getInt("cell_no");
      // dateOfBirth = result.getString("dob");
      age = result.getInt("age");
      // address = result.getString("address");
      // email = result.getString("email");
      sex = result.getString("sex");
      // emergencyContact = result.getString("emergency_contact");
      // height = result.getInt("height");
      // weight = result.getInt("weight");
      // eyeColor = result.getString("eye_color");
      // driverLicenseNumber = result.getInt("driver_license_no");

    } catch (JSONException e) {
      e.printStackTrace();
      return null;
    }

    return this;
  }