Skip to content

Commit

Permalink
Updating MDS 3.2 seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneHaensel committed Nov 30, 2023
1 parent a709716 commit fba2d71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions db/seeds/024_MDS_3_2_Study_gen.seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 1 addition & 5 deletions db/seeds/025_MDS_3_2_Investigation_gen.seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fba2d71

Please sign in to comment.