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

Manually update katsu's OpenAPI spec to v3.0 data model #239

Merged
merged 17 commits into from
Jul 8, 2024

Conversation

OrdiNeu
Copy link

@OrdiNeu OrdiNeu commented Jul 2, 2024

Description

This implements the CanDIGv3 data model changes as outlined in this document.

The updated schema can be found at this link (includes only the diffs to the schema).

Intended list of changes

Changes to the models includes:

Moving a few fields around:

  1. primary_site from donor to primary diagnosis, though the endpoints are still able to query based on it
  2. pathological_*
  3. [“days_per_cycle”, “number_of_cycles”],

Removing a few fields:

  1. Surgery's submitter_specimen_id
  2. Follow-up's recurrence_*
  3. Treatment's [“line_of_treatment”, “treatment_setting”]
  4. Primary Diagnosis' [“lymph_nodes_examined_status”, “lymph_nodes_examined_method”, “number_lymph_nodes_positive”]

Adding a few fields:

  1. Specimen's submitter_treatment_id
  2. [“surgery_reference_database”, “surgery_reference_identifier”]

And adding the new Systemic Therapy table, which supercedes (and removes) Chemo/Hormonal/Immunotherapy.

This PR does not address how the implementation of the new table, nor the new/changed endpoints, but only outlines what will need to be changed

OrdiNeu added 11 commits July 2, 2024 14:56
…the data model

This has the following work done so far:
1. Move required field “primary_site” from Donor to Primary Diagnosis
2. Add optional “submitter_treatment_id” if the specimen was resected
   during surgery
3. Moved the conditional fields [“pathological_tumour_staging_system,
   “pathological_stage_group”,
   “pathological_t_category”,  “pathological_n_category”,
   “pathological_m_category”] from Specimen to Primary Diagnosis
…ce_identifier”]

Assuming there's no 64 character limit on the
surgery_reference_identifier yet
[“recurrence_tumour_staging_system”,
“recurrence_stage_group”, “recurrence_t_category”,
“recurrence_n_category”, “recurrence_m_category”]
…ent_id from the SampleRegistrations I accidentally added it to
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.64%. Comparing base (1c25362) to head (ed7311f).
Report is 12 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #239      +/-   ##
===========================================
- Coverage    96.99%   96.64%   -0.35%     
===========================================
  Files           35       36       +1     
  Lines         3561     3669     +108     
===========================================
+ Hits          3454     3546      +92     
- Misses         107      123      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@mshadbolt mshadbolt left a comment

Choose a reason for hiding this comment

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

Found a few small things but overall looks really good to me! Thanks!

chord_metadata_service/mohpackets/docs/schema_manual.yml Outdated Show resolved Hide resolved
chord_metadata_service/mohpackets/docs/schema_manual.yml Outdated Show resolved Hide resolved
chord_metadata_service/mohpackets/docs/schema_manual.yml Outdated Show resolved Hide resolved
chord_metadata_service/mohpackets/docs/schema_manual.yml Outdated Show resolved Hide resolved
chord_metadata_service/mohpackets/docs/schema_manual.yml Outdated Show resolved Hide resolved
chord_metadata_service/mohpackets/docs/schema_manual.yml Outdated Show resolved Hide resolved
chord_metadata_service/mohpackets/docs/schema_manual.yml Outdated Show resolved Hide resolved
chord_metadata_service/mohpackets/docs/schema_manual.yml Outdated Show resolved Hide resolved
chord_metadata_service/mohpackets/docs/schema_manual.yml Outdated Show resolved Hide resolved
chord_metadata_service/mohpackets/docs/schema_manual.yml Outdated Show resolved Hide resolved
- Switch pathological categories to be an enum
- Switch actual/perscribed_cumulative_drug_dose to numbers
@OrdiNeu OrdiNeu requested a review from mshadbolt July 4, 2024 17:12
Copy link

@mshadbolt mshadbolt left a comment

Choose a reason for hiding this comment

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

LGTM

@SonQBChau
Copy link

  • Line 1044: remove primary_site object.
    Otherwise, it looks good to me.

@kcranston
Copy link
Member

  • Line 1044: remove primary_site object.
    Otherwise, it looks good to me.

Confused about why we are removing primary_site. It still exists under Primary Diagnosis in the new model.

@OrdiNeu
Copy link
Author

OrdiNeu commented Jul 5, 2024

  • Line 1044: remove primary_site object.
    Otherwise, it looks good to me.

Confused about why we are removing primary_site. It still exists under Primary Diagnosis in the new model.

It'll be in the DonorWithClinicalData response under the NestedPrimaryDiagnosis schema, so to get the primate_site you'd go: DonorWithClinicalData->primary_diagnoses[i]->primary_site.

Copy link
Member

@kcranston kcranston left a comment

Choose a reason for hiding this comment

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

Couple of documentation requests (to help both internal and external folks looking for the updated schema):

  • can we change the name of the file to include v3.0?
  • update the README to point to the new file

@kcranston
Copy link
Member

kcranston commented Jul 5, 2024

Sorry, that last comment about the readme wasn't clear. I don't think we want to replace all of the instances of schema with schema_v3 in the readme until we have updated katsu. I just wanted a line in the readme that mentioned the new, manually created schema for the upcoming model change. I know you are away next week - we can fix this in your absence!

Copy link
Member

@daisieh daisieh left a comment

Choose a reason for hiding this comment

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

LGTM

To view the API documentation, simply open [schema.md](schema.md) or [Redoc](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/CanDIG/katsu/feature/manual_schema/chord_metadata_service/mohpackets/docs/schema_manual.yml).

> [!IMPORTANT]
> Katsu is currently being transitioned to MoH clinical data model v3.0.0. There is a manually created v3.0.0 of the OpenAPI schema at [schema_v3.yml](schema_v3.yml) that can be used as a reference in the interim period. This file will be replaced by the automatically generated schema documentaion files once katsu is fully transitioned to model v3.0.0.

Choose a reason for hiding this comment

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

@kcranston is this what you were thinking for the line in the README?

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.

5 participants