Skip to content

Commit

Permalink
Fixed openFDA switch
Browse files Browse the repository at this point in the history
  • Loading branch information
blasisd committed Jan 31, 2022
1 parent d24da5d commit 78f5215
Show file tree
Hide file tree
Showing 12 changed files with 224 additions and 68 deletions.
Binary file modified gentelella/app/__pycache__/apps.cpython-38.pyc
Binary file not shown.
Binary file modified gentelella/app/__pycache__/forms.cpython-38.pyc
Binary file not shown.
Binary file modified gentelella/app/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file modified gentelella/app/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file modified gentelella/app/__pycache__/views.cpython-38.pyc
Binary file not shown.
128 changes: 121 additions & 7 deletions gentelella/app/static/build/css/pv_dash.css
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,6 @@ iframe.modalIframe {
padding-left: 1.5rem;
}


.custom-control-inline {
display: -ms-inline-flexbox;
display: inline-flex;
Expand Down Expand Up @@ -699,8 +698,6 @@ button.close {
}
}



.pathways-int-fld select {
margin: 0 1rem;
direction: ltr;
Expand All @@ -722,7 +719,6 @@ button.close {
border-color: rgba(52, 152, 219, 0.88);
}


.age_crit_info {
background-color: rgba(75, 95, 113, 0.88); /*#4d6f80;*/
border-color: rgba(75, 95, 113, 0.88);
Expand Down Expand Up @@ -775,6 +771,7 @@ button.close {
background-color: #738d9c;
border-color: #5c7586
}

.btn-enlarge:hover,
.btn-enlarge:focus,
.btn-enlarge:active,
Expand Down Expand Up @@ -817,8 +814,6 @@ button.close {
box-sizing: border-box;
}



/*@media (min-width: 768px)*/
/*.icon-bar {*/
/* position: fixed;*/
Expand Down Expand Up @@ -866,7 +861,6 @@ button.close {
/* overflow: hidden;*/
/*}*/


#notesTbl td {
vertical-align: middle;
text-align: left;
Expand Down Expand Up @@ -991,4 +985,124 @@ input[type='checkbox']+span {

.btn>span.hidden-xs, .btn>span.visible-lg {
color: white;
}

.bs-switch {
position: relative;
width: 50px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none
}

.bs-switch .bs-switch-checkbox {
display: none
}

.bs-switch .bs-switch-label {
position: relative;
display: block;
overflow: hidden;
border: 2px solid #e4e4e4;
border-radius: 20px;
cursor: pointer
}

.bs-switch .bs-switch-inner {
margin-left: -100%;
width: 200%;
-webkit-transition-delay: 0s;
-moz-transition-delay: 0s;
-o-transition-delay: 0s;
transition-delay: 0s;
-webkit-transition-timing-function: ease-in;
-moz-transition-timing-function: ease-in;
-o-transition-timing-function: ease-in;
transition-timing-function: ease-in;
-webkit-transition-duration: 0.3s;
-moz-transition-duration: 0.3s;
-o-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-property: margin;
-moz-transition-property: margin;
-o-transition-property: margin;
transition-property: margin
}

.bs-switch .bs-switch-inner:before,
.bs-switch .bs-switch-inner:after {
float: left;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
width: 50%;
height: 18px;
color: #fff;
font-size: 10px;
line-height: 1.8
}

.bs-switch .bs-switch-inner:before {
padding-left: 6px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
background-color: #2e9e89;
color: #fff;
/*content: "ON";*/
content: '\2713';
-ms-border-radius: 20px;
-o-border-radius: 20px
}

.bs-switch .bs-switch-inner:after {
padding-right: 6px;
background-color: #eee;
color: #999;
content: '\2717';
/*content: "OFF";*/
text-align: right
}

.bs-switch .bs-switch-switch {
position: absolute;
top: 0;
right: 28px;
bottom: 0;
margin: 2px;
width: 15px;
border: 2px solid #e4e4e4;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
background: #fff;
-webkit-transition-delay: 0s;
-moz-transition-delay: 0s;
-o-transition-delay: 0s;
transition-delay: 0s;
-webkit-transition-timing-function: ease-in;
-moz-transition-timing-function: ease-in;
-o-transition-timing-function: ease-in;
transition-timing-function: ease-in;
-webkit-transition-duration: 0.3s;
-moz-transition-duration: 0.3s;
-o-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-property: all;
-moz-transition-property: all;
-o-transition-property: all;
transition-property: all;
-ms-border-radius: 15px;
-o-border-radius: 15px
}

.bs-switch.bs-switch-blank .bs-switch-inner:before,
.bs-switch.bs-switch-blank .bs-switch-inner:after { content: "" }
.bs-switch-checkbox:checked + .bs-switch-label .bs-switch-inner {
margin-left: 0
}

.bs-switch-checkbox:checked + .bs-switch-label .bs-switch-switch {
right: 0
}
17 changes: 13 additions & 4 deletions gentelella/app/static/build/js/final_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,25 @@ $(function(){
$("#resultBtn").prop("disabled", proceed_disabled);
});

// $("#concomitantSwitch").on('change', function() {
// if ($(this).is(':checked')) {
// switchStatus = $(this).is(':checked');
// }
// else {
// switchStatus = $(this).is(':checked');
// }
// });


$("[id*=ShinyBtn]").click(function(){
var drug= $(this).data('drug');
var con= $(this).data('con');
var hash= $(this).data('hash');
var lang = $("#curLang").data("lang").substring(0, 2).toLowerCase();
var urlquickview1= openfda_shiny_endpoint + $(this).attr('id').replace('ShinyBtn','').replace(/\d+/,'') + "/?lang=" + lang + "&t1=" + drug + "&v1=patient.drug.openfda.generic_name&t2=" + con + "&v2=patient.reaction.reactionmeddrapt&hash=" + hash;
var urlquickview2= openfda_shiny_endpoint + $(this).attr('id').replace('ShinyBtn','').replace(/\d+/,'') + "/?lang=" + lang + "&t1=" + drug + "&v1=patient.drug.openfda.generic_name&hash=" + hash;
var urlquickview3= openfda_shiny_endpoint + $(this).attr('id').replace('ShinyBtn','').replace(/\d+/,'') + "/?lang=" + lang + "&t2=" + con + "&v2=patient.reaction.reactionmeddrapt&hash=" + hash;
// console.log(urlquickview1);
var concomitant = $("#concomitantSwitch").is(':checked')? "TRUE": "FALSE";
var urlquickview1= openfda_shiny_endpoint + $(this).attr('id').replace('ShinyBtn','').replace(/\d+/,'') + "/?lang=" + lang + "&t1=" + drug + "&v1=patient.drug.openfda.generic_name&t2=" + con + "&v2=patient.reaction.reactionmeddrapt&concomitant="+concomitant+"&hash=" + hash;
var urlquickview2= openfda_shiny_endpoint + $(this).attr('id').replace('ShinyBtn','').replace(/\d+/,'') + "/?lang=" + lang + "&t1=" + drug + "&v1=patient.drug.openfda.generic_name&concomitant="+concomitant+"&hash=" + hash;
var urlquickview3= openfda_shiny_endpoint + $(this).attr('id').replace('ShinyBtn','').replace(/\d+/,'') + "/?lang=" + lang + "&t2=" + con + "&v2=patient.reaction.reactionmeddrapt&concomitant="+concomitant+"&hash=" + hash;

if (con == '') {
document.getElementById('iframe_shiny').src = urlquickview2;
Expand Down
75 changes: 45 additions & 30 deletions gentelella/app/templates/app/final_report.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,52 +164,67 @@ <h4 class="panel-title">
<!-- <label for="openfdaChkBx"></label>-->
</div>
<br>
<div class="container">
{% if drug_condition_hash %}
<div class="row pull-right">
<div class="col-xs-3">{% trans "Συγχορηγούμενα" %}:</div>
<div class="col-xs-6 col-xs-offset-3">
<div class="bs-switch">
<input type="checkbox" name="bs-switch" class="bs-switch-checkbox" id="concomitantSwitch" checked=true>
<label class="bs-switch-label" for="concomitantSwitch">
<div class="bs-switch-inner"></div>
<div class="bs-switch-switch"></div>
</label>
</div>
</div>
</div>
{% endif %}

<div class="container mt-5">
<div class="panel-group" id="combsAccordion">

{% for d,c,k in drug_condition_hash %}

<div id="{{ d }}{% if d and c %} - {% endif %}{{ c }}" class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#combsAccordion" href="#collapse{{ forloop.counter }}" style="color:#5A738E;">{{ d }}{% if d and c %} - {% endif %}{{ c }}</a>
</h4>
</div>
<div id="collapse{{ forloop.counter }}" class="panel-collapse collapse {% if forloop.counter == 1 %}in{% endif %}">
<div class="panel-body">
<div id="{{ d.name }}{% if d and c %}_{% endif %}{{ c.name }}" class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#combsAccordion" href="#collapse{{ forloop.counter }}" style="color:#5A738E;">{{ d.name }}{% if d and c %} - {% endif %}{{ c.name }}</a>
</h4>
</div>
<div id="collapse{{ forloop.counter }}" class="panel-collapse collapse {% if forloop.counter == 1 %}in{% endif %}">
<div class="panel-body">

<strong style="padding-right:80px"><button id="QuickViewDrugEventShinyBtn{{ forloop.counter }}" data-target="#shinyModal" class="btn btn-secondary" data-toggle="modal" data-drug="{{d}}" data-con="{{c}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Γρήγορη Επισκόπηση" %}</span></strong>
<strong style="padding-right:80px"><button id="QuickViewDrugEventShinyBtn{{ forloop.counter }}" data-target="#shinyModal" class="btn btn-secondary" data-toggle="modal" data-drug="{{d.code}}" data-con="{{c.code}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Γρήγορη Επισκόπηση" %}</span></strong>

{% if d and c %}
{% if d and c %}

<strong style="padding-right:80px"><button id="DynPRRShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-toggle="modal" data-target="#shinyModal" data-drug="{{d}}" data-con="{{c}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Δυναμικό PRR" %}</span></strong>
<strong style="padding-right:80px"><button id="DynPRRShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-toggle="modal" data-target="#shinyModal" data-drug="{{d.code}}" data-con="{{c.code}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Δυναμικό PRR" %}</span></strong>

<strong style="padding-right:80px"><button id="ChangePointShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-toggle="modal" data-target="#shinyModal" data-drug="{{d}}" data-con="{{c}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Ανάλυση Αλλαγής Σημείου" %}</span></strong>
<strong style="padding-right:80px"><button id="ChangePointShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-toggle="modal" data-target="#shinyModal" data-drug="{{d.code}}" data-con="{{c.code}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Ανάλυση Αλλαγής Σημείου" %}</span></strong>

{% elif d %}
{% elif d %}

<strong style="padding-right:80px"><button id="DashShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-target="#shinyModal" data-toggle="modal" data-drug="{{d}}" data-con="{{c}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Πίνακας Ελέγχου" %}</span></strong>
<strong style="padding-right:80px"><button id="DashShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-target="#shinyModal" data-toggle="modal" data-drug="{{d.code}}" data-con="{{c.code}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Πίνακας Ελέγχου" %}</span></strong>

<strong style="padding-right:80px"><button id="RR_DShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-target="#shinyModal" data-toggle="modal" data-drug="{{d}}" data-con="{{c}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span> {% trans "Λόγος Αναφορών" %}</span></strong>
<strong style="padding-right:80px"><button id="RR_DShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-target="#shinyModal" data-toggle="modal" data-drug="{{d.code}}" data-con="{{c.code}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span> {% trans "Λόγος Αναφορών" %}</span></strong>

<strong style="padding-right:80px"><button id="LrTestShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-target="#shinyModal" data-toggle="modal" data-drug="{{d}}" data-con="{{c}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Έλεγχος Λόγου Πιθανοφανειών" %}</span></strong>
<strong style="padding-right:80px"><button id="LrTestShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-target="#shinyModal" data-toggle="modal" data-drug="{{d.code}}" data-con="{{c.code}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Έλεγχος Λόγου Πιθανοφανειών" %}</span></strong>

{% elif c %}
<strong style="padding-right:80px"><button id="RR_EShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-target="#shinyModal" data-toggle="modal" data-drug="{{d}}" data-con="{{c}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Λόγος Αναφορών" %}</span></strong>
<strong style="padding-right:80px"><button id="LrTest_EShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-target="#shinyModal" data-toggle="modal" data-drug="{{d}}" data-con="{{c}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Έλεγχος Λόγου Πιθανοφανειών" %}</span></strong>
{%endif%}
<!-- <strong style="padding-right:80px"><button id="ReportViewShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-toggle="modal" data-target="#shinyModal" data-drug="{{d}}" data-con="{{c}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button>Report View</strong>-->
{% elif c %}
<strong style="padding-right:80px"><button id="RR_EShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-target="#shinyModal" data-toggle="modal" data-drug="{{d.code}}" data-con="{{c.code}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Λόγος Αναφορών" %}</span></strong>
<strong style="padding-right:80px"><button id="LrTest_EShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-target="#shinyModal" data-toggle="modal" data-drug="{{d.code}}" data-con="{{c.code}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button><span>{% trans "Έλεγχος Λόγου Πιθανοφανειών" %}</span></strong>
{%endif%}
<!-- <strong style="padding-right:80px"><button id="ReportViewShinyBtn{{ forloop.counter }}" class="btn btn-secondary" data-toggle="modal" data-target="#shinyModal" data-drug="{{d}}" data-con="{{c}}" data-hash="{{k}}"><i class="fas fa-search-plus"></i></button>Report View</strong>-->

{%for key1,value1 in notes_openfda1.items%}
{% if key1 == k %}
<strong style="padding-right:80px"><button class="btn btn-secondary" id="NotesBtn{{ k }}" data-toggle="modal" data-target="#shinyModal_notes" data-note="{{value1|striptags|safe}}" data-drug="{{d}}" data-con="{{c}}" data-hash="{{k}}" ><i class="fas fa-search-plus"></i></button><span>{% trans "Σημειώσεις" %}</span></strong>
{%for key1,value1 in notes_openfda1.items%}
{% if key1 == k %}
<strong style="padding-right:80px"><button class="btn btn-secondary" id="NotesBtn{{ k }}" data-toggle="modal" data-target="#shinyModal_notes" data-note="{{value1|striptags|safe}}" data-drug="{{d.code}}" data-con="{{c.code}}" data-hash="{{k}}" ><i class="fas fa-search-plus"></i></button><span>{% trans "Σημειώσεις" %}</span></strong>

{% endif %}
{%endfor%}
{% endif %}
{%endfor%}

</div>
</div>
</div>
</div>
</div>
</div>
{% endfor %}

</div>
Expand Down
Loading

0 comments on commit 78f5215

Please sign in to comment.