Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK-5964 - Clinical Improvements #2474

Merged
merged 35 commits into from
Aug 28, 2024
Merged

TASK-5964 - Clinical Improvements #2474

merged 35 commits into from
Aug 28, 2024

Conversation

pfurio
Copy link
Member

@pfurio pfurio commented Jun 26, 2024

No description provided.

@pfurio pfurio requested a review from j-coll July 1, 2024 13:05
@pfurio pfurio requested a review from j-coll July 5, 2024 13:18

private Document fillStatusValues(String entity, String id, Document status, List<ClinicalStatusValue> statusValueList) {
ClinicalStatus clinicalStatus = new ClinicalStatus();
String clinicalId = status != null ? status.getString("id") : null;
Copy link
Member

Choose a reason for hiding this comment

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

This is "clinicalStatusId", right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, changed

} else {
for (ClinicalStatusValue clinicalStatusValue : statusValueList) {
if (clinicalStatusValue.getId().equals(clinicalId)) {
clinicalStatus.setId(clinicalStatusValue.getId());
Copy link
Member

Choose a reason for hiding this comment

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

What if the current study clinical configuration doesn't match the "default" one?
Is it possible for the clinicalStatus to get a description different from the values on the configuration?
Shouldn't this just transfer the "id" and "description" blindly, and then "translate" the type into the new values?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't really understand your question. You can only change the status for one that exists in the configuration. OpenCGA will not allow users to change to a non-defined status. Also, users can only set the new status id and everything else (description, type) is filled automatically from the status configuration values.

break;
}
}
if (clinicalStatus.getType() == null) {
Copy link
Member

Choose a reason for hiding this comment

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

Risky point here... we'd overwrite/remove the old values

Copy link
Member Author

Choose a reason for hiding this comment

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

That scenario is extremely unlikely but I will change to keep the original values instead of removing them. You're right


// Recalculate indexes
logger.info("Installing new indexes...");
catalogManager.installIndexes(organizationId, token);
Copy link
Member

Choose a reason for hiding this comment

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

This will create multiple new indexes, not just related to this particular migration... shouldn't this be an independent migration?

Copy link
Member Author

Choose a reason for hiding this comment

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

That will only add new indexes which are the ones that I want to create. Those new indexes have been added for this particular feature so I'd say it makes some sense having it there. I wouldn't create an independent migration just for this. If those indexes already exist, it will not do anything.

(document, bulk) -> {
Document internal = document.get("internal", Document.class);
if (internal == null) {
throw new MigrationRuntimeException("'internal' field not found in study '" + document.get("fqn") + "'");
Copy link
Member

Choose a reason for hiding this comment

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

These == null checks are super ultra mega unlikely, right? Like a very unexpected status, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Highly highly highly unlikely. That configuration ALWAYS exist so the only possibility for not getting that information would be because we have a catastrophic bug (in the migration because we haven't included those fields which I did or because the studies don't have that field which would be extremely worrying). I just need to add conditions, don't panic !!!

@Override
protected void run() throws Exception {
ClinicalAnalysisStudyConfiguration clinicalAnalysisStudyConfiguration = ClinicalAnalysisStudyConfiguration.defaultConfiguration();
Document clinicalConfigurationDocument = convertToDocument(clinicalAnalysisStudyConfiguration);
Copy link
Member

Choose a reason for hiding this comment

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

Why would you use the defaultValue instead of reading the value from the study itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because we want to override the values from the study with the default ones

@pfurio pfurio changed the base branch from develop to release-3.2.x July 19, 2024 08:08
@pfurio pfurio requested a review from j-coll July 19, 2024 08:09
j-coll
j-coll previously approved these changes Jul 19, 2024
Copy link
Member

@j-coll j-coll left a comment

Choose a reason for hiding this comment

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

I'd still like to see more @DataField annotations... 🙄

j-coll
j-coll previously approved these changes Aug 9, 2024
@pfurio pfurio requested a review from j-coll August 28, 2024 14:39
@pfurio pfurio merged commit d624826 into release-3.2.x Aug 28, 2024
5 of 6 checks passed
@pfurio pfurio deleted the TASK-5964 branch August 28, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants