2 Home
Aaron Louie edited this page 2021-01-04 10:40:19 -05:00

Setup

Create user and dependent participant(s)

On the STAR DRIVE frontend, you'll need to add a professional user and dependent:

  1. Create a user profile on the star-drive frontend: <frontendUrl>/#/register
  2. Log in with the user credentials: <frontendUrl>/#/login
  3. Complete your user profile as a mental health professional: <frontendUrl>/#/flow/professional_intake/<user_participant_id>
  4. Add and complete a dependent participant profile as a mental health professional: <frontendUrl>/#/flow/dependent_intake/<dependent_participant_id>

Create SkillSTAR chain:

  1. Go to this URL to view the participant chain questionnaire UI: <frontendUrl>/#/flow/skillstar/<dependent_participant_id>
  2. Add a Chain Session and click Save/Next to create an empty session.
  3. Add as many Chain Sessions of whatever type (as needed) to schedule future sessions for the participant.
  4. You can also use this UI to add step attempt data as well, but it's not optimized for the SkillSTAR use case, so it's very clunky.

Backend integration

API Endpoints

Get user profile data

Logging in:

<apiUrl>/login_password

On successful login, gets returns user object, along with a valid user token. Takes email and password as parameters in the body.

Refreshing a previous session:

<apiUrl>/session

On successful token validation, returns full user object. Takes user token as parameter in the body.

Selecting a participant:

In the user object, there will be a list of participants linked to the current user account. One of those participants will be the user themselves. Their participant relationship will begin with "self_". In the case of a mental health professional, their participant relationship will be "self_professional".

Their dependents (patients, really) will have the participant relationship of "dependent". If you have filled out the dependent_intake questionnaires for the dependent participant, there will be an identification object in the relevant participant object in the user participants array. That's where you'll find identifying metadata about the participant, including name and birthdate.

You'll need the participant ID for the following step.

Get chain questionnaire ID(s) for a given Participant

This is the backend API URL for getting the list of SkillSTAR chain questionnaire IDs for a particular participant: <apiUrl>/flow/skillstar/<participant_id>

(Coincidentally, you can use a similar URL format on the frontend to view and edit the the participant chain questionnaire data: <frontendUrl>/#/flow/skillstar/<participant_id>)

Saving SkillSTAR chain data to the database

Add a completely new chain for a given participant

This is the backend URL for POSTing the data for the entire chain at once: <apiUrl>/flow/skillstar/chain_questionnaire

In the body of the POST request, make sure participant_id field is populated.

Update chain data for an existing chain:

You'll need to get the questionnaire ID from the steps above. Then do a PUT request to the backend to edit the existing questionnaire record in the database. This is the backend URL for that endpoint: <apiUrl>/q/chain_questionnaire/<questionnaire_id>

Get the list of steps in the SkillSTAR chain: <apiUrl>/chain_steps