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: INSTALL.md
+109-28
Original file line number
Diff line number
Diff line change
@@ -22,19 +22,13 @@ The FHIR Server is designed to use AWS services for data storage and API access.
22
22
23
23
### Node.JS
24
24
25
-
Node is used as the Lambda runtime. To install node, we recommend the use of nvm (the Node Version Manager):
25
+
Node is used as the Lambda runtime. To install node, we recommend the use of [nvm (the Node Version Manager)](https://github.com/nvm-sh/nvm).
26
26
27
-
> https://github.com/nvm-sh/nvm
28
-
29
-
If you'd rather just install Node 12.x by itself:
30
-
31
-
> https://nodejs.org/en/download/
27
+
If you'd rather install Node 12.x by itself, see [Nodejs.org](https://nodejs.org/en/download/).
32
28
33
29
### Python
34
30
35
-
Python is used for a few scripts to instantiate a Cognito user and could be regarded as optional. To install Python browse to:
36
-
37
-
> https://www.python.org/downloads/
31
+
Python is used for a few scripts to instantiate a Cognito user and could be regarded as optional. To install Python, see [python.org](https://www.python.org/downloads/).
38
32
39
33
### boto3 AWS Python SDK
40
34
@@ -46,26 +40,20 @@ pip install boto3
46
40
47
41
### yarn
48
42
49
-
Yarn is a node package management tool similar to npm. Instructions for installing Yarn are provided for different platforms here:
50
-
51
-
> https://classic.yarnpkg.com/en/docs/install
43
+
Yarn is a node package management tool similar to npm. Instructions for installing Yarn are provided for different platforms [here](https://classic.yarnpkg.com/en/docs/install).
52
44
53
45
```sh
54
46
brew install yarn
55
47
```
56
48
57
49
### CDK CLI
58
50
AWS CDK (Cloud Development Kit) is a framework for defining cloud infrastructure such as Lambda functions and associated resources in code and provisioning it in the target AWS Account through AWS CloudFormation.
59
-
Instructions for installing CDK are provided for different platforms here:
Instructions for installing Serverless are provided for different platforms [here](https://serverless.com/framework/docs/getting-started/).
69
57
70
58
```sh
71
59
curl -o- -L https://slss.io/install | bash
@@ -218,11 +206,7 @@ We recommend you to add Elasticsearch logging for production workflows. For step
218
206
219
207
#### Running an ES command
220
208
221
-
In order to run a command directly in Elasticsearch, make sure you are in the folder
222
-
223
-
> scripts
224
-
225
-
and execute the following command:
209
+
In order to run a command directly in Elasticsearch, make sure you are in the `scripts` folder and enter the following command:
226
210
227
211
```sh
228
212
ACCESS_KEY=<ACCESS_KEY> SECRET_KEY=<SECRET_KEY> ES_DOMAIN_ENDPOINT=<ES_DOMAIN_ENDPOINT> node elasticsearch-operations.js <REGION>"<function to execute>""<optional additional params>"
@@ -244,7 +228,8 @@ If you lose this URL, it can be found in the `Info_Output.log` file under the "E
244
228
245
229
##### Accessing Elasticsearch Kibana server
246
230
247
-
> NOTE: Kibana is only deployed in the default 'dev' stage; if you want Kibana set up in other stages, like 'production', please remove `Condition: isDev` from [elasticsearch.yaml](./cloudformation/elasticsearch.yaml) if using serverless, or in the [elasticsearch.ts](./lib/elasticsearch.ts) file if using CDK.
231
+
> **Note**
232
+
Kibana is only deployed in the default 'dev' stage; if you want Kibana set up in other stages, like 'production', please remove `Condition: isDev` from [elasticsearch.yaml](./cloudformation/elasticsearch.yaml) if using serverless, or in the [elasticsearch.ts](./lib/elasticsearch.ts) file if using CDK.
248
233
249
234
The Kibana server allows you to explore data inside your Elasticsearch instance through a web UI.
`An error occurred: DynamodbKMSKey - Exception=[class software.amazon.awssdk.services.kms.model.MalformedPolicyDocumentException] ErrorCode=[MalformedPolicyDocumentException], ErrorMessage=[Policy contains a statement with one or more invalid principals.]`
358
+
```An error occurred: DynamodbKMSKey - Exception=[class software.amazon.awssdk.services.kms.model.MalformedPolicyDocumentException] ErrorCode=[MalformedPolicyDocumentException], ErrorMessage=[Policy contains a statement with one or more invalid principals.]```
374
359
375
360
Then serverless has generated an invalid Cloudformation template.
376
361
@@ -385,7 +370,102 @@ If you still get the same error after following the steps above, try removing th
385
370
If Docker is erroring out while running `apt-get`, it might be because it's unable to reach the Debian server to get software updates. Try running the build command with `--network=host`.
386
371
Run `docker build -t fhir-server-install --network=host -f docker/Dockerfile .`
387
372
388
-
Note: This issue was seen on a Fedora 32 machine.
373
+
>**Note**
374
+
This issue was seen on a Fedora 32 machine.
375
+
376
+
### Customizations to improve search functions
377
+
Search parameters are defined as accurately as possible, but you could experience some issues with search. This information will help you adjust the code and customize search fields for your needs.
378
+
379
+
#### Search returns inexact matches when doing exact match only search
380
+
1. Sign in to the [AWS Console](https://aws.amazon.com/) which hosts your FHIR installation.
5. Sign in as a user who has Kibana dashboard access. If necessary, create a new Cognito user who has access.
387
+
6. From the Kibana dashboard, open the **Dev Tools** menu.
388
+
7. Get index metadata. More details on index API and other REST APIs can be found here: [Index APIs | Elasticsearch Guide [7.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/indices.html).
389
+
```
390
+
GET indexname
391
+
```
392
+
>**Example**
393
+
If you get the `indexname` resource, the response would be the following:
394
+
```
395
+
{
396
+
indexname: {
397
+
// copy everything from here to replicate index,
398
+
// aliases, mappings, etc.
399
+
}
400
+
}
401
+
```
402
+
Other resources could be patient, medicationrequest, etc.
403
+
404
+
8. Update search mappings. For example, to get an exact match on a field, the easiest way would be to change index type to `keyword`.
405
+
String that does not produce exact match:
406
+
```
407
+
...
408
+
"display" : {
409
+
"type" : "text",
410
+
...
411
+
}
412
+
...
413
+
```
414
+
Updated string:
415
+
```
416
+
...
417
+
"display" : {
418
+
"type" : "keyword"
419
+
}
420
+
...
421
+
```
422
+
10. Reindex the data from original index into the new index.
423
+
>**Note**
424
+
This process may take from 5 minutes to several hours depending on the size of the index. To improve the index speed, see [Tune for indexing speed | Elasticsearch Guide [8.6] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-indexing-speed.html).
425
+
```
426
+
POST _reindex
427
+
{
428
+
"source": {
429
+
"index": "indexname"
430
+
},
431
+
"dest": {
432
+
"index": "indexname-copy"
433
+
}
434
+
}
435
+
```
436
+
11. Delete the original index, then clone-rename the copy. Delete copy.
437
+
```
438
+
DELETE /indexname
439
+
440
+
POST /indexname-copy/_clone/indexname
441
+
442
+
DELETE /indexname-copy
443
+
```
444
+
#### Search by field does not work
445
+
Some resources could be missing search by field in the out-of-the-box deployment. To solve this, you can add the missing field(s).
446
+
447
+
1. Open the already cloned repository `https://github.com/awslabs/fhir-works-on-aws-search-es`.
448
+
2. Locate the [`searchMappingsBase.4.0.1.json`](https://github.com/awslabs/fhir-works-on-aws-search-es/blob/mainline/src/schema/searchMappingsBase.4.0.1.json) file.
449
+
3. Find the resource and add the required field(s) with correct type. For a list of field names and types, see the FHIR reference ([Index - FHIR v4.3.0](http://hl7.org/fhir/index.html)). For example, you can add search by billable period date with the type as Period to ExplanationOfBenefits ([HL7.FHIR.US.CARIN-BB\C4BB Explanation Of Benefit - FHIR v4.0.1](https://build.fhir.org/ig/HL7/carin-bb/StructureDefinition-C4BB-ExplanationOfBenefit.html)).
450
+

451
+
```
452
+
...
453
+
"ExplanationOfBenefit": [
454
+
{
455
+
"field": "careTeam.provider",
456
+
"type": "Reference"
457
+
},
458
+
...
459
+
{
460
+
"field": "billablePeriod",
461
+
"type": "Period"
462
+
}
463
+
],
464
+
...
465
+
```
466
+
4. Redeploy the solution.
467
+
>**Note**
468
+
Make sure to link the FHIR deployment repository and modified search-es repository, otherwise changes will not be deployed.
389
469
390
470
## Initial installation (LEGACY)
391
471
@@ -454,7 +534,8 @@ Configure your AWS Credentials:
**Note:** The `-ProfileLocation $HOME\.aws\credentials` is required. The installation script uses the nodejs aws-sdk and it requires credentials to be located on the SharedCredentialsFile
537
+
>**Note**
538
+
The `-ProfileLocation $HOME\.aws\credentials` is required. The installation script uses the nodejs aws-sdk and it requires credentials to be located on the SharedCredentialsFile
0 commit comments