You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+21-18
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ The easiest and quickest way to access FHIR Works on AWS is by using [AWS soluti
19
19
**Note**: AWS Solution provides an earlier version(See Solutions [CHANGELOG](https://github.com/awslabs/fhir-works-on-aws-deployment/blob/aws-solution/CHANGELOG.md) for more details) of FWoA install. Please follow the instruction below to install from GitHub repository if you wish to install the latest version.
20
20
21
21
1. Clone or download the repository to a local directory.
3. Refer to these [instructions](./DEVELOPMENT.md) for making code changes.
39
39
40
-
If you intend to use FHIR Implementation Guides read the [Using Implementation Guides](./USING_IMPLEMENTATION_GUIDES.md) documentation first.
40
+
If you intend to use FHIR Implementation Guides read the [Using Implementation Guides](./USING_IMPLEMENTATION_GUIDES.md) documentation first.
41
41
42
42
If you intend to do a multi-tenant deployment read the [Using Multi-Tenancy](./USING_MULTI_TENANCY.md) documentation first.
43
43
@@ -46,7 +46,7 @@ If you intend to use FHIR Subscriptions read the [Using Subscriptions](./USING_S
46
46
## Architecture
47
47
48
48
The system architecture consists of multiple layers of AWS serverless services. The endpoint is hosted using API Gateway. The database and storage layer consists of Amazon DynamoDB and S3, with Elasticsearch as the search index for the data written to DynamoDB. The endpoint is secured by API keys and Cognito for user-level authentication and user-group authorization. The diagram below shows the FHIR server’s system architecture components and how they are related.
49
-
49
+
50
50

51
51
52
52
## Components overview
@@ -55,7 +55,7 @@ FHIR Works on AWS is powered by single-function components. These functions prov
55
55
+[Interface](https://github.com/awslabs/fhir-works-on-aws-interface) - Defines communication between the components.
56
56
+[Routing](https://github.com/awslabs/fhir-works-on-aws-routing) - Accepts HTTP FHIR requests, routes it to the other components, logs the errors, transforms output to HTTP responses and generates the [Capability Statement](https://www.hl7.org/fhir/capabilitystatement.html).
57
57
+[Authorization](https://github.com/awslabs/fhir-works-on-aws-authz-rbac) - Accepts the access token found in HTTP header and the action the request is trying to perform. It then determines if that action is permitted.
58
-
+[Persistence](https://github.com/awslabs/fhir-works-on-aws-persistence-ddb) - Contains the business logic for creating, reading, updating, and deleting the FHIR record from the database. FHIR also supports ‘conditional’ CRUD actions and patching.
58
+
+[Persistence](https://github.com/awslabs/fhir-works-on-aws-persistence-ddb) - Contains the business logic for creating, reading, updating, and deleting the FHIR record from the database. FHIR also supports ‘conditional’ CRUD actions and patching.
59
59
+ Bundle - Supports multiple incoming requests as one request. Think of someone wanting to create five patients at once instead of five individual function calls. There are two types of bundles, batch and transaction. We currently only support transaction bundles of size 25 entries or fewer, but support batch bundles of up to 750 entries. This 750 limit was drawn from the Lambda payload limit of 6MB and an average request size of 4KB, divided in half to allow for flexibility in request size. This limit can also be configured in the `config.ts`, by specifying the `maxBatchSize` when constructing the `DynamoDBBundleService`.
60
60
+[Search](https://github.com/awslabs/fhir-works-on-aws-search-es) - Enables system-wide searching (/?name=bob) and type searching (/Patient/?name=bob).
61
61
+ History - (*Not implemented*) Searches all archived/older versioned resources. This can be done at a system, type or instance level.
@@ -68,26 +68,29 @@ This project is licensed under the Apache-2.0 license.
68
68
69
69
### Retrieving user variables
70
70
71
-
After installation, all user-specific variables (such as `USER_POOL_APP_CLIENT_ID`) can be found in the `INFO_OUTPUT.log` file.
72
-
**Note**: The default stage is `dev` and region is `us-west-2`.
71
+
After installation, all user-specific variables (such as `USER_POOL_APP_CLIENT_ID`) can be found in the `Info_Output.log` file. You can also retrieve these values by running the following command:
72
+
```
73
+
serverless info --verbose --region <REGION> --stage <STAGE>.
74
+
```
75
+
**Note**: The default stage is `dev` and region is `us-west-2`.
73
76
74
77
If you are receiving `Error: EACCES: permission denied` when running a command, try re-running it using `sudo`.
75
78
76
79
### Accessing the FHIR API
77
80
78
-
The FHIR API can be accessed through `API_URL` using the following REST syntax:
81
+
The FHIR API can be accessed through `API_URL` using the following REST syntax:
For more information, click [here](http://hl7.org/fhir/http.html).
85
+
For more information, click [here](http://hl7.org/fhir/http.html).
83
86
84
87
### Using Postman to make API requests
85
88
86
89
To access APIs, you can use Postman as well. [Postman](https://www.postman.com/) is an API Client for RESTful services that can run on your development desktop for making requests to the FHIR Server. Postman is highly suggested and enables easier access to the FHRI API. You can use Postman to make API requests by following the steps below:
87
90
88
91
**Importing the collection file**
89
92
90
-
Under the Postman folder, you can access the JSON definitions for some API requests that you can make against the server. To import these requests into your Postman application, click [here](https://kb.datamotion.com/?ht_kb=postman-instructions-for-exporting-and-importing).
93
+
Under the Postman folder, you can access the JSON definitions for some API requests that you can make against the server. To import these requests into your Postman application, click [here](https://kb.datamotion.com/?ht_kb=postman-instructions-for-exporting-and-importing).
91
94
92
95
**Note**: Ensure that you import the [Fhir.postman_collection.json](./postman/Fhir.postman_collection.json) collection file.
93
96
@@ -113,12 +116,12 @@ To find what FHIR Server supports, use the `GET Metadata` Postman request to ret
113
116
114
117
**Authorizing a user**
115
118
116
-
FHIR Works on AWS uses Role-Based Access Control (RBAC) to determine what operations and what resource types a user can access. The default rule set can be found in [RBACRules.ts](https://github.com/awslabs/fhir-works-on-aws-deployment/blob/mainline/src/RBACRules.ts). To access the API, you must use the ID token. This ID token must include scopes of either `openid`, `profile` or `aws.cognito.signin.user.admin`.
119
+
FHIR Works on AWS uses Role-Based Access Control (RBAC) to determine what operations and what resource types a user can access. The default rule set can be found in [RBACRules.ts](https://github.com/awslabs/fhir-works-on-aws-deployment/blob/mainline/src/RBACRules.ts). To access the API, you must use the ID token. This ID token must include scopes of either `openid`, `profile` or `aws.cognito.signin.user.admin`.
117
120
118
121
Using either of these scopes provide information about users and their group. It helps determine what resources/records they can access.
119
122
120
-
+ The `openid` scope returns all user attributes in the ID token that are readable by the client. The ID token is not returned if the openid scope is not requested by the client.
121
-
+ The `profile` scope grants access to all user attributes that are readable by the client. This scope can only be requested with the openid scope.
123
+
+ The `openid` scope returns all user attributes in the ID token that are readable by the client. The ID token is not returned if the openid scope is not requested by the client.
124
+
+ The `profile` scope grants access to all user attributes that are readable by the client. This scope can only be requested with the openid scope.
122
125
+ The `aws.cognito.signin.user.admin` scope grants access to [Amazon Cognito User Pool](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/Welcome.html) API operations that require access tokens, such as `UpdateUserAttributes` and `VerifyUserAttribute`.
123
126
124
127
For more information, click [here](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-idp-settings.html).
@@ -142,18 +145,18 @@ Binary resources are FHIR resources that consist of binary/unstructured data of
142
145
143
146
### Testing binary resources
144
147
145
-
**Using Postman**
148
+
**Using Postman**
146
149
147
150
To test, use Postman. For steps, click [here](https://github.com/awslabs/fhir-works-on-aws-deployment/blob/mainline/README.md#using-postman-to-make-api-requests).
148
151
149
-
**Note**: We recommend you to test binary resources by using the `Binary` folder in Postman.
152
+
**Note**: We recommend you to test binary resources by using the `Binary` folder in Postman.
150
153
151
154
**Using cURL**
152
155
153
156
To test this with cURL, follow these steps:
154
157
1. POST a binary resource to FHIR API using the following command:
+ Support for STU3 and [R4](https://www.hl7.org/fhir/validation.html) releases of FHIR is based on the JSON schema provided by HL7. The schema for R4 is more restrictive than the schema for [STU3](http://hl7.org/fhir/STU3/validation.html). The STU3 schema doesn’t restrict appending additional fields into the POST/PUT requests of a resource, whereas the R4 schema has a strict definition of what is permitted in the request. You can access the schema [here](https://github.com/awslabs/fhir-works-on-aws-routing/blob/mainline/src/router/validation/schemas/fhir.schema.v3.json).
200
203
201
-
**Note**: We are using the official schema provided by [HL7](https://www.hl7.org/fhir/STU3/downloads.html).
204
+
**Note**: We are using the official schema provided by [HL7](https://www.hl7.org/fhir/STU3/downloads.html).
202
205
203
206
+ When making a `POST`/`PUT` request to the server, if you get an error that includes the text `Failed to parse request body as JSON resource`, check that you've set the request headers correctly. The header for `Content-Type` should be either `application/json` or `application/fhir+json`. If you're using Postman for making requests, in the **Body** tab, make sure to change the setting to `raw` and `JSON`.
204
207

0 commit comments