From e7e1dfbbc485da36bbf8a23814440940a3f20fbf Mon Sep 17 00:00:00 2001 From: Derek Furst Date: Fri, 28 Aug 2026 14:08:01 -0400 Subject: [PATCH 1/2] removed metadata_files, and image_files for donors and samples wherever they occurred including api schema yamls and examples --- entity-api-spec.yaml | 27 ------------ src/app.py | 2 +- src/schema/provenance_schema.yaml | 42 ------------------- .../api-template-test/entity-Template.yaml | 18 -------- .../example-yaml-templates/donor-schema.yaml | 6 --- .../entity-api-spec-TEMPLATE.yaml | 18 -------- .../example-yaml-templates/sample-schema.yaml | 12 ------ 7 files changed, 1 insertion(+), 124 deletions(-) diff --git a/entity-api-spec.yaml b/entity-api-spec.yaml index c2949cb5..3fbf7e4a 100644 --- a/entity-api-spec.yaml +++ b/entity-api-spec.yaml @@ -300,12 +300,6 @@ components: - consortium - public description: 'One of the values: public, consortium' - image_files: - readOnly: true - type: array - items: - $ref: '#/components/schemas/File' - description: 'List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array.' image_files_to_add: writeOnly: true type: array @@ -503,12 +497,6 @@ components: visit: type: string description: 'The visit id for the donor/patient when the sample was obtained.' - image_files: - readOnly: true - type: array - items: - $ref: '#/components/schemas/File' - description: 'List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array.' image_files_to_add: writeOnly: true type: array @@ -522,12 +510,6 @@ components: type: string format: uuid description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' - metadata_files: - readOnly: true - type: array - items: - $ref: '#/components/schemas/File' - description: 'List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array.' metadata_files_to_add: type: array items: @@ -1372,7 +1354,6 @@ components: contacts: [contact objects] description: 'Description of the property' data_access_level: 'public' - image_files: [image_files objects] image_files_to_add: [strings] image_files_to_remove: [strings] metadata: object @@ -1404,10 +1385,8 @@ components: data_access_level: 'public' sample_category: 'organ' organ: 'AO' - image_files: [image_files objects] image_files_to_add: [strings] image_files_to_remove: [strings] - metadata_files: [file object] metadata_files_to_add: [string] metadata_files_to_remove: [string] protocol_url: '10.35079/protocols.io.abcdefghijkl' @@ -1725,10 +1704,8 @@ components: data_access_level: 'public' sample_category: 'organ' organ: 'AO' - image_files: [image_files objects] image_files_to_add: [strings] image_files_to_remove: [strings] - metadata_files: [file object] metadata_files_to_add: [string] metadata_files_to_remove: [string] protocol_url: '10.35079/protocols.io.abcdefghijkl' @@ -1758,10 +1735,8 @@ components: data_access_level: 'public' sample_category: 'organ' organ: 'AO' - image_files: [image_files objects] image_files_to_add: [strings] image_files_to_remove: [strings] - metadata_files: [file object] metadata_files_to_add: [string] metadata_files_to_remove: [string] protocol_url: '10.35079/protocols.io.abcdefghijkl' @@ -1934,7 +1909,6 @@ components: contacts: [contact objects] description: 'Description of the property' data_access_level: 'public' - image_files: [image_files objects] image_files_to_add: [strings] image_files_to_remove: [strings] metadata: object @@ -1961,7 +1935,6 @@ components: contacts: [contact objects] description: 'Description of the property' data_access_level: 'public' - image_files: [image_files objects] image_files_to_add: [strings] image_files_to_remove: [strings] metadata: object diff --git a/src/app.py b/src/app.py index 4cd24fb4..83354ebd 100644 --- a/src/app.py +++ b/src/app.py @@ -5069,7 +5069,7 @@ def create_entity_details(request, normalized_entity_type, user_token, json_data # Important: use `entity_dict` instead of `filtered_merged_dict` to keep consistent with the stored - # string expression literals of Python list/dict being used with entity update, e.g., `image_files` + # string expression literals of Python list/dict being used with entity update # Important: the same property keys in entity_dict will overwrite the same key in json_data_dict # and this is what we wanted. Adding json_data_dict back is to include those `transient` properties # provided in the JSON input but not stored in neo4j, and will be needed for after_create_trigger/after_update_trigger, diff --git a/src/schema/provenance_schema.yaml b/src/schema/provenance_schema.yaml index 16aa5c00..3031f2cd 100644 --- a/src/schema/provenance_schema.yaml +++ b/src/schema/provenance_schema.yaml @@ -838,18 +838,6 @@ ENTITIES: indexed: true description: "One of the values: public, consortium" before_create_trigger: set_data_access_level - image_files: - # This property has no before_create_trigger method, but will be created via `image_files_to_add` and updated via `image_files_to_delete` - type: list - generated: true # Disallow direct user input from create via POST, but can be used for update via PUT - indexed: false - description: "List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array." - # Only file descriptions are allowed to be updated directly using this property - # Adding or deleting files must via the other two properties - before_update_trigger: update_file_descriptions - # The updated_peripherally tag is a temporary measure to correctly handle any attributes - # which are potentially updated by multiple triggers - updated_peripherally: true image_files_to_add: type: list transient: true @@ -994,12 +982,6 @@ ENTITIES: indexed: true required_on_create: true description: "The protocols.io doi url pointing the protocol under wich the sample was obtained and/or prepared." - image_file_metadata: - #todo: migrate to new attribute set as above portal_metadata_upload files - type: json_string - indexed: true - description: "A list of uploaded image files and descriptions of the files." - # A user who is a member of multiple groups HAS to send in the group_uuid group_uuid: type: string immutable: true @@ -1079,18 +1061,6 @@ ENTITIES: type: string indexed: true description: "The visit id for the donor/patient when the sample was obtained." - image_files: - # This property has no before_create_trigger method, but will be created via `image_files_to_add` and updated via `image_files_to_remove` - type: list - generated: true # Disallow direct user input from create via POST, but can be used for update via PUT - indexed: false - description: "List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array." - # Only file descriptions are allowed to be updated directly using this property - # Adding or deleting files must via the other two properties - before_update_trigger: update_file_descriptions - # The updated_peripherally tag is a temporary measure to correctly handle any attributes - # which are potentially updated by multiple triggers - updated_peripherally: true image_files_to_add: type: list transient: true @@ -1113,18 +1083,6 @@ ENTITIES: # The updated_peripherally tag is a temporary measure to correctly handle any attributes # which are potentially updated by multiple triggers updated_peripherally: true - metadata_files: - # This property has no before_create_trigger method, but will be created via `metadata_files_to_add` and updated via `metadata_files_to_remove` - type: list - generated: true # Disallow direct user input from create via POST, but can be used for update via PUT - indexed: false - description: "List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array." - # Only file descriptions are allowed to be updated directly using this property - # Adding or deleting files must via the other two properties - before_update_trigger: update_file_descriptions - # The updated_peripherally tag is a temporary measure to correctly handle any attributes - # which are potentially updated by multiple triggers - updated_peripherally: true metadata_files_to_add: type: list transient: true diff --git a/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml b/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml index 9af73a74..2bf2e99a 100644 --- a/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml +++ b/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml @@ -270,12 +270,6 @@ x-ref-components: - consortium - public description: "One of the values: public, consortium" - image_files: - readOnly: true - type: array - items: - $ref: '#/components/schemas/File' - description: "List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array." image_files_to_add: writeOnly: true type: array @@ -466,12 +460,6 @@ x-ref-components: visit: type: string description: "The visit id for the donor/patient when the sample was obtained." - image_files: - readOnly: true - type: array - items: - $ref: '#/components/schemas/File' - description: "List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array." image_files_to_add: writeOnly: true type: array @@ -486,12 +474,6 @@ x-ref-components: type: string format: file_id description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' - metadata_files: - readOnly: true - type: array - items: - $ref: '#/components/schemas/File' - description: "List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array." metadata_files_to_add: type: array items: diff --git a/src/schema_templating/example-yaml-templates/donor-schema.yaml b/src/schema_templating/example-yaml-templates/donor-schema.yaml index 32f5d07f..f37c84e6 100644 --- a/src/schema_templating/example-yaml-templates/donor-schema.yaml +++ b/src/schema_templating/example-yaml-templates/donor-schema.yaml @@ -73,12 +73,6 @@ Donor: - consortium - public description: "One of the values: public, consortium" - image_files: - readOnly: true - type: array - items: - $ref: '#/components/schemas/File' - description: "List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array." image_files_to_add: writeOnly: true type: array diff --git a/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml b/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml index a777dd78..02895eee 100644 --- a/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml +++ b/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml @@ -270,12 +270,6 @@ components: - consortium - public description: "One of the values: public, consortium" - image_files: - readOnly: true - type: array - items: - $ref: '#/components/schemas/File' - description: "List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array." image_files_to_add: writeOnly: true type: array @@ -445,12 +439,6 @@ components: visit: type: string description: "The visit id for the donor/patient when the sample was obtained." - image_files: - readOnly: true - type: array - items: - $ref: '#/components/schemas/File' - description: "List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array." image_files_to_add: writeOnly: true type: array @@ -465,12 +453,6 @@ components: type: string format: file_id description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' - metadata_files: - readOnly: true - type: array - items: - $ref: '#/components/schemas/File' - description: "List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array." metadata_files_to_add: type: array items: diff --git a/src/schema_templating/example-yaml-templates/sample-schema.yaml b/src/schema_templating/example-yaml-templates/sample-schema.yaml index 6daca5eb..a1d62c97 100644 --- a/src/schema_templating/example-yaml-templates/sample-schema.yaml +++ b/src/schema_templating/example-yaml-templates/sample-schema.yaml @@ -110,12 +110,6 @@ Sample: visit: type: string description: "The visit id for the donor/patient when the sample was obtained." - image_files: - readOnly: true - type: array - items: - $ref: '#/components/schemas/File' - description: "List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array." image_files_to_add: writeOnly: true type: array @@ -130,12 +124,6 @@ Sample: type: string format: file_id description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' - metadata_files: - readOnly: true - type: array - items: - $ref: '#/components/schemas/File' - description: "List of uploaded image files and descriptions of the files. Stored in db as a stringfied json array." metadata_files_to_add: type: array items: From d4b9eff56cf4683f8ac161d4770894371f94abd7 Mon Sep 17 00:00:00 2001 From: Derek Furst Date: Mon, 31 Aug 2026 16:29:32 -0400 Subject: [PATCH 2/2] removed usages of metadata_files, added a comment block explaining the unused functions in schema_triggers relating to metadata_files and images_files but preserving their original uses for record keeping --- entity-api-spec.yaml | 55 ---------------- src/app.py | 8 +-- src/schema/provenance_schema.yaml | 66 ------------------- src/schema/schema_manager.py | 2 +- src/schema/schema_triggers.py | 29 ++++++++ .../api-template-test/entity-Template.yaml | 40 ----------- .../example-yaml-templates/donor-schema.yaml | 14 ---- .../entity-api-spec-TEMPLATE.yaml | 41 ------------ .../example-yaml-templates/sample-schema.yaml | 28 +------- 9 files changed, 35 insertions(+), 248 deletions(-) diff --git a/entity-api-spec.yaml b/entity-api-spec.yaml index 3fbf7e4a..0cf044c7 100644 --- a/entity-api-spec.yaml +++ b/entity-api-spec.yaml @@ -300,19 +300,6 @@ components: - consortium - public description: 'One of the values: public, consortium' - image_files_to_add: - writeOnly: true - type: array - items: - type: string - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - image_files_to_remove: - writeOnly: true - type: array - items: - type: string - format: uuid - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' metadata: type: object properties: @@ -497,30 +484,6 @@ components: visit: type: string description: 'The visit id for the donor/patient when the sample was obtained.' - image_files_to_add: - writeOnly: true - type: array - items: - type: string - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - image_files_to_remove: - writeOnly: true - type: array - items: - type: string - format: uuid - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' - metadata_files_to_add: - type: array - items: - type: string - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - metadata_files_to_remove: - type: array - items: - type: string - format: uuid - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' rui_exemption: type: boolean description: 'Identifies Sample Blocks that are exempt from spatial registration via RUI.' @@ -1354,8 +1317,6 @@ components: contacts: [contact objects] description: 'Description of the property' data_access_level: 'public' - image_files_to_add: [strings] - image_files_to_remove: [strings] metadata: object protocol_url: '10.35079/protocols.io.abcdefghijkl' lab_donor_id: 'AB123' @@ -1385,10 +1346,6 @@ components: data_access_level: 'public' sample_category: 'organ' organ: 'AO' - image_files_to_add: [strings] - image_files_to_remove: [strings] - metadata_files_to_add: [string] - metadata_files_to_remove: [string] protocol_url: '10.35079/protocols.io.abcdefghijkl' lab_tissue_sample_id: '12-345 Aorta AA-1' submission_id: 'AB1234' @@ -1704,10 +1661,6 @@ components: data_access_level: 'public' sample_category: 'organ' organ: 'AO' - image_files_to_add: [strings] - image_files_to_remove: [strings] - metadata_files_to_add: [string] - metadata_files_to_remove: [string] protocol_url: '10.35079/protocols.io.abcdefghijkl' lab_tissue_sample_id: '12-345 Aorta AA-1' submission_id: 'AB1234' @@ -1735,10 +1688,6 @@ components: data_access_level: 'public' sample_category: 'organ' organ: 'AO' - image_files_to_add: [strings] - image_files_to_remove: [strings] - metadata_files_to_add: [string] - metadata_files_to_remove: [string] protocol_url: '10.35079/protocols.io.abcdefghijkl' lab_tissue_sample_id: '12-345 Aorta AA-1' submission_id: 'AB1234' @@ -1909,8 +1858,6 @@ components: contacts: [contact objects] description: 'Description of the property' data_access_level: 'public' - image_files_to_add: [strings] - image_files_to_remove: [strings] metadata: object protocol_url: '10.35079/protocols.io.abcdefghijkl' lab_donor_id: 'AB123' @@ -1935,8 +1882,6 @@ components: contacts: [contact objects] description: 'Description of the property' data_access_level: 'public' - image_files_to_add: [strings] - image_files_to_remove: [strings] metadata: object protocol_url: '10.35079/protocols.io.abcdefghijkl' lab_donor_id: 'AB123' diff --git a/src/app.py b/src/app.py index 83354ebd..fd1c901d 100644 --- a/src/app.py +++ b/src/app.py @@ -5049,7 +5049,7 @@ def create_entity_details(request, normalized_entity_type, user_token, json_data # Filter out the merged_dict by getting rid of the transitent properties (not to be stored) # and properties with None value # Meaning the returned target property key is different from the original key - # in the trigger method, e.g., Donor.image_files_to_add + # in the trigger method filtered_merged_dict = schema_manager.remove_transient_and_none_values(merged_dict, normalized_entity_type) # Create new entity try: @@ -5204,7 +5204,7 @@ def create_multiple_samples_details(request, normalized_entity_type, user_token, # Filter out the merged_dict by getting rid of the transitent properties (not to be stored) # and properties with None value # Meaning the returned target property key is different from the original key - # in the trigger method, e.g., Donor.image_files_to_add + # in the trigger method filtered_merged_dict = schema_manager.remove_transient_and_none_values(merged_dict, normalized_entity_type) samples_dict_list = [] @@ -5332,7 +5332,7 @@ def create_multiple_component_details(request, normalized_entity_type, user_toke # Filter out the merged_dict by getting rid of the transitent properties (not to be stored) # and properties with None value # Meaning the returned target property key is different from the original key - # in the trigger method, e.g., Donor.image_files_to_add + # in the trigger method filtered_merged_dict = schema_manager.remove_transient_and_none_values(merged_dict, normalized_entity_type) dataset_dict = {**filtered_merged_dict, **new_ids_dict_list[i]} dataset_dict['dataset_link_abs_dir'] = dataset_link_abs_dir @@ -5445,7 +5445,7 @@ def update_entity_details(request, normalized_entity_type, user_token, json_data # Filter out the merged_dict by getting rid of the transitent properties (not to be stored) # and properties with None value # Meaning the returned target property key is different from the original key - # in the trigger method, e.g., Donor.image_files_to_add + # in the trigger method filtered_merged_dict = schema_manager.remove_transient_and_none_values(merged_dict, normalized_entity_type) # By now the filtered_merged_dict contains all user updates and all triggered data to be added to the entity node diff --git a/src/schema/provenance_schema.yaml b/src/schema/provenance_schema.yaml index 3031f2cd..cf454742 100644 --- a/src/schema/provenance_schema.yaml +++ b/src/schema/provenance_schema.yaml @@ -838,28 +838,6 @@ ENTITIES: indexed: true description: "One of the values: public, consortium" before_create_trigger: set_data_access_level - image_files_to_add: - type: list - transient: true - exposed: false - indexed: false - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - before_create_trigger: commit_image_files - before_update_trigger: commit_image_files - # The updated_peripherally tag is a temporary measure to correctly handle any attributes - # which are potentially updated by multiple triggers - updated_peripherally: true - image_files_to_remove: - # This is only valid on update via a PUT request - type: list - transient: true - exposed: false - indexed: false - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' - before_update_trigger: delete_image_files - # The updated_peripherally tag is a temporary measure to correctly handle any attributes - # which are potentially updated by multiple triggers - updated_peripherally: true metadata: type: json_string # dict indexed: true @@ -1061,50 +1039,6 @@ ENTITIES: type: string indexed: true description: "The visit id for the donor/patient when the sample was obtained." - image_files_to_add: - type: list - transient: true - exposed: false - indexed: false - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - before_create_trigger: commit_image_files - before_update_trigger: commit_image_files - # The updated_peripherally tag is a temporary measure to correctly handle any attributes - # which are potentially updated by multiple triggers - updated_peripherally: true - image_files_to_remove: - # This is only valid on update via a PUT request - type: list - transient: true - exposed: false - indexed: false - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' - before_update_trigger: delete_image_files - # The updated_peripherally tag is a temporary measure to correctly handle any attributes - # which are potentially updated by multiple triggers - updated_peripherally: true - metadata_files_to_add: - type: list - transient: true - exposed: false - indexed: false - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - before_create_trigger: commit_metadata_files - before_update_trigger: commit_metadata_files - # The updated_peripherally tag is a temporary measure to correctly handle any attributes - # which are potentially updated by multiple triggers - updated_peripherally: true - metadata_files_to_remove: - # This is only valid on update via a PUT request - type: list - transient: true - exposed: false - indexed: false - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' - before_update_trigger: delete_metadata_files - # The updated_peripherally tag is a temporary measure to correctly handle any attributes - # which are potentially updated by multiple triggers - updated_peripherally: true thumbnail_file: generated: true indexed: true diff --git a/src/schema/schema_manager.py b/src/schema/schema_manager.py index 490867c6..a6e871ec 100644 --- a/src/schema/schema_manager.py +++ b/src/schema/schema_manager.py @@ -843,7 +843,7 @@ def remove_none_values(merged_dict): Filter out the merged_dict by getting rid of the transitent properties (not to be stored) and properties with None value Meaning the returned target property key is different from the original key -in the trigger method, e.g., Donor.image_files_to_add +in the trigger method Parameters ---------- diff --git a/src/schema/schema_triggers.py b/src/schema/schema_triggers.py index f1387dd9..dc54d481 100644 --- a/src/schema/schema_triggers.py +++ b/src/schema/schema_triggers.py @@ -462,6 +462,10 @@ def set_submission_id(property_key, normalized_type, request_args, user_token, e """ +DEPRECATED: This function is no longer used. +The image_files and metadata_files properties have been removed from the schema. +This function is retained for record-keeping purposes only and should not be called. + TriggerTypeEnum.BEFORE_CREATE Trigger event method to commit files saved that were previously uploaded with UploadFileHelper.save_file @@ -513,6 +517,11 @@ def commit_image_files(property_key, normalized_type, request_args, user_token, """ +DEPRECATED: This function is no longer used. +The image_files and metadata_files properties have been removed from the schema. +This function is retained for record-keeping purposes only and should not be called. +Original docstrings and comments left intact. + TriggerTypeEnum.BEFORE_UPDATE Trigger event methods for removing files from an entity during update @@ -552,6 +561,11 @@ def delete_image_files(property_key, normalized_type, request_args, user_token, """ +DEPRECATED: This function is no longer used. +The image_files and metadata_files properties have been removed from the schema. +This function is retained for record-keeping purposes only and should not be called. +Original docstrings and comments left intact. + TriggerTypeEnum.BEFORE_UPDATE Trigger event method to ONLY update descriptions of existing files @@ -1854,6 +1868,11 @@ def link_donor_to_lab(property_key, normalized_type, request_args, user_token, e #################################################################################################### """ +DEPRECATED: This function is no longer used. +The image_files and metadata_files properties have been removed from the schema. +This function is retained for record-keeping purposes only and should not be called. +Original docstrings and comments left intact. + TriggerTypeEnum.BEFORE_CREATE and TriggerTypeEnum.BEFORE_UPDATE Trigger event method to commit files saved that were previously uploaded with UploadFileHelper.save_file @@ -1905,6 +1924,11 @@ def commit_metadata_files(property_key, normalized_type, request_args, user_toke """ +DEPRECATED: This function is no longer used. +The image_files and metadata_files properties have been removed from the schema. +This function is retained for record-keeping purposes only and should not be called. +Original docstrings and comments left intact. + TriggerTypeEnum.BEFORE_UPDATE Trigger event methods for removing files from an entity during update @@ -2407,6 +2431,11 @@ def set_activity_creation_action(property_key, normalized_type, request_args, us #################################################################################################### """ +DEPRECATED: This function is no longer used. +The image_files and metadata_files properties have been removed from the schema. +This function is retained for record-keeping purposes only and should not be called. +Original docstrings and comments left intact. + Trigger event method to commit files saved that were previously uploaded with UploadFileHelper.save_file The information, filename and optional description is saved in the field with name specified by `target_property_key` diff --git a/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml b/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml index 2bf2e99a..5b32af4a 100644 --- a/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml +++ b/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml @@ -270,20 +270,6 @@ x-ref-components: - consortium - public description: "One of the values: public, consortium" - image_files_to_add: - writeOnly: true - type: array - items: - type: string - format: file_id - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - image_files_to_remove: - writeOnly: true - type: array - items: - type: string - format: file_id - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' metadata: type: object properties: @@ -460,32 +446,6 @@ x-ref-components: visit: type: string description: "The visit id for the donor/patient when the sample was obtained." - image_files_to_add: - writeOnly: true - type: array - items: - type: string - format: file_id - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - image_files_to_remove: - writeOnly: true - type: array - items: - type: string - format: file_id - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' - metadata_files_to_add: - type: array - items: - type: string - format: file_id - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - metadata_files_to_remove: - type: array - items: - type: string - format: file_id - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' x-ref-Dataset: x-ref-type: object x-ref-properties: diff --git a/src/schema_templating/example-yaml-templates/donor-schema.yaml b/src/schema_templating/example-yaml-templates/donor-schema.yaml index f37c84e6..9de6225f 100644 --- a/src/schema_templating/example-yaml-templates/donor-schema.yaml +++ b/src/schema_templating/example-yaml-templates/donor-schema.yaml @@ -73,20 +73,6 @@ Donor: - consortium - public description: "One of the values: public, consortium" - image_files_to_add: - writeOnly: true - type: array - items: - type: string - format: file_id - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - image_files_to_remove: - writeOnly: true - type: array - items: - type: string - format: file_id - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' metadata: type: object properties: diff --git a/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml b/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml index 02895eee..b67ac462 100644 --- a/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml +++ b/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml @@ -270,20 +270,6 @@ components: - consortium - public description: "One of the values: public, consortium" - image_files_to_add: - writeOnly: true - type: array - items: - type: string - format: file_id - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - image_files_to_remove: - writeOnly: true - type: array - items: - type: string - format: file_id - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' metadata: type: object properties: @@ -438,33 +424,6 @@ components: description: "The sample location and orientation in the ancestor organ as specified in the RUI tool. Returned as a json object." visit: type: string - description: "The visit id for the donor/patient when the sample was obtained." - image_files_to_add: - writeOnly: true - type: array - items: - type: string - format: file_id - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - image_files_to_remove: - writeOnly: true - type: array - items: - type: string - format: file_id - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' - metadata_files_to_add: - type: array - items: - type: string - format: file_id - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - metadata_files_to_remove: - type: array - items: - type: string - format: file_id - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' Dataset: type: object properties: diff --git a/src/schema_templating/example-yaml-templates/sample-schema.yaml b/src/schema_templating/example-yaml-templates/sample-schema.yaml index a1d62c97..8d9553ef 100644 --- a/src/schema_templating/example-yaml-templates/sample-schema.yaml +++ b/src/schema_templating/example-yaml-templates/sample-schema.yaml @@ -109,30 +109,4 @@ Sample: description: "The sample location and orientation in the ancestor organ as specified in the RUI tool. Returned as a json object." visit: type: string - description: "The visit id for the donor/patient when the sample was obtained." - image_files_to_add: - writeOnly: true - type: array - items: - type: string - format: file_id - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - image_files_to_remove: - writeOnly: true - type: array - items: - type: string - format: file_id - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' - metadata_files_to_add: - type: array - items: - type: string - format: file_id - description: 'List of temporary file ids with an optional description. Provide as a json array with an temp_file_id and description attribute for each element like {"files": [{"temp_file_id":"dzevgd6xjs4d5grmcp4n","description":"This is image file one"},{"temp_file_id":"yrahjadfhadf","description":"This is image file two"}]}' - metadata_files_to_remove: - type: array - items: - type: string - format: file_id - description: 'List of image files previously uploaded to delete. Provide as a json array of the file_uuids of the file like: ["232934234234234234234270c0ea6c51d604a850558ef2247d0b4", "230948203482234234234a57bfe9c056d08a0f8e6cd612baa3bfa"]' \ No newline at end of file + description: "The visit id for the donor/patient when the sample was obtained." \ No newline at end of file