Skip to content

Commit 4805b40

Browse files
committed
Updated README and removed stale comments.
1 parent 54fb2fe commit 4805b40

File tree

4 files changed

+106
-35
lines changed

4 files changed

+106
-35
lines changed

README.md

Lines changed: 104 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Healfhir
22

3-
Junior Design - Team 1122
3+
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.
44

55
## Project Structure
66
There are two main frameworks in our application:
@@ -10,15 +10,116 @@ There are two main frameworks in our application:
1010

1111
The project is then strucutred as following:
1212
- [`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.
1315
- [`src/`](src): Contains all the backend code.
1416
- [`pom.xml`](pom.xml): Contains general information about the project, required dependencies and configurations to build the project.
1517

16-
## Running the Project
18+
## Front end
19+
### Pre-requisites
1720

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:
19107

20108
```console
21109
$ mvn spring-boot:run
22110
```
23111

24112
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.
124+
125+

src/main/java/com/juniordesign/team1122/controllers/ApiController.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.juniordesign.team1122.controllers;
22

3-
import com.juniordesign.team1122.services.DatabaseConnection;
43
import com.juniordesign.team1122.services.FHIRServerConnection;
54
import org.json.simple.JSONObject;
65
import org.springframework.boot.web.client.RestTemplateBuilder;
@@ -15,6 +14,7 @@
1514
public class ApiController {
1615

1716
private FHIRServerConnection fhirServerConnection = new FHIRServerConnection(new RestTemplateBuilder());
17+
1818
/**
1919
* Get a list of all patients.
2020
* @return Json of all the patients.
@@ -27,7 +27,6 @@ public ResponseEntity<JSONObject> getAllPatients() {
2727
}
2828

2929
/**
30-
* TODO: Make real call once database is set up.
3130
* Add information about a patient to the database.
3231
* @return Json stating if the operation was successful.
3332
*/

src/main/java/com/juniordesign/team1122/services/DatabaseConnection.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

token.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1yNS1BVWliZkJpaTdOZDFqQmViYXhib1hXMCIsImtpZCI6Ik1yNS1BVWliZkJpaTdOZDFqQmViYXhib1hXMCJ9.eyJhdWQiOiJodHRwczovL2F6LWhlYWx0aGZoaXIuYXp1cmVoZWFsdGhjYXJlYXBpcy5jb20iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC85ZjU4MzMzYi05Y2NhLTRiZDktYTdkOC1lMTUxZTQzYjc5ZjMvIiwiaWF0IjoxNjM4Nzk5MjM4LCJuYmYiO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