Skip to content

Commit

Permalink
Fnguyen/post stable fixes (#87)
Browse files Browse the repository at this point in the history
* Fix the province summation not counting multiple locations in the same province

* Rename + move the cohorts count

* Be able to view patients even from other sites
  • Loading branch information
OrdiNeu authored Jul 21, 2023
1 parent 15a65df commit f06f3ce
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/views/clinicalGenomic/widgets/patientCountSingle.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ function PatientCountSingle(props) {
<Divider flexItem orientation="vertical" className={classes.divider} />
<Grid item xs={2}>
<Typography align="center" className={classes.patientEntry}>
{totalPatients}
{numCohorts}
</Typography>
</Grid>
<Divider flexItem orientation="vertical" className={classes.divider} />
<Grid item xs={2}>
<Typography align="center" className={classes.patientEntry}>
{patientsInSearch}
{totalPatients}
</Typography>
</Grid>
<Divider flexItem orientation="vertical" className={classes.divider} />
<Grid item xs={2}>
<Typography align="center" className={classes.patientEntry}>
{numCohorts}
{patientsInSearch}
</Typography>
</Grid>
<Divider flexItem orientation="vertical" className={classes.divider} />
Expand Down
6 changes: 3 additions & 3 deletions src/views/clinicalGenomic/widgets/patientCounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ function PatientCounts(props) {
</Grid>
<Grid item xs={2}>
<Typography variant="h5" align="center" className={classes.header}>
Total Patients
Total Cohorts
</Typography>
</Grid>
<Grid item xs={2}>
<Typography variant="h5" align="center" className={classes.header}>
Patients In Search
Total Patients
</Typography>
</Grid>
<Grid item xs={2}>
<Typography variant="h5" align="center" className={classes.header}>
Cohorts
Patients In Search
</Typography>
</Grid>
<Grid item xs={1} ml="auto" className={classes.button}>
Expand Down
2 changes: 1 addition & 1 deletion src/views/clinicalGenomic/widgets/patientView.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const JSONTree = (props) => {

function PatientView(props) {
const resultsContext = useSearchResultsReaderContext();
const patient = resultsContext.donor?.[0]?.results?.results?.[0];
const patient = resultsContext.donor?.map((loc) => loc?.results?.results?.[0])?.filter((donor) => donor)?.[0];
const [expanded, setExpanded] = useState(['.']);

// When searching: search, then prune the results
Expand Down
5 changes: 4 additions & 1 deletion src/views/summary/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ function Summary() {
case '/individual_count':
setIndividualCount((oldIndividualCount) => aggregateObj(stat.results, oldIndividualCount));
if (stat.location) {
candigDataSouceCollection[stat.location['province-code']] = stat.results.individual_count;
if (!(stat.location['province-code'] in candigDataSouceCollection)) {
candigDataSouceCollection[stat.location['province-code']] = 0;
}
candigDataSouceCollection[stat.location['province-code']] += stat.results.individual_count;

if (count === data.length) {
setCanDigDataSource(candigDataSouceCollection);
Expand Down

0 comments on commit f06f3ce

Please sign in to comment.