This is an example project that transforms POST data of different content types (e.g., XML, JSON) from a third-party system into the following JSON response:
{
"first_name":"Steve", // Patient's first name stored as a string
"last_name":"Test", // Patient's last name stored as a string
"external_id":"123", // Unique ID of the patient provided by the EMR
"date_of_birth":"2000-01-31" // Patient's date of birth
}
- Environment variables go into
/config/.envand newly-required.envdefinitions are checked into/config/bootstrap.php - Routes for all endpoints are declared in
/public/index.php - PSR4 namespacing is used in the
srcdirectory for all other project-related files- e.g., The
Davidwyly\Mb\Http\Controller\PatientControllerclass is located at/src/Davidwyly/Mb/Http/Controller/PatientController.php
- e.g., The
- Tests are located in
/tests- Test fixtures in
/tests/fixtures - Mock objects are located in
/src/Davidwyly/Mb/Mock
- Test fixtures in
While this project does not have to be installed in order to be evaluated, I have set up docker so that you can more easily run and test the service yourself.
These installation instructions assume that the following is already installed on your dev environment:
- Git
- Composer
- Docker
- Docker Compose
- Postman
- Navigate to your home directory
cd ~
- Clone down the project
git clone git@github.com:davidwyly/mb
- Ensure you're in the root directory
cd ~/mb
- Run
source .bash_aliases - To view all alias commands for this project, run
cat .bash_aliases
- Ensure you're in the root directory
cd ~/mb
- Composer install
composer install
- Open up a new terminal
- Navigate to the root directory
cd ~/mb
- Build your containers
docker-compose up --build
- Ensure you're in the root directory
cd ~/mb
- Run the PHPUnit tests
run_tests
- Import collection from
~/mb/storage/Mb.postman_collection.json - Set up a new postman environment
- Click the gear icon in top-right corner
- Click
Add - Create an environment name
- Add a
urlvariable withlocalhost:8080as the initial value - Click
Add - Select the environment from the drop-down in the top-right corner
- Requests can be found within the
Mbcollection