Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

# AMPL

## Prerequisites

To build the app & run it locally requires NodeJS (built against v8.*) & the Angular CLI. Once NodeJS[<https://nodejs.org/en/>] is installed, install the angular client by performing a `npm install -g @angular/cli` . This will give you access to the angular client's 'ng' binary (running 'ng' from a terminal should return a long help dialog).

## Initial app setup

Install the app's dependencies via `npm install`

## Development server

To run the GUI application standalone with mocked data:

Run `ng serve` for a dev server. After the app builds, navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

Run `ng serve -ssl` for a dev server served over SSL. Navigate to `https://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Development with local api server

To run the GUI application integrated with backend services running locally:

Service URL endpoints are specified in the /environments/environment.noproxy.ts . Adjust if necessary for your local environment.

Run `ng serve -c noproxy` for a dev server. After the app builds, navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

Run `ng serve -c noproxy -ssl` for a dev server served over SSL. Navigate to `https://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Running the build in a docker container

To run the application w/mock data in a simple apache docker (httpd:alpine) container using mock data, from the webapp folder:

1. Build the application using `ng build`
2. Generate the container using `docker build -t ampl-apache2 .`
3. Run the container (w/the webapp on port 8080, change as needed) using `docker run -dit --name ampl-apache -p 8080:80 ampl-apache2`

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Building the application

Run `ng build -c {environment}` to build the project. The variable {environment} tells angular-cli which `/src/environments/environment.{environment}.ts` file to use when packaging the app. For DEV/SQA, use the 'int' build.
For production, use the 'prod' build. The build artifacts will be stored in the `/dist` directory, the contents of which can be deployed to any web server (apache, nginx, etc).

## Running unit tests

Run `npm run test-interactive` to execute the unit tests via [Karma](https://karma-runner.github.io) in a browser in interactive mode. This mode will let you make changes to the code & automatically rerun the tests after saving. Use `npm run test` to execute the unit tests w/no browser a single time on the commandline.

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Generating project documentation

Run `npm run gendoc` to generate code documentation. Output is is stored in the /webapp/documentation folder, with the root document called index.html

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

## General Project structure

Application is built on redux design pattern w/state information separated into session & patient categories. Patient data is retrieved via HttpClient from backend data source and pushed into the store. Display/GUI elements observe the store & update content accordingly. All UI elements that modify application state update the redux store, while all elements displaying state information observe the store.

### Example process for adding/updating data call

To add a data call for patient data, the following items should be completed:

1. Create/edit data model(s) in /src/app/models based on API contract
2. Add endpoint information to /environment configurations
3. Add store action and reducer functionality in /src/app/actions & /src/app/reducers/
4. Update HttpClient service (EhrService, SessionService, etc) to include data call information
5. Run the application & monitor store to ensure data is being retrieve & stored correctly
6. Integrate data from store with UI components.