Skip to content

Commit

Permalink
Merge 2ff0d24 into 536165a
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmiller committed Feb 8, 2023
2 parents 536165a + 2ff0d24 commit c6a5ffd
Show file tree
Hide file tree
Showing 14 changed files with 327 additions and 81 deletions.
12 changes: 12 additions & 0 deletions elcid/assets/css/elcid.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion elcid/assets/css/elcid.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions elcid/assets/css/elcid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -670,3 +670,16 @@ div.add-isolate:hover{
max-width: 150px;
}
}


.scrollable-table-container {
overflow-y: scroll;
height: 75%;
position: fixed;
width: 100%;
}

.border-bottom-secondary,
.table-bordered th.border-bottom-secondary{
border-bottom: $secondary 2px solid;
}
5 changes: 5 additions & 0 deletions elcid/assets/js/elcid/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ app.config(
param_template_route(
'/templates/admissions/slice_contacts/', 'slice_id'
))
.when('/admissions/encounter/:encounter_id/contacts/',
param_template_route(
'/templates/admissions/encounter/contacts/', 'encounter_id'
))

.when('/admissions/location-history/:location_code',
param_template_route(
'/templates/admissions/location-history/', 'location_code'
Expand Down
9 changes: 9 additions & 0 deletions plugins/admissions/templates/admissions/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="left-menu">
<h3>
Admissions
</h3>
</div>

<div class="content-offset right-viewport">
{% block content %}{% endblock %}
</div>
130 changes: 130 additions & 0 deletions plugins/admissions/templates/admissions/encounter_contacts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<!-- This template used to display contacts history for an entire encounter -->

{% extends 'admissions/base.html' %}

{% load forms %}


{% block content %}
<div class="panel panel-default ">
<div class="panel-heading">

<div class="row">
<div class="col-md-9">
<h1>
<i class="fa fa-hospital-o"></i>
<a href="/#/admissions/location-history/{{ source.spell_number }}/" class="orange-link">Admission</a>
contacts
</h1>
<p>
<a href="/#/patient/{{ index_demographics.patient_id }}/location_history" class="orange-link">
{{ index_demographics.name }}
</a>
{{ index_demographics.sex }}
{{ index_demographics.date_of_birth }}

Encounter ID: {{ encounter_id }}
</p>

{% if encounter %} <!-- We don't always have this loaded - data is slightly flakey -->
<p class="content-offset-10">{{ encounter.speciality_name }} {{ encounter.consultant_name }}</p>
{% endif %}
<p class="text-muted">
This page shows all patients who were on the same ward as the index patient at any stage
during the encouter.
<br />
It does not take into account proximity.
</p>
</div>
</div>
</div>
<!-- End Panel Header -->

<section class="scrollable-table-container">

{% for slice in slices %}
<h4 style="padding-left: 12px; padding-bottom: 24px; padding-top: 12px;" class="border-bottom-secondary">
<span clas="col-sm-1">
{{ slice.unit }}
{{ slice.ward }}
</span>

{{ slice.room }}
{{ slice.bed }}
{{ slice.transfer_start_datetime }} -

{% if slice.transfer_end_datetime > now %}
<span class="text-warning">
{{ slice.transfer_end_datetime }}
</span>
{% else %}
{{ slice.transfer_end_datetime }}
({{ slice.transfer_start_datetime|timesince:slice.transfer_end_datetime }})
{% endif %}
<small>
{{slice.spell_number }}
| Potential Contacts: {{ slice.contact_transfers|length }}
<a href="/#/admissions/slice-contacts/{{ slice.encounter_slice_id }}/" class="orange-link">
Slice detail
</a>
</small>
<div class="btn-group left-offset-20 pull-right" style="margin-right: 200px">
<label class="btn btn-primary" ng-model="isTableCollapsed{{slice.abs_encounter_slice_id}}" uib-btn-radio="true">{% icon 'fa-list-alt' %}Show contacts </label>
<label class="btn btn-primary" ng-model="isTableCollapsed{{slice.abs_encounter_slice_id}}" uib-btn-radio="undefined">{% icon 'fa-align-justify' %}Hide contacts</label>
</div>
</h4>


<section uib-collapse="!isTableCollapsed{{ slice.abs_encounter_slice_id }}" >
<table class="table table-bordered table-bordered">
{% for transfer in slice.contact_transfers %}
{% ifchanged transfer.bed %}
<tr>
<th colspan="4" class="border-bottom-secondary">
<p class="content-offset-25">
{{ transfer.unit }}
{{ transfer.room }}
{{ transfer.bed }}
<a href="/#/admissions/location-history/{{ transfer.transfer_location_code }}">
Bed history
</a>
</p>
</th>
</tr>
<tr>
<th>Patient</th>
<th>Start</th>
<th>End</th>
<th>Transfer Reason</th>
</tr>
{% endifchanged %}
<tr>
<td>
<a href="/#/patient/{{ transfer.patient_id }}" class="orange-link">
{{ transfer.patient.demographics_set.all.0.name }}
</a>
</td>
<td>
{{ transfer.transfer_start_datetime }}
</td>
<td>
{% if transfer.transfer_end_datetime > now %}
<span class="text-warning">
{{ transfer.transfer_end_datetime }}
</span>
{% else %}
{{ transfer.transfer_end_datetime }}
{% endif %}
</td>
<!-- <td>{{ transfer.transfer_location_code }}</td> -->
<td>{{ transfer.transfer_reason }}</td>
</tr>
{% endfor %}
</table>
</section>

{% endfor %}
</section>

</div>
{% endblock %}
37 changes: 18 additions & 19 deletions plugins/admissions/templates/admissions/location_history.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
<div class="panel panel-default content-offset">
<!-- This template used to display occupancy history for a specific location -->
{% extends 'admissions/base.html' %}

{% block content %}
<div class="panel panel-default ">
<div class="panel-heading">

<div class="row">
<div class="col-md-9">
<h3>
<h1>
<i class="fa fa-hospital-o"></i>
Location History: {{ location }}

</h1>
<h3>
<small>
Location code: {{ location_code }}
</small>
</h3>
</div>
</div>
</div>
<!-- End Panel Header -->

<section class="scrollable-table-container">
<table class="table table-bordered table-striped">
<tr>
<th>Patient</th>
<th>Start</th>
<th>End</th>
<th>Duration</th>
<th>Location Code</th>
<th>Site Code</th>
<th>Unit</th>
<th>Room</th>
<th>Bed</th>
<th>Patient</th>
<th>Transfer Reason</th>
<th></th>
</tr>
{% for transfer in history %}
<tr>
<td>
<a href="/#/patient/{{ transfer.patient_id }}" class="orange-link">
{{ transfer.patient.demographics_set.all.0.name }}
</a>
</td>
<td>
{{ transfer.transfer_start_datetime }}
</td>
Expand All @@ -51,12 +50,10 @@ <h3>
{% if transfer.transfer_end_datetime < now %}
{{ transfer.transfer_start_datetime |timesince:transfer.transfer_end_datetime}} </td>
{% endif %}
<td>{{ transfer.transfer_location_code }}</td>
<td>{{ transfer.site_code}}</td>
<td>{{ transfer.unit }}</td>
<td>{{ transfer.room }}</td>
<td>
{{ transfer.bed }}
<a href="/#/patient/{{ transfer.patient_id }}" class="orange-link">
{{ transfer.patient.demographics_set.all.0.name }}
</a>
</td>
<td>{{ transfer.transfer_reason }}</td>
<td>
Expand All @@ -69,5 +66,7 @@ <h3>
</tr>
{% endfor %}
</table>
</section>

</div>
{% endblock %}
61 changes: 41 additions & 20 deletions plugins/admissions/templates/admissions/slice_contacts.html
Original file line number Diff line number Diff line change
@@ -1,42 +1,65 @@
<div class="panel panel-default content-offset">
<!-- This template used to display contacts for a specific transfer history slice -->
<!-- That's not so useful clinically, but is how the data presents so useful conceptually-->
{% extends 'admissions/base.html' %}

{% block content %}
<div class="panel panel-default ">
<div class="panel-heading">

<div class="row">
<div class="col-md-9">
<h3>
<h1>
<i class="fa fa-hospital-o"></i>
{{ num_contacts }}
<a href="/#/admissions/location-history/{{ source.spell_number }}/" class="orange-link">Admission</a>
Slice Contacts
<a href="/#/patient/{{ index_demographics.patient_id }}/admissions" class="orange-link">
slice contacts
{{ source.unit }} {{ source.room }} {{ source.bed }}
</h1>
<h2>
<a href="/#/patient/{{ index_demographics.patient_id }}/location_history" class="orange-link">
{{ index_demographics.name }}
</a>
</h3>
<p class="content-offset-10">
{{ source.unit }} {{ source.room }} {{ source.bed }}
{{ index_demographics.sex }}
{{ index_demographics.date_of_birth }}
</h2>
<h3 class="content-offset-10">
{{ source.transfer_start_datetime }} - {{ source.transfer_end_datetime }}
({{ source.transfer_start_datetime|timesince:source.transfer_end_datetime }})
</p>
{% if encounter %}
</h3>
{% if encounter %} <!-- We don't always have this loaded - data is slightly flakey -->
<p class="content-offset-10">{{ encounter.speciality_name }} {{ encounter.consultant_name }}</p>
{% endif %}
<p class="text-muted">
This page shows all patients who were on the same ward as the index patient while they were
in this specific bed.
<br />
It does not take into account proximity, or the index patient
moving on the ward during one stay.
</p>
</div>
</div>
</div>
<!-- End Panel Header -->

<table class="table table-bordered table-striped">
<section class="scrollable-table-container">
<table class="table table-bordered table-bordered">
{% for transfer in transfers %}
{% ifchanged transfer.bed %}
<tr>
<th colspan="4" class="border-bottom-secondary">
<p class="content-offset-25">
{{ transfer.room }}
{{ transfer.bed }}
<a href="/#/admissions/location-history/{{ transfer.transfer_location_code }}">
Bed history
</a>
</p>
</th>
</tr>
<tr>
<th>Patient</th>
<th>Start</th>
<th>End</th>
<th>Location Code</th>
<th>Site Code</th>
<th>Unit</th>
<th>Room</th>
<th>Bed</th>
<th>Transfer Reason</th>
</tr>
{% endifchanged %}
Expand All @@ -58,14 +81,12 @@ <h3>
{{ transfer.transfer_end_datetime }}
{% endif %}
</td>
<td>{{ transfer.transfer_location_code }}</td>
<td>{{ transfer.site_code}}</td>
<td>{{ transfer.unit }}</td>
<td>{{ transfer.room }}</td>
<td>{{ transfer.bed }}</td>
<!-- <td>{{ transfer.transfer_location_code }}</td> -->
<td>{{ transfer.transfer_reason }}</td>
</tr>
{% endfor %}
</table>
</section>

</div>
{% endblock %}
Loading

0 comments on commit c6a5ffd

Please sign in to comment.