<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron">

	<ns uri="http://eudract.emea.europa.eu/schema/clinical_trial/third_country" prefix="ct" />
	<let name="params" value="document('https://eudract.ema.europa.eu/eudract-web/schematron')"/>

	<pattern name="Business Rules v8.0">
	
		<rule context="ct:clinical_trial_application">
			<assert field-description="D. IMP Identification" id="1" 
				owning="sectionD" rule-id="FEAT6.2.1.02"
				section="D. IMP Identification"
				web="true"
				jexl="1 gt 0"
				test="count(ct:medicinal_product_information/ct:medicinal_product) > 0">
				There should always be at least one IMP.
			</assert>
			<assert field-description="D. IMP Identification" id="2" 
				owning="sectionDI" rule-id="FEAT6.2.1.02"
				section="D. IMP Identification" web="true"
				jexl="size(cta.ctaImps) gt 0"
				test="count(ct:medicinal_product_information/ct:medicinal_product) > 0">
				There should always be at least one IMP.
			</assert>
		</rule>

		<rule context="ct:protocol_information">
			<assert field-description="A.2 EudraCT Number" id="3" web="true"
					owning="sectionA" rule-id="FEAT6.2.4" section="A. Trial identification"
					jexl="!empty(cta.eudractNumber.eudractNumberId)"
					test="ct:cta_identification/ct:eudract_no!='' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			<assert field-description="A.3 Full title of the trial" web="true"
				 id="4" owning="sectionA" rule-id="FEAT6.2.4" section="A. Trial Identification"
					jexl="!empty(cta.fullTitle)"
					test="//ct:full_title_localized/ct:full_title[@locale='en']!=''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			<assert
					field-description="A.3.1 Title of the trial for lay people, in easily understood, i.e. non-technical, language" web="true"
				 id="5" owning="sectionA" rule-id="FEAT6.2.4" section="A. Trial Identification"
					jexl="!empty(cta.layPeopleTitle)"
					test="//ct:lay_people_title_localized/ct:lay_people_title[@locale='en']!=''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			<assert field-description="A.4.1 Sponsor's protocol code number" web="true"
				 id="6" owning="sectionA" rule-id="FEAT6.2.4" section="A. Trial Identification"
					jexl="!empty(cta.sponsorProtocolNo)"
					test="ct:sponsor_protocol_no!='' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			<assert	field-description="A.7 Is the trial part of an agreed Paediatric Investigation Plan?" web="true"
				 id="7" owning="sectionA" rule-id="FEAT6.2.4" section="A. Trial Identification"
					jexl="cta.isPartPip != -1"
					test="ct:is_part_pip!='-1' and ct:is_part_pip!=''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			<report	field-description="A.8 EMA Decision number of Paediatric Investigation Plan" web="true"
				 id="8" owning="sectionA" rule-id="FEAT6.2.4" section="A. Trial Identification"
					jexl="cta.isPartPip==1 and empty(cta.pipDecisionNo)"
					test="ct:is_part_pip='1' and ct:pip_decision_no=''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</report>
		</rule>

		<rule context="ct:sponsor">
			<assert field-description="B.1.1 Name of organisation"
			 id="9" owning="sectionB" rule-id="FEAT6.2.4" section="B.1 Sponsor Organisation" web="true"
				jexl="!empty(sponsor.sponsorOrgInfo.contactOrganisation.name)"
				test="ct:sponsor_info/ct:name!='' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="B.1.3.4 Country" id="10" web="true"
				owning="sectionB" rule-id="FEAT6.2.4" section="B.1 Sponsor Organisation"
				jexl="!empty(sponsor.sponsorOrgInfo.contactAddresses[0].country)"
				test="count(ct:sponsor_info/ct:country)!=0 and ct:sponsor_info/ct:country!=''
				and number(ct:sponsor_info/ct:country/ct:eutct_id)!=$params//controlled_term[./name='empty_term']/eutct_id">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="B.3.1 and B.3.2 Status of the sponsor"
			 id="11" owning="sectionB" rule-id="FEAT6.2.4" web="true"
				section="B.3.1 and B.3.2 Status of the sponsor"
				jexl="sponsor.sponsorType.eutctId!=emptyTerm"
				test="ct:sponsor_type!='' 
						and count(ct:sponsor_type)!=0 
						and number(ct:sponsor_type/ct:eutct_id)!=$params//controlled_term[./name='empty_term']/eutct_id">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.</assert>

			<assert field-description="B.4.1 Name of organisation" id="12" owning="sectionB" rule-id="FEAT6.2.4" web="true"
				section="B.4 Source(s) of Monetary or Material Support for the clinical trial (repeat as necessary)"
				jexl="
					if(empty(sponsor.ctaSupportSources)) {
						return false;
					}
					for (source: sponsor.ctaSupportSources) {
						if(!empty(source)) {
							if(empty(source.monetarySupportOrgInfo.contactOrganisation.name)) {
								return false;
							}
						}
					}
					return true;"
				test="count(ct:monetary_supports/ct:monetary_support)!=0
						and count(ct:monetary_supports/ct:monetary_support/ct:monetary_support_org[./ct:name=''])=0">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. 
				A field not completed will generate errors listed in the validation report
			</assert>

			<assert field-description="B.4.2 Country" id="13" owning="sectionB" rule-id="FEAT6.2.4" web="true"
				section="B.4 Source(s) of Monetary or Material Support for the clinical trial (repeat as necessary)"
				jexl="
					if(empty(sponsor.ctaSupportSources)) {
						return false;
					}
					for (source: sponsor.ctaSupportSources) {
						if(!empty(source)) {
							if(empty(source.monetarySupportOrgInfo.contactAddresses[0].country)) {
								return false;
							}
						}
					}
					return true;"
				test="count(ct:monetary_supports/ct:monetary_support)!=0
						and count(ct:monetary_supports/ct:monetary_support[./ct:monetary_support_country=''])=0">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="B.5.1 Name of organisation" id="14" owning="sectionB" rule-id="FEAT6.2.4"
				section="B.5 Contact point designated by the sponsor for further information on the trial" web="true"
				jexl="!empty(sponsor.furtherOrgInfo.contactOrganisation.name)"
				test="ct:further_info/ct:name!=''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="B.5.2 Functional name of contact point" id="15" owning="sectionB" rule-id="FEAT6.2.4"
				section="B.5 Contact point designated by the sponsor for further information on the trial" web="true"
				jexl="!empty(sponsor.contactPointName)"
				test="ct:contact_point_name!='' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="B.5.3.1	Street Address" id="16" owning="sectionB" rule-id="FEAT6.2.4"
				section="B.5 Contact point designated by the sponsor for further information on the trial" web="true"
				jexl="!empty(sponsor.furtherOrgInfo.contactAddresses[0].streetAddress1)"
				test="ct:further_info/ct:address/ct:street_address!='' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="B.5.3.2	Town/ city" id="17" owning="sectionB" rule-id="FEAT6.2.4"
				section="B.5 Contact point designated by the sponsor for further information on the trial" web="true"
				jexl="!empty(sponsor.furtherOrgInfo.contactAddresses[0].city)"
				test="ct:further_info/ct:address/ct:city!='' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="B.5.3.3	Post code" id="18" owning="sectionB" rule-id="FEAT6.2.4"
				section="B.5 Contact point designated by the sponsor for further information on the trial" 
				test="ct:further_info/ct:address/ct:post_code!=''">
				Complete if known.
			</assert>

			<assert field-description="B.5.3.4 Country" id="19" owning="sectionB" rule-id="FEAT6.2.4"
				section="B.5 Contact point designated by the sponsor for further information on the trial" web="true"
				jexl="!empty(sponsor.furtherOrgInfo.contactAddresses[0].country)"
				test="ct:further_info/ct:address/ct:country!='' and count(ct:further_info/ct:address/ct:country)!=0 ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<report field-description="B.5.4 Telephone number/B.5.5 Fax number/B.5.6 E-mail"
			 id="20" owning="sectionB" rule-id="FEAT6.2.1.44" web="true"
				section="B.5 Contact point designated by the sponsor for further information on the trial"
				jexl="for (phone: sponsor.furtherOrgInfo.contactPhones) {
 						if (!empty(phone.phoneNumber) ) {
 							return false;
 						}
 					};
 					if (!empty(sponsor.furtherOrgInfo.contactEmails[0].email)) {
 						return false;
 					}
 					return true;"
				test="ct:further_info/ct:email='' 
					and (count(ct:further_info/ct:phones/ct:phone[@type='PHONE'])=0 
						or ct:further_info/ct:phones/ct:phone[@type='PHONE']/ct:phone_number='')
					and (count(ct:further_info/ct:phones/ct:phone[@type='FAX'])=0 
						or ct:further_info/ct:phones/ct:phone[@type='FAX']/ct:phone_number='')">
                You should provide either a telephone number or email address
				for the contact point designated by the sponsor for further	information on the trial.
			</report>
		</rule>

        <rule context="ct:ca_request">
            <report field-description="C.1.5 Request to receive a copy of the CTA data as XML"
			 id="21" owning="sectionC" rule-id="FEAT6.2.2.05a" web="true"
                section="C. PIP Addressee Identification - C.1 Request to receive a copy of the CT Information data as XML"
				jexl="var areEmailsEmpty = false;
					for (email: ncaApplicant.ncaOrgInfoEmail.contactEmails) {
 						if (empty(email.email) ) {
 							areEmailsEmpty = true;
 						}
 					};
					ncaApplicant.isXmlCopySent == 1 
						and (ncaApplicant.isXmlCopySecure == -1 or areEmailsEmpty)"
				test="ct:is_xml_copy_sent = 1 
						and (ct:is_xml_copy_secure = -1 or count(ct:email_contact_info_list/ct:email_contact_info) = 0)">
				If 'C.1.5.1 Do you want a copy of this data saved on EudraCT as an XML File?' is 'Yes' then 
				'C.1.5.1.1 E-mail' should contain at least one email address and 
				'C.1.5.1.2 Secure E-mail (EudraLink account)?' must be completed.							
            </report>
            
			<assert field-description="C.1.5.1 Do you want a copy of the CTA form data saved on EudraCT as an XML file?"
	                id="22" owning="sectionC" rule-id="FEAT6.2.4" web="true" 
	                section="C. PIP Addressee Identification - C.1 Request to receive a copy of the CT Information data as XML"
					jexl="!empty(ncaApplicant.isXmlCopySent) and ncaApplicant.isXmlCopySent!= -1"
	                test="ct:is_xml_copy_sent!='-1' and ct:is_xml_copy_sent!=''">
               You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
            </assert>
        </rule>
        
        <rule context="ct:imp_identification_not_possible">
			<report field-description="D.2.2.1 In the protocol, is treatment defined only by active substance" id="24" 
						owning="sectionD" rule-id="FEAT6.2.2.12"
						section="D.1/D.2 IMP Identification and Status Details" web="true"
						jexl="impIdentNotPossible.hasAnyAuthActiveSubstance == 1 and 
							(
								impIdentNotPossible.hasLocalSiteProducts == -1 
								or impIdentNotPossible.hasImpOtherIdentification != 0
								or impIdentNotPossible.isAtcGroupUsed != 0 
							)"
						test="ct:has_any_auth_active_substance='1' and 
							(
								ct:has_local_site_products='-1' 
								or ct:has_imp_other_identification!='0'
								or ct:is_atc_group_used!='0' 
							)">
							- If 'D.2.2.1 Treatment defined only by Active Substance' is answered with "Yes" then 'D.2.2.2 Combinations
							of marketed products' may be "Yes" or "No" and 'D.2.2.3	IMP defined by ATC Group' and 'D.2.2.4 IMP identification other' should be "No".
			</report>
			
			<report field-description="D.2.2.2 In the protocol, do treatment regimens allow different combinations of marketed products used according to local clinical practice at some or all investigator sites in the MS"
					 id="25" owning="sectionD" rule-id="FEAT6.2.2.13"
						section="D.1/D.2 IMP Identification and Status Details" web="true"
						jexl="impIdentNotPossible.hasLocalSiteProducts == 1 and
						(
							impIdentNotPossible.hasImpOtherIdentification != 0 
							or impIdentNotPossible.hasAnyAuthActiveSubstance == -1 
							or impIdentNotPossible.isAtcGroupUsed != 0
						)"
						test="ct:has_local_site_products='1' and
						(
							ct:has_imp_other_identification!='0' 
							or ct:has_any_auth_active_substance='-1' 
							or ct:is_atc_group_used!='0'
						)">
						- If 'D.2.2.2 Combinations of marketed products'
						is "Yes" then 'D.2.2.1 Treatment defined only by AS' may be "Yes" or "No" and 'D.2.2.3 IMP defined by ATC Group' and 'D.2.2.4 IMP
						identification other' should be "No".
			</report>
			
			<report field-description="D.2.2.3 The products to be administered as IMPs are defined as belonging to an ATC group"
					 id="26" owning="sectionD" rule-id="FEAT6.2.2.10"
						section="D.1/D.2 IMP Identification and Status Details" web="true"
						jexl="impIdentNotPossible.isAtcGroupUsed == 1 and
						(
							impIdentNotPossible.hasAnyAuthActiveSubstance != 0 
							or impIdentNotPossible.hasLocalSiteProducts != 0
							or impIdentNotPossible.hasImpOtherIdentification != 0 
						)"
						test=" ct:is_atc_group_used='1' and
						(
							ct:has_any_auth_active_substance!='0'
							or ct:has_local_site_products!='0' 
							or ct:has_imp_other_identification!='0'
						)">
						- If 'D.2.2.3 IMP defined by ATC Group' is "Yes" then 'D.2.2.1 Treatment defined only by AS' 'D.2.2.2 Combinations of marketed products' and 'D.2.2.4 IMP
						identification other' should be "No".
			</report>
			
			<report field-description="D.2.2.4 Other"
					 id="27" owning="sectionD" rule-id="FEAT6.2.2.11a"
						section="D.1/D.2 IMP Identification and Status Details" web="true"
						jexl="impIdentNotPossible.hasImpOtherIdentification == 1 and
						(
							impIdentNotPossible.hasLocalSiteProducts != 0 
							or impIdentNotPossible.hasAnyAuthActiveSubstance != 0
							or impIdentNotPossible.isAtcGroupUsed != 0 
							or empty(impIdentNotPossible.otherDescription) 
						)"
						test="ct:has_imp_other_identification='1' and
						(
							ct:has_local_site_products!='0' 
							or ct:has_any_auth_active_substance!='0'
							or ct:is_atc_group_used!='0' 
							or ct:other_description='' 
						)">
		         		If D.2.2.4 is "Yes" then D.2.2.1, D.2.2.2 and D.2.2.3 should be "No" and the applicant should give details in this section on the specific situation set up for the trial.
       		</report>
       		
			<report field-description="D.2.2.4 Other"
					 id="28" owning="sectionD" rule-id="FEAT6.2.2.11b"
						section="D.1/D.2 IMP Identification and Status Details" web="true"
						jexl="impIdentNotPossible.hasImpOtherIdentification == 0 and !empty(impIdentNotPossible.otherDescription)"
						test="ct:has_imp_other_identification='0' and ct:other_description!=''">
						The fields 'D.2.2.4.1 IMP identification other specification' should not be answered when the parent question 'D.2.2.4 IMP identification other' is answered 'No'.
						
       		</report>
		</rule>

		<rule context="ct:medicinal_product">
			<assert field-description="D.1.2 and D.1.3 Category" id="29" owning="sectionD" rule-id="FEAT6.2.4"
				section="D.1/D.2 IMP Identification and Status Details" web="true"
				jexl="!empty(imp.impCategory.eutctId) and imp.impCategory.eutctId!=emptyTerm"
				test="ct:imp_category/ct:eutct_id!='' and ct:imp_category/ct:eutct_id!=$params//controlled_term[./name='empty_term']/eutct_id">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.2.1 Has the IMP to be used in the trial a marketing authorisation" id="30" 
				owning="sectionD" rule-id="FEAT6.2.2.7c"
				section="D.1/D.2 IMP Identification and Status Details" web="true"
				jexl="!empty(imp.hasMa) and imp.hasMa != -1"
				test="ct:has_ma != '' and ct:has_ma != -1">
				D.2.1 must be answered as Yes or No in accordance with the IMP in question, not answered is not an acceptable response.
			</assert>
		
			<!-- NOTE: 6.2.2.7b is slightly different in EEA and 3rd country -->
			<report field-description="D.2.1 Has the IMP to be used in the trial a marketing authorisation" id="31"
					owning="sectionD" rule-id="FEAT6.2.2.7b" 
					section="D.1/D.2 IMP Identification and Status Details" web="true"
					jexl="imp.hasMa == 1 
							and imp.impIdentNotPossible.hasAnyAuthActiveSubstance==0 
							and imp.impIdentNotPossible.hasLocalSiteProducts==0 
							and imp.impIdentNotPossible.isAtcGroupUsed==0 
							and imp.impIdentNotPossible.hasImpOtherIdentification==0 
							and(
								empty(imp.impMs.tradeNameInMs) 
								or empty(imp.impMs.maHolder) 
								or empty(imp.impMs.grantedMaCountry) 
								or imp.impMs.grantedMaCountry.eutctId == emptyTerm 
							)"
							
					test="ct:has_ma='1'
						  and ct:imp_identification_not_possible/ct:has_any_auth_active_substance='0' 
						  and ct:imp_identification_not_possible/ct:has_local_site_products='0' 
						  and ct:imp_identification_not_possible/ct:is_atc_group_used='0' 			
						  and ct:imp_identification_not_possible/ct:has_imp_other_identification='0'
						  and (
							ct:imp_member_state/ct:trade_name_in_ms='' 					
							or ct:imp_member_state/ct:ma_holder=''	
							or ct:imp_member_state/ct:granted_ma_country=''
							or ct:imp_member_state/ct:granted_ma_country/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id
						)">
				If 'D.2.1 IMP has MA' is 'Yes' and all D.2.2 subsections are answered as 'No', then all D.2.1.1.1, D.2.1.1.2 and D.2.1.2 must be answered.
			</report>
					
			<report field-description="D.2.2 IMP to be used in the CT has a marketing authorisation" 
				 id="23" owning="sectionD" rule-id="FEAT6.2.2.9" 
					section="D.1/D.2 IMP Identification and Status Details" web="true"
					jexl="imp.hasMa == 1 
					and	(
						empty(imp.impMs.tradeNameInMs) 
						and empty(imp.impMs.maHolder) 
						and (empty(imp.impMs.grantedMaCountry) 
						or imp.impMs.grantedMaCountry.eutctId == emptyTerm) 
					) and (
						(impIdentNotPossible.hasLocalSiteProducts == -1
						  or impIdentNotPossible.hasAnyAuthActiveSubstance == -1
						  or impIdentNotPossible.isAtcGroupUsed == -1
						  or impIdentNotPossible.hasImpOtherIdentification == -1
					    ) or (	
						  impIdentNotPossible.hasLocalSiteProducts != 1
						  and impIdentNotPossible.hasAnyAuthActiveSubstance != 1
						  and impIdentNotPossible.isAtcGroupUsed != 1
						  and impIdentNotPossible.hasImpOtherIdentification != 1)
					)"
					test="ct:has_ma='1'
					and (
						ct:imp_member_state/ct:trade_name_in_ms='' 					
						and ct:imp_member_state/ct:ma_holder=''	
						and (ct:imp_member_state/ct:granted_ma_country=''
							or (ct:imp_member_state/ct:granted_ma_country!=''
							and ct:imp_member_state/ct:granted_ma_country/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id))
					)and(
						(ct:imp_identification_not_possible/ct:has_local_site_products='-1'
							or ct:imp_identification_not_possible/ct:has_any_auth_active_substance='-1'
							or ct:imp_identification_not_possible/ct:is_atc_group_used='-1'
							or ct:imp_identification_not_possible/ct:has_imp_other_identification='-1'
						) or (	
							ct:imp_identification_not_possible/ct:has_local_site_products!='1'
							and ct:imp_identification_not_possible/ct:has_any_auth_active_substance!='1'
							and ct:imp_identification_not_possible/ct:is_atc_group_used!='1'
							and ct:imp_identification_not_possible/ct:has_imp_other_identification!='1')
					)
					">
				If answering D.2.2 all subsections should be answered i.e. (D.2.2.1, D.2.2.2, D.2.2.3, and D.2.2.4) 'Yes' or 'No' and at least one must be 'Yes'.
			</report>
		
			<report field-description="D.2.1 Has the IMP to be used in the trial a marketing authorisation"
			 id="33" owning="sectionD" rule-id="FEAT6.2.1.04" web="true"
				section="D.1/D.2 IMP Identification and Status Details"
				jexl="imp.hasMa == 0 and empty(imp.name) and empty(imp.code)" 
				test="ct:has_ma='0' and ct:name='' and ct:code=''">
				It is mandatory to answer at least 'D.3.1 IMP Name', OR 'D.3.2 IMP Code', if question 'D.2.1 IMP has MA' is answered "No".
			</report>
			
			<report field-description="D.2.2.3 The products to be administered as IMPs are defined as belonging to an ATC group" 
             id="34" owning="sectionD"
				rule-id="FEAT6.2.1.09" 
				section="D.3.8 to D.3.10 IMP Identification Details (Active Substances)" web="true"
				jexl="imp.impIdentNotPossible.isAtcGroupUsed != 1
							and imp.impIdentNotPossible.hasImpOtherIdentification != 1
							and empty(imp.ctaActiveSubstances)"
				test="ct:imp_identification_not_possible/ct:is_atc_group_used!='1'
							and ct:imp_identification_not_possible/ct:has_imp_other_identification!='1'
							and count(ct:active_substances/ct:active_substance)='0'">
				It is mandatory to identify at least one active substance for every IMP except when D.2.2.3 Products 
				to be administered as IMP belonging to ATC Group or D.2.2.4 Other are answered Yes.
            </report>
			
			<report field-description="D.2.5 Has the IMP been designated in this indication as an orphan drug in the Community" id="35" 
				owning="sectionD" rule-id="FEAT6.2.1.05"
				section="D.1/D.2 IMP Identification and Status Details"	web="true"
				jexl="(imp.isOrphanDrugInCommunity == 1 and empty(imp.orphanDrugDesignationNo))
						or (imp.isOrphanDrugInCommunity == 0 and !empty(imp.orphanDrugDesignationNo))"
				test="(ct:is_orphan_drug_in_community='1' and ct:orphan_drug_designation_no='' )
						or (ct:is_orphan_drug_in_community='0' and ct:orphan_drug_designation_no!='')">
					'D.2.5.1 Orphan drug number' should only be answered if 'D.2.5 IMP is orphan drug' is a "Yes".
			</report>
		
			<assert field-description="D.2.5 Has the IMP been designated in this indication as an orphan drug in the Community?" id="36" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.1/D.2 IMP Identification and Status Details" web="true"
				jexl="!empty(imp.isOrphanDrugInCommunity) and imp.isOrphanDrugInCommunity != -1"
				test="ct:is_orphan_drug_in_community != '' and ct:is_orphan_drug_in_community != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<report field-description="D.3.4 Pharmaceutical Form" id="37" owning="sectionD" rule-id="FEAT6.2.1.06" 
				section="D.3 Description of the IMP" web="true"
				
				jexl="(imp.impIdentNotPossible.hasAnyAuthActiveSubstance != 1 
					and imp.impIdentNotPossible.hasLocalSiteProducts != 1
					and imp.impIdentNotPossible.isAtcGroupUsed != 1 
					and imp.impIdentNotPossible.hasImpOtherIdentification != 1 )
					and (empty(imp.pharmaceuticalForm) or imp.pharmaceuticalForm.eutctId == emptyTerm ) "
				
				test="(ct:imp_identification_not_possible/ct:has_any_auth_active_substance!='1' 
					and ct:imp_identification_not_possible/ct:has_local_site_products!='1'
					and ct:imp_identification_not_possible/ct:is_atc_group_used!='1' 
					and ct:imp_identification_not_possible/ct:has_imp_other_identification!='1' )
					and (count(ct:pharmaceutical_form)=0 or  ct:pharmaceutical_form/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id ) ">
				'D.3.4 IMP Pharmaceutical Form' is a mandatory field, except where any part of D.2.2 is answered Yes and the trial may use different pharmaceutical forms of that active substance.
			</report>
		
			<report field-description="D.3.7 Route(s) of Administration of this IMP"
			 id="38" owning="sectionD" rule-id="FEAT6.2.1.60" 
				section="D.3 Description of the IMP" web="true"
				jexl="empty(imp.impRouteOfAdministration)
						and imp.impIdentNotPossible.hasLocalSiteProducts != 1
						and imp.impIdentNotPossible.hasAnyAuthActiveSubstance != 1
						and imp.impIdentNotPossible.isAtcGroupUsed != 1
						and imp.impIdentNotPossible.hasImpOtherIdentification != 1
					"
				test="count(ct:routes_of_administration/ct:route_of_administration) = 0
						and ct:imp_identification_not_possible/ct:has_local_site_products != 1
						and ct:imp_identification_not_possible/ct:has_any_auth_active_substance != 1
						and ct:imp_identification_not_possible/ct:is_atc_group_used != 1
						and ct:imp_identification_not_possible/ct:has_imp_other_identification != 1
					">
				D.3.7 must be answered except if D.2.2 is answered (i.e. at least one of D.2.2.1, D.2.2.2, D.2.2.3 or D.2.2.4 is Yes). 
			</report>
			
			<report field-description="D.3.10 Strength" id="39"	owning="sectionD" rule-id="FEAT6.2.1.11a"
				section="D.3.8 to D.3.10 IMP Identification Details (Active Substances)" web="true"
				jexl="
				if(impIdentNotPossible.hasLocalSiteProducts != 1) { 
				    for(activeSubstance : imp.ctaActiveSubstances) { 
						if(empty(activeSubstance.concentrationUnit) or 
							activeSubstance.concentrationUnit.eutctId == emptyTerm or 
							empty(activeSubstance.concentrationType) or 
							activeSubstance.concentrationType.eutctId == emptyTerm or 
							empty(activeSubstance.concentrationNumPart1)) { 
								return true; 
				        }
				    }
				    return false;
				}
				return false; "
				test="ct:imp_identification_not_possible/ct:has_local_site_products !='1' and
					(
						ct:active_substances/ct:active_substance/ct:concentration_unit/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id
						or ct:active_substances/ct:active_substance/ct:concentration_type/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id 
						or ct:active_substances/ct:active_substance/ct:concentration_num_part1 = ''
					)
					">
				D.3.10, D.3.10.1,2,3 are Mandatory fields except where 'D.2.2.2 Has local site products' is yes
			</report>
            
            <report field-description="D.3.10 Strength" id="40"	owning="sectionD" rule-id="FEAT6.2.1.11b"
				section="D.3.8 to D.3.10 IMP Identification Details (Active Substances)" web="true"
				jexl="
					if(impIdentNotPossible.hasLocalSiteProducts != 1) {
					    for(activeSubstance : imp.ctaActiveSubstances) { 
							if(
								(
									activeSubstance.concentrationType.eutctId == concentrationTypeRange and 
									(
										!activeSubstance.isConcentrationNumPart1Numeric() or 
										!activeSubstance.isConcentrationNumPart2Numeric()
									) 
								)
								or
								(
									!empty(activeSubstance.concentrationType.eutctId) and
									activeSubstance.concentrationType.eutctId != concentrationTypeRange and
									activeSubstance.concentrationType.eutctId != emptyTerm and
									(
										!activeSubstance.isConcentrationNumPart1Numeric() or  
										!empty(activeSubstance.concentrationNumPart2)
									)
								)
							)
							return true;
					   	}
					}
					return false; "
				test="ct:imp_identification_not_possible/ct:has_local_site_products !='1' and
					(
						ct:active_substances/ct:active_substance[
						(
							ct:concentration_type/ct:eutct_id=$params//controlled_term[./name='concentration_type_range']/eutct_id and
							(
								string(number(ct:concentration_num_part1)) = 'NaN' or 
								string(number(ct:concentration_num_part2)) = 'NaN' 
							)
						)
						or(
							ct:concentration_type/ct:eutct_id != '' and
							ct:concentration_type/ct:eutct_id != $params//controlled_term[./name='empty_term']/eutct_id and
							ct:concentration_type/ct:eutct_id != $params//controlled_term[./name='concentration_type_range']/eutct_id and
							(
								string(number(ct:concentration_num_part1)) = 'NaN' or
								ct:concentration_num_part2[text()] != ''
							)
						)
					]
					)
					">
				D.3.10.3 should be a single numeric value in the left field (can be a decimal) or in
				both fields only where D.3.10.2 is "RANGE"
			</report>
		
			<assert field-description="D.3.11.1 Of chemical origin?" id="41" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.hasChemicalOrigin) and imp.hasChemicalOrigin != -1"
				test="ct:has_chemical_origin != '' and ct:has_chemical_origin != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<report field-description="D.3.11.1 Of chemical origin/D.3.11.2 Of biological/ biotechnological origin/D.3.11.3 Advanced Therapy IMP"
			 id="42" owning="sectionD" rule-id="FEAT6.2.1.12" 
				section="D.3.11 Type of IMP" web="true"
				jexl="imp.hasChemicalOrigin != 1
						and imp.hasBiologicalOrigin != 1
						and imp.isAdvancedTherapyMp != 1"
				test="ct:has_chemical_origin!='1' 
						and ct:has_biological_origin!='1' 
						and ct:is_advanced_therapy_mp!='1'">
						'At least one of D.3.11.1 Chemical origin AS', 'D.3.11.2 Biological origin AS' and 'D.3.11.3 Advanced Therapy IMP' should be "Yes".
			</report>
			
			<report field-description="D.3.11.1/2 Active Substance Origin"
			 id="43" owning="sectionD" rule-id="FEAT6.2.1.13" section="D.3.11 Type of IMP"
				test="ct:has_chemical_origin='1' and ct:has_biological_origin='0' 
				and  (ct:is_somatic_therapy_mp!='0'	or ct:is_gene_therapy_mp!='0' or ct:is_tissue_engineered_mp!='0' 
				or ct:is_combination_atimp!='0' or ct:is_immunological_mp!='0'  or ct:is_plasma_derived_mp!='0' 
				or ct:is_other_extractive!='0'  or ct:is_recombinant_mp!='0' or ct:is_gmo_mp!='0')">
				If 'D.3.11.1 Chemical origin AS' is answered "Yes" and 'D.3.11.2  Biological origin AS' is answered "No", then 'D.3.11.3.1-4 and D.3.11.6-10 should be answered "No".
			</report>
			
			<assert field-description="D.3.11.2 Of biological/ biotechnological origin (other than Advanced Therapy IMP (ATIMP)?" id="44" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.hasBiologicalOrigin) and imp.hasBiologicalOrigin != -1"
				test="ct:has_biological_origin != '' and ct:has_biological_origin != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
		
			<assert field-description="D.3.11.3 Advanced Therapy IMP (ATIMP)" id="45" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isAdvancedTherapyMp) and imp.isAdvancedTherapyMp != -1"
				test="ct:is_advanced_therapy_mp != '' and ct:is_advanced_therapy_mp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.3.1 Somatic cell therapy medicinal product?" id="46" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isSomaticTherapyMp) and imp.isSomaticTherapyMp != -1"
				test="ct:is_somatic_therapy_mp != '' and ct:is_somatic_therapy_mp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.3.2 Gene therapy medical product?" id="47" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isGeneTherapyMp) and imp.isGeneTherapyMp != -1"
				test="ct:is_gene_therapy_mp != '' and ct:is_gene_therapy_mp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.3.3 Tissue Engineered Product?" id="48" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isTissueEngineeredMp) and imp.isTissueEngineeredMp != -1"
				test="ct:is_tissue_engineered_mp != '' and ct:is_tissue_engineered_mp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.3.4 Combination ATIMP (i.e. one involving a medical device)?" id="49" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isCombinationAtimp) and imp.isCombinationAtimp != -1"
				test="ct:is_combination_atimp != '' and ct:is_combination_atimp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.3.5 Has the Committee on Advanced therapies issued a classification for this product?" id="50" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isCatClassificationIssued) and imp.isCatClassificationIssued != -1"
				test="ct:is_cat_classification_isued != '' and ct:is_cat_classification_isued != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<report field-description="D.3.11.3.5 Has the Committee on Advanced therapies issued a classification for this product" id="51" 
				owning="sectionD" rule-id="FEAT6.2.1.46" 
				section="D.3.11 Type of IMP" web="true"
				jexl="(imp.isCatClassificationIssued == 1 and empty(imp.catClassification))
						or (imp.isCatClassificationIssued != 1 and !empty(imp.catClassification))"
				test="(ct:is_cat_classification_isued='1' and ct:cat_classification='')
						or ( ct:is_cat_classification_isued!='1' and ct:cat_classification!='')">
				You should only provide the classification and its reference number if
				the Committee on Advanced therapies issued a classification for this
				product.
			</report>
			
			<assert field-description="D.3.11.4 Combination product that includes a device, but does not involve an Advanced Therapy" id="52" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isDeviceIncluded) and imp.isDeviceIncluded != -1"
				test="ct:is_device_included != '' and ct:is_device_included != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.5 radiopharmaceutical medicinal product?" id="53" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isRadiopharmaceuticalMp) and imp.isRadiopharmaceuticalMp != -1"
				test="ct:is_radiopharmaceutical_mp != '' and ct:is_radiopharmaceutical_mp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.6 immunological medicinal product (such as vaccine, allergen, immune serum)?" id="54" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isImmunologicalMp) and imp.isImmunologicalMp != -1"
				test="ct:is_immunological_mp != '' and ct:is_immunological_mp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.7 plasma derived medicinal product?" id="55" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isPlasmaDerivedMp) and imp.isPlasmaDerivedMp != -1"
				test="ct:is_plasma_derived_mp != '' and ct:is_plasma_derived_mp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.8 Extractive medicinal product?" id="56" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isOtherExtractive) and imp.isOtherExtractive != -1"
				test="ct:is_other_extractive != '' and ct:is_other_extractive != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.9 Recombinant medicinal product?" id="57" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isRecombinantMp) and imp.isRecombinantMp != -1"
				test="ct:is_recombinant_mp != '' and ct:is_recombinant_mp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.10 medicinal product containing genetically modified organisms?" id="58" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isGmoMp) and imp.isGmoMp != -1"
				test="ct:is_gmo_mp != '' and ct:is_gmo_mp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.11 Herbal medicinal product?" id="59" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isHerbalMp) and imp.isHerbalMp != -1"
				test="ct:is_herbal_mp != '' and ct:is_herbal_mp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.12 Homeopathic medicinal product?" id="60" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isHomeopatheticMp) and imp.isHomeopatheticMp != -1"
				test="ct:is_homeopathetic_mp != '' and ct:is_homeopathetic_mp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="D.3.11.13 Another type of medicinal product?" id="61" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP" web="true"
				jexl="!empty(imp.isOtherMp) and imp.isOtherMp != -1"
				test="ct:is_other_mp != '' and ct:is_other_mp != -1">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
		
			<report field-description="D.3.11.13.1 If 'another type of medicinal product' specify the type of medicinal product" id="62" 
				owning="sectionD" rule-id="FEAT6.2.1.17" 
				section="D.3.11 Type of IMP" web="true"
				jexl="(imp.isOtherMp == 1 and empty(imp.otherMpSpecification))
						or (imp.isOtherMp != 1 and !empty(imp.otherMpSpecification))"
				test="(ct:is_other_mp='1' and ct:other_mp_specification='')
				or (ct:is_other_mp!='1' and ct:other_mp_specification!='')">
				D.3.11.13.1 Other MP Specification is only mandatory when the parent question is answered "Yes".
			</report>
		</rule>
		
		<rule context="ct:active_substance">
			<report field-description="D.3.8 INN - Proposed INN, D.3.9.1 CAS Number, D.3.9.2 Current sponsor code, D.3.9.3 Other descriptive name" 
	             id="63" owning="sectionD38" rule-id="FEAT6.2.1.10" 
					section="D.3.8 to D.3.10 IMP Identification Details (Active Substances)" web="true"
				jexl="empty(activeSubstance.inn) or (
						empty(activeSubstance.casNumber) and
						empty(activeSubstance.currentSponsorCode) and
						empty(activeSubstance.otherDescriptiveName)
					)"
				test="ct:inn='' or (ct:cas_number='' and ct:current_sponsor_code='' and ct:other_descriptive_name='')">
				D.3.8 must be completed and one of D.3.9.1, D.3.9.2, D.3.9.3 should be answered.
            </report>
       	</rule>
       	
		<rule context="ct:placebo">
			<assert field-description="D.8.3 Pharmaceutical form" id="d1" 
					owning="sectionD8" rule-id="FEAT6.2.4"
					section="D.8 Information on the Placebo" web="true"
					jexl="!empty(placebo.pharmaceuticalForm.eutctId) and placebo.pharmaceuticalForm.eutctId!=emptyTerm"
					test="ct:pharmaceutical_form/ct:eutct_id!=$params//controlled_term[./name='empty_term']/eutct_id 
						and count(ct:pharmaceutical_form)!=0 ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			<assert field-description="D.8.4 Route of administration" id="d2" 
					owning="sectionD8" rule-id="FEAT6.2.4"
					section="D.8 Information on the Placebo" web="true"
					jexl="!empty(placebo.routeOfAdministration.eutctId) and placebo.routeOfAdministration.eutctId!=emptyTerm"
					test="ct:route_of_administration/ct:eutct_id!=$params//controlled_term[./name='empty_term']/eutct_id 
						and count(ct:route_of_administration)!=0 ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
		</rule>

		<rule context="ct:general_information">
			<assert field-description="E.1.1 Specify the medical condition(s) to be investigated/E.1.2 MedDRA" id="64"
				owning="sectionE" rule-id="FEAT6.2.1.29" section="E.1.2 MedDRA information" web="true"
				jexl="var meddraSize=0;
					  for (meddra : ctaGeneralInfo.ctaMeddraCodeInfos) {
						meddraSize=meddraSize+1;
					  };
					if(!empty(ctaGeneralInfo.medCondition) or meddraSize gt 0) {
						return true;
					}
					return false;"
				test="ct:med_conditions_localized/ct:med_conditions[@locale='en']!='' or count(ct:meddra_information/ct:meddra)!=0 ">
				One of 'E.1.1 Medical condition' or 'E.1.2 MedDRA' are mandatory, both may also be completed.
			</assert>

			<report field-description="E.1.2 MedDRA information"
			 id="65" owning="sectionE" rule-id="FEAT6.2.1.30" section="E.1.2 MedDRA information" web="true"
				jexl="for (ctaMeddraCodeInfo: ctaGeneralInfo.ctaMeddraCodeInfos) {
 						if (empty(ctaMeddraCodeInfo.meddraVersion) and empty(ctaMeddraCodeInfo.meddraLevel)
 							and empty(ctaMeddraCodeInfo.meddraClassificationCode) and empty(ctaMeddraCodeInfo.meddraTerm)
 							and empty(ctaMeddraCodeInfo.meddraSocTerm)) {
 							return true;
 						}
 					   };
 					   return false;"
				test="count(ct:meddra_information/ct:meddra)!=0 
					and (ct:meddra_information/ct:meddra/ct:meddra_version='' 
							or ct:meddra_information/ct:meddra/ct:meddra_level='' 
							or ct:meddra_information/ct:meddra/ct:meddra_classification_code='' 
							or ct:meddra_information/ct:meddra/ct:meddra_term='')">
				All MedDRA information to be provided.
			</report>
		
			<assert field-description="E.1.1.1	Medical condition in easily understood language"
			 id="66" owning="sectionE" rule-id="FEAT6.2.4" web="true"
				section="E.1 Medical condition or disease under investigation."
				jexl="!empty(ctaGeneralInfo.medConditionInLayLang)"
				test="ct:med_condition_in_lay_langs_localized/ct:med_condition_in_lay_langs[@locale='en'] != ''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.1.1.2	Identify the therapeutic area"
			 id="67" owning="sectionE" rule-id="FEAT6.2.4" web="true"
				section="E.1 Medical condition or disease under investigation."
				jexl="!empty(ctaGeneralInfo.therapeuticArea.eutctId) and ctaGeneralInfo.therapeuticArea.eutctId != emptyTerm"
				test="count(ct:therapeutic_area)!=0 and ct:therapeutic_area/ct:eutct_id!=$params//controlled_term[./name='empty_term']/eutct_id">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert
				field-description="E.1.3 Is any of the conditions being studied a rare disease?"
			 id="68" owning="sectionE" rule-id="FEAT6.2.4" web="true"
				section="E.1 Medical condition or disease under investigation."
				jexl="ctaGeneralInfo.isRareDisease!=-1"
				test="ct:is_rare_disease!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.2.1 Main objective of the trial"
			 id="69" owning="sectionE" rule-id="FEAT6.2.4" section="E.2 Objective of the Trial" web="true"
				jexl="!empty(ctaGeneralInfo.mainObjectiveOfTrial)"
				test="ct:main_objective_of_trial_localized/ct:main_objective_of_trial[@locale='en'] != ''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.2.2 Secondary objectives of the trial"
			 id="70" owning="sectionE" rule-id="FEAT6.2.4" section="E.2 Objective of the Trial" web="true"
				jexl="!empty(ctaGeneralInfo.secObjectivesOfTrial)"
				test="ct:sec_objectives_of_trial_localized/ct:sec_objectives_of_trial[@locale='en'] != ''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.2.3 Is there a sub-study?"
			 id="71" owning="sectionE" rule-id="FEAT6.2.4" section="E.2 Objective of the Trial" web="true"
				jexl="ctaGeneralInfo.isSubStudy!=-1"
				test="ct:is_sub_study!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<report field-description="E.2.3 Is there a sub-study?" id="72"
				owning="sectionE" rule-id="FEAT6.2.1.31" section="E.2 Objective of the Trial" web="true"
				jexl="(ctaGeneralInfo.isSubStudy == 1 and empty(ctaGeneralInfo.subStoryDetails)) 
						or (ctaGeneralInfo.isSubStudy != 1 and !empty(ctaGeneralInfo.subStoryDetails))"
				test="(ct:is_sub_study='1' 
						and (count(ct:sub_story_details_localized/ct:sub_story_details) = 0
							or ct:sub_story_details_localized/ct:sub_story_details[@locale='en'] = ''))
					or (ct:is_sub_study!='1' and ct:sub_story_details_localized/ct:sub_story_details[@locale='en']!='') ">
				'E.2.3 Has a sub-study' is a mandatory field and if it is "Yes"	then 'E.2.3.1 Sub-study details' should also be completed.
			</report>

			<assert
				field-description="E.3 Principal inclusion criteria (list the most important, max 5000 characters)"
			 id="73" owning="sectionE" rule-id="FEAT6.2.4" web="true"
				section="E.3 and E.4 and E.5 Principal inclusion criteria, Principal exclusion and Primary end point(s)"
				jexl="!empty(ctaGeneralInfo.principalInclusionCriteria)"
				test="ct:principal_inclusion_criteria_localized/ct:principal_inclusion_criteria[@locale='en'] != ''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert
				field-description="E.4 Principal exclusion criteria (list the most important, max 5000 characters)"
			 id="74" owning="sectionE" rule-id="FEAT6.2.4" web="true"
				section="E.3 and E.4 and E.5 Principal inclusion criteria, Principal exclusion and Primary end point(s)"
				jexl="!empty(ctaGeneralInfo.principalExclusionCriteria)"
				test="ct:principal_exclusion_criteria_localized/ct:principal_exclusion_criteria[@locale='en']!= ''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.5.1 Primary end point(s) (max 5000 characters)"
			 id="75" owning="sectionE" rule-id="FEAT6.2.4" web="true"
				section="E.3 and E.4 and E.5 Principal inclusion criteria, Principal exclusion and Primary end point(s)"
				jexl="!empty(ctaGeneralInfo.primaryEndpoints)"
				test="ct:primary_endpoints_localized/ct:primary_endpoints[@locale='en'] != ''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.5.1.1 Timepoint(s) of evaluation of this end point"
			 id="76" owning="sectionE" rule-id="FEAT6.2.4" web="true"
				section="E.3 and E.4 and E.5 Principal inclusion criteria, Principal exclusion and Primary end point(s)"
				jexl="!empty(ctaGeneralInfo.primaryEndpointsEval)"
				test="ct:primary_endpoints_eval_localized/ct:primary_endpoints_eval[@locale='en'] != ''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.5.2 Secondary end point(s) (max 5000 characters)"
			 id="77" owning="sectionE" rule-id="FEAT6.2.4" web="true"
				section="E.3 and E.4 and E.5 Principal inclusion criteria, Principal exclusion and Primary end point(s)"
				jexl="!empty(ctaGeneralInfo.secondaryEndpoints)"
				test="ct:secondary_endpoints_localized/ct:secondary_endpoints[@locale='en'] != ''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.5.2.1	Timepoint(s) of evaluation of this end point"
			 id="78" owning="sectionE" rule-id="FEAT6.2.4" web="true"
				section="E.3 and E.4 and E.5 Principal inclusion criteria, Principal exclusion and Primary end point(s)"
				jexl="!empty(ctaGeneralInfo.secondaryEndpointsEval)"
				test="ct:secondary_endpoints_eval_localized/ct:secondary_endpoints_eval[@locale='en'] != ''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<report field-description="E.6 Scope of the trial" id="79"
				owning="sectionE" rule-id="FEAT6.2.1.32a" web="true"
				section="E.6 and E.7 Scope of the Trial, Trial Type and Phase"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopeDiagnosis != 1 
					  and ctaGeneralInfo.ctaTrialScope.hasScopeProphylaxis != 1
					  and ctaGeneralInfo.ctaTrialScope.hasScopeTherapy != 1
					  and ctaGeneralInfo.ctaTrialScope.hasScopeSafety != 1
					  and ctaGeneralInfo.ctaTrialScope.hasScopeEfficacy != 1
					  and ctaGeneralInfo.ctaTrialScope.hasScopePharmacokinetic != 1
					  and ctaGeneralInfo.ctaTrialScope.hasScopePharmacodynamic != 1
					  and ctaGeneralInfo.ctaTrialScope.hasScopeBioequivalence != 1
					  and ctaGeneralInfo.ctaTrialScope.hasScopeDoseResponse != 1
					  and ctaGeneralInfo.ctaTrialScope.hasScopePharmacogenetic != 1
					  and ctaGeneralInfo.ctaTrialScope.hasScopePharmacogenomic != 1
					  and ctaGeneralInfo.ctaTrialScope.hasScopePharmacoeconomic != 1
					  and ctaGeneralInfo.ctaTrialScope.hasOthers != 1"
				test="ct:has_scope_diagnosis!='1' and ct:has_scope_prophylaxis!='1'
					and ct:has_scope_therapy!='1' and ct:has_scope_safety!='1'
					and ct:has_scope_efficacy!='1' and ct:has_scope_pharmacokinetic!='1'
					and ct:has_scope_pharmacodynamic!='1' and ct:has_scope_bioequivalence!='1'
					and ct:has_scope_dose_response!='1' and ct:has_scope_pharmacogenetic!='1'
					and ct:has_scope_pharmacogenomic!='1' and ct:has_scope_pharmacoeconomic!='1'
					and ct:has_others!='1'">
				At least one of the answers from 'E.6.1 Diagnosis' to 'E.6.13 Others' should be 'Yes'.
			</report>
			
			<report field-description="E.6 Scope of the trial" id="80"
				owning="sectionE" rule-id="FEAT6.2.1.32b" web="true"
				section="E.6 and E.7 Scope of the Trial, Trial Type and Phase"
				jexl="(ctaGeneralInfo.ctaTrialScope.hasOthers == 1 
						and empty(ctaGeneralInfo.ctaTrialScope.otherDetails))
					  or (ctaGeneralInfo.ctaTrialScope.hasOthers != 1
					    and !empty(ctaGeneralInfo.ctaTrialScope.otherDetails))"
				test="(ct:has_others='1' 
						and (count(ct:has_other_details_localized/ct:has_other_details)= 0
							or ct:has_other_details_localized/ct:has_other_details[@locale='en']=''))
					  or (ct:has_others!='1'
					  	and ct:has_other_details_localized/ct:has_other_details[@locale='en']!='')">
				If 'E.6.13 Others' is 'Yes' then the applicant must specify the scope of the trial in 'E.6.13.1'.
			</report>

			<assert field-description="E.6.1 Diagnosis" id="81"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopeDiagnosis != -1"
				test="ct:has_scope_diagnosis!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.6.2 Prophylaxis" id="82"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopeProphylaxis != -1"
				test="ct:has_scope_prophylaxis!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.6.3 Therapy" id="83"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopeTherapy != -1"
				test="ct:has_scope_therapy!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.6.4 Safety" id="84"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopeSafety != -1"
				test="ct:has_scope_safety!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.6.5 Efficacy" id="85"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopeEfficacy != -1"
				test="ct:has_scope_efficacy!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.6.6 Pharmacokinetic" id="86"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopePharmacokinetic != -1"
				test="ct:has_scope_pharmacokinetic!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.6.7 Pharmacodynamic" id="87"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopePharmacodynamic != -1"
				test="ct:has_scope_pharmacodynamic!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.6.8 Bioequivalence" id="88"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopeBioequivalence != -1"
				test="ct:has_scope_bioequivalence!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.6.9 Dose response" id="89"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopeDoseResponse != -1"
				test="ct:has_scope_dose_response!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.6.10 Pharmacogenetic" id="90"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopePharmacogenetic != -1"
				test="ct:has_scope_pharmacogenetic!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.6.11 Pharmacogenomic" id="91"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopePharmacogenomic != -1"
				test="ct:has_scope_pharmacogenomic!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.6.12 Pharmacoeconomic"
			 id="92" owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasScopePharmacoeconomic != -1"
				test="ct:has_scope_pharmacoeconomic!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.6.13 Others" id="93"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.6 Scope of the trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialScope.hasOthers != -1"
				test="ct:has_others!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<report field-description="E.7 Trial type and phase" id="94" owning="sectionE"
				rule-id="FEAT6.2.1.33a" section="E.6 and E.7 Scope of the Trial, Trial Type and Phase" web="true"
				jexl="ctaGeneralInfo.ctaTrialTypeAndPhase.isInPhaseOne !=1 
					  and ctaGeneralInfo.ctaTrialTypeAndPhase.isFirstHumanAdministration !=1
					  and ctaGeneralInfo.ctaTrialTypeAndPhase.isInBioequivalenceStudy !=1
					  and ctaGeneralInfo.ctaTrialTypeAndPhase.isInOtherPhase !=1
					  and ctaGeneralInfo.ctaTrialTypeAndPhase.isInPhaseTwo !=1
					  and ctaGeneralInfo.ctaTrialTypeAndPhase.isInPhaseThree != 1
					  and ctaGeneralInfo.ctaTrialTypeAndPhase.isInPhaseFour != 1"
				test="ct:is_in_phase_one!='1' 
					  and ct:is_first_human_administration!='1'
					  and ct:is_in_bioequivalence_study!='1'
					  and ct:is_in_other_phase!='1'
					  and ct:is_in_phase_two!='1'
					  and ct:is_in_phase_three!='1'
					  and ct:is_in_phase_four!='1'">
                At least one of 'E.7.1 Human pharmacology (Phase I)' (including E.7.1.x subfields) to 'E.7.4 Therapeutic use (Phase IV)' should be answered 'Yes'.
			</report>
			
			<report field-description="E.7 Trial type and phase" id="142" owning="sectionE"
				rule-id="FEAT6.2.1.33c" section="E.6 and E.7 Scope of the Trial, Trial Type and Phase" web="true"
				jexl="ctaGeneralInfo.ctaTrialTypeAndPhase.isInPhaseOne ==1 
					  and ctaGeneralInfo.ctaTrialTypeAndPhase.isFirstHumanAdministration !=1
					  and ctaGeneralInfo.ctaTrialTypeAndPhase.isInBioequivalenceStudy !=1
					  and ctaGeneralInfo.ctaTrialTypeAndPhase.isInOtherPhase !=1"
				test="ct:is_in_phase_one='1' 
					  and ct:is_first_human_administration!='1'
					  and ct:is_in_bioequivalence_study!='1'
					  and ct:is_in_other_phase!='1'">
                If 'E.7.1 Human pharmacology (Phase I)' is 'Yes' then at least one of the subfields in E.7.1 should be answered 'Yes'.
			</report>
			
			<assert field-description="E.7.1 Human pharmacology (Phase I)"
			 id="95" owning="sectionE" rule-id="FEAT6.2.4" section="E.7 Trial type and phase" web="true"
				jexl="ctaGeneralInfo.ctaTrialTypeAndPhase.isInPhaseOne != -1"
				test="ct:is_in_phase_one!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.7.1.1 First administration to humans"
			 id="96" owning="sectionE" rule-id="FEAT6.2.4" section="E.7 Trial type and phase" web="true"
				jexl="ctaGeneralInfo.ctaTrialTypeAndPhase.isFirstHumanAdministration != -1"
				test="ct:is_first_human_administration!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.7.1.2	Bioequivalence study"
			 id="97" owning="sectionE" rule-id="FEAT6.2.4" section="E.7 Trial type and phase" web="true"
				jexl="ctaGeneralInfo.ctaTrialTypeAndPhase.isInBioequivalenceStudy != -1"
				test="ct:is_in_bioequivalence_study!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.7.1.3 Other" id="98"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.7 Trial type and phase" web="true"
				jexl="ctaGeneralInfo.ctaTrialTypeAndPhase.isInOtherPhase != -1"
				test="ct:is_in_other_phase!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<report field-description="E.7.1.3 Other" id="99" owning="sectionE"
				rule-id="FEAT6.2.1.33b" section="E.6 and E.7 Scope of the Trial, Trial Type and Phase" web="true"
				jexl="(ctaGeneralInfo.ctaTrialTypeAndPhase.isInOtherPhase ==1
					  	and empty(ctaGeneralInfo.ctaTrialTypeAndPhase.otherPhaseDetails))
					  or (ctaGeneralInfo.ctaTrialTypeAndPhase.isInOtherPhase !=1
					  	and !empty(ctaGeneralInfo.ctaTrialTypeAndPhase.otherPhaseDetails))"
				test="(ct:is_in_other_phase='1' 
					  	and (count(ct:other_phase_details_localized/ct:other_phase_details)=0 
					  		or ct:other_phase_details_localized/ct:other_phase_details[@locale='en']=''))
					  or (ct:is_in_other_phase!='1' 
					  	and ct:other_phase_details_localized/ct:other_phase_details[@locale='en']!='')">
                'E.7.1.3.1 Trial type Other specification' should be answered if the parent question is answered "Yes".
			</report>

			<assert field-description="E.7.2 Therapeutic exploratory (Phase II)"
			 id="100" owning="sectionE" rule-id="FEAT6.2.4" section="E.7 Trial type and phase" web="true"
				jexl="ctaGeneralInfo.ctaTrialTypeAndPhase.isInPhaseTwo != -1"
				test="ct:is_in_phase_two!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.7.3 Therapeutic confirmatory (Phase III)"
			 id="101" owning="sectionE" rule-id="FEAT6.2.4" section="E.7 Trial type and phase" web="true"
				jexl="ctaGeneralInfo.ctaTrialTypeAndPhase.isInPhaseThree != -1"
				test="ct:is_in_phase_three!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.7.4 Therapeutic use (Phase IV)"
			 id="102" owning="sectionE" rule-id="FEAT6.2.4" section="E.7 Trial type and phase" web="true"
				jexl="ctaGeneralInfo.ctaTrialTypeAndPhase.isInPhaseFour != -1"
				test="ct:is_in_phase_four!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<report field-description="E.8.1 Controlled" id="103" owning="sectionE" 
				rule-id="FEAT6.2.1.34a" section="E.8 Design of the Trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialDesign.isControlled ==1
					  and (ctaGeneralInfo.ctaTrialDesign.isRandomised == -1
					  or ctaGeneralInfo.ctaTrialDesign.isOpen == -1
					  or ctaGeneralInfo.ctaTrialDesign.isSingleBlind == -1
					  or ctaGeneralInfo.ctaTrialDesign.isDoubleBlind == -1
					  or ctaGeneralInfo.ctaTrialDesign.isParallelGroup == -1
					  or ctaGeneralInfo.ctaTrialDesign.isCrossOver == -1
					  or ctaGeneralInfo.ctaTrialDesign.isOtherType == -1
					  or ctaGeneralInfo.ctaTrialDesign.isComparatorMedicalProduct == -1
					  or ctaGeneralInfo.ctaTrialDesign.isComparatorPlacebo == -1
					  or ctaGeneralInfo.ctaTrialDesign.isComparatorOther == -1)"
				test="ct:is_controlled='1' 
					 and (ct:is_randomised='-1' 
					 or ct:is_open='-1' 
					 or ct:is_single_blind='-1' 
					 or ct:is_double_blind='-1' 
					 or ct:is_parallel_group='-1' 
					 or ct:is_cross_over='-1' 
					 or ct:is_other_type='-1' 
					 or ct:is_comparator_medical_product='-1' 
					 or ct:is_comparator_placebo='-1' 
					 or ct:is_comparator_other='-1')">
				If 'E.8.1 Controlled' is "Yes" then questions E.8.1.1 to E.8.1.7 and E.8.2 sub-questions are mandatory.
			</report>
			
			<report field-description="E.8.1 Controlled" id="104" owning="sectionE" 
				rule-id="FEAT6.2.1.34b" section="E.8 Design of the Trial"
				test="ct:is_controlled!='1' 
					 and (ct:is_single_blind='1' 
					 or ct:is_double_blind='1' 
					 or ct:is_parallel_group='1' 
					 or ct:is_cross_over='1' 
					 or ct:is_comparator_medical_product='1' 
					 or ct:is_comparator_placebo='1' 
					 or ct:is_comparator_other='1')">
				If 'E.8.1 Controlled is "No" or "Not Answered" then questions E.8.1.3 to E.8.1.6 and E.8.2 sub-questions should be "Not Answered" or "No".
			</report>
			
			<assert field-description="E.8.1 Controlled" id="105"
				owning="sectionE" rule-id="FEAT6.2.4" section="E.8 Design of the Trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialDesign.isControlled != -1"
				test="ct:is_controlled!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<report field-description="E.8.1 Controlled"
			 id="106" owning="sectionE" rule-id="FEAT6.2.1.55" section="E.8 Design of the Trial"  web="true"
				jexl="(ctaGeneralInfo.ctaTrialDesign.isControlled  == 1
						and (empty(ctaGeneralInfo.ctaTrialDesign.numberTreatmentArms) or 
							(ctaGeneralInfo.ctaTrialDesign.isComparatorMedicalProduct !=1
							 and ctaGeneralInfo.ctaTrialDesign.isComparatorPlacebo !=1
							 and ctaGeneralInfo.ctaTrialDesign.isComparatorOther !=1)))
					   or (ctaGeneralInfo.ctaTrialDesign.isControlled != 1
					   		and (ctaGeneralInfo.ctaTrialDesign.isComparatorMedicalProduct ==1
							 or ctaGeneralInfo.ctaTrialDesign.isComparatorPlacebo ==1
							 or ctaGeneralInfo.ctaTrialDesign.isComparatorOther ==1))"
				test="(ct:is_controlled='1' 
						and (ct:number_treatment_arms=''
							or (ct:is_comparator_medical_product!='1'
								and ct:is_comparator_placebo!='1'
								and ct:is_comparator_other!='1'))
					   ) or (ct:is_controlled!='1'
						and (ct:is_comparator_medical_product='1'
							or ct:is_comparator_placebo='1'
							or ct:is_comparator_other='1'))">
				If the answer to 'E.8.1 Controlled' is "Yes" then at least one of the sub questions of section 
				'E.8.2 Specify the comparator' should be answered "Yes" and 'E.8.2.4 Number of treatment arms in the trial' should be answered.
			</report>

			<report field-description="E.8.1.2, E.8.1.3 and E.8.1.4"
			 id="107" owning="sectionE" rule-id="FEAT6.2.1.35" section="E.8 Design of the Trial" web="true"
				jexl="(ctaGeneralInfo.ctaTrialDesign.isSingleBlind == 1 and ctaGeneralInfo.ctaTrialDesign.isDoubleBlind == 1)
					   or (ctaGeneralInfo.ctaTrialDesign.isSingleBlind == 1 and ctaGeneralInfo.ctaTrialDesign.isOpen == 1)
					   or (ctaGeneralInfo.ctaTrialDesign.isOpen == 1 and ctaGeneralInfo.ctaTrialDesign.isDoubleBlind == 1)"
				test="(ct:is_single_blind='1' and ct:is_double_blind='1' ) 
					 or (ct:is_open='1' and ct:is_single_blind='1' ) 
					 or (ct:is_open='1' and ct:is_double_blind='1' ) ">
				Only one of the questions 'E.8.1.2 Trial design Open', 'E.8.1.3 Trial design Single blind' or 'E.8.1.4 Trial design Double blind' should be answered "Yes".
			</report>
			
			<report field-description="E.8.1.7 Other"
			 id="108" owning="sectionE" rule-id="FEAT6.2.1.36" section="E.8 Design of the Trial" web="true"
				jexl="(ctaGeneralInfo.ctaTrialDesign.isOtherType == 1 
						and empty(ctaGeneralInfo.ctaTrialDesign.otherTypeDetails)) 
					  or (ctaGeneralInfo.ctaTrialDesign.isOtherType != 1 
					  	and !empty(ctaGeneralInfo.ctaTrialDesign.otherTypeDetails))"
				test="(ct:is_other_type='1' 
						and  (count(ct:other_type_details_localized/ct:other_type_details)=0
							or ct:other_type_details_localized/ct:other_type_details[@locale='en']=''))
					   or (ct:is_other_type!='1' 
					   	and  ct:other_type_details_localized/ct:other_type_details[@locale='en'] !='') ">
				If 'E.8.1.7 Trial design Other' is answered "Yes" then the	related free text field should be completed.
			</report>

			<report field-description="E.8.2.3 Other Comparator"
			 id="109" owning="sectionE" rule-id="FEAT6.2.1.38" section="E.8 Design of the Trial" web="true"
				jexl="(ctaGeneralInfo.ctaTrialDesign.isComparatorOther == 1 
						and empty(ctaGeneralInfo.ctaTrialDesign.comparatorOtherDetails)) 
					  or (ctaGeneralInfo.ctaTrialDesign.isComparatorOther != 1 
					  	and !empty(ctaGeneralInfo.ctaTrialDesign.comparatorOtherDetails))"
				test="(ct:is_comparator_other='1' 
						and (count(ct:comparator_other_details_localized/ct:comparator_other_details)=0 
							or ct:comparator_other_details_localized/ct:comparator_other_details[@locale='en']='' ))
					  or (ct:is_comparator_other!='1' 
					  	and  ct:comparator_other_details_localized/ct:comparator_other_details[@locale='en']!='') ">
				If 'E.8.2.3 Other ' is "Yes" and E.8.2.3.1 If 'other', specify the comparator' should be completed.
			</report>
			
			<assert field-description="E.8.3/E.8.4"
			 id="110" owning="sectionE" rule-id="FEAT6.2.1.58" section="E.8 Design of the Trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialDesign.isMultipleSite == 1 
					  or ctaGeneralInfo.ctaTrialDesign.isSingleSite == 1"
				test="ct:is_single_site='1' or  ct:is_multiple_site='1'">
				One of 'E.8.3 Will this trial be conducted at a single site globally?' or 'E.8.4 Will this trial be 
				conducted at multiple sites globally?' must be answered 'Yes'.
			</assert>

			<assert
				field-description="E.8.3 Single site in the Member State concerned (see also Section G)"
			 id="111" owning="sectionE" rule-id="FEAT6.2.4" section="E.8 Design of the Trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialDesign.isSingleSite != -1"
				test="ct:is_single_site!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert
				field-description="E.8.4 Multiple sites in the Member State concerned (see also Section G)"
			 id="112" owning="sectionE" rule-id="FEAT6.2.4" section="E.8 Design of the Trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialDesign.isMultipleSite != -1"
				test="ct:is_multiple_site!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.8.6.2 Trial being conducted completely outside of the EEA"
				 id="113" owning="sectionE" rule-id="FEAT6.2.4" section="E.8 Design of the Trial" web="true"
					jexl="ctaGeneralInfo.ctaTrialDesign.isConductedCompleteOutEea != -1"
					test="ct:is_conducted_complete_out_eea!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="E.8.6.3 Specify the countries outside of the EEA in which trial sites are planned"
				 id="114" owning="sectionE" rule-id="FEAT6.2.4" section="E.8 Design of the Trial" web="true"
					jexl="!empty(ctaGeneralInfo.ctaTrialDesign.countries)"
					test="count(ct:planned_regions/ct:planned_region)!=0">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.8.6.4 Specify the number of sites anticipated outside of the EEA"
				 id="115" owning="sectionE" rule-id="FEAT6.2.4" section="E.8 Design of the Trial" web="true"
					jexl="!empty(ctaGeneralInfo.ctaTrialDesign.noSitesAnticipatedWorld)"
					test="ct:no_sites_anticipated_world!=''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="E.8.7 Trial having an independent data monitoring committee?"
			 id="116" owning="sectionE" rule-id="FEAT6.2.4" section="E.8 Design of the Trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialDesign.hasDataMonitoringCommitee != -1"
				test="ct:has_data_monitoring_commitee!='-1'">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert
				field-description="E.8.8 Definition of the end of the trial and justification in the case where it is not the last visit of the last subject undergoing the trial"
			 id="117" owning="sectionE" rule-id="FEAT6.2.4" section="E.8 Design of the Trial" web="true"
				jexl="!empty(ctaGeneralInfo.endOfTrialDefinition)"
				test="ct:end_of_trial_definition_localized/ct:end_of_trial_definition[@locale='en'] != ''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<!-- NOTE: 6.2.2.22 is slightly different in EEA and 3rd country -->
			<report field-description="E.8.9 Initial estimate of the duration of the trial" web="true"
				 id="118" owning="sectionE" rule-id="FEAT6.2.2.22" section="E.8 Design of the Trial"
					jexl="ctaGeneralInfo.estTrialDurationWorldYears + 
						   	ctaGeneralInfo.estTrialDurationWorldMonth + 
						   	ctaGeneralInfo.estTrialDurationWorldDays le 0"
					test="translate( concat(' ', ct:est_trial_duration_world_years), ' ', '0' ) +
						translate( concat(' ', ct:est_trial_duration_world_month), ' ', '0' ) +
						translate( concat(' ', ct:est_trial_duration_world_days), ' ', '0' ) &lt;= 0">
				'E.8.9.2 Initial estimate of the duration of the trial (years, months, days) in all countries concerned
				by the trial' should be completed. The total aggregate Years + Months + Days should be greater or more 
				than zero.
          	</report>
		</rule>

		<rule context="ct:population_information">
		
			<assert field-description="F.1.1 Are the trial subjects under 18?"
			 id="119" owning="sectionF" rule-id="FEAT6.2.4" section="F.1 Age Range" web="true"
				jexl="ctaPopulationOfSubjects.ctaPopulationAges.hasUnder18 != -1"
				test="ct:has_under_18!='-1' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert
				field-description="F.1.1 Are the trial subjects under 18?/F.1.2 Adults (18-64 years)/ F.1.3 Elderly (>=65 years)"
			 id="120" owning="sectionF" rule-id="FEAT6.2.1.54"
				section="F.1 Age Range" web="true"
				jexl="ctaPopulationOfSubjects.ctaPopulationAges.hasUnder18 == 1 
					  or ctaPopulationOfSubjects.ctaPopulationAges.hasAdults == 1
					  or ctaPopulationOfSubjects.ctaPopulationAges.hasElderly ==1"
				test="ct:has_under_18 = '1' 
					  or ct:has_adults = '1'
					  or ct:has_elderly = '1'">
				At least one of F.1.1, F.1.2, F.1.3 must be answered 'Yes'.
			</assert>
			
			<report field-description="F.1.1 Are the trial subjects under 18"
			 id="121" owning="sectionF" rule-id="FEAT6.2.1.40a" section="F. Population of Trial Subjects" web="true"
				jexl="ctaPopulationOfSubjects.ctaPopulationAges.hasUnder18 == 1 
					  and (empty(ctaPopulationOfSubjects.ctaPopulationAges.under18SubjectsNo) 
					  	or ctaPopulationOfSubjects.ctaPopulationAges.under18SubjectsNo le 0)"
				test="ct:has_under_18='1' 
					  and (ct:under_18_subjects_no='0' or ct:under_18_subjects_no='')">
				If 'F.1.1 Are the trial subjects under 18?' is 'Yes'' then 'Number of subjects for this age range' 
				should be completed and greater than 0.
			</report>

			<report field-description="F.1.1 Are the trial subjects under 18"
			 id="122" owning="sectionF" rule-id="FEAT6.2.1.40b" section="F. Population of Trial Subjects" 
				test="ct:has_under_18='1' 
					and	ct:under_18_subjects_no &gt; '0' and ct:under_18_subjects_no!='' 
					and	ct:has_in_utero!='1'  
					and ct:has_preterm_newborn_infants!='1'
					and ct:has_newborns!='1' 
					and ct:has_infants_and_toddlers!='1' 
					and ct:has_childen!='1' 
					and ct:has_adolescents!='1'">
				If 'F.1.1 Are the trial subjects under 18?' is 'Yes' then one of fields F.1.1.2 to F.1.1.6 should be also 'Yes'.
			</report>
			
			<report field-description="F.1.1 Are the trial subjects under 18"
			 id="123" owning="sectionF" rule-id="FEAT6.2.1.40c" section="F. Population of Trial Subjects" web="true"
				jexl="(ctaPopulationOfSubjects.ctaPopulationAges.hasInUtero == 1 
					  	and (empty(ctaPopulationOfSubjects.ctaPopulationAges.inUteroNo) 
					  		or ctaPopulationOfSubjects.ctaPopulationAges.inUteroNo le 0))
					  or (ctaPopulationOfSubjects.ctaPopulationAges.hasPretermNewbornInfants == 1 
					  	and (empty(ctaPopulationOfSubjects.ctaPopulationAges.pretermNewbornInfantsNo) 
					  		or ctaPopulationOfSubjects.ctaPopulationAges.pretermNewbornInfantsNo le 0))
					  or (ctaPopulationOfSubjects.ctaPopulationAges.hasNewborns == 1 
					  	and (empty(ctaPopulationOfSubjects.ctaPopulationAges.newbornsNo) 
					  		or ctaPopulationOfSubjects.ctaPopulationAges.newbornsNo le 0))
					  or (ctaPopulationOfSubjects.ctaPopulationAges.hasInfantsAndToddlers == 1 
					  	and (empty(ctaPopulationOfSubjects.ctaPopulationAges.infantsAndToddlersNo) 
					  		or ctaPopulationOfSubjects.ctaPopulationAges.infantsAndToddlersNo le 0))
					  or (ctaPopulationOfSubjects.ctaPopulationAges.hasChildren == 1 
					  	and (empty(ctaPopulationOfSubjects.ctaPopulationAges.childrenNo) 
					  		or ctaPopulationOfSubjects.ctaPopulationAges.childrenNo le 0))
					  or (ctaPopulationOfSubjects.ctaPopulationAges.hasAdolescents == 1 
					  	and (empty(ctaPopulationOfSubjects.ctaPopulationAges.adolescentsNo) 
					  		or ctaPopulationOfSubjects.ctaPopulationAges.adolescentsNo le 0))"
				test="(ct:has_in_utero='1' 
					 	and (ct:in_utero_no &lt;='0' 
					 		or ct:in_utero_no=''))
					 or (ct:has_preterm_newborn_infants='1' 
					 	and (ct:preterm_newborn_infants_no &lt;='0' 
					 		or ct:preterm_newborn_infants_no='')) 
					 or	(ct:has_newborns='1' 
					 	and (ct:newborns_no &lt;='0' 
					 		or ct:newborns_no='')) 
					 or (ct:has_infants_and_toddlers='1' 
					 	and (ct:infants_and_toddlers_no &lt;='0' 
					 		or ct:infants_and_toddlers_no=''))
					 or	(ct:has_childen='1' 
					 	and (ct:childen_no &lt;='0' 
					 		or ct:childen_no='')) 
					 or	(ct:has_adolescents='1' 
					 	and (ct:adolescents_no &lt;='0' 
					 		or ct:adolescents_no=''))">
				If F.1.1 is "Yes" you should provide number of subjects for this age range and all sub-questions should be answered and at least one of F.1.1.1 to F.1.1.6 should be "Yes".
				Also, for all elements that are 'Yes', the relevant values of F.1.1.1.1 to F.1.1.6.1 should be greated than 0.
			</report>
			
			<assert field-description="F.1.2 Adults (18-64 years)"
			 id="124" owning="sectionF" rule-id="FEAT6.2.4" section="F.1 Age Range" web="true"
				jexl="ctaPopulationOfSubjects.ctaPopulationAges.hasAdults != -1"
				test="ct:has_adults!='-1' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<report field-description="F.1.2 Adults (18-64 years)"
			 id="216" owning="sectionF" rule-id="FEAT6.2.1.41" section="F. Population of Trial Subjects" web="true"
				jexl="ctaPopulationOfSubjects.ctaPopulationAges.hasAdults == 1 
					  and (empty(ctaPopulationOfSubjects.ctaPopulationAges.adultsNo) 
					  	or ctaPopulationOfSubjects.ctaPopulationAges.adultsNo le 0)"
				test="ct:has_adults='1' 
					  and (ct:adults_no='0' or ct:adults_no='')">
				If 'F.1.2 Adults (18-64 years)' is 'Yes' then 'F.1.2.1 Number of subjects for this age range' should be completed and greater than 0.
			</report>

			<assert field-description="F.1.3 Elderly (>=65 years)"
			 id="126" owning="sectionF" rule-id="FEAT6.2.4" section="F.1 Age Range" web="true"
				jexl="ctaPopulationOfSubjects.ctaPopulationAges.hasElderly != -1"
				test="ct:has_elderly!='-1' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<report field-description="F.1.3 Elderly (>=65 years)"
			 id="217" owning="sectionF" rule-id="FEAT6.2.1.42" section="F. Population of Trial Subjects" web="true"
				jexl="ctaPopulationOfSubjects.ctaPopulationAges.hasElderly == 1 
					  and (empty(ctaPopulationOfSubjects.ctaPopulationAges.elderlyNo) 
					  	or ctaPopulationOfSubjects.ctaPopulationAges.elderlyNo le 0)"
				test="ct:has_elderly='1' 
					  and (ct:elderly_no='0' or ct:elderly_no='')">
				If 'F.1.3 Elderly (>=65 years)' is 'Yes' then 'F.1.3.1 Number of subjects for this age range' should be completed and greater than 0.
			</report>
			
			<assert
				field-description="F.2.1 Female/F.2.2 Male"
			 id="128" owning="sectionF" rule-id="FEAT6.2.1.62"
				section="F.2 Gender" web="true"
				jexl="ctaPopulationOfSubjects.isGenderMale == 1 
					  or ctaPopulationOfSubjects.isGenderFemale == 1"
				test="ct:is_gender_female = '1' 
					  or ct:is_gender_male = '1'">
				At least one of F.2.1, F.2.2 must be answered 'Yes'.
			</assert>
			
			<assert field-description="F.2.1 Female " id="129"
				owning="sectionF" rule-id="FEAT6.2.4" section="F.2 Gender" web="true"
				jexl="ctaPopulationOfSubjects.isGenderFemale != -1"
				test="ct:is_gender_female!='-1' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert field-description="F.2.2 Male" id="130"
				owning="sectionF" rule-id="FEAT6.2.4" section="F.2 Gender" web="true"
				jexl="ctaPopulationOfSubjects.isGenderMale != -1"
				test="ct:is_gender_male!='-1' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="F.3.1 Healthy volunteers"
			 id="131" owning="sectionF" rule-id="FEAT6.2.4" section="F.3 Group of trial subjects" web="true"
				jexl="ctaPopulationOfSubjects.hasHealthyVolunteers != -1"
				test="ct:has_healthy_volunteers!='-1' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="F.3.2 Patients" id="132"
				owning="sectionF" rule-id="FEAT6.2.4" section="F.3 Group of trial subjects" web="true"
				jexl="ctaPopulationOfSubjects.hasPatients != -1"
				test="ct:has_patients!='-1' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>

			<assert field-description="F.3.3 Specific vulnerable populations"
			 id="133" owning="sectionF" rule-id="FEAT6.2.4" section="F.3 Group of trial subjects" web="true"
				jexl="ctaPopulationOfSubjects.hasSpecificVunerablePopul != -1"
				test="ct:has_specific_vunerable_popul!='-1' ">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<report field-description="F.3.3 Specific vulnerable populations"
				 id="134" owning="sectionF" rule-id="FEAT6.2.1.47" section="F. Population of Trial Subjects" web="true"
				jexl="(ctaPopulationOfSubjects.hasSpecificVunerablePopul == 1 
						and ctaPopulationOfSubjects.hasWomenChildBearPotent !=1
						and ctaPopulationOfSubjects.hasWomenChildBearContra !=1
						and ctaPopulationOfSubjects.hasPregnantWomen !=1
						and ctaPopulationOfSubjects.hasNursingWomen !=1
						and ctaPopulationOfSubjects.hasEmergencySituation !=1
						and ctaPopulationOfSubjects.hasIncapableConsent !=1
						and ctaPopulationOfSubjects.hasOtherPatient !=1)
					  or (ctaPopulationOfSubjects.hasSpecificVunerablePopul != 1 
						and (ctaPopulationOfSubjects.hasWomenChildBearPotent ==1
							or ctaPopulationOfSubjects.hasWomenChildBearContra ==1
							or ctaPopulationOfSubjects.hasPregnantWomen ==1
							or ctaPopulationOfSubjects.hasNursingWomen ==1
							or ctaPopulationOfSubjects.hasEmergencySituation ==1
							or ctaPopulationOfSubjects.hasIncapableConsent ==1
							or ctaPopulationOfSubjects.hasOtherPatient ==1)) "
					test="(ct:has_specific_vunerable_popul='1' 
							and ct:has_women_child_bear_potent!='1' 
							and ct:has_women_child_bear_contra!='1' 
							and	ct:has_pregnant_women!='1' 
							and	ct:has_nursing_women!='1' 
							and ct:has_emergency_situation!='1' 
							and	ct:has_incapable_consent!='1' 
							and	ct:has_other_patient!='1')
						  or(ct:has_specific_vunerable_popul!='1' 
							and (ct:has_women_child_bear_potent='1' 
								or ct:has_women_child_bear_contra='1' 
								or ct:has_pregnant_women='1' 
								or ct:has_nursing_women='1'
								or ct:has_emergency_situation='1' 
								or ct:has_incapable_consent='1' 
								or ct:has_other_patient='1'))">
				- If 'F.3.3 Specific vulnerable populations' is "Yes", F.3.3.1 to F.3.3.7 are mandatory and at least one should be answered "Yes".
				- If 'F.3.3 Specific vulnerable populations' is "No", F.3.3.1 to F.3.3.7 should be answered "No" or "Not Answered".
			</report>
		
			<report field-description="F.3.3.6 subjects incapable of giving consent personally"
			 id="135" owning="sectionF" rule-id="FEAT6.2.2.23" section="F. Population of Trial Subjects" web="true"
				jexl="(ctaPopulationOfSubjects.hasIncapableConsent == 1 
					  	and empty(ctaPopulationOfSubjects.hasIncapableConsentDetails))
					  or (ctaPopulationOfSubjects.hasIncapableConsent != 1 
					  	and !empty(ctaPopulationOfSubjects.hasIncapableConsentDetails))"
				test="(ct:has_incapable_consent='1' 
						and (count(ct:has_incapable_consent_details_localized/ct:has_incapable_consent_details)=0
							or ct:has_incapable_consent_details_localized/ct:has_incapable_consent_details[@locale='en']='')) 
					  or (ct:has_incapable_consent!='1' 
					  	and ct:has_incapable_consent_details_localized/ct:has_incapable_consent_details[@locale='en']!='') ">
			 Question 'F.3.3.6.1 Population subjects incapable of giving consent details' should be answered if the answer to the parent question is "Yes".
	  		</report>
		
			<report field-description="F.3.3.7 Others"
			 id="136" owning="sectionF" rule-id="FEAT6.2.2.24" section="F. Population of Trial Subjects" web="true"
				jexl="(ctaPopulationOfSubjects.hasOtherPatient == 1 
					  	and empty(ctaPopulationOfSubjects.otherPatientDetails))
					  or (ctaPopulationOfSubjects.hasOtherPatient != 1 
					  	and !empty(ctaPopulationOfSubjects.otherPatientDetails))"
				test="(ct:has_other_patient='1'  
						and (count(ct:other_patient_details_localized/ct:other_patient_details)=0
							or ct:other_patient_details_localized/ct:other_patient_details[@locale='en']=''))
					  or (ct:has_other_patient!='1'  
					  	and ct:other_patient_details_localized/ct:other_patient_details[@locale='en']!='')">
				If 'F.3.3.7 Others' is "Yes" then 'F.3.3.7.1 If others, specify the specific vulnerable populations' must be answered.
			</report>
		
			<assert	field-description="F.4.2.2 In the whole clinical trial"
			 id="137" owning="sectionF" rule-id="FEAT6.2.4"
				section="F.4 Planned number of subjects to be included" web="true"
				jexl="!empty(ctaPopulationOfSubjects.ctaPopulationPlannedNo.inWholeTrial)"
				test="ct:in_whole_trial!=''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
			
			<assert
				field-description="F.5 Plans for treatment or care after the subject has ended the participation in the trial"
			 id="138" owning="sectionF" rule-id="FEAT6.2.4"
				section="F.5 Plans for treatment or care after the subject has ended the participation in the trial" web="true"
				jexl="!empty(ctaPopulationOfSubjects.ctaPopulationPlannedNo.postTrialTreatmentDetails)"
				test="ct:post_trial_treatment_details_localized/ct:post_trial_treatment_details[@locale='en'] !=''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
        </rule>

		<rule context="ct:ethics_committee">
			<assert field-description="H.4.1 Clinical trial has been reviewed and given the necessary approval(s) by the Regulatory Authority (where required) and by the Ethics Committee(s)"
			 id="139" owning="sectionH" rule-id="FEAT6.2.4" web="true"
				section="H. Ethics Committee"
				jexl="!empty(ctaEthicsCommittee.firstAuthorisedThirdCountry)"
				test="ct:first_authorised_third_country!=''">
				You must complete all mandatory fields with a value and where appropriate provide an answer Yes or No. A field not completed will generate errors listed in the validation report.
			</assert>
		</rule>

	</pattern>
	
</schema>
