package gov.va.med.esr.xml;

import gov.va.med.esr.service.external.person.AddressInfo;
import gov.va.med.esr.service.external.person.AssetInfo;
import gov.va.med.esr.service.external.person.AssociationInfo;
import gov.va.med.esr.service.external.person.BaseAddressInfo;
import gov.va.med.esr.service.external.person.BeneficiaryTravelInfo;
import gov.va.med.esr.service.external.person.CDConditionInfo;
import gov.va.med.esr.service.external.person.CDProcedureInfo;
import gov.va.med.esr.service.external.person.CancelDeclineInfo;
import gov.va.med.esr.service.external.person.CatastrophicDisabilityInfo;
import gov.va.med.esr.service.external.person.CombatEpisodeInfo;
import gov.va.med.esr.service.external.person.ConflictExperienceInfo;
import gov.va.med.esr.service.external.person.ConsentInfo;
import gov.va.med.esr.service.external.person.ContactInfo;
import gov.va.med.esr.service.external.person.DeathRecondInfo;
import gov.va.med.esr.service.external.person.DebitInfo;
import gov.va.med.esr.service.external.person.DemographicInfo;
import gov.va.med.esr.service.external.person.DependentFinancialsInfo;
import gov.va.med.esr.service.external.person.DependentInfo;
import gov.va.med.esr.service.external.person.EESummary;
import gov.va.med.esr.service.external.person.EligibilityInfo;
import gov.va.med.esr.service.external.person.EligibilityVerificationInfo;
import gov.va.med.esr.service.external.person.EmailInfo;
import gov.va.med.esr.service.external.person.EmploymentInfo;
import gov.va.med.esr.service.external.person.EnrollmentDeterminationInfo;
import gov.va.med.esr.service.external.person.ExpenseInfo;
import gov.va.med.esr.service.external.person.FeeBasisInfo;
import gov.va.med.esr.service.external.person.FinancialStatementInfo;
import gov.va.med.esr.service.external.person.FinancialsInfo;
import gov.va.med.esr.service.external.person.HardshipInfo;
import gov.va.med.esr.service.external.person.IncomeInfo;
import gov.va.med.esr.service.external.person.IncomeTestInfo;
import gov.va.med.esr.service.external.person.IncomeTestStatusInfo;
import gov.va.med.esr.service.external.person.IncompetenceRulingInfo;
import gov.va.med.esr.service.external.person.IneligibilityFactorInfo;
import gov.va.med.esr.service.external.person.InsuranceInfo;
import gov.va.med.esr.service.external.person.MilitaryServiceEpisodeInfo;
import gov.va.med.esr.service.external.person.MilitaryServiceInfo;
import gov.va.med.esr.service.external.person.MilitaryServiceSiteRecordInfo;
import gov.va.med.esr.service.external.person.MilitarySexualTraumaInfo;
import gov.va.med.esr.service.external.person.MonetaryBenefitAwardInfo;
import gov.va.med.esr.service.external.person.MonetaryBenefitInfo;
import gov.va.med.esr.service.external.person.NameInfo;
import gov.va.med.esr.service.external.person.NonPrimaryFinancialStatementInfo;
import gov.va.med.esr.service.external.person.NoseThroatRadiumInfo;
import gov.va.med.esr.service.external.person.POWEpisodeInfo;
import gov.va.med.esr.service.external.person.PersonInfo;
import gov.va.med.esr.service.external.person.PhoneInfo;
import gov.va.med.esr.service.external.person.PreferredFacilityInfo;
import gov.va.med.esr.service.external.person.PrisonerOfWarInfo;
import gov.va.med.esr.service.external.person.PurpleHeartInfo;
import gov.va.med.esr.service.external.person.RatedDisabilityInfo;
import gov.va.med.esr.service.external.person.RelationInfo;
import gov.va.med.esr.service.external.person.SSNInfo;
import gov.va.med.esr.service.external.person.SensitivityInfo;
import gov.va.med.esr.service.external.person.ServiceConnectionAwardInfo;
import gov.va.med.esr.service.external.person.SpecialFactorsInfo;
import gov.va.med.esr.service.external.person.SpinalCordInjuryInfo;
import gov.va.med.esr.service.external.person.SpouseFinancialsInfo;
import gov.va.med.esr.service.external.person.SpouseInfo;
import gov.va.med.esr.service.external.person.VamcInfo;
import gov.va.med.esr.service.external.person.collections.AddressCollection;
import gov.va.med.esr.service.external.person.collections.AssetCollection;
import gov.va.med.esr.service.external.person.collections.AssociationCollection;
import gov.va.med.esr.service.external.person.collections.BeneficiaryTravelCollection;
import gov.va.med.esr.service.external.person.collections.CDConditionCollection;
import gov.va.med.esr.service.external.person.collections.CDDiagnosisCollection;
import gov.va.med.esr.service.external.person.collections.CDProcedureCollection;
import gov.va.med.esr.service.external.person.collections.CombatEpisodeCollection;
import gov.va.med.esr.service.external.person.collections.ConfidentialAddressCategoryCollection;
import gov.va.med.esr.service.external.person.collections.ConflictExperienceCollection;
import gov.va.med.esr.service.external.person.collections.DependentFinancialsCollection;
import gov.va.med.esr.service.external.person.collections.EligibilityCollection;
import gov.va.med.esr.service.external.person.collections.EmailCollection;
import gov.va.med.esr.service.external.person.collections.ExpenseCollection;
import gov.va.med.esr.service.external.person.collections.FeeBasisCollection;
import gov.va.med.esr.service.external.person.collections.IncomeCollection;
import gov.va.med.esr.service.external.person.collections.IncomeTestStatusCollection;
import gov.va.med.esr.service.external.person.collections.InsuranceCollection;
import gov.va.med.esr.service.external.person.collections.MilitaryServiceEpisodeCollection;
import gov.va.med.esr.service.external.person.collections.MilitaryServiceSiteRecordCollection;
import gov.va.med.esr.service.external.person.collections.MonetaryBenefitCollection;
import gov.va.med.esr.service.external.person.collections.NameCollection;
import gov.va.med.esr.service.external.person.collections.NonPrimaryFinancialStatementCollection;
import gov.va.med.esr.service.external.person.collections.POWEpisodeCollection;
import gov.va.med.esr.service.external.person.collections.PhoneCollection;
import gov.va.med.esr.service.external.person.collections.PreferredFacilityCollection;
import gov.va.med.esr.service.external.person.collections.RaceCollection;
import gov.va.med.esr.service.external.person.collections.RatedDisabilityCollection;
import gov.va.med.esr.service.external.person.collections.RelationCollection;
import gov.va.med.esr.service.external.person.collections.SSNCollection;
import gov.va.med.esr.service.external.person.collections.SpouseFinancialsCollection;
import gov.va.med.esr.service.external.person.collections.VamcDataCollection;
import gov.va.med.esr.webservices.generated.CdConditionCollection;
import gov.va.med.esr.webservices.generated.CdConditionInfo;
import gov.va.med.esr.webservices.generated.CdDiagnosisCollection;
import gov.va.med.esr.webservices.generated.CdProcedureCollection;
import gov.va.med.esr.webservices.generated.CdProcedureInfo;
import gov.va.med.esr.webservices.generated.EeSummary;
import gov.va.med.esr.webservices.generated.PowEpisodeInfo;
import gov.va.med.esr.webservices.generated.SsnCollection;
import gov.va.med.esr.webservices.generated.SsnInfo;

import java.util.Date;
import java.util.List;
/* 
 * IMPORTANT NOTE TO DEVELOPERS: 
 * This transformer class JAXB generated classes.  The JAXB generated are not check into source control.
 * You can generate the JAXB classes by running the the build-eesummary-jaxb-classes.xml file.
 */
public class EESummaryJAXBTransformer {
	
	public static EESummary createEESummary(EeSummary jaxbEESummary) {
		EESummary eeSummary = new EESummary();
		eeSummary.setAssociations(createAssociations(jaxbEESummary.getAssociations()));
		eeSummary.setConsentInfo(createConsentInfo(jaxbEESummary.getConsentInfo()));
		eeSummary.setDeathRecond(createDeathRecondInfo(jaxbEESummary.getDeathRecond()));
		//eeSummary.setDeliveryPreferenceInfo(createDeliveryPreferenceInfo(jaxbEESummary.get));
		eeSummary.setDemographics(createDemographics(jaxbEESummary.getDemographics()));
		//eeSummary.setEligibilityStatusInfo(createEligibilityStatusInfo(jaxbEESummary.gete));
		eeSummary.setEligibilityVerificationInfo(createEligibilityVerificationInfo(jaxbEESummary.getEligibilityVerificationInfo()));
		eeSummary.setEmploymentInfo(createEmploymentInfo(jaxbEESummary.getEmploymentInfo()));
		eeSummary.setEnrollmentDeterminationInfo(createEnrollmentDeterminationInfo(jaxbEESummary.getEnrollmentDeterminationInfo()));
		eeSummary.setFeeBasisList(createFeeBasisList(jaxbEESummary.getFeeBasisList()));
		eeSummary.setFinancialsInfo(createFinancialsInfo(jaxbEESummary.getFinancialsInfo()));
		eeSummary.setIncompetenceRulingInfo(createIncompetenceRulingInfo(jaxbEESummary.getIncompetenceRulingInfo()));
		eeSummary.setInsuranceList(createInsuranceList(jaxbEESummary.getInsuranceList()));
		eeSummary.setMilitaryServiceInfo(createMilitaryServiceInfo(jaxbEESummary.getMilitaryServiceInfo()));
		eeSummary.setPersonInfo(createPersonInfo(jaxbEESummary.getPersonInfo()));
		eeSummary.setPrisonerOfWarInfo(createPrisonerOfWarInfo(jaxbEESummary.getPrisonerOfWarInfo()));
		eeSummary.setPurpleHeart(createPurpleHeartInfo(jaxbEESummary.getPurpleHeart()));
		eeSummary.setRelations(createRelations(jaxbEESummary.getRelations()));
		eeSummary.setSensitivityInfo(createSensitivityInfo(jaxbEESummary.getSensitivityInfo()));
		eeSummary.setSpinalCordInjuryInfo(createSpinalCordInjuryInfo(jaxbEESummary.getSpinalCordInjuryInfo()));
		return eeSummary;
	}

	private static AssociationCollection createAssociations(gov.va.med.esr.webservices.generated.AssociationCollection associations) {
		if(associations == null) return null;
		AssociationCollection collection = new AssociationCollection();		
		collection.setAssociation(createAssociationInfoArray(associations.getAssociation()));
		return collection;
	}

	private static AssociationInfo[] createAssociationInfoArray(List<gov.va.med.esr.webservices.generated.AssociationInfo> jaxbAssociations) {
		if(jaxbAssociations == null) return null;
		AssociationInfo[] associationInfoArray = new AssociationInfo[jaxbAssociations.size()];
		for(int i = 0; i < jaxbAssociations.size(); i++){
			associationInfoArray[0] = createAssociationInfo(jaxbAssociations.get(i));
		}
		return associationInfoArray;
	}

	private static AssociationInfo createAssociationInfo(gov.va.med.esr.webservices.generated.AssociationInfo jaxbAssociationInfo) {
		if(jaxbAssociationInfo == null) return null;
		AssociationInfo associationInfo = new AssociationInfo();
		associationInfo.setAddress(createAddressInfo(jaxbAssociationInfo.getAddress()));
		associationInfo.setAlternatePhone(jaxbAssociationInfo.getAlternatePhone());
		associationInfo.setContactType(jaxbAssociationInfo.getContactType());
		associationInfo.setFamilyName(jaxbAssociationInfo.getFamilyName());
		associationInfo.setGivenName(jaxbAssociationInfo.getGivenName());
		if(jaxbAssociationInfo.getLastUpdateDate()!=null) associationInfo.setLastUpdateDate(new Date(jaxbAssociationInfo.getLastUpdateDate().getTime().getTime()));
		associationInfo.setMiddleName(jaxbAssociationInfo.getMiddleName());
		associationInfo.setOrganizationName(jaxbAssociationInfo.getOrganizationName());
		associationInfo.setPrefix(jaxbAssociationInfo.getPrefix());
		associationInfo.setPrimaryPhone(jaxbAssociationInfo.getPrimaryPhone());
		associationInfo.setRelationship(jaxbAssociationInfo.getRelationship());
		associationInfo.setSuffix(jaxbAssociationInfo.getSuffix());		
		return associationInfo;
	}

	private static BaseAddressInfo createAddressInfo(gov.va.med.esr.webservices.generated.BaseAddressInfo jaxbAddress) {
		if(jaxbAddress == null) return null;
		AddressInfo addressInfo = new AddressInfo();
		//addressInfo.setAddressChangeDateTime(jaxbAddress.get);
		//addressInfo.setAddressChangeEffectiveDate(jaxbAddress.get);
		//addressInfo.setAddressChangeSite(jaxbAddress.get);
		//addressInfo.setAddressChangeSource(jaxbAddress.get);
		//addressInfo.setAddressTypeCode(jaxbAddress.get);
		//addressInfo.setBadAddressReason(jaxbAddress.get);
		addressInfo.setCity(jaxbAddress.getCity());
		//addressInfo.setConfidentialAddressCategories(jaxbAddress.get);
		//addressInfo.setContactMethodReportDate(jaxbAddress.get);
		//addressInfo.setContactMethodType(jaxbAddress.get);
		addressInfo.setCountry(jaxbAddress.getCountry());
		addressInfo.setCounty(jaxbAddress.getCounty());
		//addressInfo.setEndDate(jaxbAddress.get);
		addressInfo.setLine1(jaxbAddress.getLine1());
		addressInfo.setLine2(jaxbAddress.getLine2());
		addressInfo.setLine3(jaxbAddress.getLine3());
		//addressInfo.setPhoneNumber(jaxbAddress.get);
		addressInfo.setPostalCode(jaxbAddress.getPostalCode());
		addressInfo.setProvinceCode(jaxbAddress.getProvinceCode());
		addressInfo.setState(jaxbAddress.getState());
		addressInfo.setZipCode(jaxbAddress.getZipCode());
		addressInfo.setZipPlus4(jaxbAddress.getZipPlus4());		
		return addressInfo;
	}

	private static ConsentInfo createConsentInfo(gov.va.med.esr.webservices.generated.ConsentInfo jaxbConsent) {
		if(jaxbConsent == null) return null;
		ConsentInfo consentInfo = new ConsentInfo();
		consentInfo.setConsentAuthCode(jaxbConsent.getConsentAuthCode());
		consentInfo.setConsentImageIndexNumber(jaxbConsent.getConsentImageIndexNumber());
		consentInfo.setConsentImagingSite(jaxbConsent.getConsentImagingSite());
		if(jaxbConsent.getConsentLastUpdateDate() != null) consentInfo.setConsentLastUpdateDate(new Date(jaxbConsent.getConsentLastUpdateDate().getTime().getTime()));
		if(jaxbConsent.getConsentReportDate() != null) consentInfo.setConsentReportDate(new Date(jaxbConsent.getConsentReportDate().getTime().getTime()));
		return consentInfo;
	}

	private static DeathRecondInfo createDeathRecondInfo(gov.va.med.esr.webservices.generated.DeathRecondInfo jaxbDeathRecond) {
		if(jaxbDeathRecond == null) return null;
		DeathRecondInfo deathRecondInfo = new DeathRecondInfo();
		deathRecondInfo.setDataSource(jaxbDeathRecond.getDataSource());
		deathRecondInfo.setDeathDate(jaxbDeathRecond.getDeathDate());
		if(jaxbDeathRecond.getDeathLastModified() != null) deathRecondInfo.setDeathLastModified(jaxbDeathRecond.getDeathLastModified().getTime());
		if(jaxbDeathRecond.getDeathReportDate() != null) deathRecondInfo.setDeathReportDate(new Date(jaxbDeathRecond.getDeathReportDate().getTime().getTime()));
		deathRecondInfo.setFacilityReceived(jaxbDeathRecond.getFacilityReceived());		
		return deathRecondInfo;
	}

	private static DemographicInfo createDemographics(gov.va.med.esr.webservices.generated.DemographicInfo jaxbDemographics) {
		if(jaxbDemographics == null) return null;
		DemographicInfo demographicInfo = new DemographicInfo();
		if(jaxbDemographics.getAppointmentRequestDate() == null) demographicInfo.setAppointmentRequestDate(new Date(jaxbDemographics.getAppointmentRequestDate().getTime().getTime()));
		//demographicInfo.setAppointmentRequestResponse(jaxbDemographics.get);
		if(jaxbDemographics.getAssignmentDate() != null) demographicInfo.setAssignmentDate(new Date(jaxbDemographics.getAssignmentDate().getTime().getTime()));
		demographicInfo.setClaimFolderLocation(jaxbDemographics.getClaimFolderLocation());
		demographicInfo.setClaimFolderNumber(jaxbDemographics.getClaimFolderNumber());
		demographicInfo.setContactInfo(createContactInfo(jaxbDemographics.getContactInfo()));
		demographicInfo.setEthnicity(jaxbDemographics.getEthnicity());
		demographicInfo.setMaritalStatus(jaxbDemographics.getMaritalStatus());
		demographicInfo.setPreferredFacilities(createPreferredFacilities(jaxbDemographics.getPreferredFacilities()));
		demographicInfo.setPreferredFacility(jaxbDemographics.getPreferredFacility());
		demographicInfo.setRaces(createRaces(jaxbDemographics.getRaces()));
		demographicInfo.setReligion(jaxbDemographics.getReligion());
		if(jaxbDemographics.getUnassignmentDate()!=null) demographicInfo.setUnassignmentDate(new Date(jaxbDemographics.getUnassignmentDate().getTime().getTime()));
		return demographicInfo;
	}

	private static RaceCollection createRaces(gov.va.med.esr.webservices.generated.RaceCollection jaxbRaces) {
		if(jaxbRaces == null) return null;
		RaceCollection collection = new RaceCollection();
		collection.setRace(createRaceArray(jaxbRaces.getRace()));
		return collection;
	}

	private static String[] createRaceArray(List<String> jaxbRaces) {
		if(jaxbRaces == null) return null;
		return jaxbRaces.toArray(new String[0]);
	}

	private static PreferredFacilityCollection createPreferredFacilities(gov.va.med.esr.webservices.generated.PreferredFacilityCollection jaxbPreferredFacilities) {
		if(jaxbPreferredFacilities == null) return null;
		PreferredFacilityCollection collection = new PreferredFacilityCollection();
		collection.setPreferredFacilityInfo(createPreferredFacilityInfoArray(jaxbPreferredFacilities.getPreferredFacilityInfo()));
		return collection;
	}

	private static PreferredFacilityInfo[] createPreferredFacilityInfoArray(List<gov.va.med.esr.webservices.generated.PreferredFacilityInfo> jaxbPreferredFacilityInfo) {
		if(jaxbPreferredFacilityInfo == null) return null;
		PreferredFacilityInfo[] preferredFacilityInfoArray = new PreferredFacilityInfo[jaxbPreferredFacilityInfo.size()];
		for(int i = 0; i < jaxbPreferredFacilityInfo.size(); i++){
			preferredFacilityInfoArray[i] = createPreferredFacilityInfo(jaxbPreferredFacilityInfo.get(i));
		}
		return preferredFacilityInfoArray;
	}

	private static PreferredFacilityInfo createPreferredFacilityInfo(gov.va.med.esr.webservices.generated.PreferredFacilityInfo jaxbPreferredFacilityInfo) {
		if(jaxbPreferredFacilityInfo == null) return null;
		PreferredFacilityInfo preferredFacilityInfo = new PreferredFacilityInfo();
		if(jaxbPreferredFacilityInfo.getAssignmentDate() != null) preferredFacilityInfo.setAssignmentDate(new Date(jaxbPreferredFacilityInfo.getAssignmentDate().getTime().getTime()));
		preferredFacilityInfo.setPreferredFacility(jaxbPreferredFacilityInfo.getPreferredFacility());
		if(jaxbPreferredFacilityInfo.getUnassignmentDate() != null) preferredFacilityInfo.setUnassignmentDate(new Date(jaxbPreferredFacilityInfo.getUnassignmentDate().getTime().getTime()));
		return preferredFacilityInfo;
	}

	private static ContactInfo createContactInfo(gov.va.med.esr.webservices.generated.ContactInfo jaxbContactInfo) {
		if(jaxbContactInfo == null) return null;
		ContactInfo contentInfo = new ContactInfo();
		contentInfo.setAddresses(createAddresses(jaxbContactInfo.getAddresses()));
		contentInfo.setEmails(createEmails(jaxbContactInfo.getEmails()));
		contentInfo.setPhones(createPhones(jaxbContactInfo.getPhones()));
		return contentInfo;
	}

	private static PhoneCollection createPhones(gov.va.med.esr.webservices.generated.PhoneCollection jaxbPhones) {
		if(jaxbPhones == null) return null;
		PhoneCollection collection = new PhoneCollection();
		collection.setPhone(createPhoneInfoArray(jaxbPhones.getPhone()));
		return collection;
	}

	private static PhoneInfo[] createPhoneInfoArray(List<gov.va.med.esr.webservices.generated.PhoneInfo> jaxbPhone) {
		if(jaxbPhone == null) return null;
		PhoneInfo[] phoneInfoArray = new PhoneInfo[jaxbPhone.size()];
		for(int i = 0; i < jaxbPhone.size(); i++){
			phoneInfoArray[i] = createPhoneInfo(jaxbPhone.get(i));
		}
		return phoneInfoArray;
	}

	private static PhoneInfo createPhoneInfo(gov.va.med.esr.webservices.generated.PhoneInfo jaxbPhoneInfo) {
		if(jaxbPhoneInfo == null) return null;
		PhoneInfo phoneInfo = new PhoneInfo();
		phoneInfo.setPhoneNumber(jaxbPhoneInfo.getPhoneNumber());
		if(jaxbPhoneInfo.getPhoneNumberReportDate() != null) phoneInfo.setPhoneNumberReportDate(new Date(jaxbPhoneInfo.getPhoneNumberReportDate().getTime().getTime()));
		phoneInfo.setType(jaxbPhoneInfo.getType());
		return phoneInfo;
	}

	private static EmailCollection createEmails(gov.va.med.esr.webservices.generated.EmailCollection jaxbEmails) {
		if(jaxbEmails == null) return null;
		EmailCollection collection = new EmailCollection();		
		collection.setEmail(createEmailInfoArray(jaxbEmails.getEmail()));
		return collection;
	}

	private static EmailInfo[] createEmailInfoArray(List<gov.va.med.esr.webservices.generated.EmailInfo> jaxbEmails) {
		if(jaxbEmails == null) return null;
		EmailInfo[] emailInfoArray = new EmailInfo[jaxbEmails.size()];
		for(int i = 0; i < jaxbEmails.size(); i++){
			emailInfoArray[i] = createEmailInfo(jaxbEmails.get(i));
		}
		return emailInfoArray;
	}

	private static EmailInfo createEmailInfo(gov.va.med.esr.webservices.generated.EmailInfo jaxbEmailInfo) {
		EmailInfo emailInfo = new EmailInfo();
		emailInfo.setAddress(jaxbEmailInfo.getAddress());
		if(jaxbEmailInfo.getChangeDate() != null) emailInfo.setChangeDate(new Date(jaxbEmailInfo.getChangeDate().getTime().getTime()));
		emailInfo.setSiteOfChange(jaxbEmailInfo.getSiteOfChange());
		emailInfo.setSourceOfChange(jaxbEmailInfo.getSourceOfChange());
		emailInfo.setType(jaxbEmailInfo.getType());
		return emailInfo;
	}

	private static AddressCollection createAddresses(gov.va.med.esr.webservices.generated.AddressCollection jaxbAddresses) {
		if(jaxbAddresses == null) return null;
		AddressCollection collection = new AddressCollection();
		collection.setAddress(createAddressInfoArray(jaxbAddresses.getAddress()));
		return collection;
	}

	private static AddressInfo[] createAddressInfoArray(List<gov.va.med.esr.webservices.generated.AddressInfo> jaxbAddresses) {
		if(jaxbAddresses == null) return null;
		AddressInfo[] addressInfoArray = new AddressInfo[jaxbAddresses.size()];
		
		for(int i = 0; i < jaxbAddresses.size(); i++){
			addressInfoArray[i] = createAddressInfo(jaxbAddresses.get(i));
		}
		
		return addressInfoArray;
	}

	private static AddressInfo createAddressInfo(gov.va.med.esr.webservices.generated.AddressInfo jaxbAddressInfo) {
		if(jaxbAddressInfo == null) return null;
		AddressInfo addressInfo = new AddressInfo();
		if(jaxbAddressInfo.getAddressChangeDateTime() != null) addressInfo.setAddressChangeDateTime(new Date(jaxbAddressInfo.getAddressChangeDateTime().getTime().getTime()));
		addressInfo.setAddressChangeEffectiveDate(jaxbAddressInfo.getAddressChangeEffectiveDate());
		addressInfo.setAddressChangeSite(jaxbAddressInfo.getAddressChangeSite());
		addressInfo.setAddressChangeSource(jaxbAddressInfo.getAddressChangeSource());
		addressInfo.setAddressTypeCode(jaxbAddressInfo.getAddressTypeCode());
		addressInfo.setBadAddressReason(jaxbAddressInfo.getBadAddressReason());
		addressInfo.setConfidentialAddressCategories(createConfidentialAddressCategories(jaxbAddressInfo.getConfidentialAddressCategories()));
		if(jaxbAddressInfo.getContactMethodReportDate()!=null)addressInfo.setContactMethodReportDate(new Date(jaxbAddressInfo.getContactMethodReportDate().getTime().getTime()));
		addressInfo.setContactMethodType(jaxbAddressInfo.getContactMethodType());
		addressInfo.setEndDate(jaxbAddressInfo.getEndDate());
		addressInfo.setPhoneNumber(jaxbAddressInfo.getPhoneNumber());
		return addressInfo;
	}

	private static ConfidentialAddressCategoryCollection createConfidentialAddressCategories(
			gov.va.med.esr.webservices.generated.ConfidentialAddressCategoryCollection jaxbConfidentialAddressCategories) {
		if(jaxbConfidentialAddressCategories == null) return null;
		ConfidentialAddressCategoryCollection collection= new ConfidentialAddressCategoryCollection();
		List<String> jaxbConfidentialAddressCategoryType = jaxbConfidentialAddressCategories.getConfidentialAddressCategoryType();
		String[] confidentialAddressCategoryTypeArray = new String[jaxbConfidentialAddressCategoryType.size()];
		for(int i = 0; i < jaxbConfidentialAddressCategoryType.size(); i++){
			confidentialAddressCategoryTypeArray[i] = (String) jaxbConfidentialAddressCategoryType.get(i);
		}		
		collection.setConfidentialAddressCategoryType(confidentialAddressCategoryTypeArray);
		return collection;
	}

	private static EligibilityVerificationInfo createEligibilityVerificationInfo(gov.va.med.esr.webservices.generated.EligibilityVerificationInfo jaxbEligibilityVerificationInfo) {
		if(jaxbEligibilityVerificationInfo == null) return null;
		EligibilityVerificationInfo eligibilityVerificationInfo = new EligibilityVerificationInfo();
		eligibilityVerificationInfo.setEligibilityStatus(jaxbEligibilityVerificationInfo.getEligibilityStatus());
		eligibilityVerificationInfo.setEligibilityStatusDate(jaxbEligibilityVerificationInfo.getEligibilityStatusDate());
		eligibilityVerificationInfo.setVerificationMethod(jaxbEligibilityVerificationInfo.getVerificationMethod());		
		return eligibilityVerificationInfo;
	}

	private static EmploymentInfo createEmploymentInfo(gov.va.med.esr.webservices.generated.EmploymentInfo jaxbEmploymentInfo) {
		if(jaxbEmploymentInfo == null) return null;
		EmploymentInfo employmentInfo = new EmploymentInfo();
		employmentInfo.setEmployerAddress(createAddressInfo(jaxbEmploymentInfo.getEmployerAddress()));
		employmentInfo.setEmployerName(jaxbEmploymentInfo.getEmployerName());
		employmentInfo.setEmployerPhone(jaxbEmploymentInfo.getEmployerPhone());
		employmentInfo.setEmploymentStatus(jaxbEmploymentInfo.getEmploymentStatus());
		employmentInfo.setOccupation(jaxbEmploymentInfo.getOccupation());
		employmentInfo.setRetirementDate(jaxbEmploymentInfo.getRetirementDate());
		return employmentInfo;
	}

	private static EnrollmentDeterminationInfo createEnrollmentDeterminationInfo(gov.va.med.esr.webservices.generated.EnrollmentDeterminationInfo jaxbEnrollmentDeterminationInfo) {
		if(jaxbEnrollmentDeterminationInfo == null) return null;
		EnrollmentDeterminationInfo enrollmentDeterminationInfo = new EnrollmentDeterminationInfo();
		if(jaxbEnrollmentDeterminationInfo.getApplicationDate() != null) enrollmentDeterminationInfo.setApplicationDate(new Date(jaxbEnrollmentDeterminationInfo.getApplicationDate().getTime().getTime()));
		enrollmentDeterminationInfo.setCalculationSource(jaxbEnrollmentDeterminationInfo.getCalculationSource());
		enrollmentDeterminationInfo.setCancelDeclineInfo(createCancelDeclineInfo(jaxbEnrollmentDeterminationInfo.getCancelDeclineInfo()));
		enrollmentDeterminationInfo.setCatastrophicDisabilityInfo(createCatastrophicDisabilityInfo(jaxbEnrollmentDeterminationInfo.getCatastrophicDisabilityInfo()));
		if(jaxbEnrollmentDeterminationInfo.getEffectiveDate() != null) enrollmentDeterminationInfo.setEffectiveDate(new Date(jaxbEnrollmentDeterminationInfo.getEffectiveDate().getTime().getTime()));
		enrollmentDeterminationInfo.setEligibleForMedicaid(jaxbEnrollmentDeterminationInfo.isEligibleForMedicaid());
		if(jaxbEnrollmentDeterminationInfo.getEndDate() != null) enrollmentDeterminationInfo.setEndDate(new Date(jaxbEnrollmentDeterminationInfo.getEndDate().getTime().getTime()));
		enrollmentDeterminationInfo.setEnrollmentCategoryName(jaxbEnrollmentDeterminationInfo.getEnrollmentCategoryName());
		if(jaxbEnrollmentDeterminationInfo.getEnrollmentDate() != null) enrollmentDeterminationInfo.setEnrollmentDate(new Date(jaxbEnrollmentDeterminationInfo.getEnrollmentDate().getTime().getTime()));
		enrollmentDeterminationInfo.setEnrollmentStatus(jaxbEnrollmentDeterminationInfo.getEnrollmentStatus());
		enrollmentDeterminationInfo.setFacilityReceived(jaxbEnrollmentDeterminationInfo.getFacilityReceived());
		enrollmentDeterminationInfo.setIneligibilityFactor(createIneligibilityFactorInfo(jaxbEnrollmentDeterminationInfo.getIneligibilityFactor()));
		if(jaxbEnrollmentDeterminationInfo.getMedicaidLastModifiedDate() != null) enrollmentDeterminationInfo.setMedicaidLastModifiedDate(new Date(jaxbEnrollmentDeterminationInfo.getMedicaidLastModifiedDate().getTime().getTime()));
		enrollmentDeterminationInfo.setMilitarySexualTraumaInfo(createMilitarySexualTraumaInfo(jaxbEnrollmentDeterminationInfo.getMilitarySexualTraumaInfo()));
		enrollmentDeterminationInfo.setMonetaryBenefitAwardInfo(createMonetaryBenefitAwardInfo(jaxbEnrollmentDeterminationInfo.getMonetaryBenefitAwardInfo()));
		enrollmentDeterminationInfo.setNoseThroatRadiumInfo(createNoseThroatRadiumInfo(jaxbEnrollmentDeterminationInfo.getNoseThroatRadiumInfo()));
		enrollmentDeterminationInfo.setOtherEligibilities(createOtherEligibilities(jaxbEnrollmentDeterminationInfo.getOtherEligibilities()));
		enrollmentDeterminationInfo.setPrimaryEligibility(createPrimaryEligibilityInfo(jaxbEnrollmentDeterminationInfo.getPrimaryEligibility()));
		enrollmentDeterminationInfo.setPriorityGroup(jaxbEnrollmentDeterminationInfo.getPriorityGroup());
		enrollmentDeterminationInfo.setPrioritySubGroup(jaxbEnrollmentDeterminationInfo.getPrioritySubGroup());
		if(jaxbEnrollmentDeterminationInfo.getRecordCreatedDate() != null) enrollmentDeterminationInfo.setRecordCreatedDate(new Date(jaxbEnrollmentDeterminationInfo.getRecordCreatedDate().getTime().getTime()));
		if(jaxbEnrollmentDeterminationInfo.getRecordModifiedDate() != null) enrollmentDeterminationInfo.setRecordModifiedDate(new Date(jaxbEnrollmentDeterminationInfo.getRecordModifiedDate().getTime().getTime()));
		enrollmentDeterminationInfo.setSecondaryEligibilities(createSecondaryEligibilities(jaxbEnrollmentDeterminationInfo.getSecondaryEligibilities()));
		enrollmentDeterminationInfo.setServiceConnectionAward(createServiceConnectionAwardInfo(jaxbEnrollmentDeterminationInfo.getServiceConnectionAward()));
		enrollmentDeterminationInfo.setSpecialFactors(createSpecialFactors(jaxbEnrollmentDeterminationInfo.getSpecialFactors()));
		enrollmentDeterminationInfo.setUserEnrolleeSite(jaxbEnrollmentDeterminationInfo.getUserEnrolleeSite());
		enrollmentDeterminationInfo.setUserEnrolleeValidThrough(jaxbEnrollmentDeterminationInfo.getUserEnrolleeValidThrough());
		enrollmentDeterminationInfo.setVeteran(jaxbEnrollmentDeterminationInfo.isVeteran());
		return enrollmentDeterminationInfo;
	}

	private static SpecialFactorsInfo createSpecialFactors(gov.va.med.esr.webservices.generated.SpecialFactorsInfo jaxbSpecialFactors) {
		if(jaxbSpecialFactors == null) return null;
		SpecialFactorsInfo specialFactorsInfo = new SpecialFactorsInfo();
		specialFactorsInfo.setAgentOrangeInd(jaxbSpecialFactors.isAgentOrangeInd());
		specialFactorsInfo.setAgentOrangeLocation(jaxbSpecialFactors.getAgentOrangeLocation());
		specialFactorsInfo.setEnvContaminantsInd(jaxbSpecialFactors.isEnvContaminantsInd());
		specialFactorsInfo.setRadiationExposureInd(jaxbSpecialFactors.isRadiationExposureInd());
		specialFactorsInfo.setRadiationExposureMethod(jaxbSpecialFactors.getRadiationExposureMethod());
		return specialFactorsInfo;
	}

	private static ServiceConnectionAwardInfo createServiceConnectionAwardInfo(gov.va.med.esr.webservices.generated.ServiceConnectionAwardInfo jaxbServiceConnectionAward) {
		if(jaxbServiceConnectionAward == null) return null;
		ServiceConnectionAwardInfo serviceConnectionAwardInfo = new ServiceConnectionAwardInfo();
		serviceConnectionAwardInfo.setAwardDate(jaxbServiceConnectionAward.getAwardDate());
		serviceConnectionAwardInfo.setCombinedServiceConnectedPercentageEffectiveDate(jaxbServiceConnectionAward.getCombinedServiceConnectedPercentageEffectiveDate());
		serviceConnectionAwardInfo.setPermanentAndTotal(jaxbServiceConnectionAward.isPermanentAndTotal());
		if(jaxbServiceConnectionAward.getPermanentAndTotalEffectiveDate() != null) serviceConnectionAwardInfo.setPermanentAndTotalEffectiveDate(new Date(jaxbServiceConnectionAward.getPermanentAndTotalEffectiveDate().getTime().getTime()));
		serviceConnectionAwardInfo.setRatedDisabilities(createRatedDisabilities(jaxbServiceConnectionAward.getRatedDisabilities()));
		serviceConnectionAwardInfo.setServiceConnectedIndicator(jaxbServiceConnectionAward.isServiceConnectedIndicator());
		serviceConnectionAwardInfo.setServiceConnectedPercentage(jaxbServiceConnectionAward.getServiceConnectedPercentage());
		serviceConnectionAwardInfo.setUnemployable(jaxbServiceConnectionAward.isUnemployable());
		return serviceConnectionAwardInfo;
	}

	private static RatedDisabilityCollection createRatedDisabilities(gov.va.med.esr.webservices.generated.RatedDisabilityCollection jaxbRatedDisabilities) {
		if(jaxbRatedDisabilities == null) return null;
		RatedDisabilityCollection collection = new RatedDisabilityCollection();
		collection.setRatedDisability(creatRatedDisability(jaxbRatedDisabilities.getRatedDisability()));
		return collection;
	}

	private static RatedDisabilityInfo[] creatRatedDisability(List<gov.va.med.esr.webservices.generated.RatedDisabilityInfo> jaxbRatedDisability) {
		if(jaxbRatedDisability == null) return null;
		RatedDisabilityInfo[] ratedDisabilityInfoArray = new RatedDisabilityInfo[jaxbRatedDisability.size()];
		for(int i = 0; i < jaxbRatedDisability.size(); i++){
			ratedDisabilityInfoArray[i] = createRatedDisabilityInfo(jaxbRatedDisability.get(i));
		}
		return ratedDisabilityInfoArray;
	}

	private static RatedDisabilityInfo createRatedDisabilityInfo(gov.va.med.esr.webservices.generated.RatedDisabilityInfo jaxbRatedDisabilityInfo) {
		if(jaxbRatedDisabilityInfo == null) return null;
		RatedDisabilityInfo ratedDisabilityInfo = new RatedDisabilityInfo();
		ratedDisabilityInfo.setDiagnosticExtremity(jaxbRatedDisabilityInfo.getDiagnosticExtremity());
		ratedDisabilityInfo.setDisability(jaxbRatedDisabilityInfo.getDisability());
		ratedDisabilityInfo.setDisabilityCode(jaxbRatedDisabilityInfo.getDisabilityCode());
		return ratedDisabilityInfo;
	}

	private static EligibilityInfo createPrimaryEligibilityInfo(gov.va.med.esr.webservices.generated.EligibilityInfo jaxbPrimaryEligibility) {
		if(jaxbPrimaryEligibility == null) return null;
		EligibilityInfo eligibilityInfo = new EligibilityInfo();
		//eligibilityInfo.setCreateDate(jaxbPrimaryEligibility.get);
		eligibilityInfo.setIndicator(jaxbPrimaryEligibility.getIndicator());
		//eligibilityInfo.setModifiedDate(jaxbPrimaryEligibility.get);
		eligibilityInfo.setType(jaxbPrimaryEligibility.getType());
		return eligibilityInfo;
	}

	private static EligibilityCollection createOtherEligibilities(gov.va.med.esr.webservices.generated.EligibilityCollection jaxbOtherEligibilities) {
		if(jaxbOtherEligibilities == null) return null;
		EligibilityCollection collection = new EligibilityCollection();
		collection.setEligibility(createEligibilityArray(jaxbOtherEligibilities.getEligibility()));
		return collection;
	}

	private static NoseThroatRadiumInfo createNoseThroatRadiumInfo(gov.va.med.esr.webservices.generated.NoseThroatRadiumInfo jaxbNoseThroatRadiumInfo) {
		if(jaxbNoseThroatRadiumInfo == null) return null;
		NoseThroatRadiumInfo noseThroatRadiumInfo = new NoseThroatRadiumInfo();
		noseThroatRadiumInfo.setDeterminationFacility(jaxbNoseThroatRadiumInfo.getDeterminationFacility());
		noseThroatRadiumInfo.setDiagnosedWithCancer(jaxbNoseThroatRadiumInfo.isDiagnosedWithCancer());
		if(jaxbNoseThroatRadiumInfo.getDiagnosisVerifiedDate() != null) noseThroatRadiumInfo.setDiagnosisVerifiedDate(new Date(jaxbNoseThroatRadiumInfo.getDiagnosisVerifiedDate().getTime().getTime()));
		noseThroatRadiumInfo.setFromAviatorServiceBefore1955(jaxbNoseThroatRadiumInfo.isFromAviatorServiceBefore1955());
		noseThroatRadiumInfo.setFromSubmarinerServiceBefore1965(jaxbNoseThroatRadiumInfo.isFromSubmarinerServiceBefore1965());
		noseThroatRadiumInfo.setReceivingTreatment(jaxbNoseThroatRadiumInfo.getReceivingTreatment());
		if(jaxbNoseThroatRadiumInfo.getVerificationDate() != null) noseThroatRadiumInfo.setVerificationDate(new Date(jaxbNoseThroatRadiumInfo.getVerificationDate().getTime().getTime()));
		noseThroatRadiumInfo.setVerificationFacility(jaxbNoseThroatRadiumInfo.getVerificationFacility());
		noseThroatRadiumInfo.setVerificationMethod(jaxbNoseThroatRadiumInfo.getVerificationMethod());
		return noseThroatRadiumInfo;
	}

	private static MonetaryBenefitAwardInfo createMonetaryBenefitAwardInfo(gov.va.med.esr.webservices.generated.MonetaryBenefitAwardInfo jaxbMonetaryBenefitAwardInfo) {
		if(jaxbMonetaryBenefitAwardInfo == null) return null;
		MonetaryBenefitAwardInfo monetaryBenefitAwardInfo = new MonetaryBenefitAwardInfo();
		monetaryBenefitAwardInfo.setCheckAmount(jaxbMonetaryBenefitAwardInfo.getCheckAmount());
		monetaryBenefitAwardInfo.setMonetaryBenefits(createMonetaryBenefits(jaxbMonetaryBenefitAwardInfo.getMonetaryBenefits()));
		return monetaryBenefitAwardInfo;
	}

	private static MonetaryBenefitCollection createMonetaryBenefits(gov.va.med.esr.webservices.generated.MonetaryBenefitCollection jaxbMonetaryBenefits) {
		if(jaxbMonetaryBenefits == null) return null;
		MonetaryBenefitCollection collection = new MonetaryBenefitCollection();
		collection.setMonetaryBenefit(createMonetaryBenefitArray(jaxbMonetaryBenefits.getMonetaryBenefit()));
		return collection;
	}

	private static MonetaryBenefitInfo[] createMonetaryBenefitArray(List<gov.va.med.esr.webservices.generated.MonetaryBenefitInfo> jaxbMonetaryBenefit) {
		if(jaxbMonetaryBenefit == null) return null;
		MonetaryBenefitInfo[] monetaryBenefitInfoArray = new MonetaryBenefitInfo[jaxbMonetaryBenefit.size()];
		for(int i = 0; i < jaxbMonetaryBenefit.size(); i++){
			monetaryBenefitInfoArray[i] = createMonetaryBenefitInfo(jaxbMonetaryBenefit.get(i));
		}
		return monetaryBenefitInfoArray;
	}

	private static MonetaryBenefitInfo createMonetaryBenefitInfo(gov.va.med.esr.webservices.generated.MonetaryBenefitInfo jaxbMonetaryBenefitInfo) {
		if(jaxbMonetaryBenefitInfo == null) return null;
		MonetaryBenefitInfo monetaryBenefitInfo = new MonetaryBenefitInfo();
		monetaryBenefitInfo.setMonetaryBenefitIndicator(jaxbMonetaryBenefitInfo.isMonetaryBenefitIndicator());
		if(jaxbMonetaryBenefitInfo.getMonetaryBenefitReportDate() != null) monetaryBenefitInfo.setMonetaryBenefitReportDate(new Date(jaxbMonetaryBenefitInfo.getMonetaryBenefitReportDate().getTime().getTime()));
		monetaryBenefitInfo.setType(jaxbMonetaryBenefitInfo.getType());
		return monetaryBenefitInfo;
	}

	private static MilitarySexualTraumaInfo createMilitarySexualTraumaInfo(gov.va.med.esr.webservices.generated.MilitarySexualTraumaInfo jaxbMilitarySexualTraumaInfo) {
		if(jaxbMilitarySexualTraumaInfo == null) return null;
		MilitarySexualTraumaInfo militarySexualTraumaInfo = new MilitarySexualTraumaInfo();
		militarySexualTraumaInfo.setDeterminationFacility(jaxbMilitarySexualTraumaInfo.getDeterminationFacility());
		militarySexualTraumaInfo.setStatus(jaxbMilitarySexualTraumaInfo.getStatus());
		if(jaxbMilitarySexualTraumaInfo.getStatusChangeDate() != null) militarySexualTraumaInfo.setStatusChangeDate(new Date(jaxbMilitarySexualTraumaInfo.getStatusChangeDate().getTime().getTime()));
		return militarySexualTraumaInfo;
	}

	private static IneligibilityFactorInfo createIneligibilityFactorInfo(gov.va.med.esr.webservices.generated.IneligibilityFactorInfo jaxbIneligibilityFactor) {
		if(jaxbIneligibilityFactor == null) return null;
		IneligibilityFactorInfo ineligibilityFactorInfo = new IneligibilityFactorInfo();
		ineligibilityFactorInfo.setFacilityReceived(jaxbIneligibilityFactor.getFacilityReceived());
		if(jaxbIneligibilityFactor.getIneligibleDate() != null) ineligibilityFactorInfo.setIneligibleDate(new Date(jaxbIneligibilityFactor.getIneligibleDate().getTime().getTime()));
		ineligibilityFactorInfo.setReason(jaxbIneligibilityFactor.getReason());
		if(jaxbIneligibilityFactor.getIneligibleDate() != null) ineligibilityFactorInfo.setRecordCreatedDate(new Date(jaxbIneligibilityFactor.getIneligibleDate().getTime().getTime()));
		ineligibilityFactorInfo.setVaroDecision(jaxbIneligibilityFactor.getVaroDecision());
		return ineligibilityFactorInfo;
	}

	private static EligibilityCollection createSecondaryEligibilities(gov.va.med.esr.webservices.generated.EligibilityCollection jaxbSecondaryEligibilities) {
		if(jaxbSecondaryEligibilities == null) return null;
		EligibilityCollection collection = new EligibilityCollection();
		collection.setEligibility(createEligibilityArray(jaxbSecondaryEligibilities.getEligibility()));
		return collection;
	}

	private static EligibilityInfo[] createEligibilityArray(List<gov.va.med.esr.webservices.generated.EligibilityInfo> jaxbEligibility) {
		if(jaxbEligibility == null) return null;
		EligibilityInfo[] eligibilityInfoArray = new EligibilityInfo[jaxbEligibility.size()];
		for(int i = 0; i < jaxbEligibility.size(); i++){
			eligibilityInfoArray[i] = createEligibilityInfo(jaxbEligibility.get(i));
		}
		return eligibilityInfoArray;
	}

	private static EligibilityInfo createEligibilityInfo(gov.va.med.esr.webservices.generated.EligibilityInfo jaxbEligibilityInfo) {
		EligibilityInfo eligibilityInfo = new EligibilityInfo();
		//eligibilityInfo.setCreateDate(jaxbEligibilityInfo.get);
		eligibilityInfo.setIndicator(jaxbEligibilityInfo.getIndicator());
		//.setModifiedDate(jaxbEligibilityInfo.get);
		eligibilityInfo.setType(jaxbEligibilityInfo.getType());
		return eligibilityInfo;
	}

	private static CatastrophicDisabilityInfo createCatastrophicDisabilityInfo(gov.va.med.esr.webservices.generated.CatastrophicDisabilityInfo jaxbCatastrophicDisabilityInfo) {
		if(jaxbCatastrophicDisabilityInfo == null) return null;
		CatastrophicDisabilityInfo catastrophicDisabilityInfo = new CatastrophicDisabilityInfo();
		catastrophicDisabilityInfo.setCatastrophicallyDisabled(jaxbCatastrophicDisabilityInfo.isCatastrophicallyDisabled());
		catastrophicDisabilityInfo.setCdConditions(createCdConditions(jaxbCatastrophicDisabilityInfo.getCdConditions()));
		catastrophicDisabilityInfo.setCdProcedures(createCdProcedures(jaxbCatastrophicDisabilityInfo.getCdProcedures()));
		if(jaxbCatastrophicDisabilityInfo.getDecisionDate() != null) catastrophicDisabilityInfo.setDecisionDate(new Date(jaxbCatastrophicDisabilityInfo.getDecisionDate().getTime().getTime()));
		catastrophicDisabilityInfo.setDeterminationFacility(jaxbCatastrophicDisabilityInfo.getDeterminationFacility());
		catastrophicDisabilityInfo.setDeterminationMethod(jaxbCatastrophicDisabilityInfo.getDeterminationMethod());
		catastrophicDisabilityInfo.setDeterminedBy(jaxbCatastrophicDisabilityInfo.getDeterminedBy());
		catastrophicDisabilityInfo.setDiagnoses(createDiagnoses(jaxbCatastrophicDisabilityInfo.getDiagnoses()));
		if(jaxbCatastrophicDisabilityInfo.getFacilityInitiatedCDReviewDate() != null) catastrophicDisabilityInfo.setFacilityInitiatedCDReviewDate(new Date(jaxbCatastrophicDisabilityInfo.getFacilityInitiatedCDReviewDate().getTime().getTime()));
		if(jaxbCatastrophicDisabilityInfo.getReviewDate() != null) catastrophicDisabilityInfo.setReviewDate(new Date(jaxbCatastrophicDisabilityInfo.getReviewDate().getTime().getTime()));
		if(jaxbCatastrophicDisabilityInfo.getVeteranRequestedCDReviewDate() != null) catastrophicDisabilityInfo.setVeteranRequestedCDReviewDate(new Date(jaxbCatastrophicDisabilityInfo.getVeteranRequestedCDReviewDate().getTime().getTime()));
		return catastrophicDisabilityInfo;
	}

	private static CDDiagnosisCollection createDiagnoses(CdDiagnosisCollection jaxbDiagnoses) {
		if(jaxbDiagnoses == null) return null;
		CDDiagnosisCollection collection = new CDDiagnosisCollection();
		collection.setDiagnosis(createDiagnosisArray(jaxbDiagnoses.getDiagnosis()));
		return collection;
	}

	private static String[] createDiagnosisArray(List<String> jaxbDiagnosis) {
		if(jaxbDiagnosis == null) return null;
		return jaxbDiagnosis.toArray(new String[0]);
	}

	private static CDProcedureCollection createCdProcedures(CdProcedureCollection jaxbCdProcedures) {
		if(jaxbCdProcedures == null) return null;
		CDProcedureCollection collection = new CDProcedureCollection();
		collection.setCdProcedure(createCdProcedureArray(jaxbCdProcedures.getCdProcedure()));
		return collection;
	}

	private static CDProcedureInfo[] createCdProcedureArray(List<gov.va.med.esr.webservices.generated.CdProcedureInfo> jaxbCdProcedure) {
		if(jaxbCdProcedure == null) return null;
		CDProcedureInfo[] cDProcedureInfoArray = new CDProcedureInfo[jaxbCdProcedure.size()];
		for(int i = 0; i < jaxbCdProcedure.size(); i++){
			cDProcedureInfoArray[i] = createCdProcedureInfo(jaxbCdProcedure.get(i));
		}
		return cDProcedureInfoArray;
	}

	private static CDProcedureInfo createCdProcedureInfo(CdProcedureInfo jaxbCdProcedureInfo) {
		if(jaxbCdProcedureInfo == null) return null;
		CDProcedureInfo cDProcedureInfo = new CDProcedureInfo();
		cDProcedureInfo.setAffectedExtremity(jaxbCdProcedureInfo.getAffectedExtremity());
		cDProcedureInfo.setProcedure(jaxbCdProcedureInfo.getProcedure());
		return cDProcedureInfo;
	}

	private static CDConditionCollection createCdConditions(CdConditionCollection jaxbCdConditions) {
		if(jaxbCdConditions == null) return null;
		CDConditionCollection collection = new CDConditionCollection();
		collection.setCdCondition(createCdConditionArray(jaxbCdConditions.getCdCondition()));
		return collection;
	}

	private static CDConditionInfo[] createCdConditionArray(List<gov.va.med.esr.webservices.generated.CdConditionInfo> jaxBCdConditions) {
		if(jaxBCdConditions == null) return null;
		CDConditionInfo[] cDConditionInfoArray = new CDConditionInfo[jaxBCdConditions.size()];
		for(int i = 0; i < jaxBCdConditions.size(); i++){
			cDConditionInfoArray[i] = createCdConditionInfo(jaxBCdConditions.get(i));
		}
		return cDConditionInfoArray;
	}

	private static CDConditionInfo createCdConditionInfo(CdConditionInfo jaxbCdConditionInfo) {
		if(jaxbCdConditionInfo == null) return null;
		CDConditionInfo cDConditionInfo = new CDConditionInfo();
		jaxbCdConditionInfo.setCondition(jaxbCdConditionInfo.getCondition());
		jaxbCdConditionInfo.setPermanentIndicator(jaxbCdConditionInfo.isPermanentIndicator());
		jaxbCdConditionInfo.setScore(jaxbCdConditionInfo.getScore());
		return cDConditionInfo;
	}

	private static CancelDeclineInfo createCancelDeclineInfo(gov.va.med.esr.webservices.generated.CancelDeclineInfo jaxbCancelDeclineInfo) {
		if(jaxbCancelDeclineInfo == null) return null;
		CancelDeclineInfo cancelDeclineInfo = new CancelDeclineInfo();
		cancelDeclineInfo.setCancelDeclineIndicator(jaxbCancelDeclineInfo.isCancelDeclineIndicator());
		cancelDeclineInfo.setReason(jaxbCancelDeclineInfo.getReason());
		cancelDeclineInfo.setRemarks(jaxbCancelDeclineInfo.getRemarks());
		return cancelDeclineInfo;
	}

	private static FeeBasisCollection createFeeBasisList(gov.va.med.esr.webservices.generated.FeeBasisCollection jaxbFeeBasisList) {
		if(jaxbFeeBasisList == null) return null;
		FeeBasisCollection collection = new FeeBasisCollection();
		collection.setFeeBasis(createFeeBasisArray(jaxbFeeBasisList.getFeeBasis()));
		return collection;
	}

	private static FeeBasisInfo[] createFeeBasisArray(List<gov.va.med.esr.webservices.generated.FeeBasisInfo> jaxbFeeBasis) {
		if(jaxbFeeBasis == null) return null;
		FeeBasisInfo[] feeBasisInfoArray = new FeeBasisInfo[jaxbFeeBasis.size()];
		for(int i = 0; i < jaxbFeeBasis.size(); i++){
			feeBasisInfoArray[i] = createFeeBasisInfo(jaxbFeeBasis.get(i));
		}
		return feeBasisInfoArray;
	}

	private static FeeBasisInfo createFeeBasisInfo(gov.va.med.esr.webservices.generated.FeeBasisInfo jaxbFeeBasisInfo) {
		if(jaxbFeeBasisInfo == null) return null;
		FeeBasisInfo feeBasisInfo = new FeeBasisInfo();
		if(jaxbFeeBasisInfo.getAuthorizationFromDate() != null) feeBasisInfo.setAuthorizationFromDate(new Date(jaxbFeeBasisInfo.getAuthorizationFromDate().getTime().getTime()));
		if(jaxbFeeBasisInfo.getAuthorizationToDate() != null) feeBasisInfo.setAuthorizationToDate(new Date(jaxbFeeBasisInfo.getAuthorizationToDate().getTime().getTime()));
		feeBasisInfo.setProgram(jaxbFeeBasisInfo.getProgram());
		if(jaxbFeeBasisInfo.getReportDate() != null) feeBasisInfo.setReportDate(new Date(jaxbFeeBasisInfo.getReportDate().getTime().getTime()));
		feeBasisInfo.setReportSite(jaxbFeeBasisInfo.getReportSite());
		feeBasisInfo.setTreatmentType(jaxbFeeBasisInfo.getTreatmentType());
		return feeBasisInfo;
	}

	private static FinancialsInfo createFinancialsInfo(gov.va.med.esr.webservices.generated.FinancialsInfo jaxbFinancialsInfo) {
		if(jaxbFinancialsInfo == null) return null;
		FinancialsInfo financialsInfo = new FinancialsInfo();
		financialsInfo.setBeneficiaryTravels(createBeneficiaryTravels(jaxbFinancialsInfo.getBeneficiaryTravels()));
		financialsInfo.setFinancialStatement(createFinancialStatementInfo(jaxbFinancialsInfo.getFinancialStatement()));
		financialsInfo.setIncomeTest(createIncomeTest(jaxbFinancialsInfo.getIncomeTest()));
		financialsInfo.setNonPrimaryFinancialsInfo(createNonPrimaryFinancialsInfo(jaxbFinancialsInfo.getNonPrimaryFinancialsInfo()));
		return financialsInfo;
	}

	private static NonPrimaryFinancialStatementCollection createNonPrimaryFinancialsInfo(gov.va.med.esr.webservices.generated.NonPrimaryFinancialStatementCollection jaxbNonPrimaryFinancialsInfo) {
		if(jaxbNonPrimaryFinancialsInfo == null) return null;
		NonPrimaryFinancialStatementCollection collection = new NonPrimaryFinancialStatementCollection();
		collection.setNonPrimaryFinancialStatement(createNonPrimaryFinancialStatementInfoArray(jaxbNonPrimaryFinancialsInfo.getNonPrimaryFinancialStatement()));
		return collection;
	}

	private static NonPrimaryFinancialStatementInfo[] createNonPrimaryFinancialStatementInfoArray(
			List<gov.va.med.esr.webservices.generated.NonPrimaryFinancialStatementInfo> jaxbNonPrimaryFinancialStatements) {
		if(jaxbNonPrimaryFinancialStatements == null) return null;
		NonPrimaryFinancialStatementInfo[] nonPrimaryFinancialStatementInfoArray = new NonPrimaryFinancialStatementInfo[jaxbNonPrimaryFinancialStatements.size()];
		for(int i = 0; i < jaxbNonPrimaryFinancialStatements.size(); i++){
			nonPrimaryFinancialStatementInfoArray[i] = createNonPrimaryFinancialStatementInfo(jaxbNonPrimaryFinancialStatements.get(i));
		}
		return nonPrimaryFinancialStatementInfoArray;
	}

	private static NonPrimaryFinancialStatementInfo createNonPrimaryFinancialStatementInfo(gov.va.med.esr.webservices.generated.NonPrimaryFinancialStatementInfo jaxbNonPrimaryFinancialStatement) {
		NonPrimaryFinancialStatementInfo nonPrimaryFinancialStatementInfo = new NonPrimaryFinancialStatementInfo();
		nonPrimaryFinancialStatementInfo.setFacilityVisitedCode(jaxbNonPrimaryFinancialStatement.getFacilityVisitedCode());
		nonPrimaryFinancialStatementInfo.setIncomeYear(jaxbNonPrimaryFinancialStatement.getIncomeYear());
		nonPrimaryFinancialStatementInfo.setInpatientDays(jaxbNonPrimaryFinancialStatement.getInpatientDays());
		if(jaxbNonPrimaryFinancialStatement.getLastVisitDate() != null) nonPrimaryFinancialStatementInfo.setLastVisitDate(new Date(jaxbNonPrimaryFinancialStatement.getLastVisitDate().getTime().getTime()));
		nonPrimaryFinancialStatementInfo.setOutpatientDays(jaxbNonPrimaryFinancialStatement.getOutpatientDays());
		if(jaxbNonPrimaryFinancialStatement.getVamcReportDate() != null) nonPrimaryFinancialStatementInfo.setVamcReportDate(new Date(jaxbNonPrimaryFinancialStatement.getVamcReportDate().getTime().getTime()));
		return nonPrimaryFinancialStatementInfo;
	}

	private static IncomeTestInfo createIncomeTest(gov.va.med.esr.webservices.generated.IncomeTestInfo jaxbIncomeTest) {
		if(jaxbIncomeTest == null) return null;
		IncomeTestInfo incomeTestInfo = new IncomeTestInfo();
		if(jaxbIncomeTest.getAdjudicationDate() != null) incomeTestInfo.setAdjudicationDate(new Date(jaxbIncomeTest.getAdjudicationDate().getTime().getTime()));
		incomeTestInfo.setAgreesToPayDeductible(jaxbIncomeTest.isAgreesToPayDeductible());
		incomeTestInfo.setCadAdjusted(jaxbIncomeTest.isCadAdjusted());
		incomeTestInfo.setChildIncomeExclusionThreshold(jaxbIncomeTest.getChildIncomeExclusionThreshold());
		incomeTestInfo.setComments(jaxbIncomeTest.getComments());
		if(jaxbIncomeTest.getDateMTNoLongerRequired() != null) incomeTestInfo.setDateMTNoLongerRequired(new Date(jaxbIncomeTest.getDateMTNoLongerRequired().getTime().getTime()));
		incomeTestInfo.setDeductibleExpenses(jaxbIncomeTest.getDeductibleExpenses());
		incomeTestInfo.setDiscloseFinancialInformation(jaxbIncomeTest.isDiscloseFinancialInformation());
		if(jaxbIncomeTest.getEffectiveDate() != null) incomeTestInfo.setEffectiveDate(new Date(jaxbIncomeTest.getEffectiveDate().getTime().getTime()));
		incomeTestInfo.setFutureTest(jaxbIncomeTest.isFutureTest());
		incomeTestInfo.setGmtThresholdAmount(jaxbIncomeTest.getGmtThresholdAmount());
		incomeTestInfo.setHardshipInfo(createHardshipInfo(jaxbIncomeTest.getHardshipInfo()));
		incomeTestInfo.setHardShipReason(jaxbIncomeTest.getHardShipReason());
		incomeTestInfo.setIncomeTestsource(jaxbIncomeTest.getIncomeTestsource());
		incomeTestInfo.setIncomeTestType(jaxbIncomeTest.getIncomeTestType());
		incomeTestInfo.setIncomeVerificationStatus(jaxbIncomeTest.getIncomeVerificationStatus());
		if(jaxbIncomeTest.getIncomeVerificationStatusDate() != null) incomeTestInfo.setIncomeVerificationStatusDate(new Date(jaxbIncomeTest.getIncomeVerificationStatusDate().getTime().getTime()));
		incomeTestInfo.setIncomeYear(jaxbIncomeTest.getIncomeYear());
		if(jaxbIncomeTest.getIvmTestCompletionDate() != null) incomeTestInfo.setIvmTestCompletionDate(new Date(jaxbIncomeTest.getIvmTestCompletionDate().getTime().getTime()));
		incomeTestInfo.setNetIncome(jaxbIncomeTest.getNetIncome());
		incomeTestInfo.setNetWorth(jaxbIncomeTest.getNetWorth());
		incomeTestInfo.setNetworthThreshold(jaxbIncomeTest.getNetworthThreshold());
		incomeTestInfo.setPensionThreshold(jaxbIncomeTest.getPensionThreshold());
		incomeTestInfo.setPreviousYearThresholdApplies(jaxbIncomeTest.isPreviousYearThresholdApplies());
		incomeTestInfo.setPrimaryIncomeTest(jaxbIncomeTest.isPrimaryIncomeTest());
		incomeTestInfo.setReasonMTNoLongerRequired(jaxbIncomeTest.getReasonMTNoLongerRequired());
		incomeTestInfo.setRefusedToSign(jaxbIncomeTest.isRefusedToSign());
		incomeTestInfo.setSendForAdjudication(jaxbIncomeTest.isSendForAdjudication());
		incomeTestInfo.setSiteConductingTest(jaxbIncomeTest.getSiteConductingTest());
		incomeTestInfo.setStatuses(createStatuses(jaxbIncomeTest.getStatuses()));
		incomeTestInfo.setThresholdA(jaxbIncomeTest.getThresholdA());
		incomeTestInfo.setTotalIncome(jaxbIncomeTest.getTotalIncome());
		incomeTestInfo.setTotalNumberOfDependents(jaxbIncomeTest.getTotalNumberOfDependents());
		return incomeTestInfo;
	}

	private static IncomeTestStatusCollection createStatuses(gov.va.med.esr.webservices.generated.IncomeTestStatusCollection jaxbStatuses) {
		if(jaxbStatuses == null) return null;
		IncomeTestStatusCollection collection = new IncomeTestStatusCollection();
		collection.setStatus(createIncomeTestStatusInfoArray(jaxbStatuses.getStatus()));
		return collection;
	}

	private static IncomeTestStatusInfo[] createIncomeTestStatusInfoArray(List<gov.va.med.esr.webservices.generated.IncomeTestStatusInfo> jaxbStatus) {
		if(jaxbStatus == null) return null;
		IncomeTestStatusInfo[] incomeTestStatusInfoArray = new IncomeTestStatusInfo[jaxbStatus.size()];
		for(int i = 0; i < jaxbStatus.size(); i++){
			incomeTestStatusInfoArray[i] = createIncomeTestStatusInfo((gov.va.med.esr.webservices.generated.IncomeTestStatusInfo)jaxbStatus.get(i));
		}
		return incomeTestStatusInfoArray;
	}

	private static IncomeTestStatusInfo createIncomeTestStatusInfo(gov.va.med.esr.webservices.generated.IncomeTestStatusInfo jaxbIncomeTestStatusInfo) {
		if(jaxbIncomeTestStatusInfo == null) return null;
		IncomeTestStatusInfo incomeTestStatusInfo = new IncomeTestStatusInfo();
		if(jaxbIncomeTestStatusInfo.getCompletedDate() != null) incomeTestStatusInfo.setCompletedDate(new Date(jaxbIncomeTestStatusInfo.getCompletedDate().getTime().getTime()));
		incomeTestStatusInfo.setDeterminedStatus(jaxbIncomeTestStatusInfo.getDeterminedStatus());
		incomeTestStatusInfo.setIncomeTestType(jaxbIncomeTestStatusInfo.getIncomeTestType());
		if(jaxbIncomeTestStatusInfo.getLastEditedDate() != null) incomeTestStatusInfo.setLastEditedDate(new Date(jaxbIncomeTestStatusInfo.getLastEditedDate().getTime().getTime()));
		incomeTestStatusInfo.setStatus(jaxbIncomeTestStatusInfo.getStatus());
		return incomeTestStatusInfo;
	}

	private static HardshipInfo createHardshipInfo(gov.va.med.esr.webservices.generated.HardshipInfo jaxbHardshipInfo) {
		if(jaxbHardshipInfo == null) return null;
		HardshipInfo hardshipInfo = new HardshipInfo();
		if(jaxbHardshipInfo.getEffectiveDate() != null) hardshipInfo.setEffectiveDate(new Date(jaxbHardshipInfo.getEffectiveDate().getTime().getTime()));
		hardshipInfo.setHardshipGranted(jaxbHardshipInfo.isHardshipGranted());
		hardshipInfo.setReason(jaxbHardshipInfo.getReason());
		if(jaxbHardshipInfo.getReviewDate() != null) hardshipInfo.setReviewDate(new Date(jaxbHardshipInfo.getReviewDate().getTime().getTime()));
		hardshipInfo.setSiteGrantingHardship(jaxbHardshipInfo.getSiteGrantingHardship());
		return hardshipInfo;
	}

	private static FinancialStatementInfo createFinancialStatementInfo(gov.va.med.esr.webservices.generated.FinancialStatementInfo jaxbFinancialStatement) {
		if(jaxbFinancialStatement == null) return null;
		FinancialStatementInfo financialStatementInfo = new FinancialStatementInfo();
		financialStatementInfo.setAssets(createAssets(jaxbFinancialStatement.getAssets()));
		financialStatementInfo.setContributionToSpouse(jaxbFinancialStatement.getContributionToSpouse());
		financialStatementInfo.setDebits(createDebitInfo(jaxbFinancialStatement.getDebits()));
		financialStatementInfo.setDependentFinancialsList(createDependentFinancialsList(jaxbFinancialStatement.getDependentFinancialsList()));
		financialStatementInfo.setExpenses(createExpenses(jaxbFinancialStatement.getExpenses()));
		financialStatementInfo.setIncomes(createIncomes(jaxbFinancialStatement.getIncomes()));
		financialStatementInfo.setIncomeYear(jaxbFinancialStatement.getIncomeYear());
		financialStatementInfo.setInpatientDays(jaxbFinancialStatement.getInpatientDays());
		if(jaxbFinancialStatement.getLastVisitDate() != null)financialStatementInfo.setLastVisitDate(new Date(jaxbFinancialStatement.getLastVisitDate().getTime().getTime()));	
		financialStatementInfo.setMarriedLastCalendarYear(jaxbFinancialStatement.isMarriedLastCalendarYear());
		financialStatementInfo.setNumberOfDependentChildren(jaxbFinancialStatement.getNumberOfDependentChildren());
		financialStatementInfo.setOutpatientDays(jaxbFinancialStatement.getOutpatientDays());
		financialStatementInfo.setSpouseFinancialsList(createSpouseFinancialsList(jaxbFinancialStatement.getSpouseFinancialsList()));
		if(jaxbFinancialStatement.getVamcReportDate() != null) financialStatementInfo.setVamcReportDate(new Date(jaxbFinancialStatement.getVamcReportDate().getTime().getTime()));
		return null;
		
	}

	private static SpouseFinancialsCollection createSpouseFinancialsList(gov.va.med.esr.webservices.generated.SpouseFinancialsCollection jaxbSpouseFinancialsList) {
		if(jaxbSpouseFinancialsList == null) return null;
		SpouseFinancialsCollection collection = new SpouseFinancialsCollection();
		collection.setSpouseFinancials(createSpouseFinancialsInfoArray(jaxbSpouseFinancialsList.getSpouseFinancials()));
		return collection;
	}

	private static SpouseFinancialsInfo[] createSpouseFinancialsInfoArray(List<gov.va.med.esr.webservices.generated.SpouseFinancialsInfo> jaxbSpouseFinancials) {
		if(jaxbSpouseFinancials == null) return null;
		SpouseFinancialsInfo[] spouseFinancialsInfoArray = new SpouseFinancialsInfo[jaxbSpouseFinancials.size()];
		for(int i = 0; i < jaxbSpouseFinancials.size(); i++){
			spouseFinancialsInfoArray[0] = createSpouseFinancialsInfo(jaxbSpouseFinancials.get(i));
		}
		
		return spouseFinancialsInfoArray;
	}

	private static SpouseFinancialsInfo createSpouseFinancialsInfo(gov.va.med.esr.webservices.generated.SpouseFinancialsInfo jaxbSpouseFinancialsInfo) {
		if(jaxbSpouseFinancialsInfo == null) return null;
		SpouseFinancialsInfo spouseFinancialsInfo = new SpouseFinancialsInfo();
		spouseFinancialsInfo.setAssets(createAssets(jaxbSpouseFinancialsInfo.getAssets()));
		spouseFinancialsInfo.setDebits(createDebitInfo(jaxbSpouseFinancialsInfo.getDebits()));
		spouseFinancialsInfo.setExpenses(createExpenses(jaxbSpouseFinancialsInfo.getExpenses()));
		spouseFinancialsInfo.setIncomes(createIncomes(jaxbSpouseFinancialsInfo.getIncomes()));
		spouseFinancialsInfo.setIncomeYear(jaxbSpouseFinancialsInfo.getIncomeYear());
		spouseFinancialsInfo.setInpatientDays(jaxbSpouseFinancialsInfo.getInpatientDays());
		spouseFinancialsInfo.setLivedWithPatient(jaxbSpouseFinancialsInfo.isLivedWithPatient());
		spouseFinancialsInfo.setOutpatientDays(jaxbSpouseFinancialsInfo.getOutpatientDays());
		spouseFinancialsInfo.setSpouse(createSpouseInfo(jaxbSpouseFinancialsInfo.getSpouse()));
		spouseFinancialsInfo.setValidDependent(jaxbSpouseFinancialsInfo.isValidDependent());
		return spouseFinancialsInfo;
	}

	private static SpouseInfo createSpouseInfo(gov.va.med.esr.webservices.generated.SpouseInfo jaxbSpouse) {
		if(jaxbSpouse == null) return null;
		SpouseInfo spouseInfo = new SpouseInfo();
		spouseInfo.setAddress(createAddressInfo(jaxbSpouse.getAddress()));
		spouseInfo.setDob(jaxbSpouse.getDob());
		spouseInfo.setEmployments(createEmploymentInfo(jaxbSpouse.getEmployment()));
		if(jaxbSpouse.getEndDate() != null) spouseInfo.setEndDate(new Date(jaxbSpouse.getEndDate().getTime().getTime()));
		spouseInfo.setFamilyName(jaxbSpouse.getFamilyName());
		spouseInfo.setGender(jaxbSpouse.getGender());
		spouseInfo.setGivenName(jaxbSpouse.getGivenName());
		spouseInfo.setMaidenName(jaxbSpouse.getMaidenName());
		spouseInfo.setMiddleName(jaxbSpouse.getMiddleName());
		spouseInfo.setPrefix(jaxbSpouse.getPrefix());
		spouseInfo.setRelationship(jaxbSpouse.getRelationship());
		spouseInfo.setSsns(createSsns(jaxbSpouse.getSsns()));
		spouseInfo.setStartDate(jaxbSpouse.getStartDate());
		spouseInfo.setSuffix(jaxbSpouse.getSuffix());
		return spouseInfo;
	}

	private static SSNCollection createSsns(SsnCollection jaxbSsns) {
		if(jaxbSsns == null) return null;
		SSNCollection collection = new SSNCollection();
		collection.setSsn(createSsnInfoArray(jaxbSsns.getSsn()));
		return collection;
	}

	private static SSNInfo[] createSsnInfoArray(List<gov.va.med.esr.webservices.generated.SsnInfo> jaxbSsn) {
		if(jaxbSsn == null) return null;
		SSNInfo[] ssnInfoArray = new SSNInfo[jaxbSsn.size()];
		for(int i = 0; i < jaxbSsn.size(); i++){
			ssnInfoArray[i] = createSsnInfo(jaxbSsn.get(i));
		}
		return ssnInfoArray;
	}

	private static SSNInfo createSsnInfo(SsnInfo jaxbSsnInfo) {
		if(jaxbSsnInfo == null) return null;
		SSNInfo SSNInfo = new SSNInfo();
		SSNInfo.setPseudoSSNReason(jaxbSsnInfo.getPseudoSSNReason());
		SSNInfo.setSourceOfChange(jaxbSsnInfo.getSourceOfChange());
		SSNInfo.setSsaMessage(jaxbSsnInfo.getSsaMessage());
		if(jaxbSsnInfo.getSsaReceivedDate() != null) SSNInfo.setSsaReceivedDate(new Date(jaxbSsnInfo.getSsaReceivedDate().getTime().getTime()));
		if(jaxbSsnInfo.getSsaSentDate() != null) SSNInfo.setSsaSentDate(new Date(jaxbSsnInfo.getSsaSentDate().getTime().getTime()));
		if(jaxbSsnInfo.getSsaVerificationDate() != null) SSNInfo.setSsaVerificationDate(new Date(jaxbSsnInfo.getSsaVerificationDate().getTime().getTime()));
		SSNInfo.setSsaVerificationStatus(jaxbSsnInfo.getSsaVerificationStatus());
		SSNInfo.setSsnText(jaxbSsnInfo.getSsnText());
		SSNInfo.setType(jaxbSsnInfo.getType());
		return SSNInfo;
	}

	private static IncomeCollection createIncomes(gov.va.med.esr.webservices.generated.IncomeCollection jaxbIncomes) {
		if(jaxbIncomes == null) return null;
		IncomeCollection collection = new IncomeCollection();
		collection.setIncome(createIncomeInfoArray(jaxbIncomes.getIncome()));
		return collection;
	}

	private static IncomeInfo[] createIncomeInfoArray(List<gov.va.med.esr.webservices.generated.IncomeInfo> jaxbIncomes) {
		if(jaxbIncomes == null) return null;
		IncomeInfo[] incomeInfoArray = new IncomeInfo[jaxbIncomes.size()];
		for(int i = 0; i < jaxbIncomes.size(); i++){
			incomeInfoArray[i] = createIncomeInfo(jaxbIncomes.get(i));
		}
		return incomeInfoArray;
	}

	private static IncomeInfo createIncomeInfo(gov.va.med.esr.webservices.generated.IncomeInfo jaxbIncomeInfo) {
		if(jaxbIncomeInfo == null) return null;
		IncomeInfo incomeInfo = new IncomeInfo();
		incomeInfo.setAmount(jaxbIncomeInfo.getAmount());
		if(jaxbIncomeInfo.getIncomeReportDate() != null) incomeInfo.setIncomeReportDate(new Date(jaxbIncomeInfo.getIncomeReportDate().getTime().getTime()));
		incomeInfo.setType(jaxbIncomeInfo.getType());
		return incomeInfo;
	}

	private static ExpenseCollection createExpenses(gov.va.med.esr.webservices.generated.ExpenseCollection jaxbExpenses) {
		if(jaxbExpenses == null) return null;
		ExpenseCollection collection = new ExpenseCollection();
		collection.setExpense(createExpenseInfoArray(jaxbExpenses.getExpense()));
		return collection;
	}

	private static ExpenseInfo[] createExpenseInfoArray(List<gov.va.med.esr.webservices.generated.ExpenseInfo> jaxbExpenses) {
		if(jaxbExpenses == null) return null;
		ExpenseInfo[] expenseInfoArray = new ExpenseInfo[jaxbExpenses.size()];
		for(int i = 0; i < jaxbExpenses.size(); i++){
			expenseInfoArray[i] = createExpenseInfo(jaxbExpenses.get(i));
		}
		return expenseInfoArray;
	}

	private static ExpenseInfo createExpenseInfo(gov.va.med.esr.webservices.generated.ExpenseInfo jaxbExpenseInfo) {
		if(jaxbExpenseInfo == null) return null;
		ExpenseInfo expenseInfo = new ExpenseInfo();
		expenseInfo.setAmount(jaxbExpenseInfo.getAmount());
		if(jaxbExpenseInfo.getExpenseReportDate() != null) expenseInfo.setExpenseReportDate(new Date(jaxbExpenseInfo.getExpenseReportDate().getTime().getTime()));
		expenseInfo.setExpenseType(jaxbExpenseInfo.getExpenseType());
		return expenseInfo;
	}

	private static DependentFinancialsCollection createDependentFinancialsList(gov.va.med.esr.webservices.generated.DependentFinancialsCollection jaxbDependentFinancialsList) {
		if(jaxbDependentFinancialsList == null) return null;
		DependentFinancialsCollection collection = new DependentFinancialsCollection();
		collection.setDependentFinancials(createDependentFinancialsInfoArray(jaxbDependentFinancialsList.getDependentFinancials()));
		return collection;
	}

	private static DependentFinancialsInfo[] createDependentFinancialsInfoArray(List<gov.va.med.esr.webservices.generated.DependentFinancialsInfo> jaxbDependentFinancials) {
		if(jaxbDependentFinancials == null) return null;
		DependentFinancialsInfo[] dependentFinancialsInfoArray = new DependentFinancialsInfo[jaxbDependentFinancials.size()];
		for(int i = 0; i < jaxbDependentFinancials.size(); i++){
			dependentFinancialsInfoArray[0] = createDependentFinancialsInfo(jaxbDependentFinancials.get(i));
		}
		return dependentFinancialsInfoArray;
	}

	private static DependentFinancialsInfo createDependentFinancialsInfo(gov.va.med.esr.webservices.generated.DependentFinancialsInfo jaxbDependentFinancialsInfo) {
		if(jaxbDependentFinancialsInfo == null) return null;
		DependentFinancialsInfo dependentFinancialsInfo = new DependentFinancialsInfo();
		dependentFinancialsInfo.setAmountContributedToSupport(jaxbDependentFinancialsInfo.getAmountContributedToSupport());
		dependentFinancialsInfo.setAssets(createAssets(jaxbDependentFinancialsInfo.getAssets()));
		dependentFinancialsInfo.setAttendedSchool(jaxbDependentFinancialsInfo.isAttendedSchool());
		dependentFinancialsInfo.setContributedToSupport(jaxbDependentFinancialsInfo.isContributedToSupport());
		dependentFinancialsInfo.setDebits(createDebitInfo(jaxbDependentFinancialsInfo.getDebits()));
		dependentFinancialsInfo.setDependentInfo(createDependentInfo(jaxbDependentFinancialsInfo.getDependentInfo()));
		dependentFinancialsInfo.setExpenses(createExpenses(jaxbDependentFinancialsInfo.getExpenses()));
		dependentFinancialsInfo.setHasIncome(jaxbDependentFinancialsInfo.isHasIncome());
		dependentFinancialsInfo.setIncapableOfSelfSupport(jaxbDependentFinancialsInfo.isIncapableOfSelfSupport());
		dependentFinancialsInfo.setIncomeAvailableToPatient(jaxbDependentFinancialsInfo.isIncomeAvailableToPatient());
		dependentFinancialsInfo.setIncomes(createIncomes(jaxbDependentFinancialsInfo.getIncomes()));
		dependentFinancialsInfo.setIncomeYear(jaxbDependentFinancialsInfo.getIncomeYear());
		dependentFinancialsInfo.setInpatientDays(jaxbDependentFinancialsInfo.getInpatientDays());
		dependentFinancialsInfo.setLivedWithPatient(jaxbDependentFinancialsInfo.isLivedWithPatient());
		dependentFinancialsInfo.setOutpatientDays(jaxbDependentFinancialsInfo.getOutpatientDays());
		dependentFinancialsInfo.setValidDependent(jaxbDependentFinancialsInfo.isValidDependent());
		return dependentFinancialsInfo;
	}

	private static DependentInfo createDependentInfo(gov.va.med.esr.webservices.generated.DependentInfo jaxbDependentInfo) {
		if(jaxbDependentInfo == null) return null;
		DependentInfo dependentInfo = new DependentInfo();
		dependentInfo.setDob(jaxbDependentInfo.getDob());
		if(jaxbDependentInfo.getEndDate() != null) dependentInfo.setEndDate(new Date(jaxbDependentInfo.getEndDate().getTime().getTime()));
		dependentInfo.setFamilyName(jaxbDependentInfo.getFamilyName());
		dependentInfo.setGender(jaxbDependentInfo.getGender());
		dependentInfo.setGivenName(jaxbDependentInfo.getGivenName());
		dependentInfo.setMiddleName(jaxbDependentInfo.getMiddleName());
		dependentInfo.setPrefix(jaxbDependentInfo.getPrefix());
		dependentInfo.setRelationship(jaxbDependentInfo.getRelationship());
		dependentInfo.setSsns(createSsns(jaxbDependentInfo.getSsns()));
		dependentInfo.setStartDate(jaxbDependentInfo.getStartDate());
		dependentInfo.setSuffix(jaxbDependentInfo.getSuffix());
		return dependentInfo;
	}

	private static DebitInfo createDebitInfo(gov.va.med.esr.webservices.generated.DebitInfo jaxbDebit) {
		if(jaxbDebit == null) return null;
		DebitInfo debitInfo = new DebitInfo();
		debitInfo.setAmount(jaxbDebit.getAmount());
		return debitInfo;
	}

	private static AssetCollection createAssets(gov.va.med.esr.webservices.generated.AssetCollection jaxbAssets) {
		if(jaxbAssets == null) return null;
		AssetCollection collection = new AssetCollection();
		collection.setAsset(createAssetArray(jaxbAssets.getAsset()));
		return collection;
	}

	private static AssetInfo[] createAssetArray(List<gov.va.med.esr.webservices.generated.AssetInfo> jaxbAssets) {
		if(jaxbAssets == null) return null;
		AssetInfo[] assetInfoArray= new AssetInfo[jaxbAssets.size()];
		for(int i=0; i < jaxbAssets.size(); i++){
			assetInfoArray[0] = createAssetInfo(jaxbAssets.get(i));
		}
		return assetInfoArray;
	}

	private static AssetInfo createAssetInfo(gov.va.med.esr.webservices.generated.AssetInfo jaxbAssetInfo) {
		if(jaxbAssetInfo == null) return null;
		AssetInfo assetInfo = new AssetInfo();
		assetInfo.setAmount(jaxbAssetInfo.getAmount());
		if(jaxbAssetInfo.getAssetReportDate() != null) assetInfo.setAssetReportDate(new Date(jaxbAssetInfo.getAssetReportDate().getTime().getTime()));
		assetInfo.setAssetType(jaxbAssetInfo.getAssetType());
		return assetInfo;
	}

	private static BeneficiaryTravelCollection createBeneficiaryTravels(gov.va.med.esr.webservices.generated.BeneficiaryTravelCollection jaxbBeneficiaryTravels) {
		if(jaxbBeneficiaryTravels == null) return null;
		BeneficiaryTravelCollection collection = new BeneficiaryTravelCollection();
		collection.setBeneficiaryTravel(createBeneficiaryTravelInfoArray(jaxbBeneficiaryTravels.getBeneficiaryTravel()));
		return collection;
	}

	private static BeneficiaryTravelInfo[] createBeneficiaryTravelInfoArray(List<gov.va.med.esr.webservices.generated.BeneficiaryTravelInfo> jaxbBeneficiaryTravel) {
		if(jaxbBeneficiaryTravel == null) return null;
		BeneficiaryTravelInfo[] beneficiaryTravelInfoArray = new BeneficiaryTravelInfo[jaxbBeneficiaryTravel.size()];
		for(int i = 0; i < jaxbBeneficiaryTravel.size(); i++){
			beneficiaryTravelInfoArray[i] = createBeneficiaryTravelInfo(jaxbBeneficiaryTravel.get(i));
		}
		return beneficiaryTravelInfoArray;
	}

	private static BeneficiaryTravelInfo createBeneficiaryTravelInfo(gov.va.med.esr.webservices.generated.BeneficiaryTravelInfo jaxbBeneficiaryTravelInfo) {
		if(jaxbBeneficiaryTravelInfo == null) return null;
		BeneficiaryTravelInfo beneficiaryTravelInfo = new BeneficiaryTravelInfo();
		beneficiaryTravelInfo.setAmountCertified(jaxbBeneficiaryTravelInfo.getAmountCertified());
		if(jaxbBeneficiaryTravelInfo.getDateCertified() != null) beneficiaryTravelInfo.setDateCertified(new Date(jaxbBeneficiaryTravelInfo.getDateCertified().getTime().getTime()));
		beneficiaryTravelInfo.setEligible(jaxbBeneficiaryTravelInfo.isEligible());
		return beneficiaryTravelInfo;
	}

	private static IncompetenceRulingInfo createIncompetenceRulingInfo(gov.va.med.esr.webservices.generated.IncompetenceRulingInfo jaxbIncompetenceRulingInfo) {
		if(jaxbIncompetenceRulingInfo == null) return null;
		IncompetenceRulingInfo incompetenceRulingInfo = new IncompetenceRulingInfo();
		incompetenceRulingInfo.setCivilRulingDate(jaxbIncompetenceRulingInfo.getCivilRulingDate());
		incompetenceRulingInfo.setIncompetent(jaxbIncompetenceRulingInfo.isIncompetent());
		incompetenceRulingInfo.setVaRulingDate(jaxbIncompetenceRulingInfo.getVaRulingDate());
		return incompetenceRulingInfo;
	}

	private static InsuranceCollection createInsuranceList(gov.va.med.esr.webservices.generated.InsuranceCollection jaxbInsuranceList) {
		if(jaxbInsuranceList == null) return null;
		InsuranceCollection collection = new InsuranceCollection();
		collection.setInsurance(createInsuranceInfoArray(jaxbInsuranceList.getInsurance()));
		return collection;
	}

	private static InsuranceInfo[] createInsuranceInfoArray(List<gov.va.med.esr.webservices.generated.InsuranceInfo> jaxbInsurances) {
		if(jaxbInsurances == null) return null;
		InsuranceInfo[] insuranceInfoArray = new InsuranceInfo[jaxbInsurances.size()];
		for(int i = 0; i < jaxbInsurances.size(); i++){
			insuranceInfoArray[i] = createInsuranceInfo(jaxbInsurances.get(i));
		}
		return insuranceInfoArray;
	}

	private static InsuranceInfo createInsuranceInfo(gov.va.med.esr.webservices.generated.InsuranceInfo jaxbInsuranceInfo) {
		if(jaxbInsuranceInfo == null) return null;
		InsuranceInfo insuranceInfo = new InsuranceInfo();
		insuranceInfo.setCompanyName(jaxbInsuranceInfo.getCompanyName());
		insuranceInfo.setEnrolledInPartA(jaxbInsuranceInfo.isEnrolledInPartA());
		insuranceInfo.setEnrolledInPartB(jaxbInsuranceInfo.isEnrolledInPartB());
		insuranceInfo.setGroupName(jaxbInsuranceInfo.getGroupName());
		insuranceInfo.setGroupNumber(jaxbInsuranceInfo.getGroupNumber());
		insuranceInfo.setInsAddress(createAddressInfo(jaxbInsuranceInfo.getInsAddress()));
		insuranceInfo.setInsuranceMappingTypeName(jaxbInsuranceInfo.getInsuranceMappingTypeName());
		insuranceInfo.setInsurancePhones(createPhones(jaxbInsuranceInfo.getInsurancePhones()));
		insuranceInfo.setInsuranceSiteUploadStatus(jaxbInsuranceInfo.getInsuranceSiteUploadStatus());
		insuranceInfo.setInsuredRelationship(jaxbInsuranceInfo.getInsuredRelationship());
		if(jaxbInsuranceInfo.getLastEditedDate() != null) insuranceInfo.setLastEditedDate(new Date(jaxbInsuranceInfo.getLastEditedDate().getTime().getTime()));
		insuranceInfo.setPartAEffectiveDate(jaxbInsuranceInfo.getPartAEffectiveDate());
		insuranceInfo.setPartBEffectiveDate(jaxbInsuranceInfo.getPartBEffectiveDate());
		insuranceInfo.setPlanType(jaxbInsuranceInfo.getPlanType());
		insuranceInfo.setPolicyEffectiveDate(jaxbInsuranceInfo.getPolicyEffectiveDate());
		insuranceInfo.setPolicyExpirationDate(jaxbInsuranceInfo.getPolicyExpirationDate());
		insuranceInfo.setPolicyHolderName(jaxbInsuranceInfo.getPolicyHolderName());
		insuranceInfo.setPolicyNumber(jaxbInsuranceInfo.getPolicyNumber());
		insuranceInfo.setPreadmitCertification(jaxbInsuranceInfo.isPreadmitCertification());
		insuranceInfo.setReasonInsuranceNotUploaded(jaxbInsuranceInfo.getReasonInsuranceNotUploaded());
		insuranceInfo.setSubscriber(jaxbInsuranceInfo.getSubscriber());		
		return insuranceInfo;
	}

	private static MilitaryServiceInfo createMilitaryServiceInfo(gov.va.med.esr.webservices.generated.MilitaryServiceInfo jaxbMilitaryServiceInfo) {
		if(jaxbMilitaryServiceInfo == null) return null;
		MilitaryServiceInfo militaryServiceInfo = new MilitaryServiceInfo();
		if(jaxbMilitaryServiceInfo.getClassIIDentalApplicationDueBefore() != null) militaryServiceInfo.setClassIIDentalApplicationDueBefore(jaxbMilitaryServiceInfo.getClassIIDentalApplicationDueBefore().getTime());
		militaryServiceInfo.setCombatEpisodes(createCombatEpisodes(jaxbMilitaryServiceInfo.getCombatEpisodes()));
		if(jaxbMilitaryServiceInfo.getCombatVeteranEligibilityEndDate() != null) militaryServiceInfo.setCombatVeteranEligibilityEndDate(new Date(jaxbMilitaryServiceInfo.getCombatVeteranEligibilityEndDate().getTime().getTime()));
		militaryServiceInfo.setDisabilityRetirementIndicator(jaxbMilitaryServiceInfo.isDisabilityRetirementIndicator());
		militaryServiceInfo.setDischargeDueToDisability(jaxbMilitaryServiceInfo.isDischargeDueToDisability());
		militaryServiceInfo.setEligibleForClassIIDental(jaxbMilitaryServiceInfo.isEligibleForClassIIDental());
		militaryServiceInfo.setMedalofHonorIndicator(jaxbMilitaryServiceInfo.isMedalofHonorIndicator());
		militaryServiceInfo.setMilitaryServiceSiteRecords(createMilitaryServiceSiteRecords(jaxbMilitaryServiceInfo.getMilitaryServiceSiteRecords()));
		militaryServiceInfo.setShadIndicator(jaxbMilitaryServiceInfo.isShadIndicator());
		return militaryServiceInfo;
	}

	private static MilitaryServiceSiteRecordCollection createMilitaryServiceSiteRecords(gov.va.med.esr.webservices.generated.MilitaryServiceSiteRecordCollection jaxbMilitaryServiceSiteRecords) {
		if(jaxbMilitaryServiceSiteRecords == null) return null;
		MilitaryServiceSiteRecordCollection collection = new MilitaryServiceSiteRecordCollection();
		collection.setMilitaryServiceSiteRecord(createMilitaryServiceSiteRecordArray(jaxbMilitaryServiceSiteRecords.getMilitaryServiceSiteRecord()));
		return collection;
	}

	private static MilitaryServiceSiteRecordInfo[] createMilitaryServiceSiteRecordArray(List<gov.va.med.esr.webservices.generated.MilitaryServiceSiteRecordInfo> jaxbMilitaryServiceSiteRecord) {
		if(jaxbMilitaryServiceSiteRecord == null) return null;
		MilitaryServiceSiteRecordInfo[] militaryServiceSiteRecordInfoArray = new MilitaryServiceSiteRecordInfo[jaxbMilitaryServiceSiteRecord.size()];
		for(int i = 0; i < jaxbMilitaryServiceSiteRecord.size(); i++){
			militaryServiceSiteRecordInfoArray[i] = createMilitaryServiceSiteRecordInfo(jaxbMilitaryServiceSiteRecord.get(i));
		}
		return militaryServiceSiteRecordInfoArray;
	}

	private static MilitaryServiceSiteRecordInfo createMilitaryServiceSiteRecordInfo(gov.va.med.esr.webservices.generated.MilitaryServiceSiteRecordInfo jaxbMilitaryServiceSiteRecordInfo) {
		if(jaxbMilitaryServiceSiteRecordInfo == null) return null;
		MilitaryServiceSiteRecordInfo militaryServiceSiteRecordInfo = new MilitaryServiceSiteRecordInfo();
		militaryServiceSiteRecordInfo.setConflictExperiences(createConflictExperiences(jaxbMilitaryServiceSiteRecordInfo.getConflictExperiences()));
		militaryServiceSiteRecordInfo.setMilitaryServiceEpisodes(createMilitaryServiceEpisodes(jaxbMilitaryServiceSiteRecordInfo.getMilitaryServiceEpisodes()));
		militaryServiceSiteRecordInfo.setServicePeriod(jaxbMilitaryServiceSiteRecordInfo.getServicePeriod());
		militaryServiceSiteRecordInfo.setSite(jaxbMilitaryServiceSiteRecordInfo.getSite());
		return null;
	}

	private static MilitaryServiceEpisodeCollection createMilitaryServiceEpisodes(gov.va.med.esr.webservices.generated.MilitaryServiceEpisodeCollection jaxbMilitaryServiceEpisodes) {
		if(jaxbMilitaryServiceEpisodes == null) return null;
		MilitaryServiceEpisodeCollection collection = new MilitaryServiceEpisodeCollection();
		collection.setMilitaryServiceEpisode(createMilitaryServiceEpisodeArray(jaxbMilitaryServiceEpisodes.getMilitaryServiceEpisode()));
		return collection;
	}

	private static MilitaryServiceEpisodeInfo[] createMilitaryServiceEpisodeArray(List<gov.va.med.esr.webservices.generated.MilitaryServiceEpisodeInfo> jaxbMilitaryServiceEpisode) {
		if(jaxbMilitaryServiceEpisode == null) return null;
		MilitaryServiceEpisodeInfo[] militaryServiceEpisodeInfoArray = new MilitaryServiceEpisodeInfo[jaxbMilitaryServiceEpisode.size()];
		for(int i = 0; i < jaxbMilitaryServiceEpisode.size(); i++){
			militaryServiceEpisodeInfoArray[i] = createMilitaryServiceEpisodeInfo(jaxbMilitaryServiceEpisode.get(i));
		}
		return militaryServiceEpisodeInfoArray;
	}

	private static MilitaryServiceEpisodeInfo createMilitaryServiceEpisodeInfo(gov.va.med.esr.webservices.generated.MilitaryServiceEpisodeInfo jaxbMilitaryServiceEpisodeInfo) {
		if(jaxbMilitaryServiceEpisodeInfo == null) return null;
		MilitaryServiceEpisodeInfo militaryServiceEpisodeInfo = new MilitaryServiceEpisodeInfo();
		militaryServiceEpisodeInfo.setDischargeType(jaxbMilitaryServiceEpisodeInfo.getDischargeType());
		militaryServiceEpisodeInfo.setEndDate(jaxbMilitaryServiceEpisodeInfo.getEndDate());
		militaryServiceEpisodeInfo.setServiceBranch(jaxbMilitaryServiceEpisodeInfo.getServiceBranch());
		militaryServiceEpisodeInfo.setServiceNumber(jaxbMilitaryServiceEpisodeInfo.getServiceNumber());
		militaryServiceEpisodeInfo.setStartDate(jaxbMilitaryServiceEpisodeInfo.getStartDate());
		return militaryServiceEpisodeInfo;
	}

	private static ConflictExperienceCollection createConflictExperiences(gov.va.med.esr.webservices.generated.ConflictExperienceCollection jaxbConflictExperiences) {
		if(jaxbConflictExperiences == null) return null;
		ConflictExperienceCollection collection = new ConflictExperienceCollection();
		collection.setConflictExperience(createConflictExperiences(jaxbConflictExperiences.getConflictExperience()));
		return collection;
	}

	private static ConflictExperienceInfo[] createConflictExperiences(List<gov.va.med.esr.webservices.generated.ConflictExperienceInfo> jaxbConflictExperience) {
		if(jaxbConflictExperience == null) return null;
		ConflictExperienceInfo[] cconflictExperienceInfoArray = new ConflictExperienceInfo[jaxbConflictExperience.size()];
		for(int i = 0; i < jaxbConflictExperience.size(); i++){
			cconflictExperienceInfoArray[i] = createConflictExperienceInfo(jaxbConflictExperience.get(i));
		}
		return cconflictExperienceInfoArray;
	}

	private static ConflictExperienceInfo createConflictExperienceInfo(gov.va.med.esr.webservices.generated.ConflictExperienceInfo jaxbConflictExperienceInfo) {
		if(jaxbConflictExperienceInfo == null) return null;
		ConflictExperienceInfo conflictExperienceInfo = new ConflictExperienceInfo();
		conflictExperienceInfo.setConflictLocation(jaxbConflictExperienceInfo.getConflictLocation());
		conflictExperienceInfo.setEndDate(jaxbConflictExperienceInfo.getEndDate());
		conflictExperienceInfo.setStartDate(jaxbConflictExperienceInfo.getStartDate());
		return conflictExperienceInfo;
	}

	private static CombatEpisodeCollection createCombatEpisodes(gov.va.med.esr.webservices.generated.CombatEpisodeCollection jaxbCombatEpisodes) {
		if(jaxbCombatEpisodes == null) return null;
		CombatEpisodeCollection collection = new CombatEpisodeCollection();
		collection.setCombatEpisode(createCombatEpisodeArray(jaxbCombatEpisodes.getCombatEpisode()));
		return collection;
	}

	private static CombatEpisodeInfo[] createCombatEpisodeArray(List<gov.va.med.esr.webservices.generated.CombatEpisodeInfo> jaxbCombatEpisodes) {
		if(jaxbCombatEpisodes == null) return null;
		CombatEpisodeInfo[] combatEpisodeInfoArray = new CombatEpisodeInfo[jaxbCombatEpisodes.size()];
		for(int i = 0; i < jaxbCombatEpisodes.size(); i++){
			combatEpisodeInfoArray[i] = createCombatEpisodeInfo(jaxbCombatEpisodes.get(i));
		}
		return combatEpisodeInfoArray;
	}

	private static CombatEpisodeInfo createCombatEpisodeInfo(gov.va.med.esr.webservices.generated.CombatEpisodeInfo jaxbCombatEpisodeInfo) {
		if(jaxbCombatEpisodeInfo == null) return null;
		CombatEpisodeInfo combatEpisodeInfo = new CombatEpisodeInfo();
		combatEpisodeInfo.setCombatPayType(jaxbCombatEpisodeInfo.getCombatPayType());
		combatEpisodeInfo.setConflictLocation(jaxbCombatEpisodeInfo.getConflictLocation());
		combatEpisodeInfo.setEndDate(jaxbCombatEpisodeInfo.getEndDate());
		combatEpisodeInfo.setOEFOIFSource(jaxbCombatEpisodeInfo.getOEFOIFSource());
		combatEpisodeInfo.setOEFOIFStationNumber(jaxbCombatEpisodeInfo.getOEFOIFStationNumber());
		combatEpisodeInfo.setStartDate(jaxbCombatEpisodeInfo.getStartDate());
		return combatEpisodeInfo;
	}

	private static PersonInfo createPersonInfo(gov.va.med.esr.webservices.generated.PersonInfo jaxbPerson) {
		if(jaxbPerson == null) return null;
		PersonInfo personInfo = new PersonInfo();
		personInfo.setDob(jaxbPerson.getDob());
		personInfo.setFirstName(jaxbPerson.getFirstName());
		personInfo.setGender(jaxbPerson.getGender());
		personInfo.setLastName(jaxbPerson.getLastName());
		personInfo.setMiddleName(jaxbPerson.getMiddleName());
		personInfo.setMothersMaidenName(jaxbPerson.getMothersMaidenName());
		personInfo.setNames(createNames(jaxbPerson.getNames()));
		personInfo.setPlaceOfBirthCity(jaxbPerson.getPlaceOfBirthCity());
		personInfo.setPlaceOfBirthState(jaxbPerson.getPlaceOfBirthState());
		personInfo.setPrefix(jaxbPerson.getPrefix());
		if(jaxbPerson.getSsaVerificationDate() != null) personInfo.setSsaVerificationDate(new Date(jaxbPerson.getSsaVerificationDate().getTime().getTime()));
		personInfo.setSsaVerificationStatus(jaxbPerson.getSsaVerificationStatus());
		personInfo.setSsnText(jaxbPerson.getSsnText());
		personInfo.setSuffix(jaxbPerson.getSuffix());
		personInfo.setVamcData(createVamcData(jaxbPerson.getVamcData()));
		return personInfo;
	}

	private static VamcDataCollection createVamcData(gov.va.med.esr.webservices.generated.VamcDataCollection jaxbVamcDatas) {
		if(jaxbVamcDatas == null) return null;
		VamcDataCollection collection = new VamcDataCollection();
		collection.setVamcInfo(createVamcInfoArray(jaxbVamcDatas.getVamcInfo()));
		return collection;
	}

	private static VamcInfo[] createVamcInfoArray(List<gov.va.med.esr.webservices.generated.VamcInfo> jaxbVamcInfos) {
		if(jaxbVamcInfos == null) return null;
		VamcInfo[] vamcInfoArray = new VamcInfo[jaxbVamcInfos.size()];
		for(int i = 0; i < jaxbVamcInfos.size(); i++){
			vamcInfoArray[i] = createVamcInfo(jaxbVamcInfos.get(i));
		}
		return vamcInfoArray;
	}

	private static VamcInfo createVamcInfo(gov.va.med.esr.webservices.generated.VamcInfo jaxbVamcInfo) {
		if(jaxbVamcInfo == null) return null; 
		VamcInfo vamcInfo = new VamcInfo();
		vamcInfo.setDfnNumber(jaxbVamcInfo.getDfnNumber());
		vamcInfo.setFacilityNumber(jaxbVamcInfo.getFacilityNumber());
		if(jaxbVamcInfo.getLastVisitDate() != null) vamcInfo.setLastVisitDate(new Date(jaxbVamcInfo.getLastVisitDate().getTime().getTime()));
		if(jaxbVamcInfo.getVamcReportDate() != null) vamcInfo.setVamcReportDate(new Date(jaxbVamcInfo.getVamcReportDate().getTime().getTime()));
		return vamcInfo;
	}

	private static NameCollection createNames(gov.va.med.esr.webservices.generated.NameCollection jaxbNames) {
		if(jaxbNames == null) return null;
		NameCollection collection = new NameCollection();
		collection.setName(createNameArray(jaxbNames.getName()));
		return collection;
	}

	private static NameInfo[] createNameArray(List<gov.va.med.esr.webservices.generated.NameInfo> jaxbNames) {
		if(jaxbNames == null) return null;
		NameInfo[] nameInfoArray = new NameInfo[jaxbNames.size()];
		for(int i = 0; i < jaxbNames.size(); i++){
			nameInfoArray[i] = createNameInfo(jaxbNames.get(i));
		}
		return nameInfoArray;
	}

	private static NameInfo createNameInfo(gov.va.med.esr.webservices.generated.NameInfo jaxbNameInfo) {
		if(jaxbNameInfo == null) return null;
		NameInfo nameInfo = new NameInfo();
		nameInfo.setOtherName(jaxbNameInfo.getOtherName());
		return nameInfo;
	}

	private static PrisonerOfWarInfo createPrisonerOfWarInfo(gov.va.med.esr.webservices.generated.PrisonerOfWarInfo jaxbPrisonerOfWarInfo) {
		if(jaxbPrisonerOfWarInfo == null) return null;
		PrisonerOfWarInfo prisonerOfWarInfo = new PrisonerOfWarInfo();
		prisonerOfWarInfo.setEpisodes(createEpisodes(jaxbPrisonerOfWarInfo.getEpisodes()));
		prisonerOfWarInfo.setPowIndicator(jaxbPrisonerOfWarInfo.getPowIndicator());
		return prisonerOfWarInfo;
	}

	private static POWEpisodeCollection createEpisodes(gov.va.med.esr.webservices.generated.PowEpisodeCollection jaxbEpisodes) {
		if(jaxbEpisodes == null) return null;
		POWEpisodeCollection collection = new POWEpisodeCollection();
		collection.setEpisode(createEpisodeArray(jaxbEpisodes.getEpisode()));
		return collection;
	}

	private static POWEpisodeInfo[] createEpisodeArray(List<gov.va.med.esr.webservices.generated.PowEpisodeInfo> jaxbEpisode) {
		if(jaxbEpisode == null) return null;
		POWEpisodeInfo[] powEpisodeInfoArray = new POWEpisodeInfo[jaxbEpisode.size()];
		for(int i = 0; i < jaxbEpisode.size(); i++){
			powEpisodeInfoArray[i] = createPOWEpisodeInfo(jaxbEpisode.get(i));
		}
		return powEpisodeInfoArray;
	}

	private static POWEpisodeInfo createPOWEpisodeInfo(PowEpisodeInfo jaxbPowEpisodeInfo) {
		if(jaxbPowEpisodeInfo == null) return null;
		POWEpisodeInfo powEpisodeInfo = new POWEpisodeInfo();
		powEpisodeInfo.setCaptureDate(jaxbPowEpisodeInfo.getCaptureDate());
		powEpisodeInfo.setDataSource(jaxbPowEpisodeInfo.getDataSource());
		powEpisodeInfo.setDocumentType(jaxbPowEpisodeInfo.getDocumentType());
		powEpisodeInfo.setReleaseDate(jaxbPowEpisodeInfo.getReleaseDate());
		return powEpisodeInfo;
	}

	private static PurpleHeartInfo createPurpleHeartInfo(gov.va.med.esr.webservices.generated.PurpleHeartInfo jaxbPurpleHeart) {
		if(jaxbPurpleHeart == null) return null;
		PurpleHeartInfo purpleHeartInfo = new PurpleHeartInfo();
		purpleHeartInfo.setStatus(jaxbPurpleHeart.getStatus());
		purpleHeartInfo.setIndicator(new Boolean(true));
		return purpleHeartInfo;
	}

	private static RelationCollection createRelations(gov.va.med.esr.webservices.generated.RelationCollection jaxbRelations) {
		if(jaxbRelations == null) return null;
		RelationCollection collection = new RelationCollection();
		collection.setRelation(createRelationArray(jaxbRelations.getRelation()));
		return collection;
	}

	private static RelationInfo[] createRelationArray(List<gov.va.med.esr.webservices.generated.RelationInfo> jaxbRelations) {
		if(jaxbRelations == null) return null;
		RelationInfo[] relationInfoArray = new RelationInfo[jaxbRelations.size()];
		for(int i = 0; i < jaxbRelations.size(); i++){
			relationInfoArray[i] = createRelationInfo(jaxbRelations.get(i));
		}
		return relationInfoArray;
	}

	private static RelationInfo createRelationInfo(gov.va.med.esr.webservices.generated.RelationInfo jaxbRelationInfo) {
		if(jaxbRelationInfo == null) return null;
		RelationInfo relationInfo = new RelationInfo();
		relationInfo.setDob(jaxbRelationInfo.getDob());
		if(jaxbRelationInfo.getEndDate() != null) relationInfo.setEndDate(new Date(jaxbRelationInfo.getEndDate().getTime().getTime()));
		relationInfo.setFamilyName(jaxbRelationInfo.getFamilyName());
		relationInfo.setGender(jaxbRelationInfo.getGender());
		relationInfo.setMiddleName(jaxbRelationInfo.getMiddleName());
		//relationInfo.setPrefix(jaxbRelationInfo.get);
		relationInfo.setRelationship(jaxbRelationInfo.getRelationship());
		relationInfo.setSsns(createSsns(jaxbRelationInfo.getSsns()));
		relationInfo.setStartDate(jaxbRelationInfo.getStartDate());
		//relationInfo.setSuffix(jaxbRelationInfo.get);
		return relationInfo;
	}

	private static SensitivityInfo createSensitivityInfo(gov.va.med.esr.webservices.generated.SensitivityInfo jaxbSensitivityInfo) {
		if(jaxbSensitivityInfo == null) return null;
		SensitivityInfo sensitivityInfo = new SensitivityInfo();
		if(jaxbSensitivityInfo.getSensitivityChangeDate() != null)  sensitivityInfo.setSensitivityChangeDate(new Date(jaxbSensitivityInfo.getSensitivityChangeDate().getTime().getTime()));
		sensitivityInfo.setSensitivityChangeSite(jaxbSensitivityInfo.getSensitivityChangeSite());
		sensitivityInfo.setSensitivityChangeSource(jaxbSensitivityInfo.getSensitivityChangeSource());
		sensitivityInfo.setSensityFlag(jaxbSensitivityInfo.isSensityFlag());
		return sensitivityInfo;
	}

	private static SpinalCordInjuryInfo createSpinalCordInjuryInfo(gov.va.med.esr.webservices.generated.SpinalCordInjuryInfo jaxbSpinalCordInjuryInfo) {
		if(jaxbSpinalCordInjuryInfo == null) return null;
		SpinalCordInjuryInfo spinalCordInjuryInfo = new SpinalCordInjuryInfo();
		spinalCordInjuryInfo.setDeterminationFacility(jaxbSpinalCordInjuryInfo.getDeterminationFacility());
		spinalCordInjuryInfo.setSpinalCordInjuryType(jaxbSpinalCordInjuryInfo.getSpinalCordInjuryType());
		return spinalCordInjuryInfo;
	}

}
