Skip to content

Commit

Permalink
♻️ Set visibility_reason, visibility_comment for hidden things
Browse files Browse the repository at this point in the history
  • Loading branch information
znatty22 committed Jun 23, 2023
1 parent e00eecb commit 9c79c2d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 9 deletions.
6 changes: 6 additions & 0 deletions kf_update_dbgap_consent/sample_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def entities_dict(endpoint, filt):
"consent_type": None,
"dbgap_consent_code": None,
"visible": False,
"visibility_reason": "Consent Hold",
"visibility_comment": "Sample is not registered in dbGaP",
}
hidden_specimens[kfid] = bs

Expand All @@ -225,6 +227,10 @@ def entities_dict(endpoint, filt):
for k, e in entities.items():
storage[endpoint][k] = e
patches[endpoint][k]["visible"] = False
patches[endpoint][k]["visibility_reason"] = "Consent Hold"
patches[endpoint][k][
"visibility_comment"
] = "Sample is not registered in dbGaP"
if endpoint == "genomic-files":
hidden_genomic_files.add(k)

Expand Down
36 changes: 27 additions & 9 deletions tests/data/phs999999_patches.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
{
"biospecimen-diagnoses": {
"BD_11111111": {
"visible": false
"visible": false,
"visibility_reason": "Consent Hold",
"visibility_comment": "Sample is not registered in dbGaP"
}
},
"biospecimen-genomic-files": {
"BG_00000000": {
"visible": false
"visible": false,
"visibility_reason": "Consent Hold",
"visibility_comment": "Sample is not registered in dbGaP"
},
"BG_11111111": {
"visible": false
"visible": false,
"visibility_reason": "Consent Hold",
"visibility_comment": "Sample is not registered in dbGaP"
}
},
"biospecimens": {
"BS_11111111": {
"visible": false
"visible": false,
"visibility_reason": "Consent Hold",
"visibility_comment": "Sample is not registered in dbGaP"
},
"BS_22222222": {
"consent_type": "LOL",
Expand All @@ -28,11 +36,15 @@
"genomic-files": {
"GF_00000000": {
"authz": [],
"visible": false
"visible": false,
"visibility_reason": "Consent Hold",
"visibility_comment": "Sample is not registered in dbGaP"
},
"GF_11111111": {
"authz": [],
"visible": false
"visible": false,
"visibility_reason": "Consent Hold",
"visibility_comment": "Sample is not registered in dbGaP"
},
"GF_22222222": {
"authz": [
Expand All @@ -50,15 +62,21 @@
},
"sequencing-experiment-genomic-files": {
"SG_00000000": {
"visible": false
"visible": false,
"visibility_reason": "Consent Hold",
"visibility_comment": "Sample is not registered in dbGaP"
},
"SG_11111111": {
"visible": false
"visible": false,
"visibility_reason": "Consent Hold",
"visibility_comment": "Sample is not registered in dbGaP"
}
},
"sequencing-experiments": {
"SE_11111111": {
"visible": false
"visible": false,
"visibility_reason": "Consent Hold",
"visibility_comment": "Sample is not registered in dbGaP"
}
},
"studies": {
Expand Down
2 changes: 2 additions & 0 deletions tests/test_sample_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def test_sample_status(requests_mock):
patches, alerts = ConsentProcessor(host).get_patches_for_study(study_id)
new_expected_patches["biospecimens"]["BS_44444444"] = {
"visible": False,
"visibility_reason": "Consent Hold",
"visibility_comment": "Sample is not registered in dbGaP",
"consent_type": None,
"dbgap_consent_code": None,
}
Expand Down

0 comments on commit 9c79c2d

Please sign in to comment.