Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
chore: normalize all the line endings (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
carvantes authored Sep 8, 2021
1 parent 3a55bf3 commit c7c6341
Show file tree
Hide file tree
Showing 23 changed files with 4,000 additions and 4,000 deletions.
26 changes: 13 additions & 13 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Issue #, if available:

Description of changes:


Checklist:

<!-- You can erase any parts of this template not applicable to your Pull Request. -->

* [ ] Have you successfully deployed to an AWS account with your changes?
* [ ] Have you written new tests for your core changes, as applicable?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available:

Description of changes:


Checklist:

<!-- You can erase any parts of this template not applicable to your Pull Request. -->

* [ ] Have you successfully deployed to an AWS account with your changes?
* [ ] Have you written new tests for your core changes, as applicable?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
36 changes: 18 additions & 18 deletions .github/no-response.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#

# Configuration for probot-no-response - https://github.com/probot/no-response

# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 7
# Label requiring a response
responseRequiredLabel: closing-soon-if-no-response
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
This issue has been automatically closed because there has been no response
to our request for more information from the original author. With only the
information that is currently in the issue, we don't have enough information
to take action. Please reach out if you have or find the answers we need so
that we can investigate further.
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#

# Configuration for probot-no-response - https://github.com/probot/no-response

# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 7
# Label requiring a response
responseRequiredLabel: closing-soon-if-no-response
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
This issue has been automatically closed because there has been no response
to our request for more information from the original author. With only the
information that is currently in the issue, we don't have enough information
to take action. Please reach out if you have or find the answers we need so
that we can investigate further.
4 changes: 2 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Helps with using npm package-locally, while in a yarn workflow (avoids coupling scripts to yarn).
# This is needed because yarn goes out of it's way to ensure it controls what `node` binary is used (for good!)
# Helps with using npm package-locally, while in a yarn workflow (avoids coupling scripts to yarn).
# This is needed because yarn goes out of it's way to ensure it controls what `node` binary is used (for good!)
scripts-prepend-node-path=auto
10 changes: 5 additions & 5 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = {
semi: true,
trailingComma: 'all',
Expand Down
340 changes: 170 additions & 170 deletions CHANGELOG.md

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions CUSTOMIZE.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
# FHIR Works on AWS customization

## API customization

To change what this FHIR server supports, both in terms of operations and in resource types, please check out the [config.ts](src/config.ts) file.

### Resource types

We split the resource types into two buckets 'genericResource' and 'resources'.

#### Generic resources

_genericResource_ are resources that should all be treated the same, in terms of how the resource type is operated on. For example, this implementation says all `genericResources` should use the `dynamoDbDataService` persistence component and the `esSearch` for typeSearching. In _genericResource_ you can modify the component you would like to use AND what operations you want to support.

Ways of customization:

- `profile.genericResource`
- `genericResource.operations` is the list of valid operations this FHIR server will support in relation to ALL generic resource types.
- `genericResource.excluded<Version>Resources` removes these resources from being supported for the specified \<Version\>.
- `genericResource.fhirVersions` is the FHIR versions that this genericResource definition supports.
- `genericResource.persistence` is the persistence component you want to use with these generic resources.
- `genericResource.typeHistory` is the history component you want to use with these generic resources.
- `genericResource.typeSearch` is the search component you want to use with these generic resources.

#### Resources

_resources_ are the 'special' resources that should be treated differently than the generic ones. For example, this implementation has `Binary` as a 'special' resource, meaning it will be using the `s3DataService` persistence component and no search component. Much like in _genericResource_ in these _resources_ you can modify the component you would like to use AND what operations you want to support.

Ways of customization:

- `profile.resources.<Type>`
- `<Type>.operations` is the list of valid operations this FHIR server will support for this specific resource type.
- `<Type>.fhirVersions` is the FHIR versions that this resource type supports.
- `<Type>.persistence` is the persistence component you want to use with this resource type.
- `<Type>.typeHistory` is the history component you want to use with this resource type.
- `<Type>.typeSearch` is the search component you want to use with this resource type.

### FHIR versions

This FHIR Works on AWS supports FHIR R4 out of the box. To change the version of support you must change the `profile.fhirVersion`, the `profile.genericResource.fhirVersions` and the 'special' `profile.resources.<Type>.fhirVersions`

## Authorization (RBAC) customization

This FHIR Works on AWS deployment supports role based access control (RBAC) for authorization. To modify the rules please see [RBACRules.ts](src/RBACRules.ts) file. This file is structured by Cognito User Groups. For example the `practitioner` User Group can do ['create', 'read', 'update', 'delete', 'vread', 'search-type', 'transaction'] operations on all R4 resource types.

To assign users to specific user groups please log into the AWS console and navigate to the Cognito service. Once there select on your FHIR User Pool and find the user you want to modify. From there add that user to the desired user group.

## CORS customization

The FHIR Works on AWS deployment can be customized to provide CORS support for browser-based applications. The following configuration steps are required:


- Supply a [CorsOptions](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/cors/index.d.ts) configuration when building the [serverless router](src/index.ts). For example
```ts
const corsOptions: CorsOptions = {...};
...
generateServerlessRouter(fhirConfig, genericResources, corsOptions)
```
Please see the available [configuration options](https://www.npmjs.com/package/cors#configuration-options).
- For pre-flight request support, add an OPTIONS method to the API Gateway `{proxy+}` route within the Serverless template. The request should be handled by the Lambda handler. The method should not use authorization.
- If using a custom authorizer, then rejected requests also need to provide CORS headers, otherwise it is tricky to interpret the unauthorized response in the browser. The following [blog](https://www.serverless.com/blog/cors-api-gateway-survival-guide) describes how a `GatewayResponse` resource may be added to the Serverless template to provide these headers.

## Supporting other FHIR implementation guides or profiles

FHIR has this concept of [profiling](https://www.hl7.org/fhir/profiling.html). FHIR Works on AWS does not explicitly support it, but it does not explicitly restrict users from adapting the [FHIR Works router](https://github.com/awslabs/fhir-works-on-aws-routing) to fit their needs.

To add support for profiles you will need to modify the router's json validation schema found [here](https://github.com/awslabs/fhir-works-on-aws-routing/tree/mainline/src/router/validation/schemas). Inside of the schema you can add/remove resource types and modify the expected parameters for each type.

If you are adding/removing a new resource type you will most likely want to adjust what resource types are defined as 'generic'. This can be done in the [constants.ts](src/constants.ts) file.
# FHIR Works on AWS customization

## API customization

To change what this FHIR server supports, both in terms of operations and in resource types, please check out the [config.ts](src/config.ts) file.

### Resource types

We split the resource types into two buckets 'genericResource' and 'resources'.

#### Generic resources

_genericResource_ are resources that should all be treated the same, in terms of how the resource type is operated on. For example, this implementation says all `genericResources` should use the `dynamoDbDataService` persistence component and the `esSearch` for typeSearching. In _genericResource_ you can modify the component you would like to use AND what operations you want to support.

Ways of customization:

- `profile.genericResource`
- `genericResource.operations` is the list of valid operations this FHIR server will support in relation to ALL generic resource types.
- `genericResource.excluded<Version>Resources` removes these resources from being supported for the specified \<Version\>.
- `genericResource.fhirVersions` is the FHIR versions that this genericResource definition supports.
- `genericResource.persistence` is the persistence component you want to use with these generic resources.
- `genericResource.typeHistory` is the history component you want to use with these generic resources.
- `genericResource.typeSearch` is the search component you want to use with these generic resources.

#### Resources

_resources_ are the 'special' resources that should be treated differently than the generic ones. For example, this implementation has `Binary` as a 'special' resource, meaning it will be using the `s3DataService` persistence component and no search component. Much like in _genericResource_ in these _resources_ you can modify the component you would like to use AND what operations you want to support.

Ways of customization:

- `profile.resources.<Type>`
- `<Type>.operations` is the list of valid operations this FHIR server will support for this specific resource type.
- `<Type>.fhirVersions` is the FHIR versions that this resource type supports.
- `<Type>.persistence` is the persistence component you want to use with this resource type.
- `<Type>.typeHistory` is the history component you want to use with this resource type.
- `<Type>.typeSearch` is the search component you want to use with this resource type.

### FHIR versions

This FHIR Works on AWS supports FHIR R4 out of the box. To change the version of support you must change the `profile.fhirVersion`, the `profile.genericResource.fhirVersions` and the 'special' `profile.resources.<Type>.fhirVersions`

## Authorization (RBAC) customization

This FHIR Works on AWS deployment supports role based access control (RBAC) for authorization. To modify the rules please see [RBACRules.ts](src/RBACRules.ts) file. This file is structured by Cognito User Groups. For example the `practitioner` User Group can do ['create', 'read', 'update', 'delete', 'vread', 'search-type', 'transaction'] operations on all R4 resource types.

To assign users to specific user groups please log into the AWS console and navigate to the Cognito service. Once there select on your FHIR User Pool and find the user you want to modify. From there add that user to the desired user group.

## CORS customization

The FHIR Works on AWS deployment can be customized to provide CORS support for browser-based applications. The following configuration steps are required:


- Supply a [CorsOptions](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/cors/index.d.ts) configuration when building the [serverless router](src/index.ts). For example
```ts
const corsOptions: CorsOptions = {...};
...
generateServerlessRouter(fhirConfig, genericResources, corsOptions)
```
Please see the available [configuration options](https://www.npmjs.com/package/cors#configuration-options).
- For pre-flight request support, add an OPTIONS method to the API Gateway `{proxy+}` route within the Serverless template. The request should be handled by the Lambda handler. The method should not use authorization.
- If using a custom authorizer, then rejected requests also need to provide CORS headers, otherwise it is tricky to interpret the unauthorized response in the browser. The following [blog](https://www.serverless.com/blog/cors-api-gateway-survival-guide) describes how a `GatewayResponse` resource may be added to the Serverless template to provide these headers.

## Supporting other FHIR implementation guides or profiles

FHIR has this concept of [profiling](https://www.hl7.org/fhir/profiling.html). FHIR Works on AWS does not explicitly support it, but it does not explicitly restrict users from adapting the [FHIR Works router](https://github.com/awslabs/fhir-works-on-aws-routing) to fit their needs.

To add support for profiles you will need to modify the router's json validation schema found [here](https://github.com/awslabs/fhir-works-on-aws-routing/tree/mainline/src/router/validation/schemas). Inside of the schema you can add/remove resource types and modify the expected parameters for each type.

If you are adding/removing a new resource type you will most likely want to adjust what resource types are defined as 'generic'. This can be done in the [constants.ts](src/constants.ts) file.
Loading

0 comments on commit c7c6341

Please sign in to comment.