<?xml version="1.0" encoding="UTF-8"?>
<schema>
		
	<ns uri="http://eudract.emea.europa.eu/schema/clinical_trial" 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"
				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="1=1">
				There should always be at least one IMP.
			</assert>
		</rule>
    	
		<rule context="ct:protocol_information">
			<assert field-description="A.1 National Competent Authority" web="true"
			 id="3" owning="sectionA" rule-id="FEAT6.2.4" section="A. Trial Identification"
				jexl="!empty(cta.submissionOrg.name)"
				test="ct:cta_identification/ct:nca!='' ">
				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.2 EudraCT Number" id="4" 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="5" 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="6" 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="7" 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.4.3 Sponsor's protocol date yyyy-mm-dd" web="true"
			 id="8" owning="sectionA" rule-id="FEAT6.2.4" section="A. Trial Identification"
				jexl="!empty(cta.sponsorProtocolVersionDate)"
				test="ct:sponsor_protocol_version_date!='' ">
				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.6 Is this a resubmission?" web="true"
			 id="9" owning="sectionA" rule-id="FEAT6.2.4" section="A. Trial Identification"
				jexl="cta.isResubmission != -1"
				test="ct:is_resubmission!='-1' and ct:is_resubmission!='' ">
				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.6 Indicate the resubmission letter or else select 'First submission'" web="true"
			 id="10" owning="sectionA" rule-id="FEAT6.2.4" section="A. Trial Identification"
				jexl="!empty(cta.resubmissionLetter.eutctId)"
				test="ct:resubmission_letter/ct:eutct_id!=$params//controlled_term[./name='empty_term']/eutct_id and count(ct:resubmission_letter)!=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="A.6 Resubmission letter" id="11" owning="sectionA" 
				rule-id="FEAT6.2.2.01" section="A. Trial Identification"
				test="
					(ct:is_resubmission='0' and number(ct:resubmission_letter/ct:eutct_id)!=$params//controlled_term[./name='first_resubmission_letter']/eutct_id) 
					or
					(ct:is_resubmission='1' and  number(ct:resubmission_letter/ct:eutct_id)=$params//controlled_term[./name='first_resubmission_letter']/eutct_id)">
				The	question "Is this a resubmission? Should always be answered "Yes" or "No". If the answer is "No" the 
				entry from the drop-down list should be	"First Submission" if the answer is "Yes" the entry	should be 
				Resubmission A or B or further letters in the list.
			</report>
			<assert
				field-description="A.7 Is the trial part of an agreed Paediatric Investigation Plan?" web="true"
			 id="12" 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>
		</rule>

		<rule context="ct:sponsor">
			<assert field-description="B.1.1 Name of organisation"
			 id="13" 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.2.1 Given name" id="14" web="true"
				owning="sectionB" rule-id="FEAT6.2.4" section="B.1 Sponsor Organisation"
				jexl="!empty(sponsor.sponsorContactInfo.contactPerson.firstName)"
				test="ct:sponsor_contact_info/ct:first_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.2.3 Family name" id="15" web="true"
				owning="sectionB" rule-id="FEAT6.2.4" section="B.1 Sponsor Organisation"
				jexl="!empty(sponsor.sponsorContactInfo.contactPerson.familyName)"
				test="ct:sponsor_contact_info/ct:family_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.1 Street Address" id="16" web="true"
				owning="sectionB" rule-id="FEAT6.2.4" section="B.1 Sponsor Organisation"
				jexl="!empty(sponsor.sponsorOrgInfo.contactAddresses[0].streetAddress1)"
				test="ct:sponsor_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.1.3.2 Town/ city" id="17" web="true"
				owning="sectionB" rule-id="FEAT6.2.4" section="B.1 Sponsor Organisation"
				jexl="!empty(sponsor.sponsorOrgInfo.contactAddresses[0].city)"
				test="ct:sponsor_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.1.3.3 Post code" id="18"
				owning="sectionB" rule-id="FEAT6.2.4" section="B.1 Sponsor Organisation"
				test="ct:sponsor_info/ct:address/ct:post_code!='' ">
					Complete if known.
			</assert>

			<assert field-description="B.1.3.4 Country" id="19" 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:address/ct:country)!=0 and ct:sponsor_info/ct:address/ct:country!=''
				and number(ct:sponsor_info/ct:address/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>
			
			<let name="sponsor_country_eutct_id" value="ct:sponsor_info/ct:address/ct:country/ct:eutct_id"/>
			<let name="legalrep_exist" value="count(ct:sponsor_info/ct:address/ct:country/ct:eutct_id)!=0 
						and count($params//country[@member_state='true']/eutct_id[./text()=$sponsor_country_eutct_id])=0"/>
			
			<report field-description="B.1.3.4 Country" id="20" owning="sectionB" rule-id="FEAT6.2.2.26"
				section="B.2 Legal Representative"
				test="
				(
					not($legalrep_exist)
				)
				and
				(
					ct:legal_rep_info/ct:name != ''
					or ct:legal_rep_contact_info/ct:first_name != ''
					or ct:legal_rep_contact_info/ct:middle_name != ''
					or ct:legal_rep_contact_info/ct:family_name != ''
					or ct:legal_rep_info/ct:address/ct:street_address != ''
					or ct:legal_rep_info/ct:address/ct:city != ''
					or ct:legal_rep_info/ct:address/ct:post_code != ''
					or ct:legal_rep_info/ct:address/ct:country/ct:eutct_id != ''
					or ct:legal_rep_info/ct:address/ct:country/ct:eutct_version != ''
					or ct:legal_rep_info/ct:email != ''
					or ct:legal_rep_info/ct:phones/phone[@type='PHONE']/ct:international_dialing_prefix != ''
					or ct:legal_rep_info/ct:phones/phone[@type='PHONE']/ct:country_dialing_prefix != ''
					or ct:legal_rep_info/ct:phones/phone[@type='PHONE']/ct:local_area_code != ''
					or ct:legal_rep_info/ct:phones/phone[@type='PHONE']/ct:phone_number != ''
					or ct:legal_rep_info/ct:phones/phone[@type='PHONE']/ct:extension != ''
					or ct:legal_rep_info/ct:phones/phone[@type='FAX']/ct:international_dialing_prefix != ''
					or ct:legal_rep_info/ct:phones/phone[@type='FAX']/ct:country_dialing_prefix != ''
					or ct:legal_rep_info/ct:phones/phone[@type='FAX']/ct:local_area_code != ''
					or ct:legal_rep_info/ct:phones/phone[@type='FAX']/ct:phone_number != ''
					or ct:legal_rep_info/ct:phones/phone[@type='FAX']/ct:extension != ''
				)
				">
				The 'B.2 Legal Representative' section should only be completed when 'B.1.3.4 Country' is not a member state.
			</report>
			
			<assert field-description="B.1.4 Telephone number/B.1.5 Fax number/B.1.6 E-mail" id="21" web="true"
				owning="sectionB" rule-id="FEAT6.2.1.01" section="B.1 Sponsor Organisation"
				jexl="for (phone: sponsor.sponsorOrgInfo.contactPhones) {
 						if (!empty(phone.phoneNumber) ) {
 							return true;
 						}
 					};
 					if (!empty(sponsor.sponsorOrgInfo.contactEmails[0].email)) {
 						return true;
 					}
 					return false;"
				test="
					(count(ct:sponsor_info/ct:phones/ct:phone[@type='PHONE'])!=0
                		and ct:sponsor_info/ct:phones/ct:phone[@type='PHONE']/ct:phone_number!='')
                	or (count(ct:sponsor_info/ct:phones/ct:phone[@type='FAX'])!=0 and
                		ct:sponsor_info/ct:phones/ct:phone[@type='FAX']/ct:phone_number!='')
                	or ct:sponsor_info/ct:email!=''">
                You should provide either a telephone number or fax number or email address for the sponsor organisation information on the trial.
			</assert>
			
			<report field-description="B.2.1 Name of organisation" id="22" owning="sectionB" rule-id="FEAT6.2.4"
					section="B.2 Legal Representative" web="true"
					jexl="if(sponsor.sponsorOrgInfo.contactAddresses[0].country != null
								and !sponsor.sponsorOrgInfo.contactAddresses[0].country.memState 
								and empty(sponsor.legalRepOrgInfo.contactOrganisation.name)) {
							return true;
						}
						return false;"
					test="$legalrep_exist and ct:legal_rep_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.
			</report>

			<report field-description="B.2.2.1 Given name" id="23" web="true"
				owning="sectionB" rule-id="FEAT6.2.4" section="B.2 Legal Representative"
				jexl="if(sponsor.sponsorOrgInfo.contactAddresses[0].country != null
								and !sponsor.sponsorOrgInfo.contactAddresses[0].country.memState 
								and empty(sponsor.legalRepContactInfo.contactPerson.firstName)) {
							return true;
						}
						return false;"
				test="$legalrep_exist and ct:legal_rep_contact_info/ct:first_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.
			</report>
			
			<report field-description="B.2.2.3 Family name" id="24" web="true"
				owning="sectionB" rule-id="FEAT6.2.4" section="B.2 Legal Representative"
				jexl="if(sponsor.sponsorOrgInfo.contactAddresses[0].country != null
								and !sponsor.sponsorOrgInfo.contactAddresses[0].country.memState 
								and empty(sponsor.legalRepContactInfo.contactPerson.familyName)) {
							return true;
						}
						return false;"
				test="$legalrep_exist and ct:legal_rep_contact_info/ct:family_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.
			</report>
			
			<report field-description="B.2.3.1 Street Address" id="25" web="true"
				owning="sectionB" rule-id="FEAT6.2.4" section="B.2 Legal Representative"
				jexl="if(sponsor.sponsorOrgInfo.contactAddresses[0].country != null
								and !sponsor.sponsorOrgInfo.contactAddresses[0].country.memState 
								and empty(sponsor.legalRepOrgInfo.contactAddresses[0].streetAddress1)) {
							return true;
						}
						return false;"
				test="$legalrep_exist and 
						(count(ct:legal_rep_info/ct:address/ct:street_address)=0 
								or ct:legal_rep_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.
			</report>

			<report field-description="B.2.3.2 Town/ city" id="26" web="true"
				owning="sectionB" rule-id="FEAT6.2.4" section="B.2 Legal Representative"
				jexl="if(sponsor.sponsorOrgInfo.contactAddresses[0].country != null
								and !sponsor.sponsorOrgInfo.contactAddresses[0].country.memState 
								and empty(sponsor.legalRepOrgInfo.contactAddresses[0].city)) {
							return true;
						}
						return false;"
				test="$legalrep_exist and 
						(count(ct:legal_rep_info/ct:address/ct:city)=0
							or ct:legal_rep_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.
			</report>

			<report field-description="B.2.3.3 Post code" id="27"
				owning="sectionB" rule-id="FEAT6.2.4" section="B.2 Legal Representative"
				test="$legalrep_exist and 
						(count(ct:legal_rep_info/ct:address/ct:post_code)=0 
							or ct:legal_rep_info/ct:address/ct:post_code='')">
					Complete if known.
			</report>

			<report field-description="B.2.3.4 Country" id="28" web="true"
				owning="sectionB" rule-id="FEAT6.2.4" section="B.2 Legal Representative"
				jexl="if(sponsor.sponsorOrgInfo.contactAddresses[0].country != null
								and !sponsor.sponsorOrgInfo.contactAddresses[0].country.memState 
								and empty(sponsor.legalRepOrgInfo.contactAddresses[0].country)) {
							return true;
						}
						return false;"
				test="$legalrep_exist
						and (count(ct:legal_rep_info/ct:address/ct:country)=0
							or ct:legal_rep_info/ct:address/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.
			</report>
			
			<report field-description="B.2.4 Telephone number/B.2.5 Fax number/B.2.6 E-mail" id="29" web="true"
				owning="sectionB" rule-id="FEAT6.2.1.03" section="B.2 Legal Representative"
				jexl="if(sponsor.sponsorOrgInfo.contactAddresses[0].country != null
							and !sponsor.sponsorOrgInfo.contactAddresses[0].country.memState) {
						for (phone: sponsor.legalRepOrgInfo.contactPhones) {
	 						if (!empty(phone.phoneNumber) ) {
	 							return false;
	 						}
	 					};
	 					
	 					if (!empty(sponsor.legalRepOrgInfo.contactEmails[0].email)) {
	 						return false;
	 					}
	 					
	 					return true;
	 				}
	 				return false;"
				test="$legalrep_exist and
					ct:legal_rep_info/ct:email='' 
					and (count(ct:legal_rep_info/ct:phones/ct:phone[@type='PHONE']/ct:phone_number)=0 
						or ct:legal_rep_info/ct:phones/ct:phone[@type='PHONE']/ct:phone_number='')
					and (count(ct:legal_rep_info/ct:phones/ct:phone[@type='FAX']/ct:phone_number)=0
						or ct:legal_rep_info/ct:phones/ct:phone[@type='FAX']/ct:phone_number='')">
                You should provide either a telephone number or fax number or email address 
                for the legal representative of the trial.
			</report>

			<assert field-description="B.3.1 and B.3.2 Status of the sponsor"
			 id="30" 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="31" 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="32" 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="33" 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="34" 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="35" 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="36" 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="37" 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="38" 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="39" 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">
			<assert field-description="C.1.1 and C.1.2 and C.1.3"
			 id="40" owning="sectionC" rule-id="FEAT6.2.4"
				section="C.1 Applicant Identification - Request for the Competent Authority" web="true"
				jexl="!empty(ncaApplicant.caApplicantType.eutctId) and ncaApplicant.caApplicantType.eutctId != emptyTerm"
				test="ct:applicant_type!='' and count(ct:applicant_type)!=0 and number(ct:applicant_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="C.1.4.1	Name of Organisation"
			 id="41" owning="sectionC" rule-id="FEAT6.2.4" web="true"
				section="C.1 Applicant Identification - Request for the Competent Authority"
				jexl="!empty(ncaApplicant.ncaOrgInfoContact.contactOrganisation.name)"
				test="ct:applicant_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="C.1.4.2.1 Given Name"
			 id="42" owning="sectionC" rule-id="FEAT6.2.4" web="true"
				section="C.1 Applicant Identification - Request for the Competent Authority"
				jexl="!empty(ncaApplicant.ncaContactInfo.contactPerson.firstName)"
				test="ct:applicant_contact_info/ct:first_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="C.1.4.2.3 Family name" id="43"
				owning="sectionC" rule-id="FEAT6.2.4" web="true"
				section="C.1 Applicant Identification - Request for the Competent Authority"
				jexl="!empty(ncaApplicant.ncaContactInfo.contactPerson.familyName)"
				test="ct:applicant_contact_info/ct:family_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="C.1.4.3.1 Street address"
			 id="44" owning="sectionC" rule-id="FEAT6.2.4" web="true"
				section="C.1 Applicant Identification - Request for the Competent Authority"
				jexl="!empty(ncaApplicant.ncaOrgInfoContact.contactAddresses[0].streetAddress1)"
				test="ct:applicant_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="C.1.4.3.2 Town/ city" id="45"
				owning="sectionC" rule-id="FEAT6.2.4" web="true"
				section="C.1 Applicant Identification - Request for the Competent Authority"
				jexl="!empty(ncaApplicant.ncaOrgInfoContact.contactAddresses[0].city)"
				test="ct:applicant_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="C.1.4.3.4 Country" id="46"
				owning="sectionC" rule-id="FEAT6.2.4" web="true"
				section="C.1 Applicant Identification - Request for the Competent Authority"
				jexl="!empty(ncaApplicant.ncaOrgInfoContact.contactAddresses[0].country) 
					and ncaApplicant.ncaOrgInfoContact.contactAddresses[0].country.eutctId != emptyTerm"
				test="ct:applicant_info/ct:address/ct: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>

			<report field-description="C.1.4.4/C.1.4.5/C.1.4.6 Applicant Telephone/Fax/Email"
			 id="47" owning="sectionC" rule-id="FEAT6.2.2.04" web="true"
				section="C.1 Applicant Identification - Request for the Competent Authority"
				jexl="for (phone: ncaApplicant.ncaOrgInfoContact.contactPhones) {
	 					if (!empty(phone.phoneNumber) ) {
	 						return false;
	 					}
	 				};
 					if (!empty(ncaApplicant.ncaOrgInfoContact.contactEmails[0].email)) {
 						return false;
 					}
 					return true;"
				test="(count(ct:applicant_info/ct:phones/ct:phone[@type='FAX'])=0 
                	or ct:applicant_info/ct:phones/ct:phone[@type='FAX']/ct:phone_number='' )
                	and (count(ct:applicant_info/ct:phones/ct:phone[@type='PHONE'])=0 
                	or ct:applicant_info/ct:phones/ct:phone[@type='PHONE']/ct:phone_number='' )
              		and ct:applicant_info/ct:email='' ">
              At least one of 'C.1.4.4 CA Telephone number', 'C.1.4.5 CA Applicant Fax', and 'C.1.4.6 CA Applicant Email' must be completed
             </report>
			
			<report field-description="C.1.5 Request to receive a copy of the CTA data as XML"
			 id="48" owning="sectionC" rule-id="FEAT6.2.2.05a" web="true"
				section="C.1 Applicant Identification - Request for the Competent Authority"
				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?" web="true"
			 id="49" owning="sectionC" rule-id="FEAT6.2.4" section="C.1 Applicant Identification - Request for the Competent Authority"
				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:iec_request">
			<assert field-description="C.2 Request for Opinion of the Ethics Committee"
			 id="50" owning="sectionC" rule-id="FEAT6.2.2.06"
				section="C.2 Applicant Identification - Request for the Ethics Committee"
				test="
				(ct:applicant_type/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id and
				ct:applicant_info/ct:name='' and
				ct:applicant_contact_info/ct:first_name='' and
				ct:applicant_contact_info/ct:middle_name='' and
				ct:applicant_contact_info/ct:family_name='' and
				(count(ct:applicant_info/ct:address/ct:street_address)=0 or ct:applicant_info/ct:address/ct:street_address='') and
				(count(ct:applicant_info/ct:address/ct:post_code)=0 or ct:applicant_info/ct:address/ct:post_code='') and
				(count(ct:applicant_info/ct:address/ct:city)=0 or ct:applicant_info/ct:address/ct:city='') and
				(count(ct:applicant_info/ct:address/ct:country)=0 or ct:applicant_info/ct:address/ct:country/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id) and
				count(ct:applicant_info/ct:phones/ct:phone[@type='PHONE'])=0 and 
				count(ct:applicant_info/ct:phones/ct:phone[@type='FAX'])=0 and
				ct:applicant_info/ct:email='')
				or
				(ct:applicant_type/ct:eutct_id!=$params//controlled_term[./name='empty_term']/eutct_id and
				ct:applicant_info/ct:name!='' and
				ct:applicant_contact_info/ct:family_name!='' and
				ct:applicant_info/ct:address/ct:street_address!='' and
				ct:applicant_info/ct:address/ct:post_code!='' and
				ct:applicant_info/ct:address/ct:city!='' and
				ct:applicant_info/ct:address/ct:country/ct:eutct_id!=$params//controlled_term[./name='empty_term']/eutct_id and
				count(ct:applicant_info/ct:phones/ct:phone[@type='PHONE'])!=0 and 
				count(ct:applicant_info/ct:phones/ct:phone[@type='FAX'])!=0 and 
				ct:applicant_info/ct:phones/ct:phone[@type='PHONE']/ct:phone_number!='' and
				ct:applicant_info/ct:phones/ct:phone[@type='FAX']/ct:phone_number!='' and
				ct:applicant_info/ct:email!='')">
				This section is not mandatory. It should be completed for applications to ethics committees in those Member States where the Ethics Committee requests this form as part of the application to them. If completed then all fields mandatory except 'C.2.5.2.1 Given Name' and 'C.2.5.2.2 Middle name'.
			</assert>
		</rule>

		<rule context="ct:medicinal_product">
			<assert field-description="D.1.2 and D.1.3 Category" id="51" 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="52" 
				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="53"
					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.maNumber) 
								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:ma_number=''
							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, D.2.1.1.3 and D.2.1.2 must be answered.
			</report>
			
			<report field-description="D.2.1 Has the IMP to be used in the trial a marketing authorisation" id="54"
					owning="sectionD" rule-id="FEAT6.2.2.7a" 
					section="D.1/D.2 IMP Identification and Status Details" web="true"
					jexl="
						imp.hasMa == 0 
						and (
							!empty(imp.impMs.tradeNameInMs) 
							or !empty(imp.impMs.evIdentifiableProductCode) 
							or !empty(imp.impMs.maHolder) 
							or !empty(imp.impMs.maNumber) 
							or imp.impMs.isImpModified == 1
							or !empty(imp.impMs.impModifiedSpecification) 
							or (
								!empty(imp.impMs.grantedMaCountry) 
								and imp.impMs.grantedMaCountry.eutctId != emptyTerm
							)
							or imp.impMs.isGrantingMaConcernedMs == 1
							or imp.impIdentNotPossible.hasAnyAuthActiveSubstance == 1
							or imp.impIdentNotPossible.hasLocalSiteProducts == 1
							or imp.impIdentNotPossible.isAtcGroupUsed == 1
							or imp.impIdentNotPossible.hasImpOtherIdentification == 1
							or !empty(imp.impIdentNotPossible.otherDescription)
						)
					"
					test="
						ct:has_ma='0' 
						and (
							ct:imp_member_state/ct:trade_name_in_ms!='' 
							or ct:imp_member_state/ct:ev_identifiable_product_code!='' 				
							or ct:imp_member_state/ct:ma_holder!='' 
							or ct:imp_member_state/ct:ma_number!=''  							
							or ct:imp_member_state/ct:is_imp_modified='1' 
							or ct:imp_member_state/ct:imp_modified_specification!=''
							or ct:imp_member_state/ct:granted_ma_country/ct:eutct_id!=$params//controlled_term[./name='empty_term']/eutct_id 
							or ct:imp_member_state/ct:is_granting_ma_concerned_ms='1'
							or ct:imp_identification_not_possible/ct:has_any_auth_active_substance='1' 
							or ct:imp_identification_not_possible/ct:has_local_site_products='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:other_description!=''
						)">
				If 'D.2.1 IMP has MA' is answered "No" the applicant should then go to D.2.3, and need not answer further questions in D.2.1 or D.2.2.
				Regarding autofill in of the member state and setting D.2.1.2.1 = Yes, If the IMP does not have a marketing authorisation which is the default setting, please remove the country and set D.2.1.2.1 = No to avoid the validation rule error.
			</report>
			
			<let name="granted_ma_country_eutct_id"
				value="ct:imp_member_state/ct:granted_ma_country/ct:eutct_id" />
				
			<let name="granted_ma_country_not_member"
				value="count($params//country[@member_state='true']/eutct_id[./text()=$granted_ma_country_eutct_id])=0" />
			
			<report field-description="D.2.1 Has the IMP to be used in the trial a marketing authorisation" id="55"
				owning="sectionD" rule-id="FEAT6.2.2.7d"
				section="D.1/D.2 IMP Identification and Status Details" web="true"
				jexl="
					(imp.impMs.grantedMaCountry.eutctId != europeanUnionEutctId and
						(empty(imp.impMs.isGrantingMaConcernedMs) or imp.impMs.isGrantingMaConcernedMs == -1)) or
					(imp.impMs.grantedMaCountry.eutctId == europeanUnionEutctId and
						(imp.impMs.isGrantingMaConcernedMs == 1 or imp.impMs.isGrantingMaConcernedMs == 0))
				"
				test="
					(ct:imp_member_state/ct:granted_ma_country/ct:eutct_id != $params//country[./name='European Union']/eutct_id and
						(ct:imp_member_state/ct:is_granting_ma_concerned_ms = '' or ct:imp_member_state/ct:is_granting_ma_concerned_ms = -1)) or
					(ct:imp_member_state/ct:granted_ma_country/ct:eutct_id = $params//country[./name='European Union']/eutct_id and
						(ct:imp_member_state/ct:is_granting_ma_concerned_ms = 1 or ct:imp_member_state/ct:is_granting_ma_concerned_ms = 0))
				">
				'D.2.1.2.1 Is this the Member State concerned with this application' must be left not answered if 'D.2.1.2 country which granted the MA' is 'European Union', and is mandatory when D.2.1.2 is not 'European Union'.
			</report>
			
			<report field-description="D.2.2 IMP to be used in the CT has a marketing authorisation" 
				 id="195" 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.maNumber) 
						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:ma_number=''
						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="56" 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.1.1.4 Is the IMP modified in relation to its Marketing Authorisation" id="57"
				owning="sectionD" rule-id="FEAT6.2.2.08"
				section="D.1/D.2 IMP Identification and Status Details"
				test="(ct:imp_member_state/ct:is_imp_modified='0' and ct:imp_member_state/ct:imp_modified_specification!='')
						or (ct:imp_member_state/ct:is_imp_modified='1' and ct:imp_member_state/ct:imp_modified_specification='')">
					If question D.2.1.1.4 is answered "Yes" then question D.2.1.1.4.1 should be answered.
			</report>
			
			<report field-description="D.2.2.3 The products to be administered as IMPs are defined as belonging to an ATC group" 
             id="58" 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>
			
			<assert field-description="D.2.3 IMPD Submitted" id="59" owning="sectionD" rule-id="FEAT6.2.2.14"
				section="D.1/D.2 IMP Identification and Status Details" web="true"
				
				jexl="(imp.hasFullImpd == 1	and imp.hasSimplifiedImpd == 0 and imp.hasSummaryOfProdCharacter == 0) or
						(imp.hasSimplifiedImpd == 1 and imp.hasFullImpd == 0 and imp.hasSummaryOfProdCharacter == 0) or
						(imp.hasSummaryOfProdCharacter == 1	and imp.hasSimplifiedImpd == 0	and imp.hasFullImpd == 0)"
						
				test="(ct:has_full_impd = 1 and ct:has_simplified_impd = 0 and ct:has_summary_of_prod_character = 0) or
						(ct:has_simplified_impd = 1 and ct:has_full_impd = 0 and ct:has_summary_of_prod_character = 0) or
						(ct:has_summary_of_prod_character = 1 and ct:has_simplified_impd = 0 and ct:has_full_impd = 0)">
						
				'D.2.3.1 Full IMPD submitted', 'D.2.3.2 Simplified IMPD submitted' and 'D.2.3.3 Only SmPC submitted' are mandatory, but only one may be "Yes" and the other two should be "No".
			</assert>
			
			<assert field-description="D.2.3.1 Full IMPD" id="60" owning="sectionD" rule-id="FEAT6.2.4"
				section="D.1/D.2 IMP Identification and Status Details" web="true"
				jexl="!empty(imp.hasFullImpd) and imp.hasFullImpd != -1"
				test="ct:has_full_impd != '' and ct:has_full_impd != -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.2.3.2 Simplified IMPD" id="61" owning="sectionD" rule-id="FEAT6.2.4"
				section="D.1/D.2 IMP Identification and Status Details" web="true"
				jexl="!empty(imp.hasSimplifiedImpd) and imp.hasSimplifiedImpd != -1"
				test="ct:has_simplified_impd != '' and ct:has_simplified_impd != -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.2.3.3 Summary of product characteristics (SmPC) only:" id="62" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.1/D.2 IMP Identification and Status Details" web="true"
				jexl="!empty(imp.hasSummaryOfProdCharacter) and imp.hasSummaryOfProdCharacter != -1"
				test="ct:has_summary_of_prod_character != '' and ct:has_summary_of_prod_character != -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.2.4 Has the use of the IMP been previously authorised in a clinical trial conducted by the sponsor in the Community?" id="63" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.1/D.2 IMP Identification and Status Details"
				test="ct:is_prev_auth_in_community != '' and ct:is_prev_auth_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.2.4 Has the use of the IMP been previously authorised in a clinical trial conducted by the sponsor in the Community"
			 id="64" owning="sectionD" rule-id="FEAT6.2.2.15"
				section="D.1/D.2 IMP Identification and Status Details"
				test="(ct:is_prev_auth_in_community='1' and count(ct:member_states/ct:country)=0) or
						(ct:is_prev_auth_in_community='0' and count(ct:member_states/ct:country)!=0)">
				'D.2.4 IMP previously used for CT in community' is a mandatory field and if "Yes" so is D.2.4.1 for at least one MS.
			</report>
			
			<assert field-description="D.2.5 Has the IMP been designated in this indication as an orphan drug in the Community?" id="65" 
				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.2.5 Has the IMP been designated in this indication as an orphan drug in the Community" id="66" 
				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.6 Has the IMP been the subject of scientific advice related to this clinical trial?" id="67" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.1/D.2 IMP Identification and Status Details" web="true"
				jexl="!empty(imp.hasScientificAdvice) and imp.hasScientificAdvice != -1"
				test="ct:has_scientific_advice != '' and ct:has_scientific_advice != -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.2.6 Has the IMP been the subject of scientific advice related to this clinical trial" id="68" 
					owning="sectionD" rule-id="FEAT6.2.2.16" web="true"
					section="D.1/D.2 IMP Identification and Status Details"
					jexl="imp.hasScientificAdvice == 1
							and 
							((imp.hasScientificAdviceChmp == -1 or imp.hasScientificAdviceMsca == -1)
							or
							(imp.hasScientificAdviceChmp != 1 and imp.hasScientificAdviceMsca != 1))"
					test="
						ct:has_scientific_advice='1' 
						and
						((ct:has_scientific_advice_chmp='-1' or ct:has_scientific_advice_nca='-1')
						or
						(ct:has_scientific_advice_chmp!='1' and ct:has_scientific_advice_nca!='1'))
	    			">
    			-'D.2.6' is a mandatory field and if it is ticked "Yes", question 'D.2.6.1' should be completed 
    			and at least one of the subquestions 'D.2.6.1.1 SA from CHMP' and 'D.2.6.1.2 SA from NCA' 
    			should be answered and one should be "Yes".
			</report>
			
			<report field-description="D.3.4 Pharmaceutical Form"
			 id="69" 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>
			
			<assert field-description="D.3.4.1 Is this a specific paediatric formulation?" id="70" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3 Description of the IMP" web="true"
				jexl="!empty(imp.isPaediatricFormulation) and imp.isPaediatricFormulation != -1"
				test="ct:is_paediatric_formulation != '' and ct:is_paediatric_formulation != -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.5 Maximum duration of treatment of a subject according to the protocol" id="71" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3 Description of the IMP"
				test="ct:max_duration_imp != ''">
				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.6.1 For first trial only"
			 id="72" owning="sectionD" rule-id="FEAT6.2.1.57" 
				section="D.3 Description of the IMP" web="true"
				jexl="cta.ctaGeneralInfo.ctaTrialTypeAndPhase.isFirstHumanAdministration == 1 and (
						(imp.firstDoseFihPerDayTotal == -1 or
						empty(imp.firstDoseFihTotalDoseNum) or
						imp.firstDoseFihTotalDoseUnit.eutctId == emptyTerm or
						imp.firstDoseFihRoa.eutctId == emptyTerm)
						or
						!(imp.maxDosePerdayTotalImp == -1 or
						empty(imp.totalDoseNumber) or
						imp.totalDoseUnit.eutctId == emptyTerm or
						imp.maxDoseRouteOfAdministration.eutctId == emptyTerm)
						)"
				test="../../ct:general_information/ct:is_first_human_administration='1' and (
						 (ct:first_dose_fih_per_day_total='-1' or
						 ct:first_dose_fih_total_dose_num='' or
						 ct:first_dose_fih_total_dose_unit/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id or
						 ct:first_dose_fih_roa/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id)
						 or
						not(ct:max_dose_perday_total_imp='-1' or
						ct:total_dose_number='' or
						ct:total_dose_unit/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id or
						ct:max_dose_route_of_administration/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id)
						 )">
				If E.7.1.1 First Admin to Humans = 'Yes' then D.3.6.1 fields should always be completed and 
				D.3.6.2 fields should be left blank. 
			</report>
			
			<report field-description="D.3.6.2 For all trials" id="73" 
				owning="sectionD" rule-id="FEAT6.2.1.61"
				section="D.3 Description of the IMP" web="true"
				jexl="cta.ctaGeneralInfo.ctaTrialTypeAndPhase.isFirstHumanAdministration == 0 and (
						(imp.maxDosePerdayTotalImp == -1 or
						empty(imp.totalDoseNumber) or
						imp.totalDoseUnit.eutctId == emptyTerm or
						imp.maxDoseRouteOfAdministration.eutctId == emptyTerm)
						or
						!(imp.firstDoseFihPerDayTotal == -1 or
						empty(imp.firstDoseFihTotalDoseNum) or
						imp.firstDoseFihTotalDoseUnit.eutctId == emptyTerm or
						imp.firstDoseFihRoa.eutctId == emptyTerm)
						)"
				test="../../ct:general_information/ct:is_first_human_administration='0' and (
						(ct:max_dose_perday_total_imp='-1' or
						ct:total_dose_number='' or
						ct:total_dose_unit/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id or
						ct:max_dose_route_of_administration/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id)
						or
						not(ct:first_dose_fih_per_day_total='-1' or
						 ct:first_dose_fih_total_dose_num='' or
						 ct:first_dose_fih_total_dose_unit/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id or
						 ct:first_dose_fih_roa/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id)
						 )">
				If E.7.1.1 First Admin to Humans = 'No' then D.3.6.2 fields should always be completed and 
				D.3.6.1 fields should be left blank. 
			</report>
			
			<report field-description="D.3.7 Route(s) of Administration of this IMP"
			 id="74" 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="75" 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="76" 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="77" 
				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="78" 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="79" 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="80" 
				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="81" 
				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="82" 
				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.1 Somatic cell therapy medicinal product"
			 id="83" owning="sectionD" rule-id="FEAT6.2.1.16" section="D.4 Somatic Cell Therapy Investigational Medicinal Product"
				test="
					(
						ct:is_somatic_therapy_mp='1'
						and (
							(ct:somatic_cell/ct:somatic_cell_autologous='1' and ct:somatic_cell/ct:somatic_cell_allogeneic='0' and ct:somatic_cell/ct:somatic_cell_xenogeneic='0')
							or (ct:somatic_cell/ct:somatic_cell_autologous='0' and ct:somatic_cell/ct:somatic_cell_allogeneic='1' and ct:somatic_cell/ct:somatic_cell_xenogeneic='0')
							or (ct:somatic_cell/ct:somatic_cell_autologous='0' and ct:somatic_cell/ct:somatic_cell_allogeneic='0' and ct:somatic_cell/ct:somatic_cell_xenogeneic='1')
						)
						and (
							(ct:somatic_cell/ct:somatic_cell_stem='1' and ct:somatic_cell/ct:somatic_cell_differenciated='0' and ct:somatic_cell/ct:somatic_cell_others='0')
							or (ct:somatic_cell/ct:somatic_cell_stem='0' and ct:somatic_cell/ct:somatic_cell_differenciated='1' and ct:somatic_cell/ct:somatic_cell_others='0')
							or (ct:somatic_cell/ct:somatic_cell_stem='0' and ct:somatic_cell/ct:somatic_cell_differenciated='0' and ct:somatic_cell/ct:somatic_cell_others='1')
						)
					)
					or (
						(ct:is_somatic_therapy_mp='0' or ct:is_somatic_therapy_mp='-1')
						and (
							ct:somatic_cell/ct:somatic_cell_autologous='0' and ct:somatic_cell/ct:somatic_cell_allogeneic='0' and ct:somatic_cell/ct:somatic_cell_xenogeneic='0' and
							ct:somatic_cell/ct:somatic_cell_stem='0' and ct:somatic_cell/ct:somatic_cell_differenciated='0' and ct:somatic_cell/ct:somatic_cell_others='0'
						)
					)">
				If 'D.3.11.3.1 Somatic cell therapy MP' is "Yes" 
				then one but only one of the subquestions of section D.4.1 should also be "Yes" and one but only one of the subquestions
				of section D.4.2 should also be Yes (and vice versa). If 'D.3.11.3.1 Somatic cell therapy MP' is No  then all the parts of 
				section 'D.4 Somatic Cell Therapy IMP' is "No" (and vice versa).
			</assert>
			
			<assert field-description="D.3.11.3.2 Gene therapy medical product?" id="84" 
				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="85" 
				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.3 Tissue Engineered Product"
				 id="86" owning="sectionD" rule-id="FEAT6.2.1.48" section="D.3.11 Type of IMP"
					test="
						(ct:is_tissue_engineered_mp='1' 
						and (
							(ct:cell_origin/ct:tissue_eng_origin_autologous='1' and ct:cell_origin/ct:tissue_eng_origin_allogeneic!='1' and ct:cell_origin/ct:tissue_eng_origin_xenogeneic!='1')
							or (ct:cell_origin/ct:tissue_eng_origin_autologous!='1' and ct:cell_origin/ct:tissue_eng_origin_allogeneic='1' and ct:cell_origin/ct:tissue_eng_origin_xenogeneic!='1')
							or (ct:cell_origin/ct:tissue_eng_origin_autologous!='1' and ct:cell_origin/ct:tissue_eng_origin_allogeneic!='1' and ct:cell_origin/ct:tissue_eng_origin_xenogeneic='1')
						)
						and (
							(ct:cell_type/ct:tissue_eng_type_stem='1' and ct:cell_type/ct:tissue_eng_type_differentiated!='1' and ct:cell_type/ct:tissue_eng_other!='1')
							or (ct:cell_type/ct:tissue_eng_type_stem!='1' and ct:cell_type/ct:tissue_eng_type_differentiated='1' and ct:cell_type/ct:tissue_eng_other!='1')
							or (ct:cell_type/ct:tissue_eng_type_stem!='1' and ct:cell_type/ct:tissue_eng_type_differentiated!='1' and ct:cell_type/ct:tissue_eng_other='1')
						))
						or (
							(ct:is_tissue_engineered_mp='0' or ct:is_tissue_engineered_mp='-1')
							and (
								ct:cell_origin/ct:tissue_eng_origin_autologous='0' and ct:cell_origin/ct:tissue_eng_origin_allogeneic='0' and 
								ct:cell_origin/ct:tissue_eng_origin_xenogeneic='0' and ct:cell_type/ct:tissue_eng_type_stem='0' and 
								ct:cell_type/ct:tissue_eng_type_differentiated='0' and ct:cell_type/ct:tissue_eng_other='0'
							)
						)">
				If 'D.3.11.3.3 Tissue Engineered Product' is "Yes" then one but only one of the sub questions of section D.6.1 
				should also be "Yes", and one but only one of the sub questions of section D.6.2 should also be "Yes" (and vice versa). 
			</assert>
			
			<assert field-description="D.3.11.3.4 Combination ATIMP (i.e. one involving a medical device)?" id="87" 
				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="88" 
				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="89" 
				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="90" 
				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>
			
			<report field-description="D.3.11.4 Combination product that includes a device, but does not involve an Advanced Therapy"
			 id="91" owning="sectionD" rule-id="FEAT6.2.1.49a" section="D.3.11 Type of IMP"
				test="(	
				(ct:is_combination_atimp='1' or ct:is_device_included='1') and 
					( (ct:imp_device/ct:device_description='' or
					   ct:imp_device/ct:device_name='' or
					   ct:imp_device/ct:device_implantable='-1' ) 
				   or (ct:imp_device/ct:is_medical_device!='1' and 
				   	   ct:imp_device/ct:has_biomedical_material!='1' and
					   ct:imp_device/ct:has_scaffolds!='1' and
					   ct:imp_device/ct:has_matrices!='1' and
					   ct:imp_device/ct:has_other_device!='1' )   
					) 
				) ">
				If D.3.11.3.4 OR D.3.11.4 = 'Yes' then Section D.7 should be completed.
				D.7.1, D.7.2 and D.7.3 should be answered.
				At least one of D.7.4.1, D.7.4.2, D.7.4.3, D.7.4.4, D.7.4.5 should be 'Yes'.
				If D.7.4.1.1 Medical device have a CE Mark = 'Yes' then D.7.4.1.1.1 Notified body should be completed.
			</report>
			
			<report field-description="D.3.11.4 Combination product that includes a device, but does not involve an Advanced Therapy"
			 id="92" owning="sectionD" rule-id="FEAT6.2.1.49b" section="D.3.11 Type of IMP"
				test="ct:imp_device/ct:has_device_ce_mark='1' and
						ct:imp_device/ct:device_notified_body=''">
				If D.7.4.1.1 Medical device have a CE Mark = 'Yes' then D.7.4.1.1.1 Notified body should be completed.
			</report>
			
			<assert field-description="D.3.11.5 radiopharmaceutical medicinal product?" id="93" 
				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="94" 
				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="95" 
				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="96" 
				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="97" 
				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="98" 
				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="99" 
				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>
			
			<report field-description="D.3.11.11 Herbal medicinal product" id="100"
				owning="sectionD" rule-id="FEAT6.2.2.17" 
				section="D.3.11 Type of IMP" web="true"
				jexl="(
						(
							imp.isGmoMp == 1 and
							(
								(imp.isGeneticallyModAuthAccord == -1 or imp.isGeneticallyModAuthPend == -1)
								or (empty(imp.isGeneticallyModAuthAccord) or empty(imp.isGeneticallyModAuthPend))
							)
						)
						or (imp.isGmoMp == 0 and
							imp.isGeneticallyModAuthAccord != -1 and
							imp.isGeneticallyModAuthPend != 0)
						or (imp.isGmoMp == 0 and
							imp.isGeneticallyModAuthAccord != 0 and
							imp.isGeneticallyModAuthPend != -1)
				
						)"
				test="(
						(
							ct:is_gmo_mp='1' and 
							(
								(ct:is_genetically_mod_auth_accord='-1' or  ct:is_genetically_mod_auth_pend='-1') 
								or (ct:is_genetically_mod_auth_accord='' or  ct:is_genetically_mod_auth_pend='')
							) 
						)
		             	or ( ct:is_gmo_mp='0' and 
		             		ct:is_genetically_mod_auth_accord!='-1' and 
		             		ct:is_genetically_mod_auth_pend!='0')
		             	or ( ct:is_gmo_mp='0' and 
		             		ct:is_genetically_mod_auth_accord!='0' 
		             		and ct:is_genetically_mod_auth_pend!='-1')
	             		)
	             		"> 
		             	- 'D.3.11.10.1 GMP MP Auth granted', 'D.3.11.10.2 GMP MP Auth pending' are only mandatory when the parent question is yes.
			</report>
			
			<assert field-description="D.3.11.12 Homeopathic medicinal product?" id="101" 
				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="102" 
				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="103" 
				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>
			
			<assert field-description="D.3.13 Is it an IMP to be used in a first-in-human clinical trial?" id="104" 
				owning="sectionD" rule-id="FEAT6.2.4"
				section="D.3.11 Type of IMP"
				test="ct:is_first_in_human != '' and ct:is_first_in_human != -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.13.1 If yes, are there risk factors identified, according to the guidance FIH"
			 id="105" owning="sectionD" rule-id="FEAT6.2.2.31" 
				section="D.3.11 Type of IMP"
				test=" (ct:is_first_in_human='1' and ct:first_in_human_risk_factors='') or
					( ct:is_first_in_human!='1' and ct:first_in_human_risk_factors!='') ">	
					You should only provide the risk factors identified, according to the guidance FIH if the IMP is to be used in a first-in-human clinical trial.
			</report>
		</rule>

		<rule context="ct:active_substance">
			<report	field-description="D.3.8 AS INN, D.3.9.1 CAS Number, D.3.9.2 Current sponsor code, D.3.9.3 Other descriptive name"
				id="106" 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>
		
			<assert field-description="D.8.5 Which IMP(s) is it a placebo for?" id="d3" 
					owning="sectionD8" rule-id="FEAT6.2.1.64"
					section="D.8 Information on the Placebo" web="true"
					jexl="size(placebo.ctaPlaceboRelatedImps)!=0"
					test="count(ct:placebo_related_imps/ct:placebo_related_imp)!=0">
				Placebo should be associated with at least one valid IMP.
			</assert>
		
			<report field-description="D.8.5.2 Is it otherwise identical to the IMP?" id="d4" 
					owning="sectionD8" rule-id="FEAT6.2.4"
					section="D.8 Information on the Placebo" web="true"
					jexl="for (placeboRelatedImp: placebo.ctaPlaceboRelatedImps) { 
								if(placeboRelatedImp.isIdenticalToImp == -1) { 
									return true; 
								}
							}
							return false"
					test="ct:placebo_related_imps/ct:placebo_related_imp/ct:is_identical_to_imp=-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.
			</report>
		
			<report field-description="D.8.5.2 Is it otherwise identical to the IMP?" id="d5" 
					owning="sectionD8" rule-id="FEAT6.2.1.28"
					section="D.8 Information on the Placebo" web="true"
					jexl="
						for (placeboRelatedImp: placebo.ctaPlaceboRelatedImps) { 
							if(placeboRelatedImp.isIdenticalToImp == 0 and empty(placeboRelatedImp.majorIngredients)) { 
								return true 
							} 
						}
						return false"
					test="ct:placebo_related_imps/ct:placebo_related_imp/ct:major_ingredients[../ct:is_identical_to_imp=0]=''">
				If 'D.8.5.2 Is it otherwise identical to the IMP?' is No then 
				'D.8.5.2.1 If composition is not otherwise identical, specify the major ingredients' must be completed.
			</report>
		
		</rule>
		
		<rule context="ct:medicinal_product_information">
			<report field-description="D.9 Site(s) where the qualified person certifies batch release" 
			 id="108" owning="sectionD9" rule-id="FEAT6.2.1.59" 
				section="D.9 Site(s) where the qualified person certifies batch release" 
				test="count(ct:medicinal_product[@id=//ct:ctaImps/ct:imp_id])!=count(ct:medicinal_product)">
				Each IMP must be identified under either 'D.9.1 IMPs and placebos for which no responsible site needs to be identified' 
				or 'D.9.2 Add Responsible Site'.
			</report>
			<assert field-description="D.9 Site(s) where the qualified person certifies batch release" 
			 id="109" owning="sectionD9I" rule-id="FEAT6.2.1.59" 
				section="D.9 Site(s) where the qualified person certifies batch release" web="true"
				jexl="  if(size(cta.ctaImps) == 0){
							return true;
						}
						for(imp : cta.ctaImps){
						 var isImpReferencedNoRes = false;
						 var isImpReferencedRes = false;
						 for(refImp : cta.ctaNoResponsibleSiteProd.ctaImps) {
						 	if(imp.equals(refImp)) {
						 		isImpReferencedNoRes = true;
						 		break;
						 	}
						 }
						 if(!isImpReferencedNoRes) {
							 for(resSite : cta.ctaResponsibleSiteProds) {
							 	for(refImp2 : resSite.ctaImps) {
							 		if(imp.equals(refImp2)) {
							 			isImpReferencedRes = true;
							 			break;
							 		}
							 	}
							 }
						 } 
						 if(!isImpReferencedNoRes and !isImpReferencedRes) {
						 	return false;
						 }
					  }
					  return true;"
				test="1=1">
				Each IMP must be identified under either 'D.9.1 IMPs and placebos for which no responsible site needs to be identified' 
				or 'D.9.2 Add Responsible Site'.
			</assert>
		</rule>
		
		<rule context="ct:responsible_site">
			<report field-description="D.9.2 Responsible Site" id="110" owning="sectionD9" rule-id="FEAT6.2.2.19" 
				section="D.9 Site where the qualified person certifies batch release" web="true"
				jexl="responsibleSiteProd.authorisationType.eutctId == emptyTerm
					  or empty(responsibleSiteProd.responsibleSiteOrgInfo.contactOrganisation.name)
					  or empty(responsibleSiteProd.responsibleSiteOrgInfo.contactAddresses[0].country)
					  or responsibleSiteProd.responsibleSiteOrgInfo.contactAddresses[0].country.eutctId == emptyTerm"
				test="ct:authorisation_type/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id 
					  or ct:responsible_site_org_info/ct:name='' 
					  or(count(ct:responsible_site_org_info/ct:address/ct:country))=0
					  or(count(ct:responsible_site_org_info/ct:address/ct:country/ct:eutct_id))=0
					  or ct:responsible_site_org_info/ct:address/ct:country/ct:eutct_id=$params//controlled_term[./name='empty_term']/eutct_id
					  ">
				Where products are to be identified under 'D.9.2 Responsible site', 
				'D.9.2.1 and D.9.2.2 As a manufacturer, importer or both?', 'D.9.2.3 Site organisation name'
				 and 'D.9.2.4.4 Country' are mandatory and must be completed.
			</report>
			
			<report field-description="D.9.2.5 Manufacturer authorisation number"
			 id="111" owning="sectionD9" rule-id="FEAT6.2.2.20" section="D.9  Site where the qualified person certifies batch release"
				test="
				(ct:manufacturer_auth_no='' and ct:auth_no_omission_reason='') or
				(ct:manufacturer_auth_no!='' and ct:auth_no_omission_reason!='')
				">
		       	'D.9.2.5.1 If no authorisation, give the reasons' is mandatory if 'D.9.2.5 Manufacturer authorisation number' is blank and vice versa. One and only one must be completed.
	  		</report>
		</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="112"
				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>

			<assert field-description="E.1.1.1	Medical condition in easily understood language"
			 id="113" 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="114" 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>

			<report field-description="E.1.2 MedDRA information"
			 id="115" 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.3 Is any of the conditions being studied a rare disease?"
			 id="116" 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="117" 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="118" 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="119" 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="120"
				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="121" 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="122" 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="123" 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="124" 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="125" 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="126" 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="127"
				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="128"
				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="129"
				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="130"
				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="131"
				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="132"
				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="133"
				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="134"
				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="135"
				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="136"
				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="137"
				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="138"
				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="139"
				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="140" 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="141"
				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="142" 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="143" 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>

			<report field-description="E.7.1.3 Other" id="144" 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.1.1 First administration to humans"
			 id="145" 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="146" 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="147"
				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>

			<assert field-description="E.7.2 Therapeutic exploratory (Phase II)"
			 id="148" 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="149" 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="150" 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>

			<assert field-description="E.8.1 Controlled" id="151"
				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="152" 
				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="153" 
				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>
			
			<report field-description="E.8.1 Controlled"
			 id="154" 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="155" 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="156" 
				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="157" 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 Single site in the Member State concerned (see also Section G)"
			 id="158" 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.3 Single site in the Member State concerned"
			 id="159" 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 Single site in the Member State concerned (see also Section G)'or 'E.8.4 Multiple sites in 
				the Member State concerned (see also Section G)'' must be answered 'Yes'.
			</assert>

			<assert
				field-description="E.8.4 Multiple sites in the Member State concerned (see also Section G)"
			 id="160" 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>
			
			<report field-description="E.8.4 Multiple sites in Member State"
			 id="161" owning="sectionE" rule-id="FEAT6.2.1.39" section="E.8 Design of the Trial" web="true"
				jexl="(ctaGeneralInfo.ctaTrialDesign.isMultipleSite == 1 
						and (empty(ctaGeneralInfo.ctaTrialDesign.noSitesInMs) 
							or ctaGeneralInfo.ctaTrialDesign.noSitesInMs le 0)) 
					  or (ctaGeneralInfo.ctaTrialDesign.isMultipleSite != 1 
					  	and !empty(ctaGeneralInfo.ctaTrialDesign.noSitesInMs))"
				test="(ct:is_multiple_site='1' and (ct:no_sites_in_ms='' or number(ct:no_sites_in_ms) &lt;= 0))
				       or (ct:is_multiple_site!='1' and  ct:no_sites_in_ms!='')">
				'E.8.4 Multiple sites in the Member State concerned (see also Section G)' is a mandatory field and if answered "Yes" then question 'E.8.4.1 Number of sites anticipated in Member State concerned' should be answered.
			</report>

			<assert field-description="E.8.5 Multiple Member States"
			 id="162" owning="sectionE" rule-id="FEAT6.2.4" section="E.8 Design of the Trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialDesign.isInMultipleMs != -1"
				test="ct:is_in_multiple_ms!='-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.5 Multiple Member States"
			 id="163" owning="sectionE" rule-id="FEAT6.2.2.21" section="E.8 Design of the Trial" web="true"
				jexl="(ctaGeneralInfo.ctaTrialDesign.isInMultipleMs == 1 and (empty(ctaGeneralInfo.ctaTrialDesign.noSitesInCommunity) 
					  	or (!empty(ctaGeneralInfo.ctaTrialDesign.noSitesInCommunity) and ctaGeneralInfo.ctaTrialDesign.noSitesInCommunity le 0)) ) 
					 or(ctaGeneralInfo.ctaTrialDesign.isInMultipleMs == 0 and !empty(ctaGeneralInfo.ctaTrialDesign.noSitesInCommunity))"
				test="(ct:is_in_multiple_ms='1' and (ct:no_sites_in_community='' or number(ct:no_sites_in_community) &lt;=  0)) 
					  or (ct:is_in_multiple_ms='0' and ct:no_sites_in_community!='')">
				If E.8.5 is answered "Yes" then question E.8.5.1 should be answered. 
				If answered "No" then E.8.5.1 should not be answered.
			</report>

			<assert field-description="E.8.6.1 Trial involving countries outside the EEA?"
			 id="164" owning="sectionE" rule-id="FEAT6.2.4" section="E.8 Design of the Trial" web="true"
				jexl="ctaGeneralInfo.ctaTrialDesign.isThirdCountryInvolved != -1"
				test="ct:is_third_country_involved!='-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.6.4 Number of sites anticipated outside of the EEA"
			 id="165" owning="sectionE" rule-id="FEAT6.2.2.34" section="E.8 Design of the Trial" web="true"
				jexl="(
						(ctaGeneralInfo.ctaTrialDesign.isThirdCountryInvolved == 1 or ctaGeneralInfo.ctaTrialDesign.isConductedCompleteOutEea == 1)
						and (empty(ctaGeneralInfo.ctaTrialDesign.noSitesAnticipatedWorld) or ctaGeneralInfo.ctaTrialDesign.noSitesAnticipatedWorld le 0)
					) or (ctaGeneralInfo.ctaTrialDesign.isThirdCountryInvolved != 1	and ctaGeneralInfo.ctaTrialDesign.isConductedCompleteOutEea != 1
						and !empty(ctaGeneralInfo.ctaTrialDesign.noSitesAnticipatedWorld))"
				test="((ct:is_third_country_involved='1' or ct:is_conducted_complete_out_eea='1') 
						and (ct:no_sites_anticipated_world='' or number(ct:no_sites_anticipated_world) &lt;= 0) )
                	   or (not(ct:is_third_country_involved='1' or ct:is_conducted_complete_out_eea='1') 
                	   	and ct:no_sites_anticipated_world!='') ">
                If 'E.8.6.1 Trial being conducted both within and outside the EEA' or 'E.8.6.2 Trial being conducted completely 
                outside of the EEA' are "Yes" then provide the information on 'E.8.6.4 If E.8.6.1 or E.8.6.2 are yes, 
                specify the number of sites anticipated outside of the EEA'.
            </report>

			<assert field-description="E.8.7 Trial having an independent data monitoring committee?"
			 id="166" 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="167" 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>

			<report field-description="E.8.9 Initial estimate of the duration of the trial" web="true"
			 id="168" owning="sectionE" rule-id="FEAT6.2.2.22" section="E.8 Design of the Trial"
				jexl="
						(
							ctaGeneralInfo.ctaTrialDesign.isInMultipleMs == 1 and  
							(
								ctaGeneralInfo.estTrialDurationMsYears + 
								ctaGeneralInfo.estTrialDurationMsMonths + 
								ctaGeneralInfo.estTrialDurationMsDays le 0
							)
						)
						or 
						(
							ctaGeneralInfo.ctaTrialDesign.isThirdCountryInvolved == 1 and
							(
						  	  	ctaGeneralInfo.estTrialDurationWorldYears + 
						  	  	ctaGeneralInfo.estTrialDurationWorldMonth + 
						  	  	ctaGeneralInfo.estTrialDurationWorldDays le 0
							)
						)"
				test="(
						ct:is_in_multiple_ms='1' 
						and (
						   	translate( concat(' ', ct:est_trial_duration_ms_years), ' ', '0' ) + 
						   	translate( concat(' ', ct:est_trial_duration_ms_months), ' ', '0' ) + 
						   	translate( concat(' ', ct:est_trial_duration_ms_days), ' ', '0' ) &lt;= 0
					   )
					)
					or (
						ct:is_third_country_involved='1' 
						and (
						   	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.1 Initial estimate of the duration of the trial in the Member State concerned' should be 
				completed if E.8.5 = Yes and 'E.8.9.2 Initial estimate of the duration of the trial all countries 
				concerned by the trial' should be completed if 'E.8.6.1 Trial being conducted both within and outside 
				the EEA' = Yes. 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="169" 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="170" 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="171" 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="172" 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="173" 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="174" 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="176" 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="178" 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="179"
				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="180"
				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="181" 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="182"
				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="183" 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="184" 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="185" 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="186" 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.1 In the member state"
			 id="187" owning="sectionF" rule-id="FEAT6.2.4"
				section="F.4 Planned number of subjects to be included" web="true"
				jexl="!empty(ctaPopulationOfSubjects.ctaPopulationPlannedNo.inMsNo)"
				test="ct:in_ms_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>
			
			<report
				field-description="F.4.2.1 In the EEA/F.4.2.2 In the whole clinical trial"
			 id="188" owning="sectionF" rule-id="FEAT6.2.1.63"
				section="F.4 Planned number of subjects to be included" web="true"
				jexl="(ctaGeneralInfo.ctaTrialDesign.isInMultipleMs == 1 
					  	or ctaGeneralInfo.ctaTrialDesign.isThirdCountryInvolved == 1)
					  and (empty(ctaPopulationOfSubjects.ctaPopulationPlannedNo.inEeaNo) 
					  	or empty(ctaPopulationOfSubjects.ctaPopulationPlannedNo.inWholeTrial))"
				test="(../ct:general_information/ct:is_in_multiple_ms = '1' 
					  	or ../ct:general_information/ct:is_third_country_involved = '1')
					  and (ct:in_eea_no = '' 
					  	or ct:in_whole_trial = '')">
				If one of E.8.5 or E.8.6.1 is 'Yes' then F.4.2.1 and F.4.2.2 must be completed.
			</report>
			
			<assert
				field-description="F.5 Plans for treatment or care after the subject has ended the participation in the trial"
			 id="189" 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:proposed_clinical_trial_sites_information">
			<report field-description="G.1/G.2 Investigator Details"
			 id="190" owning="sectionG" rule-id="FEAT6.2.2.25" section="G.1 and G.2 Investigator Details"
				test="ct:investigators='' or count(ct:investigators/ct:investigator)=0">
				There should be at least one investigator (the principal of a single centre or coordinator of a multicentre trial).
			</report>
			<assert field-description="G.1 and G.2 Investigator Details"
			 id="191" owning="sectionGI" rule-id="FEAT6.2.2.25" section="G.1 and G.2 Investigator Details" web="true"
				jexl="size(cta.ctaInvestigators) gt 0"
				test="1=1">
				There should be at least one investigator (the principal of a single centre or coordinator of a multicentre trial).
			</assert>
		</rule>

		<rule context="ct:investigator">
        	<assert field-description="G.1.3/G.2.3 Family name"
			 id="192" owning="sectionG" rule-id="FEAT6.2.4" section="G.1 and G.2 Investigator Details" web="true"
				jexl="!empty(ctaInvestigator.investigatorContactInfo.contactPerson.familyName)"
				test="ct:investigator_contact_info/ct:family_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="G.1.5/G.2.5 Institution name"
			 id="193" owning="sectionG" rule-id="FEAT6.2.4" section="G.1 and G.2 Investigator Details" web="true"
				jexl="!empty(ctaInvestigator.investigatorOrgInfo.contactOrganisation.name)"
				test="ct:investigator_org_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>
		</rule>
		
		<rule context="ct:ethics_committee">
			<report field-description="H.2.1 Ethics committee name"
			 id="194" owning="sectionH" rule-id="FEAT6.2.4" section="H. Ethics Committee" web="true"
				jexl="empty(ctaEthicsCommittee.ethicsCommitteeOrgInfo.contactOrganisation.name)"
				test="ct:iec_contact_information/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.
			</report>
		</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="196" 
						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="197" 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="198" 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.3 The products to be administered as IMPs are defined as belonging to an ATC group" id="199" 
				owning="sectionD" rule-id="FEAT6.2.1.07" web="true"
				section="D.1/D.2 IMP Identification and Status Details"
				jexl="impIdentNotPossible.isAtcGroupUsed == 1 and empty(imp.ctaAtcCodes)"
				test="ct:is_atc_group_used='1' and count(../ct:atc_codes/ct:atc_code)=0">
                - Where 'D.2.2.3 IMP defined by ATC Group' is answered "Yes" at least one ATC code is mandatory in 'D.3.3 IMP ATC Code'
            </report>
			
			<report field-description="D.2.2.4 Other"
					 id="200" 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="201" 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:somatic_cell">
			<assert field-description="D.4.1.3 Xenogeneic"
			 id="202" owning="sectionD" rule-id="FEAT6.2.1.20"
				section="D.4 Somatic Cell Therapy Investigational Medicinal Product"
				test="
					(ct:somatic_cell_xenogeneic='1' and ct:somatic_cell_xen_sp_origin!='')
					or (
						(ct:somatic_cell_xenogeneic='0' or ct:somatic_cell_xenogeneic='-1')
						and ct:somatic_cell_xen_sp_origin=''
					)">
				The subquestion to question D.4.1.3 should be completed if D.4.1.3 is "Yes". 
				It should be blank if D.4.1.3  is "No" or "Not Answered".
			</assert>
			
			<assert field-description="D.4.2.2 Differentiated cells"
			 id="203" owning="sectionD" rule-id="FEAT6.2.1.21"
				section="D.4 Somatic Cell Therapy Investigational Medicinal Product"
				test="
					(ct:somatic_cell_differenciated='1' and ct:somatic_cell_diff_type!='')
					or (
						(ct:somatic_cell_differenciated='0' or ct:somatic_cell_differenciated='-1')
						and ct:somatic_cell_diff_type=''
					)">
				The subquestion 'D.4.2.2.1 If differentiated, specify the type of cells' to question D.4.2.2 should be completed if D.4.2.2 is "Yes". 
				It should be blank if D.4.2.2 is "No" or "Not Answered".
			</assert>
			
			<assert field-description="D.4.2.3 Others"
			 id="204" owning="sectionD" rule-id="FEAT6.2.1.22"
				section="D.4 Somatic Cell Therapy Investigational Medicinal Product"
				test="
                	(ct:somatic_cell_others='1' and ct:somatic_cell_others_specify!='')
					or  (
						(ct:somatic_cell_others='0' or ct:somatic_cell_others='-1')
						and ct:somatic_cell_others_specify=''
					)">
				The subquestion to question 'D.4.2.3 Somatic Cell Therapy type other' should be completed if D.4.2.3 is answered "Yes". 
				It should be blank if D.4.2.3 is "No" or "Not Answered".
			</assert>
		</rule>

		<rule context="ct:gene_therapy">
			<report field-description="D.5.4.1 Nucleic acid (e.g. plasmid)"
			 id="205" owning="sectionD" rule-id="FEAT6.2.1.23a" section="D.5 Gene Therapy  Imps"
				test=" ../ct:is_gene_therapy_mp='1' and
				ct:gene_ther_nucleic_acid='1' and 
				(ct:gene_ther_nucleic_acid_complex='-1' or ct:gene_ther_nucleic_acid_naked='-1')">The subquestions to question 'D.5.4.1 Gene therapy nucleic
				acid' should be completed if D.5.4.1 is answered "Yes". They should be blank or "No" if D.5.4.1 is "No".
			</report>
			
			<report field-description="D.5.4.1 Nucleic acid (e.g. plasmid)"
			 id="206" owning="sectionD" rule-id="FEAT6.2.1.23b" section="D.5 Gene Therapy  Imps"
				test=" ../ct:is_gene_therapy_mp='1' and 
				ct:gene_ther_nucleic_acid='0' and
                (ct:gene_ther_nucleic_acid_complex='1' or ct:gene_ther_nucleic_acid_naked='1')
                ">The subquestions to question 'D.5.4.1 Gene therapy nucleic
				acid' should be blank if D.5.4.1 is answered "Yes". They should	be blank or "No" if D.5.4.1 is "No".
			</report>
			
			<assert field-description="D.5.4.2 Viral vector"
				 id="207" owning="sectionD" rule-id="FEAT6.2.1.24" section="D.5 Gene Therapy  Imps"
					test="
					(ct:gene_ther_viral='1' and ct:gene_ther_viral_specify!='') 
					or (
						(ct:gene_ther_viral='0' or ct:gene_ther_viral='-1')
						 and ct:gene_ther_viral_specify=''
					)">
				The subquestion to question D.5.4.2 should be completed if D.5.4.2 is "Yes". 
				It should be blank if D.5.4.2 is "No" or "Not Answered".
			</assert>
			
			<assert field-description="D.5.4.3 Others"
				 id="208" owning="sectionD" rule-id="FEAT6.2.1.25" section="D.5 Gene Therapy  Imps"
					test="
					(ct:gene_ther_others='1' and ct:gene_ther_others_specify!='') 
					or (
						(ct:gene_ther_others='0' or ct:gene_ther_others='-1')
						and ct:gene_ther_others_specify=''
					)">
                The subquestion to question D.5.4.3 should be completed if D.5.4.3 is "Yes". 
                It should be blank if D.5.4.3 is "No" or "Not Answered".
			</assert>
			
			<report field-description="D.5.5 Does the IMP contain genetically modified cells"
				 id="209" owning="sectionD" rule-id="FEAT6.2.1.26" section="D.5 Gene Therapy  Imps"
					test="
					(
						ct:gene_ther_genetically_modified='1' 
						and (
							ct:gene_ther_autologous='-1' or 
							ct:gene_ther_allogeneic='-1' or 
							ct:gene_ther_xenogeneic='-1' or 
							ct:gene_ther_type_cells_dtls='' 
 						)
					)
	                or
	                (
	                	ct:gene_ther_genetically_modified='0'
	                	and (
	                		ct:gene_ther_autologous='1' or 
	                		ct:gene_ther_allogeneic='1' or 
	                		ct:gene_ther_xenogeneic='1' or 
	                		ct:gene_ther_type_cells_dtls!=''
	                	) 
	                )
				">
                The subquestions to 'D.5.5 GM Cells' should be completed if D.5.5 is "Yes". They should be blank or "No" if D.5.5 is answered "No".
			</report>
			
			<assert field-description="D.5.5.3 Xenogeneic"
				 id="210" owning="sectionD" rule-id="FEAT6.2.1.27" section="D.5 Gene Therapy  Imps"
					test="
                	(ct:gene_ther_xenogeneic='1' and ct:gene_ther_xeno_species_origin!='')
                	or (
                		(ct:gene_ther_xenogeneic='0' or ct:gene_ther_xenogeneic='-1')
                		and ct:gene_ther_xeno_species_origin=''
                	)">
				The subquestion to question D.5.5.3 should be completed if D.5.5.3 is "Yes". 
				It should be blank if D.5.5.3 is "No" or "Not Answered".
			</assert>
			
			<assert field-description="D.3.11.3.2 gene therapy medicinal product"
			 id="211" owning="sectionD" rule-id="FEAT6.2.1.18" section="D.3.11 Type of IMP"
				test="
				(
					../ct:is_gene_therapy_mp='1'
					and (
						ct:gene_ther_in_vivo!='-1' and ct:gene_ther_ex_vivo!='-1' and ct:gene_ther_nucleic_acid!='-1'	
						and ct:gene_ther_viral!='-1' and ct:gene_ther_others!='-1' and ct:gene_ther_genetically_modified!='-1'
					)
				)
				or (
					(../ct:is_gene_therapy_mp='0' or ../ct:is_gene_therapy_mp='-1')
					and (
						ct:gene_ther_in_vivo='0' and ct:gene_ther_ex_vivo='0' and ct:gene_ther_nucleic_acid='0'	
						and ct:gene_ther_viral='0' and ct:gene_ther_others='0' and ct:gene_ther_genetically_modified='0'
					)
				)">
				If 'D.3.11.3.2 Gene Therapy MP' is "Yes" then section 'D.5 Gene Therapy MP' is mandatory (and vice versa). 
				If 'D.3.11.3.2 Gene Therapy MP' is No then all of D.5 should be No.
			</assert>
		</rule>
		
		<rule context="ct:cell_origin">
			<report field-description="D.6.1.3.1 If yes, specify the species of origin"
			 id="212" owning="sectionD" rule-id="FEAT6.2.1.50" section="D.6 Tissue Engineered Product"
				test=" ../ct:is_tissue_engineered_mp='1' and (
                (ct:tissue_eng_origin_xenogeneic='1' and ct:tissue_eng_xenogeneic_species='') or
			(ct:tissue_eng_origin_xenogeneic!='1' and ct:tissue_eng_xenogeneic_species!='') ) ">The field 'D.6.1.3.1 Tissue Engineered xenogeneic species' should only	be completed if the parent question is answered yes.
			</report>
		</rule>

		<rule context="ct:cell_type">
			<report field-description="D.6.2.3.1 If 'others', specify the type of cells"
			 id="213" owning="sectionD" rule-id="FEAT6.2.1.51" section="D.6 Tissue Engineered Product"
				test="../ct:is_tissue_engineered_mp='1' and (
                (ct:tissue_eng_other='1' and ct:tissue_eng_other_spec='') or
                (ct:tissue_eng_other!='1' and ct:tissue_eng_other_spec!='') ) ">The field 'D.6.2.3.1 Tissue Engineered Other Specification' should only be completed if the parent question is answered yes.
			</report>
			
			<assert field-description="D.6.2.2 Differentiated cells"
				 id="214" owning="sectionD" rule-id="FEAT6.2.1.56" section="D.6 Tissue Engineered Product"
					test="
					(ct:tissue_eng_type_differentiated='1' and ct:tissue_eng_diff_spec!='')
					or (
						(ct:tissue_eng_type_differentiated='0' or ct:tissue_eng_type_differentiated='-1')
						and ct:tissue_eng_diff_spec =''
					)">
				If the information is provided in D.6.2.2 then details should be provided in D.6.2.2.1.  
			</assert>
		</rule>

		<rule context="ct:imp_device">
			<report field-description="D.7.4.1.1 Does this medical device have a CE mark"
				 id="215" owning="sectionD" rule-id="FEAT6.2.1.52"
					section="D.7 Products containing devices"
					test="(ct:is_medical_device='1' and ct:has_device_ce_mark='-1')
						or (ct:is_medical_device!='1' and ct:has_device_ce_mark!='0')">
          		The field 'D.7.4.1.1 Device has CE mark' should only be completed if the parent question is answered "Yes".
			</report>
			
			<report field-description="D.7.4.5.1 If 'other', specify"
			 id="216" owning="sectionD" rule-id="FEAT6.2.1.53"
				section="D.7 Products containing devices"
				test=" (../ct:is_device_included='1' or  ../ct:is_combination_atimp='1' ) and (
                (ct:has_other_device='1' and ct:other_device_spec='') or
                (ct:has_other_device!='1' and ct:other_device_spec!='') )">The field 'D.7.4.5 Device Other' should only be completed if the parent question is answered "Yes".
			</report>
		</rule>

	</pattern>
</schema>
