コード例 #1
0
ファイル: RemsUpdater.java プロジェクト: vjkrishna87/GGK
  private String buildPracticeRegistrationRequest(ECommerceUpdate oneUpdate) {
    StringBuffer requestBuf = new StringBuffer();
    String timeNow = getTimeStampString();
    int pendingItemID = oneUpdate.getPendingItemID().intValue();

    MemberDBBean dbBean = new MemberDBBean(getClass().getName());
    Member contact = null;
    PracticeGroup practice = null;
    String ToBeDetermined = null;

    Vector aff = new Vector();
    try {
      practice = dbBean.retrievePracticeRegistration(pendingItemID);
      aff = dbBean.getPracticeActiveAffiliations(practice.getPracticeID());
      contact = practice.getContact();

    } catch (Exception e) {
      e.printStackTrace();
    }
    String aff_type = "MC";
    String contract_username = "";
    java.text.SimpleDateFormat df = new java.text.SimpleDateFormat("MMddyy");
    String start_date = "";
    String end_date = "";
    String aff_rec_id = "";
    if (aff != null && !aff.isEmpty()) {
      int asize = aff.size();
      for (int x = 0; x < asize; x++) {
        UserAffiliation vv = (UserAffiliation) aff.elementAt(x);
        if (aff_type.equals(vv.getAffiliationType())) {
          if (vv.getStartDate() != null) start_date = df.format(vv.getStartDate());
          if (vv.getEndDate() != null) end_date = df.format(vv.getEndDate());
          aff_rec_id = "" + vv.getID();
          if (vv.getPrefix() != null && !vv.getPrefix().equals(""))
            aff_rec_id = vv.getPrefix() + "-" + aff_rec_id;
          User user = dbBean.retrieveUser((long) vv.getAffiliationID());
          contract_username = user.getUserName();
          break;
        }
      }
    }

    if (practice.getPracticeID() > 0) {
      requestBuf.append("service=Rcopia&action=register_practice");
      requestBuf.append("&drwebid=");
      requestBuf.append(practice.getPracticeID());
      requestBuf.append("&username="******"&password=dGVzdDEyMzQ%3D");
      // requestBuf.append(StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getPassword())));
      requestBuf.append("&prefix=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getPrefix())));
      requestBuf.append("&firstName=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getFirstName())));
      requestBuf.append("&lastName=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getLastName())));
      requestBuf.append("&email=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getEmail())));
      requestBuf.append("&memberType=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(practice.getMemberType())));
      requestBuf.append("&spec1_desc=");
      requestBuf.append(
          StringFunctions.urlEncoded(
              StringFunctions.objectToString(practice.getPrimarySpecialty())));
      requestBuf.append("&practicename=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(practice.getPracticeName())));
      requestBuf.append("&officeName=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(practice.getOfficeName())));
      requestBuf.append("&address1=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getPrimaryAddress1())));
      requestBuf.append("&address2=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getPrimaryAddress2())));
      requestBuf.append("&city=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getPrimaryCity())));
      requestBuf.append("&state=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getPrimaryState())));
      requestBuf.append("&zip=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getPrimaryZip())));
      requestBuf.append("&country=US");
      requestBuf.append("&PhoneAreaCode1=");
      requestBuf.append(
          StringFunctions.urlEncoded(
              StringFunctions.objectToString(contact.getPrimaryPhoneAreaCode())));
      requestBuf.append("&PhonePrefix1=");
      requestBuf.append(
          StringFunctions.urlEncoded(
              StringFunctions.objectToString(contact.getPrimaryPhonePrefix())));
      requestBuf.append("&PhoneSuffix1=");
      requestBuf.append(
          StringFunctions.urlEncoded(
              StringFunctions.objectToString(contact.getPrimaryPhoneSuffix())));
      requestBuf.append("&PhoneExtension1=");
      requestBuf.append(
          StringFunctions.urlEncoded(
              StringFunctions.objectToString(contact.getPrimaryPhoneExtension())));
      requestBuf.append("&FaxAreaCode1=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getFaxAreaCode())));
      requestBuf.append("&FaxPrefix1=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getFaxPrefix())));
      requestBuf.append("&FaxSuffix1=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(contact.getFaxSuffix())));
      requestBuf.append("&registered_by=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(practice.getRegisteredBy())));
      requestBuf.append("&created_date=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(practice.getCreatedDate())));
      requestBuf.append("&practiceManagementSystem=");
      requestBuf.append(
          StringFunctions.urlEncoded(
              StringFunctions.objectToString(practice.getPracticeManagementSystem())));
      requestBuf.append("&user_affiliation_id=");
      requestBuf.append(aff_rec_id);
      requestBuf.append("&start_date=");
      requestBuf.append(StringFunctions.objectToString(start_date));
      requestBuf.append("&end_date=");
      requestBuf.append(StringFunctions.objectToString(end_date));
      requestBuf.append("&contract_username="******"&assigned_region=");
      requestBuf.append(
          StringFunctions.urlEncoded(
              StringFunctions.objectToString(practice.getAssignedRegionName())));
      System.out.println(
          "practice assigned Region name========" + practice.getAssignedRegionName());

      requestBuf.append("&time=");
      requestBuf.append(getTimeStampString());
    }

    return requestBuf.toString();
  }
コード例 #2
0
ファイル: RemsUpdater.java プロジェクト: vjkrishna87/GGK
  private String buildUserRegistrationRequest(ECommerceUpdate oneUpdate) {
    StringBuffer requestBuf = new StringBuffer();
    String timeNow = getTimeStampString();
    int pendingItemID = oneUpdate.getPendingItemID().intValue();

    MemberDBBean dbBean = new MemberDBBean(getClass().getName());
    Member member = null;
    PracticeGroup practice = null;

    try {
      member = dbBean.retrieveUserRegistration(pendingItemID);
      practice = member.getPractice();
    } catch (Exception e) {
      e.printStackTrace();
    }

    if (member.getMemberID() > 0) {
      requestBuf.append("service=Order&action=registerUser");
      requestBuf.append("&drwebid=");
      requestBuf.append(member.getMemberID());
      requestBuf.append("&username="******"&password="******"&firstName=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(member.getFirstName())));
      requestBuf.append("&lastName=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(member.getLastName())));
      requestBuf.append("&email=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(member.getEmail())));
      requestBuf.append("&memberTypeSelectBox=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(member.getMemberType())));
      requestBuf.append("&practicename");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(practice.getPracticeName())));
      requestBuf.append("&address1=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(member.getPrimaryAddress1())));
      requestBuf.append("&address2=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(member.getPrimaryAddress2())));
      requestBuf.append("&city=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(member.getPrimaryCity())));
      requestBuf.append("&state=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(member.getPrimaryState())));
      requestBuf.append("&zip=");
      requestBuf.append(
          StringFunctions.urlEncoded(StringFunctions.objectToString(member.getPrimaryZip())));
      requestBuf.append("&PhoneAreaCode1=");
      requestBuf.append(member.getPrimaryPhone().substring(1, 3));
      requestBuf.append("&PhonePrefix1=");
      requestBuf.append(member.getPrimaryPhone().substring(6, 8));
      requestBuf.append("&PhoneSuffix1=");
      requestBuf.append(member.getPrimaryPhone().substring(10, 13));
      requestBuf.append("&time=");
      requestBuf.append(getTimeStampString());
    }

    return requestBuf.toString();
  }