private EDSF424SupplementDocument getEDSF424Supplement() {

		EDSF424SupplementDocument edsf424SupplementDocument = EDSF424SupplementDocument.Factory
				.newInstance();
		EDSF424Supplement edsf424Supplement = EDSF424Supplement.Factory
				.newInstance();
		edsf424Supplement.setFormVersion(FormVersion.v1_1.getVersion());
		ProposalPersonContract pi = getS2SProposalPersonService().getPrincipalInvestigator(pdDoc);
		edsf424Supplement.setProjectDirector(globLibV20Generator
				.getContactPersonDataType(pi));
		String answer = null;
		List<? extends AnswerHeaderContract> answerHeaders = getPropDevQuestionAnswerService().getQuestionnaireAnswerHeaders(pdDoc.getDevelopmentProposal().getProposalNumber());
		if (answerHeaders != null && !answerHeaders.isEmpty()) {
            for (AnswerHeaderContract answerHeader : answerHeaders) {
                List<? extends AnswerContract> answerDetails = answerHeader.getAnswers();
                for (AnswerContract answers : answerDetails) {
                    Integer seqId = getQuestionAnswerService().findQuestionById(answers.getQuestionId()).getQuestionSeqId();
                    if (seqId != null
                            && seqId.equals(
                                    PROPOSAL_YNQ_NOVICE_APPLICANT)) {
                        if (answers.getAnswer() != null) {
                            answer = answers.getAnswer();
                        }
                        if (YnqConstant.YES.code().equals(answer)) {
                            edsf424Supplement
                                    .setIsNoviceApplicant(YesNoNotApplicableDataType.Y_YES);
                        } else if (YnqConstant.NO.code().equals(answer)) {
                            edsf424Supplement
                                    .setIsNoviceApplicant(YesNoNotApplicableDataType.N_NO);
                        } else if (YnqConstant.NA.code().equals(answer)) {
                            edsf424Supplement
                                    .setIsNoviceApplicant(YesNoNotApplicableDataType.NA_NOT_APPLICABLE);
                        }
                    }
                }
            }
        }

		edsf424Supplement.setIsHumanResearch(YesNoDataType.N_NO);
		OrganizationContract organization = pdDoc.getDevelopmentProposal()
				.getApplicantOrganization().getOrganization();
		for (ProposalSpecialReviewContract specialReview : pdDoc
				.getDevelopmentProposal().getPropSpecialReviews()) {
			if (specialReview.getSpecialReviewType() != null
					&& specialReview.getSpecialReviewType().getCode().equals(
                    SPECIAL_REVIEW_CODE)) {
				edsf424Supplement.setIsHumanResearch(YesNoDataType.Y_YES);
				if (specialReview.getApprovalType() != null
						&& specialReview.getApprovalType().getCode().equals(
                        APPROVAL_TYPE_CODE)) {
					edsf424Supplement
							.setIsHumanResearchExempt(YesNoDataType.Y_YES);
					ExemptionsNumber exemptionsNumber = ExemptionsNumber.Factory
							.newInstance();
					exemptionsNumber
							.setIsHumanResearchExempt(YesNoDataType.Y_YES);
					if (specialReview.getSpecialReviewExemptions() != null
							&& specialReview.getSpecialReviewExemptions().size() > 0) {
					    List<String> exemptionTypeCodes = new ArrayList<>();
					    for (ProposalSpecialReviewExemptionContract exemption : specialReview.getSpecialReviewExemptions()) {
					        exemptionTypeCodes.add(exemption.getExemptionType().getCode());
					    }
						exemptionsNumber.setStringValue(
                                colToString(exemptionTypeCodes));
					}
					edsf424Supplement.setExemptionsNumber(exemptionsNumber);
				} else {
					edsf424Supplement
							.setIsHumanResearchExempt(YesNoDataType.N_NO);
					if (organization != null) {
						AssuranceNumber assuranceNumber = AssuranceNumber.Factory
								.newInstance();
						assuranceNumber
								.setIsHumanResearchExempt(YesNoDataType.N_NO);
						if (organization.getHumanSubAssurance() != null) {
							assuranceNumber.setStringValue(organization
									.getHumanSubAssurance());
						}
						edsf424Supplement.setAssuranceNumber(assuranceNumber);
					}
				}
				Boolean paramValue= s2SConfigurationService.getValueAsBoolean(ConfigurationConstants.IRB_PROTOCOL_DEVELOPMENT_PROPOSAL_LINKING_ENABLED);
			    if(paramValue){
			    	ExemptionsNumber exemptionsNumber = ExemptionsNumber.Factory
					.newInstance();
			    	if (specialReview.getSpecialReviewExemptions() != null
							&& specialReview.getSpecialReviewExemptions().size() > 0) {
			    		edsf424Supplement
						.setIsHumanResearchExempt(YesNoDataType.Y_YES);
			    		exemptionsNumber
						.setIsHumanResearchExempt(YesNoDataType.Y_YES);	
			    		List<String> exemptionTypeCodes = new ArrayList<>();
					    for (ProposalSpecialReviewExemptionContract exemption : specialReview.getSpecialReviewExemptions()) {
					        exemptionTypeCodes.add(exemption.getExemptionType().getCode());
					    }
						exemptionsNumber.setStringValue(
                                colToString(exemptionTypeCodes));
						edsf424Supplement.setExemptionsNumber(exemptionsNumber);
			    	} else {
			    		edsf424Supplement.setIsHumanResearch(YesNoDataType.N_NO);
			    		if (organization != null) {
							AssuranceNumber assuranceNumber = AssuranceNumber.Factory
									.newInstance();
							assuranceNumber
									.setIsHumanResearchExempt(YesNoDataType.N_NO);
							if (organization.getHumanSubAssurance() != null) {
								assuranceNumber.setStringValue(organization
										.getHumanSubAssurance());
							}
							edsf424Supplement.setAssuranceNumber(assuranceNumber);
						}
			    		}}
				break;
			} else {
				edsf424Supplement.setIsHumanResearch(YesNoDataType.N_NO);
			}
			
		    	}
		AttachedFileDataType attachedFileDataType = null;
		for (NarrativeContract narrative : pdDoc.getDevelopmentProposal()
				.getNarratives()) {
			if (narrative.getNarrativeType().getCode() != null
					&& Integer.parseInt(narrative.getNarrativeType().getCode()) == NARRATIVE_TYPE_ED_SF424_SUPPLIMENT) {
				attachedFileDataType = getAttachedFileType(narrative);
				if(attachedFileDataType != null){
					edsf424Supplement.setAttachment(attachedFileDataType);
					break;
				}
			}
		}
		edsf424SupplementDocument.setEDSF424Supplement(edsf424Supplement);
		return edsf424SupplementDocument;
	}
private EDSF424SupplementDocument getEDSF424Supplement ( ) { EDSF424SupplementDocument edsf424SupplementDocument = EDSF424SupplementDocument . Factory . newInstance ( ) ; EDSF424Supplement edsf424Supplement = EDSF424Supplement . Factory . newInstance ( ) ; edsf424Supplement . setFormVersion ( FormVersion . v1_1 . getVersion ( ) ) ; ProposalPersonContract pi = getS2SProposalPersonService ( ) . getPrincipalInvestigator ( pdDoc ) ; edsf424Supplement . setProjectDirector ( globLibV20Generator . getContactPersonDataType ( pi ) ) ; String answer = null ; List < ? extends AnswerHeaderContract > answerHeaders = getPropDevQuestionAnswerService ( ) . getQuestionnaireAnswerHeaders ( pdDoc . getDevelopmentProposal ( ) . getProposalNumber ( ) ) ; if ( answerHeaders != null && ! answerHeaders . isEmpty ( ) ) { for ( AnswerHeaderContract answerHeader : answerHeaders ) { List < ? extends AnswerContract > answerDetails = answerHeader . getAnswers ( ) ; for ( AnswerContract answers : answerDetails ) { Integer seqId = getQuestionAnswerService ( ) . findQuestionById ( answers . getQuestionId ( ) ) . getQuestionSeqId ( ) ; if ( seqId != null && seqId . equals ( PROPOSAL_YNQ_NOVICE_APPLICANT ) ) { if ( answers . getAnswer ( ) != null ) { answer = answers . getAnswer ( ) ; } if ( YnqConstant . YES . code ( ) . equals ( answer ) ) { edsf424Supplement . setIsNoviceApplicant ( YesNoNotApplicableDataType . Y_YES ) ; } else if ( YnqConstant . NO . code ( ) . equals ( answer ) ) { edsf424Supplement . setIsNoviceApplicant ( YesNoNotApplicableDataType . N_NO ) ; } else if ( YnqConstant . NA . code ( ) . equals ( answer ) ) { edsf424Supplement . setIsNoviceApplicant ( YesNoNotApplicableDataType . NA_NOT_APPLICABLE ) ; } } } } } edsf424Supplement . setIsHumanResearch ( YesNoDataType . N_NO ) ; OrganizationContract organization = pdDoc . getDevelopmentProposal ( ) . getApplicantOrganization ( ) . getOrganization ( ) ; for ( ProposalSpecialReviewContract specialReview : pdDoc . getDevelopmentProposal ( ) . getPropSpecialReviews ( ) ) { if ( specialReview . getSpecialReviewType ( ) != null && specialReview . getSpecialReviewType ( ) . getCode ( ) . equals ( SPECIAL_REVIEW_CODE ) ) { edsf424Supplement . setIsHumanResearch ( YesNoDataType . Y_YES ) ; if ( specialReview . getApprovalType ( ) != null && specialReview . getApprovalType ( ) . getCode ( ) . equals ( APPROVAL_TYPE_CODE ) ) { edsf424Supplement . setIsHumanResearchExempt ( YesNoDataType . Y_YES ) ; ExemptionsNumber exemptionsNumber = ExemptionsNumber . Factory . newInstance ( ) ; exemptionsNumber . setIsHumanResearchExempt ( YesNoDataType . Y_YES ) ; if ( specialReview . getSpecialReviewExemptions ( ) != null && specialReview . getSpecialReviewExemptions ( ) . size ( ) > 0 ) { List < String > exemptionTypeCodes = new ArrayList < > ( ) ; for ( ProposalSpecialReviewExemptionContract exemption : specialReview . getSpecialReviewExemptions ( ) ) { exemptionTypeCodes . add ( exemption . getExemptionType ( ) . getCode ( ) ) ; } exemptionsNumber . setStringValue ( colToString ( exemptionTypeCodes ) ) ; } edsf424Supplement . setExemptionsNumber ( exemptionsNumber ) ; } else { edsf424Supplement . setIsHumanResearchExempt ( YesNoDataType . N_NO ) ; if ( organization != null ) { AssuranceNumber assuranceNumber = AssuranceNumber . Factory . newInstance ( ) ; assuranceNumber . setIsHumanResearchExempt ( YesNoDataType . N_NO ) ; if ( organization . getHumanSubAssurance ( ) != null ) { assuranceNumber . setStringValue ( organization . getHumanSubAssurance ( ) ) ; } edsf424Supplement . setAssuranceNumber ( assuranceNumber ) ; } } Boolean paramValue = s2SConfigurationService . getValueAsBoolean ( ConfigurationConstants . IRB_PROTOCOL_DEVELOPMENT_PROPOSAL_LINKING_ENABLED ) ; if ( paramValue ) { ExemptionsNumber exemptionsNumber = ExemptionsNumber . Factory . newInstance ( ) ; if ( specialReview . getSpecialReviewExemptions ( ) != null && specialReview . getSpecialReviewExemptions ( ) . size ( ) > 0 ) { edsf424Supplement . setIsHumanResearchExempt ( YesNoDataType . Y_YES ) ; exemptionsNumber . setIsHumanResearchExempt ( YesNoDataType . Y_YES ) ; List < String > exemptionTypeCodes = new ArrayList < > ( ) ; for ( ProposalSpecialReviewExemptionContract exemption : specialReview . getSpecialReviewExemptions ( ) ) { exemptionTypeCodes . add ( exemption . getExemptionType ( ) . getCode ( ) ) ; } exemptionsNumber . setStringValue ( colToString ( exemptionTypeCodes ) ) ; edsf424Supplement . setExemptionsNumber ( exemptionsNumber ) ; } else { edsf424Supplement . setIsHumanResearch ( YesNoDataType . N_NO ) ; if ( organization != null ) { AssuranceNumber assuranceNumber = AssuranceNumber . Factory . newInstance ( ) ; assuranceNumber . setIsHumanResearchExempt ( YesNoDataType . N_NO ) ; if ( organization . getHumanSubAssurance ( ) != null ) { assuranceNumber . setStringValue ( organization . getHumanSubAssurance ( ) ) ; } edsf424Supplement . setAssuranceNumber ( assuranceNumber ) ; } } } break ; } else { edsf424Supplement . setIsHumanResearch ( YesNoDataType . N_NO ) ; } } AttachedFileDataType attachedFileDataType = null ; for ( NarrativeContract narrative : pdDoc . getDevelopmentProposal ( ) . getNarratives ( ) ) { if ( narrative . getNarrativeType ( ) . getCode ( ) != null && Integer . parseInt ( narrative . getNarrativeType ( ) . getCode ( ) ) == NARRATIVE_TYPE_ED_SF424_SUPPLIMENT ) { attachedFileDataType = getAttachedFileType ( narrative ) ; if ( attachedFileDataType != null ) { edsf424Supplement . setAttachment ( attachedFileDataType ) ; break ; } } } edsf424SupplementDocument . setEDSF424Supplement ( edsf424Supplement ) ; return edsf424SupplementDocument ; }
This method returns EDSF424SupplementDocument object based on proposal
development document which contains the EDSF424SupplementDocument
informations
NoviceApplicant,HumanResearch,HumanResearchExempt,ExemptionsNumber,AssuranceNumber,and
attachment for a particular proposal

@return edsf424SupplementDocument(EDSF424SupplementDocument)
{@link XmlObject} of type EDSF424SupplementDocument.