Skip to content

Upgrade Monitoring Setup Page, Add Question Management #37hg3wd

This issue is the continuation of these issues:

Take a look at #240 for the broader context.

!! Please take a look at SymptomCheckEditComponent

Many of the methods of that component can be copy/pasted or taken as a starting point.

What is to be done?

  • Add functionality to the orange buttons in the white boxes: add Questions to their respective lists (upgrade from #251 (closed))
  • Add content to the RccCardComponents: display question previews
  • Add functionality to the edit button on the RccCardComponents: edit the respective question
  • Add functionality to the remove button on the RccCardComponents: remove the respective question from their list
  • Make sure that questions added by template selection (#248) end up in the 'symptoms' list

Adding questions

Make use RccMonitoringSetupService to track the current editing state, so that if the user navigates away for some reason, she can pick up the editing where she left it.

Each of the six categories should get their own list of questions. Each question has a schedule associated with it. Setting a schedule to 'null' indicates that the default schedule should be used (see #249 (closed)). All questions start out with null as schedule.

Questions that are added by the template selection (see #248) should all go into the first list 'Symptome'.

There is no layout for the question selection part. Use the old Modal for now: ItemSelectService.select(...) as used in SymptomCheckEditComponent.selectQuestions

Editing questions

There is no layout for the question edit part yet. Use the old Modal for now: QuestionEditService.editCopy(...) as used in SymptomCheckEditComponent.customizeQuestion(...)

Question edits should be trigger with (editClick) output on the RccCardComponents

Removing Questions

Question removals should be trigger by the (removeClick) output on the RccCardComponent

Schedules

Disregard schedules for the time being.

(Schedules can be turned into localized strings with the translatePipe: schedule|translate.)

Question previews

Check out QuestionEditComponent for the preview of a question. Use RccQueryView. You will have to construct a temporary QueryControl for each question in order to display a preview. <rcc-widget> then goes into the respective RccCardComponent:

<rcc-widget
  [widgetControl] = "queryControl"
  class = "rcc-e2e-answers"
></rcc-widget>

Updating the SymptomCheck

When questions are customized, added or removed we have to update the RccMonitoringSetupService.symptomCheck, because that is the Object being send with the send button. Alternatively we update that SymptomCheck only right before we share it ().

At the moment symptomchecks to not have multiple lists of questions. So when transferring the data the information of which category they were put in gets lost: Just add everything to .questions of the symptomcheck. Taking care of the categories will be the subject of a later issue.

Take a look at SymptomCheckEditComponent.getResult() That method collects all the data from the editing process to compile it into a SymptomCheckConfig. Creating a new SymptomCheck(config) is the quickest way of checking if the config is valid; it it is not, new SymptomCheck(config) will throw an error, telling you what's missing or wrong.

Requirements

  • Questions can be added to all lists
  • Every question has a preview rendered in a RccCardComponent
  • Every question can be removed
  • Every question can be customized
  • Questions from temeplate selection (#248) end up in the 'symptoms' question list. (Moved to #274)
  • Clicking the send button creates a QR code that transfers a SymptomCheck to the PAT with all the questions (without regard for the list they were put in)

Where to start

  • RccMonitoringSetupPageComponent
  • SymptomCheckEditComponent (90% is already implemented here)
  • QuestionEditComponent

Layouts

Here's what the the final screens should look like; This issue is only concerned with the boxes with the orange buttons in the middle and the cards next to them containing question previews.

figma

This PDF with Annotations shows how questions in the questions list are supposed to look like.

Edited by James Jenkinson