Skip to content

Conversation

gblaih
Copy link
Contributor

@gblaih gblaih commented Mar 21, 2025

Update CancerStudy type with field resourceCounts that holds resource information and counts within study and dynamically calculate these resource counts

Copy link

@gblaih gblaih force-pushed the demo-home-imaging-filter branch 3 times, most recently from eb83e6e to 9b3f196 Compare May 15, 2025 18:41
@dippindots dippindots added the api label May 16, 2025
Copy link
Collaborator

@dippindots dippindots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gblaih Thanks for making efforts and making this aviablable! This is great!

Just one quick comment: I think we can go ahead and merge this as a solid initial approach. That said, we should also explore ways to automatically discover new resource types. For example, if we add a new imaging type like new_image_type, it would be ideal for it to appear on the homepage automatically. Even if this requires introducing a new endpoint or doing some additional refactoring, I believe it's worth the effort.

@gblaih gblaih force-pushed the demo-home-imaging-filter branch from a31ff3e to 1f45edc Compare May 30, 2025 20:46
@gblaih gblaih force-pushed the demo-home-imaging-filter branch from ddbf315 to 0800a6b Compare June 13, 2025 15:39
Copy link
Collaborator

@dippindots dippindots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gblaih Overall, the PR looks great and works well for demo purposes. My comments are mainly focused on improving code clarity and aligning better with API design principles. Here's a breakdown:

  • Rename resources to resourceCounts
    To better reflect the data type (List<ResourceCount>), let's rename related variables and methods in the model, service, and repository layers. (Apologies for initially suggesting resources — your original ResourceCount naming is actually more descriptive.)

  • Conditionally include resourceCounts based on projection
    Since projection controls the response detail in our API, we should include resourceCounts only when projection is SUMMARY or DETAILED. We can handle this with a simple conditional in the service layer.

  • Add support in fetchStudies
    fetchStudies is the third method that needs to add resourceCounts, but it’s currently missing from the implementation.

  • Remove hard‑coded CHROMOSCOPE and FIGURES
    Let’s avoid hardcoding these in the backend. Instead, handle them in the frontend—either by hardcoding there or by leveraging the new JSON field.

@gblaih gblaih force-pushed the demo-home-imaging-filter branch 3 times, most recently from e5fdad7 to 32368e5 Compare June 25, 2025 21:25
Copy link
Collaborator

@dippindots dippindots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your updates looks great! I just have two more comments related to the mapper file

@gblaih gblaih force-pushed the demo-home-imaging-filter branch from 32368e5 to 161b1d7 Compare June 26, 2025 20:09
Copy link
Collaborator

@dippindots dippindots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good to me! Thanks!

@dippindots dippindots force-pushed the demo-home-imaging-filter branch from 161b1d7 to 94874b0 Compare June 26, 2025 21:39
Copy link
Collaborator

@dippindots dippindots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gblaih The tests are indicating an real issue, I have some explainations in comments

<where>
<if test="studyIds != null and studyIds.size > 0">
<if test="studyIds != null and !studyIds.isEmpty()">
cancer_study.CANCER_STUDY_IDENTIFIER IN
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the issue:
need to replace this with

cs.CANCER_STUDY_IDENTIFIER IN

The reason is when you give a table an alias (e.g. cancer_study cs), that alias cs replaces the original table name in the rest of the query. Using the full table name afterward will cause an error

<where>
<if test="studyIds != null and studyIds.size > 0">
<if test="studyIds != null and !studyIds.isEmpty()">
cancer_study.CANCER_STUDY_IDENTIFIER IN
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link

@dippindots dippindots force-pushed the demo-home-imaging-filter branch from 654ebf2 to 4b06f4f Compare September 2, 2025 14:49
@dippindots dippindots changed the base branch from master to release-6.4.0 October 13, 2025 18:41
@dippindots dippindots changed the base branch from release-6.4.0 to master October 13, 2025 18:41
@dippindots dippindots force-pushed the demo-home-imaging-filter branch from 4b06f4f to be840ee Compare October 13, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants