You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository is for the project created by Junior Design Team 1122. The purpose of our application is to demonstrate the capabilities of the FHIR patient record format while utilizing Microsoft's Healthcare API for FHIR.
4
4
5
5
## Project Structure
6
6
There are two main frameworks in our application:
@@ -10,15 +10,116 @@ There are two main frameworks in our application:
10
10
11
11
The project is then strucutred as following:
12
12
-[`frontend/`](frontend): Contains all the front-end code.
13
+
-[`package.json`](frontend/package.json): Contains all the dependencies and commands to run and build React app.
14
+
-[`src/`](frontend/src): Contains the code that is rendered and seen by the user.
13
15
-[`src/`](src): Contains all the backend code.
14
16
-[`pom.xml`](pom.xml): Contains general information about the project, required dependencies and configurations to build the project.
15
17
16
-
## Running the Project
18
+
## Front end
19
+
### Pre-requisites
17
20
18
-
If you already have React, Spring-Boot, and Maven installed you can run the command:
21
+
The following tools and technologies are used to build and run the project.
22
+
23
+
1. Node.js
24
+
25
+
Node.js is a Javascript runtime that allows you to run Javascript outside of your browser. For this project, please download and perform
26
+
the instalation for this technology here:
27
+
28
+
-[Installing Node.js on Windows 10](https://stackoverflow.com/questions/27344045/installing-node-js-and-npm-on-windows-10)
29
+
-[Installing Node.js on Mac](https://treehouse.github.io/installation-guides/mac/node-mac.html)
30
+
31
+
After installing, you can verify the that you have the latest version required for this project by running the following command:
32
+
33
+
```console
34
+
$ node -v
35
+
v17.0.1
36
+
```
37
+
38
+
2. NPM (Node Package Manager)
39
+
40
+
NPM helps with downloading and installing packages (dependencies) that are required to run the application, particularly the frontend. It should be immediately
41
+
installed with npm, which you can verify with the command:
42
+
43
+
```console
44
+
$ npm -v
45
+
8.1.0
46
+
```
47
+
48
+
However, if `npm` is missing, download npm from [here](https://www.npmjs.com/get-npm) (this includes all the installation guide).
49
+
50
+
3. Installing Dependencies
51
+
52
+
Once you have the required technologies installed, you can install all the required dependencies for the front-end by running the command:
53
+
54
+
```console
55
+
$ npm install
56
+
```
57
+
58
+
### Running front-end application
59
+
60
+
If you wish to run only the frontend code, you can run the command:
61
+
62
+
```console
63
+
$ npm run start
64
+
```
65
+
66
+
This should initialize the application on `https://localhost:3000`.
67
+
68
+
## Backend
69
+
### Pre-requisites
70
+
71
+
1. Java JDK
72
+
73
+
JDK (Java Development Kit) is a development environment for building application and components using Java. <br />
74
+
For this project, please download OpenJDK 11 LTS version from [here](https://adoptopenjdk.net/index.html?variant=openjdk11&jvmVariant=openj9) and perform the installation.
75
+
- Choose OpenJDK 11 (LTS) as the version
76
+
- Choose OpenJ9 as the JVM.
77
+
- Click the Latest release download button to download the package.
78
+
79
+
To verify the installation, run the following command:
80
+
81
+
```console
82
+
$ java -version
83
+
openjdk version "17" 2021-09-14
84
+
OpenJDK Runtime Environment Homebrew (build 17+0)
85
+
OpenJDK 64-Bit Server VM Homebrew (build 17+0, mixed mode, sharing)
86
+
```
87
+
88
+
2. Maven
89
+
90
+
Maven is a command-line tool for building and managing any Java-based project. Please see the installation instructions [here](https://www.baeldung.com/install-maven-on-windows-linux-mac) for different platforms.
91
+
92
+
### Installing Dependent Libraries
93
+
To install of the required dependencies:
94
+
95
+
```console
96
+
$ mvn install
97
+
```
98
+
99
+
### Running the backend
100
+
101
+
In order to run this project, you will need an Azure environment set up with the Azure Healthcare Api for FHIR available. The full tutorial to create
102
+
the environment can be found [here](https://docs.microsoft.com/en-us/azure/healthcare-apis/azure-api-for-fhir/tutorial-web-app-fhir-server).
103
+
104
+
Once you have completed the environment setup and have created a token for authentication, you can use that same token in order to access the FHIR api from the application. You can copy and paste the entire token string into the `token.txt` file.
105
+
106
+
Once you already have React, Spring-Boot, Maven installed and you have set up the token.txt file you can run the command:
19
107
20
108
```console
21
109
$ mvn spring-boot:run
22
110
```
23
111
24
112
This should initialize the application on `https://localhost:8080`.
113
+
114
+
## Troubleshooting
115
+
116
+
These are possible problems that may arise and their possible solutions:
117
+
1. Error code 403
118
+
119
+
Error code 403 stands for "Forbidden Request". This means that you don't have the permissions to make the call to the API. This is normally due to not having a valid token or not having a token at all, which can be fixed by generating a new token (can be done by clicking the Generate Token button in the authorization tab in Postman) and copying the token to the `token.txt` file.
120
+
121
+
2. Error code 5000
122
+
123
+
Error code 500 stands for "Internal Server Error". In this case, typically this is due to using an expired token, which can be fixed by generating a new token and copying it into the `token.txt` file.
0 commit comments