Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ELiuHub committed Sep 23, 2022
1 parent 0c4b59b commit 6816605
Show file tree
Hide file tree
Showing 25 changed files with 24,613 additions and 18,076 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

# High Level Architecture

The following architecture diagram illustrates the various AWS components utliized to deliver the solution. For an in-depth explanation of the frontend and backend stacks, refer to the [Architecture Deep Dive](docs/ArchitectureDeepDive.md).
The following architecture diagram illustrates the various AWS components utliized to deliver the solution. For an explanation of the stack, refer to the [Architecture Deep Dive](docs/ArchitectureDeepDive.md).

![Alt text](./docs/images/architecture-diagram.png?)
![Alt text](./docs/images/architecture-diagram.png)

# Deployment Guide

Expand Down
8 changes: 5 additions & 3 deletions docs/ArchitectureDeepDive.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Architecture

![Architecture diagram](../docs/images/architecture-diagram.png)
![Architecture diagram](images/architecture-diagram.png)

## Description

Expand All @@ -14,10 +14,12 @@

4. An API call is made to the GraphQL API by the app.

5. The GraphQL API call queries Amazon DynamoDB for the form name, version, and ID.
5. The GraphQL API call queries Amazon DynamoDB for relevant data about the form.

6. The result of the query is passed back from the API.

7. The result of the query is returned to the app.

8. The app uses the returned data to send a request to the FHIR server to retrieve the appropriate resource.
8. The app uses the returned data to send an authorized request to the FHIR server to retrieve the appropriate resources.

This flow is for retrieving the forms. Uploading the forms is identical, just in a different order. When uploading, the FHIR resource is first sent to the server before necessary data about the form is stored into the database.
18 changes: 9 additions & 9 deletions docs/DeploymentGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,28 @@ If you have multiple AWS Profiles, specify one with sufficient admin permissions

This step creates an IAM role called **amplifyconsole-basics4health-backend-role** that will be used on the next step.

The **Deploy to Amplify Console** button will take you to your AWS console to deploy the front-end solution.
The **Deploy to Amplify Console** button will take you to your AWS console to deploy the solution. Make sure you are logged into your AWS account.

<a href="https://console.aws.amazon.com/amplify/home#/deploy?repo=https://github.com/UBC-CIC/basics-for-health">
<img src="https://oneclick.amplifyapp.com/button.svg" alt="Deploy to Amplify Console">
</a>

1. On the AWS console, select your region and click `Connect to GitHub`.
![alt text](images/deployment.png)
2. Authorize AWS Amplify with your GitHub account.
![alt text](images/deployment2.PNG)
![alt text](images/deployment/deployment.PNG)
2. Authorize AWS Amplify with your GitHub account (if required).
![alt text](images/deployment/deployment2.PNG)
3. Select the **amplifyconsole-basics4health-backend-role** we made previously for the deployment role, and then press `Save and Deploy`
![alt text](images/deployment3.png)
![alt text](images/deployment/deployment3.PNG)
4. The deployment will take a few minutes. Wait until the status of **Verify** is green
![alt text](images/deployment4.png)
5. Next, on the left side menu, click on Rewrites and redirects and click the `Edit` button. Click and replace the first rule's **source address** (or add a rule if there is none) to `</^((?!\.(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$).)*$/>`. Replace the **target address** to `/index.html`, and replace the **type** to `200 (Rewrite)`. Add a second rule with the **same source and target address**, but change the **type** to `404 (Rewrite)`. Refer to [AWS's Page on Single Page Apps](https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html#redirects-for-single-page-web-apps-spa) for further information on why that was necessary.
![alt text](images/deployment/deployment4.PNG)
5. Next, on the left side menu, click on Rewrites and redirects and click the `Edit` button. Click and replace the first rule's **source address** (or add a rule if there is none) to `</^((?!\.(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$).)*$/>`. Replace the **target address** to `/index.html`, and replace the **type** to `200 (Rewrite)`. Refer to [AWS's Page on Single Page Apps](https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html#redirects-for-single-page-web-apps-spa) for further information on why that was necessary.

It should look like this once you are done:
![alt text](images/deployment5.png)
![alt text](images/deployment/deployment5.PNG)

The app is now deployed!

If you wish to further contribute to this project, install the required packages and dependencies with the following command:
If you wish to make changes and further contribute to this project, install the required packages and dependencies with the following command:

```bash
npm install
Expand Down
29 changes: 15 additions & 14 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# User Guide

**Before Continuing with this User Guide, please make sure you have deployed the frontend and backend stacks.**
**Before Continuing with this User Guide, please make sure you have deployed the stack.**

- [Deployment Guides](./DeploymentGuide.md)

Expand All @@ -18,10 +18,10 @@
Start the docker container as described [here](https://github.com/smart-on-fhir/smart-dev-sandbox).

Click on `Launch a SMART App`.
![alt text](images/user-guide.PNG)
![alt text](images/userGuide/user-guide.PNG)

Scroll down and enter the app URL in the `App Launch URL` field.
![alt text](images/user-guide2.PNG)
![alt text](images/userGuide/user-guide2.PNG)

Log in as the provided practitioner and select a patient from the list. The sign in/sign up screen for the app will then be displayed.

Expand All @@ -30,10 +30,10 @@ Log in as the provided practitioner and select a patient from the list. The sign
**This will be the only page available to regular, non-admin users.**

When a user signs in, the first page shown will be the page for filling out forms.
![alt text](images/user-guide3.PNG)
![alt text](images/userGuide/user-guide3.PNG)

There is a dropdown menu that will display all the forms that the user has uploaded or that has been assigned to them. Next to it is a spinbox that allows the user to pick the version of the form to render (if updates have been made to it). Clicking on `LOAD` after selecting a form and its version will render the form to be filled out.
![alt text](images/user-guide4.PNG)
![alt text](images/userGuide/user-guide4.PNG)

If the form has been submitted before, the answers will also be loaded with it.

Expand All @@ -42,16 +42,16 @@ If the form has been submitted before, the answers will also be loaded with it.
This page allows admin users to either upload new forms or update existing ones.

When uploading a new one, a name for the form is required; this is what will be shown in the dropdown selection menu. There is another field (optional) that allows the user to enter the name of another user to give them access to the form as well.
![alt text](images/user-guide5.png)
![alt text](images/userGuide/user-guide5.PNG)

When updating an existing one, the user must select the form they are updating from the dropdown menu.
![alt text](images/user-guide6.PNG)
![alt text](images/userGuide/user-guide6.PNG)

To actually create these forms, online tools exist for building FHIR questionnaires. The one we used can be found [here](https://lhcformbuilder.nlm.nih.gov/previous/).
![alt text](images/user-guide7.PNG)
![alt text](images/userGuide/user-guide7.PNG)

When adding questions, please use LOINC codes when possible.
![alt text](images/user-guide8.PNG)
![alt text](images/userGuide/user-guide8.PNG)

After you are finished building your form, click `Export` to download it as a file; this is what will be uploaded to the application.

Expand All @@ -60,16 +60,17 @@ If updating an existing form, click `Import` and select the one you wish to edit
## Add Admin User

This page allows the admin user to set other users as admins.
![alt text](images/user-guide9.PNG)
![alt text](images/userGuide/user-guide9.PNG)

To set up the **first** admin account, you will need to do the following steps. (Note: this assumes the user has already signed up on the app)

1. On the [AWS online console](https://console.aws.amazon.com/console/home), enter `Cognito` in the search bar.
![alt text](images/admin-setup.png)
![alt text](images/adminSetup/admin-setup.PNG)
2. Click `Manage User Pools` and select the user pool that corresponds to the project name. The following screen will then be shown.
![alt text](images/admin-setup2.png)
![alt text](images/adminSetup/admin-setup2.PNG)
3. On the left side menu, under General settings, click `Users and groups`. Select the user you wish to set as an admin.
![alt text](images/admin-setup3.png)
![alt text](images/adminSetup/admin-setup3.PNG)
4. Click the `Add to group` button and select **Admins** from the drop down menu.
![alt text](images/admin-setup4.png)
![alt text](images/adminSetup/admin-setup4.PNG)

You must sign out of the app and sign back in to see the change.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added docs/images/deployment/deployment3.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/deployment/deployment4.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/deployment/deployment5.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/deployment5.PNG
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit 6816605

Please sign in to comment.