use of org.mskcc.oncotree.error.InvalidOncotreeMappingsParameters in project oncotree by cBioPortal.
the class OncotreeMappingsApi method getMappings.
@RequestMapping(value = "api/crosswalk", method = RequestMethod.GET)
public OncotreeMappingsResp getMappings(@RequestParam(value = "vocabularyId", required = false) String vocabularyId, @RequestParam(value = "conceptId", required = false) String conceptId, @RequestParam(value = "histologyCode", required = false) String histologyCode, @RequestParam(value = "siteCode", required = false) String siteCode) {
String cleanVocabularyId = apiUtil.cleanArgument(vocabularyId);
String cleanConceptId = apiUtil.cleanArgument(conceptId);
String cleanHistologyCode = apiUtil.cleanArgument(histologyCode);
String cleanSiteCode = apiUtil.cleanArgument(siteCode);
if (!mappingParametersAreValid(cleanVocabularyId, cleanConceptId, cleanHistologyCode, cleanSiteCode)) {
throw new InvalidOncotreeMappingsParameters("Your query parameters, vocabularyId: " + cleanVocabularyId + ", conceptId: " + cleanConceptId + ", histologyCode: " + cleanHistologyCode + ", siteCode: " + cleanSiteCode + " are not valid. Please refer to the documentation");
}
MSKConcept mskConcept = crosswalkRepository.queryCVS(cleanVocabularyId, cleanConceptId, cleanHistologyCode, cleanSiteCode);
return extractOncotreeMappings(mskConcept);
}
Aggregations