From fba2d7142885ffa25f6b1bf508506b0a51f11b20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20H=C3=A4nsel?= Date: Thu, 30 Nov 2023 16:00:45 +0100 Subject: [PATCH] Updating MDS 3.2 seeds --- db/seeds/024_MDS_3_2_Study_gen.seeds.rb | 6 +----- db/seeds/025_MDS_3_2_Investigation_gen.seeds.rb | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/db/seeds/024_MDS_3_2_Study_gen.seeds.rb b/db/seeds/024_MDS_3_2_Study_gen.seeds.rb index f5c2c8ed87..6ee34ab288 100644 --- a/db/seeds/024_MDS_3_2_Study_gen.seeds.rb +++ b/db/seeds/024_MDS_3_2_Study_gen.seeds.rb @@ -347,14 +347,10 @@ def create_sample_controlled_vocab_terms_attributes(array) sample_controlled_vocab_terms_attributes: create_sample_controlled_vocab_terms_attributes( ['Certain infectious or parasitic diseases (I)', 'Neoplasms (II)', 'Diseases of the blood or blood-forming organs and certain disorders involving the immune mechanism (III)', 'Endocrine, nutritional and metabolic diseases (IV)', 'Mental and behavioural disorders (V)', 'Diseases of the nervous system (VI)', 'Diseases of the eye and adnexa (VII)', 'Diseases of the ear or mastoid process (VIII)', 'Diseases of the circulatory system (IX)', 'Diseases of the respiratory system (X)', 'Diseases of the digestive system (XI)', 'Diseases of the skin and subcutaneous tissue (XII)', 'Diseases of the musculoskeletal system and connective tissue (XIII)', 'Diseases of the genitourinary system (XIV)', 'Pregnancy, childbirth or the puerperium (XV)', 'Certain conditions originating in the perinatal period (XVI)', 'Congenital malformations, deformations and chromosomal abnormalities (XVII)', 'Symptoms, signs and abnormal clinical and laboratory findings, not elsewhere classified (XVIII)', 'Injury, poisoning and certain other consequences of external causes (XIX)', 'External causes of morbidity or mortality (XX)', 'Factors influencing health status and contact with health services (XXI)', 'Other', 'Not applicable', 'Unknown'])) - Design_groupsOfDiseases_conditions_Study_cv = SampleControlledVocab.where(title: 'Design_groupsOfDiseases_conditions_Study').first_or_create!( - sample_controlled_vocab_terms_attributes: create_sample_controlled_vocab_terms_attributes( - ['Lower level ICD-10 (https://icd.who.int/browse10/2019/en), with autocomplete'])) - unless CustomMetadataType.where(title:'Design_groupsOfDiseases_Study', supported_type:'CustomMetadata').any? cmt = CustomMetadataType.new(title: 'Design_groupsOfDiseases_Study', supported_type:'CustomMetadata') cmt.custom_metadata_attributes << CustomMetadataAttribute.new(title: 'Design_groupsOfDiseases_generally_Study', sample_attribute_type: @cv_list_type, sample_controlled_vocab:Design_groupsOfDiseases_generally_Study_cv, description:'Groups of diseases or conditions on which the data were collected in the Study.', label:'Which groups of diseases or conditions were the data collected on?') - cmt.custom_metadata_attributes << CustomMetadataAttribute.new(title: 'Design_groupsOfDiseases_conditions_Study', sample_attribute_type: @string_typ, sample_controlled_vocab:nil, description:'Other diseases or conditions on which the data were collected in the Study.', label:'On which other diseases or conditions were the data collected?') + cmt.custom_metadata_attributes << CustomMetadataAttribute.new(title: 'Design_groupsOfDiseases_conditions_Study', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description:'Other diseases or conditions on which the data were collected in the Study.', label:'On which other diseases or conditions were the data collected?') cmt.save! end diff --git a/db/seeds/025_MDS_3_2_Investigation_gen.seeds.rb b/db/seeds/025_MDS_3_2_Investigation_gen.seeds.rb index 6e142f9100..a29c1338fd 100644 --- a/db/seeds/025_MDS_3_2_Investigation_gen.seeds.rb +++ b/db/seeds/025_MDS_3_2_Investigation_gen.seeds.rb @@ -347,14 +347,10 @@ def create_sample_controlled_vocab_terms_attributes(array) sample_controlled_vocab_terms_attributes: create_sample_controlled_vocab_terms_attributes( ['Certain infectious or parasitic diseases (I)', 'Neoplasms (II)', 'Diseases of the blood or blood-forming organs and certain disorders involving the immune mechanism (III)', 'Endocrine, nutritional and metabolic diseases (IV)', 'Mental and behavioural disorders (V)', 'Diseases of the nervous system (VI)', 'Diseases of the eye and adnexa (VII)', 'Diseases of the ear or mastoid process (VIII)', 'Diseases of the circulatory system (IX)', 'Diseases of the respiratory system (X)', 'Diseases of the digestive system (XI)', 'Diseases of the skin and subcutaneous tissue (XII)', 'Diseases of the musculoskeletal system and connective tissue (XIII)', 'Diseases of the genitourinary system (XIV)', 'Pregnancy, childbirth or the puerperium (XV)', 'Certain conditions originating in the perinatal period (XVI)', 'Congenital malformations, deformations and chromosomal abnormalities (XVII)', 'Symptoms, signs and abnormal clinical and laboratory findings, not elsewhere classified (XVIII)', 'Injury, poisoning and certain other consequences of external causes (XIX)', 'External causes of morbidity or mortality (XX)', 'Factors influencing health status and contact with health services (XXI)', 'Other', 'Not applicable', 'Unknown'])) - Design_groupsOfDiseases_conditions_Investigation_cv = SampleControlledVocab.where(title: 'Design_groupsOfDiseases_conditions_Investigation').first_or_create!( - sample_controlled_vocab_terms_attributes: create_sample_controlled_vocab_terms_attributes( - ['Lower level ICD-10 (https://icd.who.int/browse10/2019/en), with autocomplete'])) - unless CustomMetadataType.where(title:'Design_groupsOfDiseases_Investigation', supported_type:'CustomMetadata').any? cmt = CustomMetadataType.new(title: 'Design_groupsOfDiseases_Investigation', supported_type:'CustomMetadata') cmt.custom_metadata_attributes << CustomMetadataAttribute.new(title: 'Design_groupsOfDiseases_generally_Investigation', sample_attribute_type: @cv_list_type, sample_controlled_vocab:Design_groupsOfDiseases_generally_Investigation_cv, description:'Groups of diseases or conditions on which the data were collected in the Investigation.', label:'Which groups of diseases or conditions were the data collected on?') - cmt.custom_metadata_attributes << CustomMetadataAttribute.new(title: 'Design_groupsOfDiseases_conditions_Investigation', sample_attribute_type: @string_typ, sample_controlled_vocab:nil, description:'Other diseases or conditions on which the data were collected in the Investigation.', label:'On which other diseases or conditions were the data collected?') + cmt.custom_metadata_attributes << CustomMetadataAttribute.new(title: 'Design_groupsOfDiseases_conditions_Investigation', sample_attribute_type: @string_type, sample_controlled_vocab:nil, description:'Other diseases or conditions on which the data were collected in the Investigation.', label:'On which other diseases or conditions were the data collected?') cmt.save! end