Commit d3ab4195 authored by Pinar Alper's avatar Pinar Alper
Browse files

Merge branch '12-update-use-restriction-rules' into 'master'

Resolve "Update use restriction rules"

Closes #12

See merge request pinar.alper/metadata-tools!15
parents 0ac6a330 d6149df0
......@@ -150,102 +150,111 @@ class DishXlsExporter:
datadec_dict['special_subject_notes'] = sheet[22, 1]
use_restrictions = []
# Is data consented to be used only in specific research/disease areas?
if process_yes_no_dontknow_answer(sheet[24, 1]):
use_restrictions.append({'use_class': 'RS-[XX]',
'use_restriction_rule': "CONSTRAINTS",
'use_restriction_rule': "CONSTRAINED_PERMISSION",
'use_class_note': sheet[24, 0],
'use_restriction_note': sheet[25,1]})
elif process_yes_no_dontknow_answer(sheet[24, 1]) is not None:
use_restrictions.append({'use_class': 'RS-[XX]',
'use_restriction_rule': "NO_CONSTRAINTS",
'use_restriction_rule': "PERMISSION",
'use_class_note': sheet[24, 0]})
# Does consent contain clauses that put geographical restrictions to the sharing of data?
if process_yes_no_dontknow_answer(sheet[26, 1]):
use_restrictions.append({'use_class': 'GS-[XX]',
'use_restriction_rule': "CONSTRAINTS",
'use_restriction_rule': "PROHIBITION",
'use_class_note': sheet[26, 0],
'use_restriction_note': sheet[27,1]})
elif process_yes_no_dontknow_answer(sheet[26, 1]) is not None:
use_restrictions.append({'use_class': 'GS-[XX]',
'use_restriction_rule': "NO_CONSTRAINTS",
'use_restriction_rule': "PERMISSION",
'use_class_note': sheet[26, 0]})
# Does the consent limit the type of recipients?
if process_yes_no_dontknow_answer(sheet[28, 1]):
use_restrictions.append({'use_class': 'IS',
'use_restriction_rule': "CONSTRAINTS",
'use_restriction_rule': "CONSTRAINED_PERMISSION",
'use_class_note': sheet[28, 0],
'use_restriction_note': sheet[29,1]})
elif process_yes_no_dontknow_answer(sheet[28, 1]) is not None:
use_restrictions.append({'use_class': 'IS',
'use_restriction_rule': "NO_CONSTRAINTS",
'use_restriction_rule': "PERMISSION",
'use_class_note': sheet[28, 0]})
# Does the consent contain clauses that put time-limits on the use of data?
if process_yes_no_dontknow_answer(sheet[30, 1]):
use_restrictions.append({'use_class': 'TS-[XX]',
'use_restriction_rule': "CONSTRAINTS",
'use_restriction_rule': "OBLIGATION",
'use_class_note': sheet[30, 0],
'use_restriction_note': sheet[31,1]})
elif process_yes_no_dontknow_answer(sheet[30, 1]) is not None:
use_restrictions.append({'use_class': 'IS',
'use_restriction_rule': "NO_CONSTRAINTS",
use_restrictions.append({'use_class': 'TS-[XX]',
'use_restriction_rule': "PERMISSION",
'use_class_note': sheet[30, 0]})
# Is the use of data limited to the project named in the Submission sheet?
if process_yes_no_answer(sheet[35, 1]):
use_restrictions.append({'use_class': 'PS',
'use_restriction_rule': "CONSTRAINTS",
'use_restriction_rule': "CONSTRAINED_PERMISSION",
'use_class_note': sheet[35, 0],
'use_restriction_note': dataset_dict["project"]})
else:
use_restrictions.append({'use_class': 'PS',
'use_restriction_rule': "NO_CONSTRAINTS",
'use_restriction_rule': "PERMISSION",
'use_class_note': sheet[35, 0]})
# Is the data being sent to ELIXIR-LU/LCSB for a limited duration?
if process_yes_no_answer(sheet[36, 1]):
datadec_dict["storage_end_date"] = process_possible_date(sheet[37, 1])
use_restrictions.append({'use_class': 'TS-[XX]',
'use_restriction_rule': "CONSTRAINTS",
'use_restriction_rule': "OBLIGATION",
'use_class_note': sheet[36, 0],
'use_restriction_note': process_possible_date(sheet[37, 1])})
else:
use_restrictions.append({'use_class': 'TS-[XX]',
'use_restriction_rule': "NO_CONSTRAINTS",
'use_restriction_rule': "PERMISSION",
'use_class_note': sheet[36, 0]})
# Are there any requirements in case of publications based on the DATA?
if process_yes_no_answer(sheet[38, 1]):
use_restrictions.append({'use_class': 'PUB',
'use_restriction_rule': "CONSTRAINTS",
'use_restriction_rule': "OBLIGATION",
'use_class_note': sheet[38, 0],
'use_restriction_note': sheet[39, 1]})
else:
use_restrictions.append({'use_class': 'PUB',
'use_restriction_rule': "NO_CONSTRAINTS",
'use_restriction_rule': "PERMISSION",
'use_class_note': sheet[38, 0]})
# Is there a requirement to return data or documents to the database/resource?
if process_yes_no_answer(sheet[40, 1]):
use_restrictions.append({'use_class': 'RTN',
'use_restriction_rule': "CONSTRAINTS",
'use_restriction_rule': "OBLIGATION",
'use_class_note': sheet[40, 0],
'use_restriction_note': sheet[41, 1]})
else:
use_restrictions.append({'use_class': 'RTN',
'use_restriction_rule': "NO_CONSTRAINTS",
'use_restriction_rule': "PERMISSION",
'use_class_note': sheet[40, 0]})
if sheet[42, 1]:
use_restrictions.append({'use_class': 'Other',
'use_restriction_rule': "CONSTRAINTS",
'use_restriction_rule': "CONSTRAINED_PERMISSION",
'use_class_note': sheet[42, 0],
'use_restriction_note': sheet[42, 1]})
# Are there any IP restrictions/requirements when using the DATA?
if process_yes_no_answer(sheet[47, 1]):
use_restrictions.append({'use_class': 'IP',
'use_restriction_rule': "CONSTRAINTS",
'use_restriction_rule': "CONSTRAINED_PERMISSION",
'use_class_note': sheet[47, 0],
'use_restriction_note': sheet[48, 1]})
else:
use_restrictions.append({'use_class': 'IP',
'use_restriction_rule': "NO_CONSTRAINTS",
'use_restriction_rule': "PERMISSION",
'use_class_note': sheet[47, 1]})
datadec_dict['use_restrictions'] = use_restrictions
......
Subproject commit b17f543d31fc044024578bcbf2291f2a0ddf4708
Subproject commit 81fb8d257236219555832a7aab3c4ed16a4250c6
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment