Skip to content

Commit 6e19364

Browse files
authored
Merge pull request #152 from cmu-delphi/pre-development
Pre development
2 parents 07f329d + d961097 commit 6e19364

File tree

3 files changed

+100
-37
lines changed

3 files changed

+100
-37
lines changed

src/signals/models.py

+7
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,13 @@ def has_all_demographic_scopes(self) -> bool:
571571
"""
572572
return self.demographic_scope.count() == DemographicScope.objects.count()
573573

574+
@property
575+
def same_base_signals(self):
576+
"""
577+
Returns the signals that have the same base signal.
578+
"""
579+
return self.base.base_for.all() if self.base else None
580+
574581
class Meta:
575582
unique_together = ['name', 'source']
576583
ordering: list[str] = ["modified"]

src/templates/signals/signal_detail.html

+89-33
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ <h5>About this signal</h5>
8383
</td>
8484
</tr>
8585
<tr>
86-
<th scope="row">Geography</th>
86+
<th scope="row">Geographic Granularity, aka Geo-Level</th>
8787
<td>
8888
<ul class="no-padding">
89-
{% for geography in signal.available_geography.all %}
89+
{% for geography in signal.geography_signals.all %}
9090
<a href="{% url 'signals' %}?available_geography={{ geography.id }}">
9191
<span class="badge rounded-pill bg-dark">
92-
{{ geography }}
92+
{{ geography.display_name }}
9393
</span>
9494
</a>
9595
{% endfor %}
@@ -181,15 +181,15 @@ <h5>About this signal</h5>
181181
</td>
182182
</tr>
183183
<tr>
184-
<th scope="row">Available Since</th>
184+
<th scope="row">Temporal Scope Start</th>
185185
<td>
186-
{{ signal.from_date }}
186+
{{ signal.temporal_scope_start }}
187187
</td>
188188
</tr>
189189
<tr>
190-
<th scope="row">Available Until</th>
190+
<th scope="row">Temporal Scope End</th>
191191
<td>
192-
{{ signal.to_date }}
192+
{{ signal.temporal_scope_end }}
193193
</td>
194194
</tr>
195195
<tr>
@@ -218,40 +218,96 @@ <h5>Signals with same base</h5>
218218
<th scope="col">Active</th>
219219
<th scope="col">Data Source</th>
220220
<th scope="col">Description</th>
221-
<th scope="col">Pathogen/Disease Area</th>
222-
<th scope="col">Base Signal</th>
223-
<th scope="col">Last Updated</th>
221+
<th scope="col">Geographic Scope</th>
222+
<th scope="col">Geographic Granularity, aka Geo-Level</th>
223+
<th scope="col">Available Since</th>
224+
<th scope="col">Available Until</th>
225+
<th scope="col">Temporal Granularity</th>
226+
<th scope="col">Reporting Cadence</th>
227+
<th scope="col">Reporting Lag(nominal)</th>
228+
<th scope="col">Revision Cadence</th>
229+
<th scope="col">Demographic Scope</th>
230+
<!--<th scope="col">Demographic Disaggregation</th> -->
231+
<th scope="col">Pathogen / Syndrome</th>
232+
<th scope="col">Severity Pyramid Rungs</th>
233+
<th scope="col">Missingness</th>
234+
<th scope="col">License / Data Use Restrictions</th>
224235
</tr>
225236
</thead>
226237
<tbody>
227238
{% for signal in signal.same_base_signals %}
228-
<tr classs="clickable-table-row">
229-
<td onClick="location.href='{% url 'signal' pk=signal.id %}';" class="clickable-table-cell">{{ signal.display_name }}</td>
230-
{% if signal.active == True %}
231-
<td><i class="bi bi-circle-fill" style="color:green;" ></i></td>
232-
{% else %}
233-
<td><i class="bi bi-circle-fill" style="color:red;" ></i></td>
234-
{% endif %}
235-
<td>{{ signal.source.data_source }}</td>
236-
<td>{{ signal.description }}</td>
237-
<td>
238-
{% for pathogen in signal.pathogen.all %}
239-
<span class="badge rounded-pill bg-dark">{{ pathogen|title }}</span>
240-
{% endfor %}
239+
<tr>
240+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
241+
{{ signal.display_name }}
241242
</td>
242-
<td>
243-
{% if signal.base %}
244-
<a href="{% url 'signal' pk=signal.base.id %}">{{ signal.display_name }}</a>
243+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
244+
{% if signal.active == True%}
245+
<i class="bi bi-circle-fill" style="color:green;"></i>
245246
{% else %}
246-
--/--
247+
<i class="bi bi-circle-fill" style="color:red;"></i>
247248
{% endif %}
248249
</td>
249-
<td>
250-
{% if signal.last_updated %}
251-
{{ signal.last_updated|date:"Y-m-d" }}
252-
{% else %}
253-
--/--
254-
{% endif %}
250+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
251+
{{ signal.source.external_name }}
252+
</td>
253+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
254+
{{ signal.description }}
255+
</td>
256+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
257+
{{ signal.geographic_scope.name }}
258+
</td>
259+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
260+
{% for geography in signal.geography_signals.all %}
261+
<span class="badge rounded-pill bg-dark">
262+
{{ geography.display_name }}
263+
</span>
264+
{% endfor %}
265+
</td>
266+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
267+
{{ signal.temporal_scope_start }}
268+
</td>
269+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
270+
{{ signal.temporal_scope_end }}
271+
</td>
272+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
273+
{{ signal.time_type }}
274+
</td>
275+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
276+
{{ signal.reporting_cadence }}
277+
</td>
278+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
279+
{{ signal.typical_reporting_lag }}
280+
</td>
281+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
282+
{{ signal.typical_revision_cadence }}
283+
</td>
284+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
285+
{% for demographic_scope in signal.demographic_scope.all %}
286+
<span>
287+
{{ demographic_scope }}
288+
</span>
289+
{% endfor %}
290+
</td>
291+
<!-- <td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
292+
Place for Demographic Disaggregation
293+
</td> -->
294+
<td cla ss="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
295+
{% for pathogen in signal.pathogen.all %}
296+
<span class="badge rounded-pill bg-dark">
297+
{{ pathogen|title }}
298+
</span>
299+
{% endfor %}
300+
</td>
301+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
302+
{{ signal.severenity_pyramid_rungs }}
303+
</td>
304+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
305+
{{ signal.missingness }}
306+
</td>
307+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
308+
{{ signal.license }}
309+
<br>
310+
{{ signal.restrictions }}
255311
</td>
256312
</tr>
257313
{% endfor %}

src/templates/signals/signals.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2 class="accordion-header" id="pathogen-heading">
3333
Pathogen / Syndrome
3434
<a tabindex="0" role="button" class="info-button" data-bs-toggle="popover"
3535
data-bs-title="Pathogen / Syndrome"
36-
data-bs-content="{{ filter_descriptions.SignalFilter.pathogen }}">
36+
data-bs-content="{{ filters_descriptions.SignalFilter.pathogen }}">
3737
<i class="bi bi-info-circle"></i>
3838
</a>
3939
</label>
@@ -90,7 +90,7 @@ <h2 class="accordion-header" id="active-heading">
9090
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#available_geography-collapse" aria-expanded="false" aria-controls="active-collapse">
9191
<label for="id_available_geography" class="form-label">
9292
Geo-level
93-
<a tabindex="0" role="button" class="info-button" data-bs-toggle="popover" data-bs-title="Available Geography" data-bs-content="{{ filters_descriptions.SignalFilter.available_geography }}"><i class="bi bi-info-circle"></i></a>
93+
<a tabindex="0" role="button" class="info-button" data-bs-toggle="popover" data-bs-title="Geo-level" data-bs-content="{{ filters_descriptions.SignalFilter.available_geography }}"><i class="bi bi-info-circle"></i></a>
9494
</label>
9595
</button>
9696
</h2>
@@ -117,7 +117,7 @@ <h2 class="accordion-header" id="severenity_pyramid_rungs-heading">
117117
Severity Pyramid
118118
<a tabindex="0" role="button" class="info-button" data-bs-toggle="popover"
119119
data-bs-title="Severity Pyramid"
120-
data-bs-content="{{ filters_descriptions.SignalFilter.severity_pyramid }}">
120+
data-bs-content="{{ filters_descriptions.SignalFilter.severenity_pyramid_rungs }}">
121121
<i class="bi bi-info-circle"></i>
122122
</a>
123123
</label>
@@ -144,7 +144,7 @@ <h2 class="accordion-header" id="source-heading">
144144
<label for="id_source" class="form-label">
145145
Data Source
146146
<a tabindex="0" role="button" class="info-button" data-bs-toggle="popover"
147-
data-bs-title="Source"
147+
data-bs-title="Data Source"
148148
data-bs-content="{{ filters_descriptions.SignalFilter.source }}">
149149
<i class="bi bi-info-circle"></i>
150150
</a>

0 commit comments

Comments
 (0)