private AdditionalInformation getAdditionalInformation() {
        AdditionalInformation additionalInformation = AdditionalInformation.Factory.newInstance();
        additionalInformation.setCitizenship(CitizenshipDataType.U_S_CITIZEN_OR_NONCITIZEN_NATIONAL);
        StemCells stemCells = StemCells.Factory.newInstance();
        stemCells.setIsHumanStemCellsInvolved(YesNoDataType.N_NO);
        stemCells.setStemCellsIndicator(YesNoDataType.N_NO);
        GraduateDegreeSought graduateDegreeSought = GraduateDegreeSought.Factory.newInstance();
        ProposalPersonContract principalInvestigator = s2SProposalPersonService.getPrincipalInvestigator(pdDoc);
        ArrayList<String> cellLinesList = new ArrayList<>(Arrays.asList(stemCells.getCellLinesArray()));
		for (ProposalPersonContract proposalPerson : pdDoc.getDevelopmentProposal().getProposalPersons()) {
			if (proposalPerson.isPrincipalInvestigator()) {
				CitizenshipType citizenShip=s2SProposalPersonService.getCitizenship(proposalPerson);
				if(citizenShip!=null && StringUtils.isNotBlank(citizenShip.getCitizenShip())){
					if(citizenShip.getCitizenShip().trim().equals(CitizenshipDataType.NON_U_S_CITIZEN_WITH_TEMPORARY_VISA.toString())){
						additionalInformation.setCitizenship(CitizenshipDataType.NON_U_S_CITIZEN_WITH_TEMPORARY_VISA);
					}
					else if(citizenShip.getCitizenShip().trim().equals(CitizenshipDataType.PERMANENT_RESIDENT_OF_U_S.toString())){
						additionalInformation.setCitizenship(CitizenshipDataType.PERMANENT_RESIDENT_OF_U_S);
					}
					else if(citizenShip.getCitizenShip().trim().equals(CitizenshipDataType.U_S_CITIZEN_OR_NONCITIZEN_NATIONAL.toString())){
						additionalInformation.setCitizenship(CitizenshipDataType.U_S_CITIZEN_OR_NONCITIZEN_NATIONAL);
					}
					else if(citizenShip.getCitizenShip().trim().equals(CitizenshipDataType.PERMANENT_RESIDENT_OF_U_S_PENDING.toString())){
						additionalInformation.setCitizenship(CitizenshipDataType.PERMANENT_RESIDENT_OF_U_S_PENDING);
					}
				}else{
					additionalInformation.setCitizenship(null);
				}
			}
		}
		if (principalInvestigator != null && principalInvestigator.getMobilePhoneNumber() != null) {
			additionalInformation.setAlernatePhoneNumber(principalInvestigator.getMobilePhoneNumber());
		}
        List<? extends AnswerHeaderContract> answerHeaders = getPropDevQuestionAnswerService().getQuestionnaireAnswerHeaders(pdDoc.getDevelopmentProposal().getProposalNumber(), getNamespace(), getFormName());
		for (AnswerHeaderContract answerHeader : answerHeaders) {
            for (AnswerContract questionnaireAnswer : answerHeader.getAnswers()) {
                String answer = questionnaireAnswer.getAnswer();

                Integer seqId = getQuestionAnswerService().findQuestionById(questionnaireAnswer.getQuestionId()).getQuestionSeqId();
                if(seqId.equals(STEMCELLLINES)){
                    List<AnswerContract> answerList = getAnswers(questionnaireAnswer.getQuestionnaireQuestionsId(),answerHeader);
                    for (AnswerContract questionnaireAnswerBO: answerList) {
                        String questionnaireSubAnswer =  questionnaireAnswerBO.getAnswer();
                        if(questionnaireSubAnswer!=null){
                            cellLinesList.add(questionnaireSubAnswer);
                            stemCells.addCellLines(questionnaireSubAnswer);
                        }
                    }
                }

                if (answer != null) {
                    switch (seqId) {
                        case BROAD_TRAINING:
                case FIELD_TRAINING:
                            if (!answer.toUpperCase().equals(SUB_CATEGORY_NOT_FOUND)) {
                                FieldOfTrainingDataType.Enum e = FieldOfTrainingDataType.Enum.forString(answer);
                                additionalInformation.setFieldOfTraining(e);
                            }
                            break;
                case NRSA_SUPPORT:
                            additionalInformation
                                    .setCurrentPriorNRSASupportIndicator(answer
                                            .equals(YnqConstant.YES.code()) ? YesNoDataType.Y_YES
                                            : YesNoDataType.N_NO);
                            break;
                case SUBMITTED_DIFF_INST:
                            additionalInformation
                                    .setChangeOfInstitution(answer
                                            .equals(YnqConstant.YES.code()) ? YesNoDataType.Y_YES
                                            : YesNoDataType.N_NO);
                            break;
                case FORMER_INST:
                            additionalInformation.setFormerInstitution(answer);
                            break;
                case STEMCELLS:
                            stemCells
                                    .setIsHumanStemCellsInvolved(answer
                                            .equals(YnqConstant.YES.code()) ? YesNoDataType.Y_YES
                                            : YesNoDataType.N_NO);
                            break;
                case CELLLINEIND:
                            stemCells.setStemCellsIndicator(answer
                                    .equals(YnqConstant.YES.code()) ? YesNoDataType.Y_YES
                                    : YesNoDataType.N_NO);
                            break;

                case DEGREE_TYPE_SOUGHT:
                            graduateDegreeSought.setDegreeType(DegreeTypeDataType.Enum.forString(answer));
                            break;
                case DEG_EXP_COMP_DATE:
                            graduateDegreeSought.setDegreeDate(answer.substring(6, 10)
                                    + STRING_SEPRATOR + answer.substring(0, 2));
                            break;
                case OTHER_MASTERS:
                            graduateDegreeSought.setOtherDegreeTypeText(answer);
                            break;
                case OTHER_DOCT:
                            graduateDegreeSought.setOtherDegreeTypeText(answer);
                            break;
                case OTHER_DDOT:
                            graduateDegreeSought.setDegreeType(DegreeTypeDataType.DDOT_OTHER_DOCTOR_OF_MEDICAL_DENTISTRY);
                            graduateDegreeSought.setOtherDegreeTypeText(answer);
                            break;
                case OTHER_VDOT:
                            graduateDegreeSought.setDegreeType(DegreeTypeDataType.VDOT_OTHER_DOCTOR_OF_VETERINARY_MEDICINE);
                            graduateDegreeSought.setOtherDegreeTypeText(answer);
                            break;
                case OTHER_DBOTH:
                            graduateDegreeSought.setDegreeType(DegreeTypeDataType.DBOTH_OTHER_DOUBLE_DEGREE_PROGRAM);
                            graduateDegreeSought.setOtherDegreeTypeText(answer);
                            break;
                case OTHER_MDOT:
                            graduateDegreeSought.setDegreeType(DegreeTypeDataType.MDOT_OTHER_DOCTOR_OF_MEDICINE);
                            graduateDegreeSought.setOtherDegreeTypeText(answer);
                            break;
                        default:
                            break;
                    }
                }
            }
        }

        additionalInformation.setStemCells(stemCells);
        if(graduateDegreeSought.getDegreeType()!=null){
            additionalInformation.setGraduateDegreeSought(graduateDegreeSought);
        }
        additionalInformation
                .setCurrentPriorNRSASupportArray(getCurrentPriorNRSASupportArray());
        additionalInformation.setConcurrentSupport(YesNoDataType.N_NO);
        FellowshipTrainingAndCareerGoals fellowshipTrainingAndCareerGoals = FellowshipTrainingAndCareerGoals.Factory.newInstance();
        ActivitiesPlannedUnderThisAward activitiesPlannedUnderThisAward = ActivitiesPlannedUnderThisAward.Factory.newInstance();

        AttachedFileDataType attachedFileDataType = null;
        for (NarrativeContract narrative : pdDoc.getDevelopmentProposal()
                .getNarratives()) {
            if (narrative.getNarrativeType().getCode() != null) {
                switch (Integer.parseInt(narrative.getNarrativeType().getCode())) {
                case CONCURRENT_SUPPORT:
                    attachedFileDataType = getAttachedFileType(narrative);
                    if(attachedFileDataType == null){
                        continue;
                    }
                    ConcurrentSupportDescription concurrentSupportDescription = ConcurrentSupportDescription.Factory
                            .newInstance();
                    concurrentSupportDescription
                            .setAttFile(attachedFileDataType);
                    additionalInformation
                            .setConcurrentSupport(YesNoDataType.Y_YES);
                    additionalInformation
                            .setConcurrentSupportDescription(concurrentSupportDescription);
                    break;
                case FELLOWSHIP:
                    attachedFileDataType = getAttachedFileType(narrative);
                    if(attachedFileDataType == null){
                        continue;
                    }
                    fellowshipTrainingAndCareerGoals.setAttFile(attachedFileDataType);
                    break;
                case DISSERTATION:
                    attachedFileDataType = getAttachedFileType(narrative);
                    if(attachedFileDataType == null){
                        continue;
                    }
                    DissertationAndResearchExperience dissertationAndResearchExperience = DissertationAndResearchExperience.Factory
                            .newInstance();
                    dissertationAndResearchExperience
                            .setAttFile(attachedFileDataType);
                    additionalInformation
                            .setDissertationAndResearchExperience(dissertationAndResearchExperience);
                    break;
                case ACTIVITIES:
                    attachedFileDataType = getAttachedFileType(narrative);
                    if(attachedFileDataType == null){
                        continue;
                    }
                    activitiesPlannedUnderThisAward.setAttFile(attachedFileDataType);
                    break;
                default:
                    break;

                }
            }
        }
        additionalInformation.setFellowshipTrainingAndCareerGoals(fellowshipTrainingAndCareerGoals);
        additionalInformation.setActivitiesPlannedUnderThisAward(activitiesPlannedUnderThisAward);
        return additionalInformation;
    }
private AdditionalInformation getAdditionalInformation ( ) { AdditionalInformation additionalInformation = AdditionalInformation . Factory . newInstance ( ) ; additionalInformation . setCitizenship ( CitizenshipDataType . U_S_CITIZEN_OR_NONCITIZEN_NATIONAL ) ; StemCells stemCells = StemCells . Factory . newInstance ( ) ; stemCells . setIsHumanStemCellsInvolved ( YesNoDataType . N_NO ) ; stemCells . setStemCellsIndicator ( YesNoDataType . N_NO ) ; GraduateDegreeSought graduateDegreeSought = GraduateDegreeSought . Factory . newInstance ( ) ; ProposalPersonContract principalInvestigator = s2SProposalPersonService . getPrincipalInvestigator ( pdDoc ) ; ArrayList < String > cellLinesList = new ArrayList < > ( Arrays . asList ( stemCells . getCellLinesArray ( ) ) ) ; for ( ProposalPersonContract proposalPerson : pdDoc . getDevelopmentProposal ( ) . getProposalPersons ( ) ) { if ( proposalPerson . isPrincipalInvestigator ( ) ) { CitizenshipType citizenShip = s2SProposalPersonService . getCitizenship ( proposalPerson ) ; if ( citizenShip != null && StringUtils . isNotBlank ( citizenShip . getCitizenShip ( ) ) ) { if ( citizenShip . getCitizenShip ( ) . trim ( ) . equals ( CitizenshipDataType . NON_U_S_CITIZEN_WITH_TEMPORARY_VISA . toString ( ) ) ) { additionalInformation . setCitizenship ( CitizenshipDataType . NON_U_S_CITIZEN_WITH_TEMPORARY_VISA ) ; } else if ( citizenShip . getCitizenShip ( ) . trim ( ) . equals ( CitizenshipDataType . PERMANENT_RESIDENT_OF_U_S . toString ( ) ) ) { additionalInformation . setCitizenship ( CitizenshipDataType . PERMANENT_RESIDENT_OF_U_S ) ; } else if ( citizenShip . getCitizenShip ( ) . trim ( ) . equals ( CitizenshipDataType . U_S_CITIZEN_OR_NONCITIZEN_NATIONAL . toString ( ) ) ) { additionalInformation . setCitizenship ( CitizenshipDataType . U_S_CITIZEN_OR_NONCITIZEN_NATIONAL ) ; } else if ( citizenShip . getCitizenShip ( ) . trim ( ) . equals ( CitizenshipDataType . PERMANENT_RESIDENT_OF_U_S_PENDING . toString ( ) ) ) { additionalInformation . setCitizenship ( CitizenshipDataType . PERMANENT_RESIDENT_OF_U_S_PENDING ) ; } } else { additionalInformation . setCitizenship ( null ) ; } } } if ( principalInvestigator != null && principalInvestigator . getMobilePhoneNumber ( ) != null ) { additionalInformation . setAlernatePhoneNumber ( principalInvestigator . getMobilePhoneNumber ( ) ) ; } List < ? extends AnswerHeaderContract > answerHeaders = getPropDevQuestionAnswerService ( ) . getQuestionnaireAnswerHeaders ( pdDoc . getDevelopmentProposal ( ) . getProposalNumber ( ) , getNamespace ( ) , getFormName ( ) ) ; for ( AnswerHeaderContract answerHeader : answerHeaders ) { for ( AnswerContract questionnaireAnswer : answerHeader . getAnswers ( ) ) { String answer = questionnaireAnswer . getAnswer ( ) ; Integer seqId = getQuestionAnswerService ( ) . findQuestionById ( questionnaireAnswer . getQuestionId ( ) ) . getQuestionSeqId ( ) ; if ( seqId . equals ( STEMCELLLINES ) ) { List < AnswerContract > answerList = getAnswers ( questionnaireAnswer . getQuestionnaireQuestionsId ( ) , answerHeader ) ; for ( AnswerContract questionnaireAnswerBO : answerList ) { String questionnaireSubAnswer = questionnaireAnswerBO . getAnswer ( ) ; if ( questionnaireSubAnswer != null ) { cellLinesList . add ( questionnaireSubAnswer ) ; stemCells . addCellLines ( questionnaireSubAnswer ) ; } } } if ( answer != null ) { switch ( seqId ) { case BROAD_TRAINING : case FIELD_TRAINING : if ( ! answer . toUpperCase ( ) . equals ( SUB_CATEGORY_NOT_FOUND ) ) { FieldOfTrainingDataType . Enum e = FieldOfTrainingDataType . Enum . forString ( answer ) ; additionalInformation . setFieldOfTraining ( e ) ; } break ; case NRSA_SUPPORT : additionalInformation . setCurrentPriorNRSASupportIndicator ( answer . equals ( YnqConstant . YES . code ( ) ) ? YesNoDataType . Y_YES : YesNoDataType . N_NO ) ; break ; case SUBMITTED_DIFF_INST : additionalInformation . setChangeOfInstitution ( answer . equals ( YnqConstant . YES . code ( ) ) ? YesNoDataType . Y_YES : YesNoDataType . N_NO ) ; break ; case FORMER_INST : additionalInformation . setFormerInstitution ( answer ) ; break ; case STEMCELLS : stemCells . setIsHumanStemCellsInvolved ( answer . equals ( YnqConstant . YES . code ( ) ) ? YesNoDataType . Y_YES : YesNoDataType . N_NO ) ; break ; case CELLLINEIND : stemCells . setStemCellsIndicator ( answer . equals ( YnqConstant . YES . code ( ) ) ? YesNoDataType . Y_YES : YesNoDataType . N_NO ) ; break ; case DEGREE_TYPE_SOUGHT : graduateDegreeSought . setDegreeType ( DegreeTypeDataType . Enum . forString ( answer ) ) ; break ; case DEG_EXP_COMP_DATE : graduateDegreeSought . setDegreeDate ( answer . substring ( 6 , 10 ) + STRING_SEPRATOR + answer . substring ( 0 , 2 ) ) ; break ; case OTHER_MASTERS : graduateDegreeSought . setOtherDegreeTypeText ( answer ) ; break ; case OTHER_DOCT : graduateDegreeSought . setOtherDegreeTypeText ( answer ) ; break ; case OTHER_DDOT : graduateDegreeSought . setDegreeType ( DegreeTypeDataType . DDOT_OTHER_DOCTOR_OF_MEDICAL_DENTISTRY ) ; graduateDegreeSought . setOtherDegreeTypeText ( answer ) ; break ; case OTHER_VDOT : graduateDegreeSought . setDegreeType ( DegreeTypeDataType . VDOT_OTHER_DOCTOR_OF_VETERINARY_MEDICINE ) ; graduateDegreeSought . setOtherDegreeTypeText ( answer ) ; break ; case OTHER_DBOTH : graduateDegreeSought . setDegreeType ( DegreeTypeDataType . DBOTH_OTHER_DOUBLE_DEGREE_PROGRAM ) ; graduateDegreeSought . setOtherDegreeTypeText ( answer ) ; break ; case OTHER_MDOT : graduateDegreeSought . setDegreeType ( DegreeTypeDataType . MDOT_OTHER_DOCTOR_OF_MEDICINE ) ; graduateDegreeSought . setOtherDegreeTypeText ( answer ) ; break ; default : break ; } } } } additionalInformation . setStemCells ( stemCells ) ; if ( graduateDegreeSought . getDegreeType ( ) != null ) { additionalInformation . setGraduateDegreeSought ( graduateDegreeSought ) ; } additionalInformation . setCurrentPriorNRSASupportArray ( getCurrentPriorNRSASupportArray ( ) ) ; additionalInformation . setConcurrentSupport ( YesNoDataType . N_NO ) ; FellowshipTrainingAndCareerGoals fellowshipTrainingAndCareerGoals = FellowshipTrainingAndCareerGoals . Factory . newInstance ( ) ; ActivitiesPlannedUnderThisAward activitiesPlannedUnderThisAward = ActivitiesPlannedUnderThisAward . Factory . newInstance ( ) ; AttachedFileDataType attachedFileDataType = null ; for ( NarrativeContract narrative : pdDoc . getDevelopmentProposal ( ) . getNarratives ( ) ) { if ( narrative . getNarrativeType ( ) . getCode ( ) != null ) { switch ( Integer . parseInt ( narrative . getNarrativeType ( ) . getCode ( ) ) ) { case CONCURRENT_SUPPORT : attachedFileDataType = getAttachedFileType ( narrative ) ; if ( attachedFileDataType == null ) { continue ; } ConcurrentSupportDescription concurrentSupportDescription = ConcurrentSupportDescription . Factory . newInstance ( ) ; concurrentSupportDescription . setAttFile ( attachedFileDataType ) ; additionalInformation . setConcurrentSupport ( YesNoDataType . Y_YES ) ; additionalInformation . setConcurrentSupportDescription ( concurrentSupportDescription ) ; break ; case FELLOWSHIP : attachedFileDataType = getAttachedFileType ( narrative ) ; if ( attachedFileDataType == null ) { continue ; } fellowshipTrainingAndCareerGoals . setAttFile ( attachedFileDataType ) ; break ; case DISSERTATION : attachedFileDataType = getAttachedFileType ( narrative ) ; if ( attachedFileDataType == null ) { continue ; } DissertationAndResearchExperience dissertationAndResearchExperience = DissertationAndResearchExperience . Factory . newInstance ( ) ; dissertationAndResearchExperience . setAttFile ( attachedFileDataType ) ; additionalInformation . setDissertationAndResearchExperience ( dissertationAndResearchExperience ) ; break ; case ACTIVITIES : attachedFileDataType = getAttachedFileType ( narrative ) ; if ( attachedFileDataType == null ) { continue ; } activitiesPlannedUnderThisAward . setAttFile ( attachedFileDataType ) ; break ; default : break ; } } } additionalInformation . setFellowshipTrainingAndCareerGoals ( fellowshipTrainingAndCareerGoals ) ; additionalInformation . setActivitiesPlannedUnderThisAward ( activitiesPlannedUnderThisAward ) ; return additionalInformation ; }
/*
This method is used to set additional information data to
AdditionalInformation XMLObject from DevelopmentProposal, ProposalYnq