<commit_before># Crucible SMART on FHIR Test App [![Build Status](https://travis-ci.org/fhir-crucible/crucible_smart_app.svg?branch=master)](https://travis-ci.org/fhir-crucible/crucible_smart_app)

This application creates test clients that exercise the range of requirements of a
[SMART on FHIR](http://smarthealthit.org/smart-on-fhir/) server. These clients have tests for the
[SMART App Launch Framework](http://www.hl7.org/fhir/smart-app-launch/), [Argonaut](http://hl7.org/fhir/DSTU2/argonaut/argonaut.html)
Implementation Guides, and [FHIR DSTU2](http://hl7.org/fhir/DSTU2/index.html).

## System Requirements

* [Ruby 2.5+](https://www.ruby-lang.org/en/)
* [Ruby Bundler](http://bundler.io/)
* [SQLite](https://www.sqlite.org/)

## Installation and Running

### Local Installation

The *Crucible SMART on FHIR Test App* can installed and run locally on your machine.  Install the dependencies
listed above and enter the following in a terminal prompt:

```sh
# MacOS or Linux
git clone https://github.com/fhir-crucible/crucible_smart_app.git
cd crucible_smart_app
bundle install
bundle exec ruby app.rb
```

*Crucible SMART on FHIR Test App* can then be accessed at http://localhost:4567 in a web browser.

### Docker Installation

Docker is the recommended installation method for Windows devices and can also be used on Linux and MacOS hosts.

1. Install Docker for the host platform as well as the docker-compose tool (which may be included in the distribution, as is the case for Windows and MacOS).
2. Download the `crucuble_smart_app` project to your local computer on a directory of your choice.
3. Open a terminal in the directory where the project was downloaded (above).
4. Run the command `docker-compose up` to start the server. This will automatically build the Docker image with the correct ruby version and launch both the ruby server (using unicorn) and an NGINX server to front it all.
5. Navigate to http://localhost:8080 to find the running application.

If the docker image gets out of sync with the underlying system, such as when new dependencies are added to the application, you need to run `docker-compose up -- build` to rebuild the containers.

### Remote Deployment

The *Crucible SMART on FHIR Test App* can also be deployed onto a server to test many different
instances of the FHIR Servers by multiple users.  Test results are kept private at a unique, unguessable URI that can
be saved for future reference or shared.

Deployment on a remote server can be done by using a modified form of the Docker containers provided (see above) or by direct installation on the remote host.

* Please see the file [deployment-configuration.md](https://github.com/fhir-crucible/crucible_smart_app/blob/master/deployment-configuration.md) for details.

## Unit Tests

The *Crucible SMART on FHIR Test App* contains a robust set of self-tests to ensure that the
test clients conform to the specification and performs as intended.  To run these tests, execute the following
command:

```sh
bundle exec rake
```

## Basic Usage Instructions

Open the application in the browser (http://localhost:4567 by default for local installations).  Provide the DSTU2
FHIR endpoint to be tested in the prompt and click the `Begin` button.

The application is organized into a series of test sequences, each which perform a set of actions against a FHIR
server and related security services.  These actions contain tests to ensure that the server is responding to client requests
as expected.  They also may collect information about the server for use in later sequences, such a list of FHIR Resources
supported by the FHIR server.  Some sequences also perform actions that may be required for later tests, such as
authorizing the client to access protected resources in accordance with SMART on FHIR.<commit_msg>Remove unnecessary bullet in README.md<commit_after># Crucible SMART on FHIR Test App [![Build Status](https://travis-ci.org/fhir-crucible/crucible_smart_app.svg?branch=master)](https://travis-ci.org/fhir-crucible/crucible_smart_app)

This application creates test clients that exercise the range of requirements of a
[SMART on FHIR](http://smarthealthit.org/smart-on-fhir/) server. These clients have tests for the
[SMART App Launch Framework](http://www.hl7.org/fhir/smart-app-launch/), [Argonaut](http://hl7.org/fhir/DSTU2/argonaut/argonaut.html)
Implementation Guides, and [FHIR DSTU2](http://hl7.org/fhir/DSTU2/index.html).

## System Requirements

* [Ruby 2.5+](https://www.ruby-lang.org/en/)
* [Ruby Bundler](http://bundler.io/)
* [SQLite](https://www.sqlite.org/)

## Installation and Running

### Local Installation

The *Crucible SMART on FHIR Test App* can installed and run locally on your machine.  Install the dependencies
listed above and enter the following in a terminal prompt:

```sh
# MacOS or Linux
git clone https://github.com/fhir-crucible/crucible_smart_app.git
cd crucible_smart_app
bundle install
bundle exec ruby app.rb
```

*Crucible SMART on FHIR Test App* can then be accessed at http://localhost:4567 in a web browser.

### Docker Installation

Docker is the recommended installation method for Windows devices and can also be used on Linux and MacOS hosts.

1. Install Docker for the host platform as well as the docker-compose tool (which may be included in the distribution, as is the case for Windows and MacOS).
2. Download the `crucuble_smart_app` project to your local computer on a directory of your choice.
3. Open a terminal in the directory where the project was downloaded (above).
4. Run the command `docker-compose up` to start the server. This will automatically build the Docker image with the correct ruby version and launch both the ruby server (using unicorn) and an NGINX server to front it all.
5. Navigate to http://localhost:8080 to find the running application.

If the docker image gets out of sync with the underlying system, such as when new dependencies are added to the application, you need to run `docker-compose up -- build` to rebuild the containers.

### Remote Deployment

The *Crucible SMART on FHIR Test App* can also be deployed onto a server to test many different
instances of the FHIR Servers by multiple users.  Test results are kept private at a unique, unguessable URI that can
be saved for future reference or shared.

Deployment on a remote server can be done by using a modified form of the Docker containers provided (see above) or by direct installation on the remote host.

Please see the file [deployment-configuration.md](https://github.com/fhir-crucible/crucible_smart_app/blob/master/deployment-configuration.md) for details.

## Unit Tests

The *Crucible SMART on FHIR Test App* contains a robust set of self-tests to ensure that the
test clients conform to the specification and performs as intended.  To run these tests, execute the following
command:

```sh
bundle exec rake
```

## Basic Usage Instructions

Open the application in the browser (http://localhost:4567 by default for local installations).  Provide the DSTU2
FHIR endpoint to be tested in the prompt and click the `Begin` button.

The application is organized into a series of test sequences, each which perform a set of actions against a FHIR
server and related security services.  These actions contain tests to ensure that the server is responding to client requests
as expected.  They also may collect information about the server for use in later sequences, such a list of FHIR Resources
supported by the FHIR server.  Some sequences also perform actions that may be required for later tests, such as
authorizing the client to access protected resources in accordance with SMART on FHIR.
{'fraction_non_alphanumeric': 0.06806624070934933, 'fraction_numerical': 0.006780545051506063, 'mean_word_length': 4.594456601021152, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '844465', 'n_tokens_mistral': 2190, 'n_tokens_neox': 2033, 'n_words': 1035}