@Test public void testStudyWithEfoTraitsAndApprovedAssociation() throws Exception { when(checkEfoTermAssignmentService.checkStudyEfoAssignment(STUDY_EFO_TRAIT_ASSIGNED_ASS_APPROVED_AN_WITH_COR)).thenReturn(true); publishStudyCheckService.runChecks(STUDY_EFO_TRAIT_ASSIGNED_ASS_APPROVED_AN_WITH_COR, Collections.singletonList(ASS_APPROVED)); verify(checkEfoTermAssignmentService, times(1)).checkStudyEfoAssignment(STUDY_EFO_TRAIT_ASSIGNED_ASS_APPROVED_AN_WITH_COR); assertTrue(checkEfoTermAssignmentService.checkStudyEfoAssignment(STUDY_EFO_TRAIT_ASSIGNED_ASS_APPROVED_AN_WITH_COR)); assertNull(publishStudyCheckService.runChecks(STUDY_EFO_TRAIT_ASSIGNED_ASS_APPROVED_AN_WITH_COR, Collections.singletonList(ASS_APPROVED))); }
public String runChecks(Study study, Collection<Association> associations) { String message = null; Boolean efoTermsAssigned = checkEfoTermAssignmentService.checkStudyEfoAssignment(study); int snpNotApproved = studyAssociationCheck(associations); boolean missingCoR = countryOfRecruitmentCheck(study); Collection<GenotypingTechnology> genotypingTechnologies = study.getGenotypingTechnologies(); boolean missingGenotypingTechnology = false; if(genotypingTechnologies.isEmpty()){ missingGenotypingTechnology = true; } if(snpNotApproved == 1 || !efoTermsAssigned || missingCoR || missingGenotypingTechnology){ message = "Study: " + study.getPublicationId().getFirstAuthor().getFullnameShort(30) + ", " + " pubmed = " + study.getPublicationId().getPubmedId() + " requires review before publication because "; if(snpNotApproved == 1){ message = message.concat("some SNP associations have not been approved; "); } if(!efoTermsAssigned){ message = message.concat("no EFO trait assigned; "); } if(missingCoR){ message = message.concat("at least one ancestry description with no country of recruitment; "); } if(missingGenotypingTechnology){ message = message.concat("no genotyping technology provided; "); } } return message; }
PublishStudyCheckService { public String runChecks(Study study, Collection<Association> associations) { String message = null; Boolean efoTermsAssigned = checkEfoTermAssignmentService.checkStudyEfoAssignment(study); int snpNotApproved = studyAssociationCheck(associations); boolean missingCoR = countryOfRecruitmentCheck(study); Collection<GenotypingTechnology> genotypingTechnologies = study.getGenotypingTechnologies(); boolean missingGenotypingTechnology = false; if(genotypingTechnologies.isEmpty()){ missingGenotypingTechnology = true; } if(snpNotApproved == 1 || !efoTermsAssigned || missingCoR || missingGenotypingTechnology){ message = "Study: " + study.getPublicationId().getFirstAuthor().getFullnameShort(30) + ", " + " pubmed = " + study.getPublicationId().getPubmedId() + " requires review before publication because "; if(snpNotApproved == 1){ message = message.concat("some SNP associations have not been approved; "); } if(!efoTermsAssigned){ message = message.concat("no EFO trait assigned; "); } if(missingCoR){ message = message.concat("at least one ancestry description with no country of recruitment; "); } if(missingGenotypingTechnology){ message = message.concat("no genotyping technology provided; "); } } return message; } }
PublishStudyCheckService { public String runChecks(Study study, Collection<Association> associations) { String message = null; Boolean efoTermsAssigned = checkEfoTermAssignmentService.checkStudyEfoAssignment(study); int snpNotApproved = studyAssociationCheck(associations); boolean missingCoR = countryOfRecruitmentCheck(study); Collection<GenotypingTechnology> genotypingTechnologies = study.getGenotypingTechnologies(); boolean missingGenotypingTechnology = false; if(genotypingTechnologies.isEmpty()){ missingGenotypingTechnology = true; } if(snpNotApproved == 1 || !efoTermsAssigned || missingCoR || missingGenotypingTechnology){ message = "Study: " + study.getPublicationId().getFirstAuthor().getFullnameShort(30) + ", " + " pubmed = " + study.getPublicationId().getPubmedId() + " requires review before publication because "; if(snpNotApproved == 1){ message = message.concat("some SNP associations have not been approved; "); } if(!efoTermsAssigned){ message = message.concat("no EFO trait assigned; "); } if(missingCoR){ message = message.concat("at least one ancestry description with no country of recruitment; "); } if(missingGenotypingTechnology){ message = message.concat("no genotyping technology provided; "); } } return message; } @Autowired  PublishStudyCheckService(CheckEfoTermAssignmentService checkEfoTermAssignment); }
PublishStudyCheckService { public String runChecks(Study study, Collection<Association> associations) { String message = null; Boolean efoTermsAssigned = checkEfoTermAssignmentService.checkStudyEfoAssignment(study); int snpNotApproved = studyAssociationCheck(associations); boolean missingCoR = countryOfRecruitmentCheck(study); Collection<GenotypingTechnology> genotypingTechnologies = study.getGenotypingTechnologies(); boolean missingGenotypingTechnology = false; if(genotypingTechnologies.isEmpty()){ missingGenotypingTechnology = true; } if(snpNotApproved == 1 || !efoTermsAssigned || missingCoR || missingGenotypingTechnology){ message = "Study: " + study.getPublicationId().getFirstAuthor().getFullnameShort(30) + ", " + " pubmed = " + study.getPublicationId().getPubmedId() + " requires review before publication because "; if(snpNotApproved == 1){ message = message.concat("some SNP associations have not been approved; "); } if(!efoTermsAssigned){ message = message.concat("no EFO trait assigned; "); } if(missingCoR){ message = message.concat("at least one ancestry description with no country of recruitment; "); } if(missingGenotypingTechnology){ message = message.concat("no genotyping technology provided; "); } } return message; } @Autowired  PublishStudyCheckService(CheckEfoTermAssignmentService checkEfoTermAssignment); String runChecks(Study study, Collection<Association> associations); }
PublishStudyCheckService { public String runChecks(Study study, Collection<Association> associations) { String message = null; Boolean efoTermsAssigned = checkEfoTermAssignmentService.checkStudyEfoAssignment(study); int snpNotApproved = studyAssociationCheck(associations); boolean missingCoR = countryOfRecruitmentCheck(study); Collection<GenotypingTechnology> genotypingTechnologies = study.getGenotypingTechnologies(); boolean missingGenotypingTechnology = false; if(genotypingTechnologies.isEmpty()){ missingGenotypingTechnology = true; } if(snpNotApproved == 1 || !efoTermsAssigned || missingCoR || missingGenotypingTechnology){ message = "Study: " + study.getPublicationId().getFirstAuthor().getFullnameShort(30) + ", " + " pubmed = " + study.getPublicationId().getPubmedId() + " requires review before publication because "; if(snpNotApproved == 1){ message = message.concat("some SNP associations have not been approved; "); } if(!efoTermsAssigned){ message = message.concat("no EFO trait assigned; "); } if(missingCoR){ message = message.concat("at least one ancestry description with no country of recruitment; "); } if(missingGenotypingTechnology){ message = message.concat("no genotyping technology provided; "); } } return message; } @Autowired  PublishStudyCheckService(CheckEfoTermAssignmentService checkEfoTermAssignment); String runChecks(Study study, Collection<Association> associations);  }