-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sanger feedback #4345
Sanger feedback #4345
Changes from 10 commits
b6ba007
a6e8256
0bb5f1e
e0004e6
08e33df
b961bdf
3c7e35b
18930ae
e87050c
e617a57
1e4723c
058730d
348dff0
7be1509
547f80b
b596822
f924833
bc852b9
710cd21
a8616ae
fb12630
10adb97
61e6743
9f683f5
e574e96
18504f7
d0c9898
cb3a96b
68601a4
ca41397
bfc3ad0
90f0918
257c8ae
1ca0cc7
d154eca
2dd1674
610b7a9
266edf5
90b5695
600bf99
37bcbd6
2895a3f
0903be4
c094d75
6f4f74d
b411247
a54805b
fe45880
cdf0380
a6fb494
a550c4c
689d220
15ad41f
bba4f91
b7ef51b
69a3b51
7931a7d
ebd11f8
591f61d
345f07e
9c0a4a8
fbc581c
cebb0f7
a1c63cd
8be3fea
d180249
6dac315
2f03a64
dab23fd
22cdd1b
81fab78
c4f1736
8db399c
177b025
4d049aa
bbd58be
2bee21c
a0d68b6
a8d3cce
84c1dda
3cac301
9e4d891
23fec9e
a22585d
987ad80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import logging | ||
from collections import Counter | ||
from typing import Any, Dict, List | ||
from typing import Dict, List, Optional | ||
|
||
import pymongo | ||
|
||
|
@@ -214,6 +214,22 @@ def sanger_ordered( | |
sanger_ordered = [item for item in results] | ||
return sanger_ordered | ||
|
||
def sanger_ordered_by(self, institute_id: str, case_id: str, variant_id: str) -> Optional[str]: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
"""retrieve the id of a user which ordered the Sanger verification of a variant.""" | ||
|
||
query = { | ||
"verb": "sanger", | ||
"institute": institute_id, | ||
"case": case_id, | ||
"variant_id": variant_id, | ||
} | ||
projection = {"_id": 0, "user_id": 1} | ||
result: dict = self.event_collection.find_one( | ||
query, projection, sort=[("created_at", pymongo.DESCENDING)] | ||
) | ||
if result: | ||
return result["user_id"] | ||
|
||
def validated( | ||
self, institute_id: str = None, user_id: str = None, case_id: str = None | ||
) -> List[Dict[str, List]]: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -704,5 +704,17 @@ <h5 class="modal-title" id="exampleModalLabel">Edit synopsis</h5> | |
$('[data-bs-toggle=sidebar-collapse]').click(function() { | ||
SidebarCollapse(); | ||
}); | ||
|
||
// Allows a Sanger recipient to notify the user who ordered a Sanger verification that it was a true positive | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I'm missing the gain from checking for the user in Sanger recipients? If they are posed to set the validation status, they got the info somehow, didn't they? The Sanger recipient can conveniently be a function email box at the hospital, to which several lab users have access. |
||
function validate_action(validated_option) { | ||
if (validated_option != "True positive"){ | ||
document.getElementById('validation_form').submit(); | ||
} | ||
const sanger_recipients = {{ institute.sanger_recipients | tojson }}; | ||
if ( sanger_recipients.includes("{{current_user.email}}") ){ | ||
var myModal = new bootstrap.Modal(document.getElementById('validationModal')) | ||
myModal.show(); | ||
} | ||
} | ||
</script> | ||
{% endblock %} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -553,17 +553,7 @@ <h6>No pinned variants</h6> | |||||
</div> | ||||||
</div> | ||||||
<div class="col-5"> | ||||||
<form action="{{ url_for('cases.mark_validation', | ||||||
institute_id=variant.institute, | ||||||
case_name=case.display_name, | ||||||
variant_id=variant._id) }}" | ||||||
method="POST" accept-charset="utf-8"> | ||||||
<select class="form-control form-control-sm" onchange="this.form.submit()" name="type"> | ||||||
{% for type in ('Not validated', 'True positive', 'False positive') %} | ||||||
<option value="{{ type }}" {% if type == variant.validation %}selected{% endif %}>{{ type }}</option> | ||||||
{% endfor %} | ||||||
</select> | ||||||
</form> | ||||||
{{ validation_macro(variant, case) }} | ||||||
</div> | ||||||
<div class="col-2"> | ||||||
{{ remove_form(url_for('cases.pin_variant', | ||||||
|
@@ -583,6 +573,43 @@ <h6>No pinned variants</h6> | |||||
</div> | ||||||
{% endmacro %} | ||||||
|
||||||
|
||||||
{% macro validation_macro(variant, case) %} | ||||||
<form action="{{ url_for('cases.mark_validation', institute_id=variant.institute, case_name=case.display_name, variant_id=variant._id) }}" method="POST" accept-charset="utf-8" id="validation_form"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pre-existing code |
||||||
<select class="form-control form-control-sm" onchange="validate_action(this.value);" name="type"> | ||||||
{% for type in ('Not validated', 'True positive', 'False positive') %} | ||||||
<option value="{{ type }}" {% if type == variant.validation %}selected{% endif %}>{{ type }}</option> | ||||||
{% endfor %} | ||||||
</select> | ||||||
</form> | ||||||
|
||||||
<div class="modal fade" tabindex="-1" id="validationModal"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New code |
||||||
<div class="modal-dialog"> | ||||||
<div class="modal-content"> | ||||||
<div class="modal-header"> | ||||||
<h5 class="modal-title">Positive validation notification</h5> | ||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||||||
</div> | ||||||
<form action="{{ url_for('cases.mark_validation', institute_id=variant.institute, case_name=case.display_name, variant_id=variant._id) }}" method="POST" accept-charset="utf-8"> | ||||||
<input type="hidden" name="type" value="True positive"/> | ||||||
<div class="modal-body"> | ||||||
<p>The variant is being marked as a true positive.</p> | ||||||
<input class="form-check-input" type="checkbox" value="yes" name="notify_user" id="notify_user" checked> | ||||||
<label class="form-check-label" for="notify_user"> | ||||||
Notify user which ordered verification | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Unless it's one of those function email boxes at work of course! 😉 |
||||||
</label> | ||||||
</div> | ||||||
<div class="modal-footer"> | ||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Dismiss</button> | ||||||
<button type="submit" class="btn btn-primary">Save changes</button> | ||||||
</div> | ||||||
</form> | ||||||
</div> | ||||||
</div> | ||||||
</div> | ||||||
{% endmacro %} | ||||||
|
||||||
|
||||||
{% macro matching_causatives(other_causatives, institute, case, default=False) %} | ||||||
<div data-bs-toggle='tooltip' class="panel-heading" title="If there are any variants in this case | ||||||
that have been marked as causative in another case for this insitute. {% if default %}Variants in default panels for the case only.{% endif %}"> | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A False positive would very possibly trigger some action as well, depending on the institutes workflow..