Skip to content

Commit

Permalink
feat: new resources (#17)
Browse files Browse the repository at this point in the history
* feat: Added support for R4 resources and environment setup
* feat: Added support for automatic changleog generation
* fix: fixed issues with filenames in newly generated code

BREAKING CHANGE: New resources contain new dependencies. One of these
contains graphql which may require you to delete and reinstall node
modules. We have updated several versions so when updating, you should
rerun yarn install and may need to remove node_modules before hand.
  • Loading branch information
Robert-W committed Jan 11, 2019
1 parent be3b700 commit 74986a8
Show file tree
Hide file tree
Showing 5,014 changed files with 417,734 additions and 151,926 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 1.0.0 (2019-01-09)


### Bug Fixes

* fixed issues with filenames in newly generated code ([77e7a6b](https://github.com/Asymmetrik/graphql-fhir/commit/77e7a6b))


### Features

* Added support for automatic changleog generation ([2fe0f75](https://github.com/Asymmetrik/graphql-fhir/commit/2fe0f75))
* Added support for R4 resources and environment setup ([686a764](https://github.com/Asymmetrik/graphql-fhir/commit/686a764))


### BREAKING CHANGES

* New resources contain new dependencies. One of these
contains graphql which may require you to delete and reinstall node
modules. We have updated several versions so when updating, you should
rerun yarn install and may need to remove node_modules before hand.



5 changes: 3 additions & 2 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,10 @@ We also allow for partial error handling, so you can reject things in one resolv
```

## Resource configuration
By default, we support almost all the resources from STU3(3.0.1) and DSTU2(1.0.2). We allow you to turn on or off entire versions very easily. We also allow you to turn off individual profiles or even capabilities within a profile if you desire.
By default, we support almost all the resources from R4(4.0.0), STU3(3.0.1), and DSTU2(1.0.2). Since most teams will not need to support all the resources for all three versions, we make it very easy to disable resources or even entire versions. Furthermore, you can disable operations at the resource level incase you only want to support read or something similar.

To configure which version you want to support, add/remove a value to the `VERSION` constant in `src/config.js`. You just need to make sure you have a corresponding set of resources in `src/resources`.
### Version configuration
To configure which version you want to support, add/remove a value to the `VERSION` constant in `src/config.js`. You just need to make sure you have a corresponding set of resources in `src/resources`. So if you only want to support R4, just remove the `1_0_2` and `3_0_1` entries.

In order to explain how to configure a specific profile, let's walk through an example of configuring the patient profile and completely disabling the observation profile for version 1.0.2.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ src
- [ ] Support for more versions
- [x] DSTU2 (1.0.2).
- [x] STU3 (3.0.1).
- [ ] R4
- [x] R4
- [ ] Work with community to continue to establish best practices for FHIR with GraphQL and implement them here.

## Contributing
Expand Down
21 changes: 15 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
{
"name": "graphql-fhir",
"version": "0.9.1",
"version": "1.0.0",
"description": "A Javascript based GraphQL FHIR server",
"main": "index.js",
"author": "Robert-W <rwinterbottom@asymmetrik.com>>",
"license": "MIT",
"private": false,
"scripts": {
"start": "node src/index",
"nodemon": "node src/scripts/nodemon",
"test": "node src/scripts/test --env=jsdom",
"start": "cross-env NODE_ENV=production node src/index",
"nodemon": "cross-env NODE_ENV=development node src/scripts/nodemon",
"test": "cross-env NODE_ENV=test node src/scripts/test",
"prettier": "prettier \"src/**/*.js\" --write",
"lint": "eslint \"src/**/*.js\""
"lint": "eslint \"src/**/*.js\"",
"changelog": "conventional-changelog -p angular -s -r 0 -i CHANGELOG.md"
},
"prettier": {
"trailingComma": "all",
"singleQuote": true
},
"dependencies": {
"@asymmetrik/fhir-gql-schema-utils": "^1.0.1",
"@asymmetrik/sof-graphql-invariant": "^1.0.2",
"body-parser": "^1.18.3",
"compression": "^1.7.2",
"cross-env": "^5.2.0",
"express": "^4.16.3",
"express-graphql": "^0.6.12",
"glob": "^7.1.2",
"graphql": "^0.13.2",
"graphql": "^14.0.2",
"graphql-outfields": "^0.9.1",
"helmet": "^3.12.1",
"moment-timezone": "^0.5.21",
Expand All @@ -38,6 +41,7 @@
"xss": "^1.0.3"
},
"devDependencies": {
"conventional-changelog-cli": "^2.0.11",
"coveralls": "^3.0.2",
"eslint": "^5.1.0",
"jest": "^23.2.0",
Expand All @@ -51,10 +55,15 @@
"lcov",
"json"
],
"setupFiles": [
"<rootDir>/src/environment.js"
],
"testEnvironment": "node",
"testPathIgnorePatterns": [
"<rootDir>/src/scripts/"
],
"coveragePathIgnorePatterns": [
"<rootDir>/src/environment.js",
"<rootDir>/src/resources/"
]
}
Expand Down
3 changes: 2 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const path = require('path');
const VERSION = {
'1_0_2': '1_0_2',
'3_0_1': '3_0_1',
'4_0_0': '4_0_0',
};

/**
Expand Down Expand Up @@ -57,7 +58,7 @@ const RESOURCE_CONFIG = {
// base folder for all the resources relative to src
resourceBase: 'resources',
// Path is relative to version folder under resources
profilesRelativePath: 'profiles/**/index.js',
profilesRelativePath: 'profiles/**/register.js',
};

module.exports = {
Expand Down
19 changes: 19 additions & 0 deletions src/environment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* WARNING: DO NOT PUT ANY SECRETS IN HERE, THIS IS ONLY INTENDED TO SETUP
* SIMPLE FEATURE FLAGS. SECRETS SHOULD BE PART OF YOUR DEPLOYMENT STRATEGY
*/

if (process.env.NODE_ENV === 'development') {
process.env.SOF_AUTHENTICATION = true;
process.env.HAS_GRAPHIQL = true;
}

if (process.env.NODE_ENV === 'production') {
process.env.SOF_AUTHENTICATION = true;
process.env.HAS_GRAPHIQL = false;
}

if (process.env.NODE_ENV === 'test') {
process.env.SOF_AUTHENTICATION = false;
process.env.HAS_GRAPHIQL = false;
}
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { SERVER_CONFIG } = require('./config');
const FHIRServer = require('./lib/server');
const { SERVER_CONFIG } = require('./config.js');
const FHIRServer = require('./lib/server.js');

// load environment settings
require('./environment.js');

// Start buliding our server
let server = new FHIRServer(SERVER_CONFIG)
Expand Down

0 comments on commit 74986a8

Please sign in to comment.