InteractionEcologies / scilla-mobile

SCI self-experimentation mobile app
0 stars 0 forks source link

Add screens to report user-generated measurement. #1

Closed sprite728 closed 6 years ago

sprite728 commented 6 years ago

Background

Scilla is a mobile app that helps patients find out the right dosage of Baclofen for them. Baclofen is a medicine that can reduce spasticity but may cause tiredness and depression. Scilla allows users to self-report symptoms such as their mood, severity of spasticity, etc. Later on this information will be summarized to help patients find out the right dosage for them.

Expected behaviors

A user can tap on a Report tab at the bottom tab navigator, this will bring them to a screen with a few buttons -- Spasticity, Mood, Daily Evaluation. These buttons are dynamically generated based on the measurementType the user wants to track overtime. This is setup when the user creates a Regimen, that is, a prescribed course of medical treatment. There will always be a Daily Evaluation button at the end. Reporting using Daily Evaluation is outside this task.

Once the user presses on a button, e.g., Spasticity, the app will bring them to a screen to report their severity of spasticity with a few options: Very severe pain, severe pain, moderate pain, mild pain, least pain. (Note that the options may change as we revise our UI design.) Pressing the Mood button will bring them to a similar screen with a set of options to report their mood. After they choose an option, they can click Done, and the system will create a MeasurementObject and store it to the cloud. (You just need to create the object for now, skip the upload to cloud part). The user will then be brought back to the initial report page with a set of reporting options.

An example can be seen below. Note that we want to combine the first two screens into just one. image

Task

In this task, you will need to:

  1. Setup dev environment and understand some frameworks:

    • Setup VSCode, Expo, flow, github
    • Understand static typing using flow.
    • Understand run-time debugging in VSCode and with Expo+Chrome Dev Tool.
    • Understand react-navigation
  2. Create a screen under screens/report/ named ReportSelectionScreen.js, add it to navigation/MainTabNavigator.

  3. Create another screen screens/report/ReportMeasurementScreen.js that will dynamically show the measurement options, the associated scale and create an MeasurementObject.

    • This screen will take in a prop props.trackedMeasurementTypes, and use this to generate the required view components.
    • This screen will dynamically swap different view components based on the option selection.
  4. Develop tests for it under screens/report/__tests__ using Jest. The test case should cover selection of different options and check if the view is created correctly as well as the measurement object.

  5. After you've validated everything works correctly, created a PR and assigned to jeffhuang for review. Add label: Need: Review, Done: Validation.

Notes

sprite728 commented 6 years ago

https://github.com/InteractionEcologies/scilla-mobile/pull/5 #