Pasientdata er kildekoden fra sommerstudentprosjektet 2019. Prosjektet vedlikeholdes ikke, og er ikke ment for bruk med reelle personopplysninger.
This is a project done by 5 summer interns, who will find and create a solution for finding and collecting data from devices that patients use. They will do user tests as well as develop a webapp for visualising and storing data with the FHIR standard.
** Disclaimer: we do not reccomend logging in with your own Google account if you do not want to share information about your steps, physical activity minutes and weight.
Link: http://helseinnsikt.surge.sh/
Before running the program, take a look at setup
Run using npm:
npm start
Standing in the /src/citizenapp folder, execute the following command:
npm run-script build
Then install surge:
npm i --global surge
Run surge:
surge
Then make a surge user through the terminal by following the instructions given there.
You are then asked to specify the path to the build folder of the project, and then give a name to the .surge.sh URL of the web page.
Once this is done the web page should be deployed!
Start by setting up your editors for the source/backend and the web/frontend, we recommend using Visual Studio for the backend and Visual Studio Code for the frontend. Both programs can be downloaded here:
- Visual Studio: https://visualstudio.microsoft.com/
- Visual Studio Code: https://code.visualstudio.com/
When you have completed you can clone our repo and follow the setup for backend and then frontend
The backend is now running on a server, but we also have a local version. If you want to run it locally, follow the steps below.
- Download and install the .NET core sdk 2.2 from their website: https://dotnet.microsoft.com/download
- Open a terminal in
src/fhirserver
folder, and start the FHIR server with commanddotnet run
- Check that the Spark FHIR Server is running, by opening
https:\\localhost:5001
in your browser - Now the backend is setup and you can move to the next section.
*If you want to run the server locally, you need to change the useLocalServer variable to "true" in the file called fhirUrl.js.
To install the packages and run the application you need to install nodeJS, which can be downloaded from: https://nodejs.org/en/ (Install NodeJS before continuing).
- Before installing the packages, you need to get your key from e-helse so that you can get the styling components from them, which will be installed when you use npm install.
- This key should be placed in a file called ".npmrc" and the file should be placed right under your "user" folder.
C:\Users\"username"
- If these components are not needed you need to go through the code and remove them as well as remove it from the node_modules folder on you local computer.
- When the key is placed in the right location, you can use the command below
How to install packages:
npm install
*if missing packages, install the package manually with:
npm install --save "name_of_package"
Now you can run the program as shown above
To access google data you will need to log into: concole.developers.google.com
How to set up credentials:
- Select a project -> new project
- set project name (let location be default: No organization) -> create
- Select your new project
- Click "APIs & Services" on the left
- Click "+ ENABLE APIS AND SERVICES"
- Search and select "Fitness API", then enable it
- Go back by entering "https://console.developers.google.com/apis/dashboard" in the url
- Click on "Credentials" on the left
- Click on "OAuth consent screen" from the tabs
- Fill in application name
- Click "add scope" and add the APIs needed (our case: activity.read, body.read and nutrition.read. You will need to add one at the time.)
- Click save
- Click the "Credentials" from the tabs
- Click "Create credentials", then "Oauth client ID"
- Choose "Web application"
- Give it a name
- Add "Authorized JavaScript origins" (http://localhost:3000, if you are still in development environment)
- Add "Authorized redirect URIs" (also http://localhost:3000 if you have a single page app)
- Click on "OAuth consent screen" from the tabs
- Click "APIs & Services" on the left
- Copy your clientID and paste it over the clientID in the "googleFit.js" file under the api folder.