Search in sources :

Example 1 with InvalidOncotreeMappingsParameters

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);
}
Also used : InvalidOncotreeMappingsParameters(org.mskcc.oncotree.error.InvalidOncotreeMappingsParameters) MSKConcept(org.mskcc.oncotree.crosswalk.MSKConcept) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

MSKConcept (org.mskcc.oncotree.crosswalk.MSKConcept)1 InvalidOncotreeMappingsParameters (org.mskcc.oncotree.error.InvalidOncotreeMappingsParameters)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1