|
24 | 24 |
|
25 | 25 | {% if image_count > 0 %} |
26 | 26 | <div class="app-mammogram-cards"> |
27 | | - <div class="app-mammogram-card"> |
28 | | - {% set right_views_html %} |
29 | | - <div class="app-mammogram-views"> |
30 | | - {% with images=images["RCC"], laterality="RCC", side="right" %} |
31 | | - {% include "mammograms/_image_set.jinja" %} |
32 | | - {% endwith %} |
33 | | - {% with images=images["RMLO"], laterality="RMLO", side="right" %} |
34 | | - {% include "mammograms/_image_set.jinja" %} |
35 | | - {% endwith %} |
36 | | - {% if images["RCCID"] | length > 0 %} |
37 | | - {% with images=images["RCCID"], laterality="RCCID", side="right" %} |
38 | | - {% include "mammograms/_image_set.jinja" %} |
39 | | - {% endwith %} |
| 27 | + {% for side in ["Right", "Left"] %} |
| 28 | + <div class="app-mammogram-card"> |
| 29 | + {% set rh_keys = [] %} |
| 30 | + {% for k in images %} |
| 31 | + {% if k[0] == side[0] %} |
| 32 | + {% set _ = rh_keys.append(k) %} |
40 | 33 | {% endif %} |
41 | | - {% if images["RMLOID"] | length > 0 %} |
42 | | - {% with images=images["RMLOID"], laterality="RMLOID", side="right" %} |
43 | | - {% include "mammograms/_image_set.jinja" %} |
44 | | - {% endwith %} |
45 | | - {% endif %} |
46 | | - </div> |
47 | | - {% endset %} |
48 | | - {{ card({ |
49 | | - "heading": "Right breast", |
50 | | - "headingLevel": "2", |
51 | | - "feature": true, |
52 | | - "descriptionHtml": right_views_html |
53 | | - }) }} |
54 | | - </div> |
55 | | - |
56 | | - <div class="app-mammogram-card"> |
57 | | - {% set left_views_html %} |
58 | | - <div class="app-mammogram-views"> |
59 | | - {% with images=images["LCC"], laterality="LCC", side="left" %} |
60 | | - {% include "mammograms/_image_set.jinja" %} |
61 | | - {% endwith %} |
62 | | - {% with images=images["LMLO"], laterality="LMLO", side="left" %} |
63 | | - {% include "mammograms/_image_set.jinja" %} |
64 | | - {% endwith %} |
65 | | - {% if images["LCCID"] | length > 0 %} |
66 | | - {% with images=images["LCCID"], laterality="LCCID", side="left" %} |
67 | | - {% include "mammograms/_image_set.jinja" %} |
68 | | - {% endwith %} |
69 | | - {% endif %} |
70 | | - {% if images["LMLOID"] | length > 0 %} |
71 | | - {% with images=images["LMLOID"], laterality="LMLOID", side="left" %} |
72 | | - {% include "mammograms/_image_set.jinja" %} |
73 | | - {% endwith %} |
74 | | - {% endif %} |
75 | | - </div> |
76 | | - {% endset %} |
77 | | - {{ card({ |
78 | | - "heading": "Left breast", |
79 | | - "headingLevel": "2", |
80 | | - "feature": true, |
81 | | - "descriptionHtml": left_views_html |
82 | | - }) }} |
83 | | - </div> |
| 34 | + {% endfor %} |
| 35 | + {% set side_html %} |
| 36 | + <div class="app-mammogram-views"> |
| 37 | + {% for laterality in rh_keys %} |
| 38 | + {% with images=images[laterality], side=side.lower() %} |
| 39 | + {% if not laterality.endswith("ID") %} |
| 40 | + {% include "mammograms/_image_set.jinja" %} |
| 41 | + {% elif images | length > 0 %} |
| 42 | + {% include "mammograms/_image_set.jinja" %} |
| 43 | + {% endif %} |
| 44 | + {% endwith %} |
| 45 | + {% endfor %} |
| 46 | + </div> |
| 47 | + {% endset %} |
| 48 | + {{ card({ |
| 49 | + "heading": side ~ " breast", |
| 50 | + "headingLevel": "2", |
| 51 | + "feature": true, |
| 52 | + "descriptionHtml": side_html |
| 53 | + }) }} |
| 54 | + </div> |
| 55 | + {% endfor %} |
84 | 56 | </div> |
85 | 57 | {% endif %} |
86 | 58 |
|
|
0 commit comments