Skip to content

Commit

Permalink
move getSampleClinicalDataFromStudyViewFilter and getPatientClinicalD…
Browse files Browse the repository at this point in the history
…ataFromStudyViewFilter back to study view mapper
  • Loading branch information
onursumer committed Jun 27, 2024
1 parent f7905ff commit 1c383c6
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 66 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,55 @@
</where>
GROUP BY hugo_gene_symbol;
</select>

<select id="getSampleClinicalDataFromStudyViewFilter" resultType="org.cbioportal.model.ClinicalData">
SELECT
sample_unique_id as sampleId,
patient_unique_id as patientId,
attribute_name as attrId,
attribute_value as attrValue,
cancer_study_identifier as studyId
FROM clinical_data_derived
<where>
sample_unique_id IN (
<include refid="sampleUniqueIdsFromStudyViewFilter"/>
<if test="applyPatientIdFilters == true">
INTERSECT <include refid="getSampleIdsFromPatientIds"/>
</if>
)
</where>
<if test="attributeIds != null and !attributeIds.isEmpty()">
AND attribute_name IN
<foreach item="attributeId" collection="attributeIds" open="(" separator="," close=")">
#{attributeId}
</foreach>
</if>
AND type = 'sample'
</select>

<select id="getPatientClinicalDataFromStudyViewFilter" resultType="org.cbioportal.model.ClinicalData">
SELECT
patient_unique_id as patientId,
attribute_name as attrId,
attribute_value as attrValue,
cancer_study_identifier as studyId
FROM clinical_data_derived
<where>
patient_unique_id IN (
<include refid="getPatientIdsFromSampleIdFilters"/>
<if test="applyPatientIdFilters == true">
INTERSECT <include refid="patientUniqueIdsFromStudyViewFilter"/>
</if>
)
</where>
<if test="attributeIds != null and !attributeIds.isEmpty()">
AND attribute_name IN
<foreach item="attributeId" collection="attributeIds" open="(" separator="," close=")">
#{attributeId}
</foreach>
</if>
AND type = 'patient'
</select>

<!-- for /clinical-data-counts/fetch (returns ClinicalData) which will then be converted to clinicalDataCountItems -->
<select id="getClinicalDataCounts" resultType="org.cbioportal.model.ClinicalDataCount">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ public SqlSessionFactoryBean sqlColumnarSessionFactory(ResourceLoader resourceLo
var studyViewMapperResource = resourceLoader.getResource("classpath:org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml") ;
var studyViewFilterMapperResource = resourceLoader.getResource("classpath:org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml");
var alterationFilterMapperResource = resourceLoader.getResource("classpath:org/cbioportal/persistence/mybatisclickhouse/StudyViewAlterationFilterMapper.xml");
var clinicalDataMapperResource = resourceLoader.getResource("classpath:org/cbioportal/persistence/mybatisclickhouse/StudyViewClinicalDataMapper.xml");
sessionFactory.setMapperLocations(
studyViewMapperResource,studyViewFilterMapperResource, alterationFilterMapperResource, clinicalDataMapperResource
studyViewMapperResource,studyViewFilterMapperResource, alterationFilterMapperResource
);
return sessionFactory;
}
Expand Down

0 comments on commit 1c383c6

Please sign in to comment.