|
31 | 31 |
|
32 | 32 | @pytest.mark.django_db |
33 | 33 | class TestRecordMedicalInformationPresenter: |
34 | | - def test_formats_symptoms_summary_list(self): |
| 34 | + def test_symptom_rows(self): |
35 | 35 | appointment = AppointmentFactory.create() |
36 | 36 |
|
37 | 37 | symptom1 = SymptomFactory.create( |
@@ -143,6 +143,144 @@ def test_formats_symptoms_summary_list(self): |
143 | 143 | }, |
144 | 144 | ] |
145 | 145 |
|
| 146 | + def test_read_only_symptom_rows(self): |
| 147 | + appointment = AppointmentFactory.create() |
| 148 | + |
| 149 | + SymptomFactory.create( |
| 150 | + lump=True, |
| 151 | + appointment=appointment, |
| 152 | + when_started=RelativeDateChoices.NOT_SURE, |
| 153 | + area=SymptomAreas.LEFT_BREAST, |
| 154 | + intermittent=True, |
| 155 | + when_resolved="resolved date", |
| 156 | + additional_information="abc", |
| 157 | + ) |
| 158 | + |
| 159 | + SymptomFactory.create( |
| 160 | + swelling_or_shape_change=True, |
| 161 | + appointment=appointment, |
| 162 | + when_started=RelativeDateChoices.LESS_THAN_THREE_MONTHS, |
| 163 | + area=SymptomAreas.BOTH_BREASTS, |
| 164 | + ) |
| 165 | + |
| 166 | + SymptomFactory.create( |
| 167 | + other=True, |
| 168 | + appointment=appointment, |
| 169 | + when_started=RelativeDateChoices.LESS_THAN_THREE_MONTHS, |
| 170 | + area=SymptomAreas.RIGHT_BREAST, |
| 171 | + symptom_sub_type_details="abc", |
| 172 | + ) |
| 173 | + |
| 174 | + SymptomFactory.create( |
| 175 | + other=True, |
| 176 | + appointment=appointment, |
| 177 | + when_started=RelativeDateChoices.LESS_THAN_THREE_MONTHS, |
| 178 | + area=SymptomAreas.LEFT_BREAST, |
| 179 | + highlight_to_readers=False, |
| 180 | + symptom_sub_type_details="xyz", |
| 181 | + ) |
| 182 | + |
| 183 | + presenter = MedicalInformationPresenter(appointment) |
| 184 | + |
| 185 | + assert presenter.read_only_symptom_rows == [ |
| 186 | + { |
| 187 | + "key": { |
| 188 | + "html": 'Lump<br><strong class="nhsuk-tag app-nowrap nhsuk-tag--yellow">Highlight to image readers</strong>', |
| 189 | + }, |
| 190 | + "value": { |
| 191 | + "html": "Left breast<br>Not sure<br>Symptom is intermittent<br>Stopped: resolved date<br>Not investigated<br>Additional information: abc", |
| 192 | + }, |
| 193 | + }, |
| 194 | + { |
| 195 | + "key": { |
| 196 | + "html": 'Other<br><strong class="nhsuk-tag app-nowrap nhsuk-tag--yellow">Highlight to image readers</strong>' |
| 197 | + }, |
| 198 | + "value": { |
| 199 | + "html": "Description: abc<br>Right breast<br>Less than 3 months ago<br>Not investigated" |
| 200 | + }, |
| 201 | + }, |
| 202 | + { |
| 203 | + "key": {"text": "Other"}, |
| 204 | + "value": { |
| 205 | + "html": "Description: xyz<br>Left breast<br>Less than 3 months ago<br>Not investigated" |
| 206 | + }, |
| 207 | + }, |
| 208 | + { |
| 209 | + "key": { |
| 210 | + "html": 'Swelling or shape change<br><strong class="nhsuk-tag app-nowrap nhsuk-tag--yellow">Highlight to image readers</strong>', |
| 211 | + }, |
| 212 | + "value": { |
| 213 | + "html": "Both breasts<br>Less than 3 months ago<br>Not investigated", |
| 214 | + }, |
| 215 | + }, |
| 216 | + ] |
| 217 | + |
| 218 | + def test_significant_symptom_rows(self): |
| 219 | + appointment = AppointmentFactory.create() |
| 220 | + |
| 221 | + SymptomFactory.create( |
| 222 | + lump=True, |
| 223 | + appointment=appointment, |
| 224 | + when_started=RelativeDateChoices.NOT_SURE, |
| 225 | + area=SymptomAreas.LEFT_BREAST, |
| 226 | + intermittent=True, |
| 227 | + when_resolved="resolved date", |
| 228 | + additional_information="abc", |
| 229 | + ) |
| 230 | + |
| 231 | + SymptomFactory.create( |
| 232 | + swelling_or_shape_change=True, |
| 233 | + appointment=appointment, |
| 234 | + when_started=RelativeDateChoices.LESS_THAN_THREE_MONTHS, |
| 235 | + area=SymptomAreas.BOTH_BREASTS, |
| 236 | + ) |
| 237 | + |
| 238 | + SymptomFactory.create( |
| 239 | + other=True, |
| 240 | + appointment=appointment, |
| 241 | + when_started=RelativeDateChoices.LESS_THAN_THREE_MONTHS, |
| 242 | + area=SymptomAreas.RIGHT_BREAST, |
| 243 | + symptom_sub_type_details="abc", |
| 244 | + ) |
| 245 | + |
| 246 | + SymptomFactory.create( |
| 247 | + other=True, |
| 248 | + appointment=appointment, |
| 249 | + when_started=RelativeDateChoices.LESS_THAN_THREE_MONTHS, |
| 250 | + area=SymptomAreas.LEFT_BREAST, |
| 251 | + highlight_to_readers=False, |
| 252 | + symptom_sub_type_details="xyz", |
| 253 | + ) |
| 254 | + |
| 255 | + presenter = MedicalInformationPresenter(appointment) |
| 256 | + |
| 257 | + assert presenter.significant_symptom_rows == [ |
| 258 | + { |
| 259 | + "key": { |
| 260 | + "html": 'Lump<br><strong class="nhsuk-tag app-nowrap nhsuk-tag--yellow">Highlight to image readers</strong>', |
| 261 | + }, |
| 262 | + "value": { |
| 263 | + "html": "Left breast<br>Not sure<br>Symptom is intermittent<br>Stopped: resolved date<br>Not investigated<br>Additional information: abc", |
| 264 | + }, |
| 265 | + }, |
| 266 | + { |
| 267 | + "key": { |
| 268 | + "html": 'Other<br><strong class="nhsuk-tag app-nowrap nhsuk-tag--yellow">Highlight to image readers</strong>' |
| 269 | + }, |
| 270 | + "value": { |
| 271 | + "html": "Description: abc<br>Right breast<br>Less than 3 months ago<br>Not investigated" |
| 272 | + }, |
| 273 | + }, |
| 274 | + { |
| 275 | + "key": { |
| 276 | + "html": 'Swelling or shape change<br><strong class="nhsuk-tag app-nowrap nhsuk-tag--yellow">Highlight to image readers</strong>', |
| 277 | + }, |
| 278 | + "value": { |
| 279 | + "html": "Both breasts<br>Less than 3 months ago<br>Not investigated", |
| 280 | + }, |
| 281 | + }, |
| 282 | + ] |
| 283 | + |
146 | 284 | def test_add_lump_button(self): |
147 | 285 | appointment = AppointmentFactory() |
148 | 286 |
|
|
0 commit comments