forked from mithun008/FHIRServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FHIR Workshop - Lab Instructions.html
830 lines (551 loc) · 48.6 KB
/
FHIR Workshop - Lab Instructions.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
<!doctype html>
<html><head><title>FHIR Workshop - Lab Instructions</title><meta charset="UTF-8"><link href="http://fonts.googleapis.com/css?family=Crimson+Text:400,400italic,700,700italic|Roboto:400,700,700italic,400italic" rel="stylesheet" type="text/css"><style>/*
* Copyright 2014 Quip
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
body {
font-size: 15px;
color: #333;
background: #fff;
padding: 60px 95px;
max-width: 900px;
margin: 0 auto;
text-rendering: optimizeLegibility;
font-feature-settings: "kern";
font-kerning: normal;
-moz-font-feature-settings: "kern";
-webkit-font-feature-settings: "kern";
}
/* Headings */
h1,
h2,
h3,
th {
font-family: Roboto, sans-serif;
font-weight: 700;
margin: 0;
margin-top: 1.25em;
margin-bottom: 0.75em;
}
h1 {
font-size: 35px;
line-height: 42px;
}
h1:first-child {
margin-top: 0;
}
h2 {
font-size: 18px;
line-height: 22px;
}
h3 {
text-transform: uppercase;
font-size: 13px;
line-height: 16px;
}
/* Body text */
body,
p,
ul,
ol,
td {
font-family: "Crimson Text", serif;
font-size: 16px;
line-height: 20px;
}
blockquote,
q {
display: block;
margin: 1em 0;
font-style: italic;
}
blockquote a,
q a {
text-decoration: underline;
}
blockquote {
padding-left: 10px;
border-left: 4px solid #a6a6a6;
}
q {
color: #a6a6a6;
line-height: 40px;
font-size: 24px;
text-align: center;
quotes: none;
}
q a {
color: #a6a6a6;
}
code,
pre {
font-family: Consolas, "Liberation Mono", Menlo, "Courier Prime Web",
Courier, monospace;
background: #f3f3f3;
}
code {
padding: 1px;
margin: 0 -1px;
border-radius: 3px;
}
pre {
display: block;
line-height: 20px;
text-shadow: 0 1px white;
padding: 5px 5px 5px 30px;
white-space: nowrap;
position: relative;
margin: 1em 0;
}
pre:before {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 15px;
border-left: solid 1px #dadada;
}
/* Lists */
div[data-section-style="5"],
div[data-section-style="6"],
div[data-section-style="7"] {
margin: 12px 0;
}
ul {
padding: 0 0 0 40px;
}
ul li {
margin-bottom: 0.4em;
}
/* Bulleted list */
div[data-section-style="5"] ul {
list-style-type: disc;
}
div[data-section-style="5"] ul ul {
list-style-type: circle;
}
div[data-section-style="5"] ul ul ul {
list-style-type: square;
}
div[data-section-style="5"] ul ul ul ul {
list-style-type: disc;
}
div[data-section-style="5"] ul ul ul ul ul {
list-style-type: circle;
}
div[data-section-style="5"] ul ul ul ul ul ul {
list-style-type: square;
}
/* Numbered list */
div[data-section-style="6"] ul {
list-style-type: decimal;
}
div[data-section-style="6"] ul ul {
list-style-type: lower-alpha;
}
div[data-section-style="6"] ul ul ul {
list-style-type: lower-roman;
}
div[data-section-style="6"] ul ul ul ul {
list-style-type: decimal;
}
div[data-section-style="6"] ul ul ul ul ul {
list-style-type: lower-alpha;
}
div[data-section-style="6"] ul ul ul ul ul ul {
list-style-type: lower-roman;
}
/* Checklist */
div[data-section-style="7"] ul {
list-style-type: none;
}
div[data-section-style="7"] ul li:before {
content: "\2610";
position: absolute;
display: inline;
margin-right: 1.2em;
margin-left: -1.2em;
}
div[data-section-style="7"] ul li.parent:before {
content: "";
}
div[data-section-style="7"] ul li.parent {
font-weight: bold;
}
div[data-section-style="7"] ul li.checked {
text-decoration: line-through;
}
div[data-section-style="7"] ul li.checked:before {
content: "\2611";
text-decoration: none;
}
/* Tables */
div[data-section-style="8"] {
margin: 12px 0;
}
table {
border-spacing: 0;
border-collapse: separate;
border: solid 1px #bbb;
table-layout: fixed;
position: relative;
}
table th,
table td {
padding: 2px 2px 0;
min-width: 1.5em;
word-wrap: break-word;
}
table th {
border-bottom: 1px solid #e1e1e1;
background: #f4f4f4;
font-weight: bold;
vertical-align: bottom;
color: #3a4449;
text-align: center;
}
table td {
padding-top: 0;
border-left: 1px solid #e1e1e1;
border-top: 1px solid #e1e1e1;
vertical-align: top;
}
table td.bold {
font-weight: bold;
}
table td.italic {
font-style: italic;
}
table td.underline {
text-decoration: underline;
}
table td.strikethrough {
text-decoration: line-through;
}
table td.underline.strikethrough {
text-decoration: underline line-through;
}
table td:first-child {
border-left: hidden;
}
table tr:first-child td {
border-top: hidden;
}
/* Images */
div[data-section-style="11"] {
margin-top: 20px;
margin-bottom: 20px;
margin-left: auto;
margin-right: auto;
}
div[data-section-style="11"][data-section-float="0"] {
clear: both;
text-align: center;
}
div[data-section-style="11"][data-section-float="1"] {
float: left;
clear: left;
margin-right: 20px;
}
div[data-section-style="11"][data-section-float="2"] {
float: right;
clear: right;
margin-left: 20px;
}
div[data-section-style="11"] img {
display: block;
max-width: 100%;
height: auto;
margin: auto;
}
hr {
width: 70px;
margin: 20px auto;
}
/* Apps */
div[data-section-style="19"].placeholder {
margin: 0.8em auto;
padding: 4px 0;
display: block;
color: #29b6f2;
text-align: center;
border: 1px solid rgba(41, 182, 242, 0.2);
border-radius: 3px;
background: #e9f8fe;
font-family: Roboto, sans-serif;
}
div[data-section-style="19"].first-party-element {
margin-bottom: 10px;
background-repeat: no-repeat;
background-size: contain;
}
div[data-section-style="19"].first-party-element.kanban {
background-image: url("https://quip-cdn.com/nK0hSyhsb4jrLIL2s5Ma-g");
height: 166px;
}
div[data-section-style="19"].first-party-element.calendar {
background-image: url("https://quip-cdn.com/OYujqLny03RILxcLIiyERg");
height: 244px;
}
div[data-section-style="19"].first-party-element.poll {
background-image: url("https://quip-cdn.com/fbIiFrcKGv__4NB7CBfxoA");
height: 116px;
}
div[data-section-style="19"].first-party-element.countdown {
background-image: url("https://quip-cdn.com/3bPhykD2dBei9sSjCWteTQ");
height: 96px;
}
div[data-section-style="19"].first-party-element.process_bar {
background-image: url("https://quip-cdn.com/ybQlHnHEIIBLog5rZmYs_w");
height: 36px;
}
div[data-section-style="19"].first-party-element.project_tracker {
background-image: url("https://quip-cdn.com/OFQU087b4Mxzz1ZaHwtjXA");
height: 164px;
}
div[data-section-style="19"] img {
margin: 0.5em;
}
div[data-section-style="19"] img.masked-image {
margin: 0;
transform-origin: top left;
}
div[data-section-style="19"] .image-mask {
position: relative;
overflow: hidden;
}
</style></head><body><h1 id='CSb9CAquRCS'>FHIR Workshop - Lab Instructions </h1>
<b>Pre-requisites : </b>The workshop assumes that the participants have some basic understanding of AWS services such as AWS Lambda, IAM, DynamoDB and the Java programming language. The account user should have admin access to create IAM roles.<br/>
<br/>
Note: The workshop uses us-east-1 region for all the services that are deployed as part of the workshop but participants can use any of the US regions of their choice. <br/>
<br/>
<div data-section-style='6'><ul id='CSb9CAErc80'><li id='CSb9CATLazS' class='' value='1'>Log on to the AWS management console and change your region from the top right corner to US East(N. Virgina) or any US region of your choice .
<br/></li><li id='CSb9CA8bE6r' class=''>Click on services and search for cloud9. Cloud9 service is a browser based built-in IDE desktop to write code, run CLI commands or create container images. It has a pre-configured AWS CLI and provides a linux terminal to run commands.
<br/></li><li id='CSb9CA1L4kM' class=''>Create a new environment and call it as FHIRDesktop. <b>Use t2.small type. Leave the other settings as default.</b>
<br/></li></ul></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:410px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/bVk9hAeze87cUjc-LN_lVw?a=3adIVnzaGKCWadhLhy45WqaU8BHN207z7nciOaaDVEwa' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAdLiRo' alt='' width='800' height='409' class='masked-image'></img></div></div><br/>
<h2 id='CSb9CAyblth'>Download source code </h2>
<div data-section-style='6'><ul id='CSb9CArBC6a'><li id='CSb9CAMQtM5' class='' value='1'>Go to the terminal window at the lower pane and checkout the source code from git hub using the following command:
<br/></li><li id='CSb9CAqQIHk' class=''> <code>git clone <a href="https://github.com/mithun008/FHIRServer.git">https://github.com/mithun008/FHIRServer.git</a></code>
<br/></li><li id='CSb9CAlNhHw' class=''>Make sure that required folders are present by navigating through the directory FHIRServer directory. There should be a resources and src folder and also a pom.xml file.
<br/></li></ul></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:393px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/q4qWJ1drv4qLBMGnqAdJ0Q?a=cQU9P9zEw7wL4nEUjFSy0eBGCrtfUocFHYVdYU0Sn40a' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAqmH9v' alt='' width='800' height='392' class='masked-image'></img></div></div><h2 id='CSb9CACYJFT'>Setup the environment</h2>
<div data-section-style='6'><ul id='CSb9CAI8BX8'><li id='CSb9CAfDXsi' class='' value='1'>Locate the terminal window on the lower pane of the screen.
<br/></li><li id='CSb9CAjUE1g' class=''>Change directory to FHIRServer/resources by running <code>cd FHIRServer/resources </code>and look for the file setupEnv.sh
<br/></li><li id='CSb9CAwfNqM' class=''>Change the file to executable by running the following command:
<br/></li></ul></div><code>chmod u+x setupEnv.sh</code><br/>
<div data-section-style='6'><ul id='CSb9CAFxq5F'><li id='CSb9CAtjd7r' class='' value='1'>Run the script by executing following command. <b>Answer y when prompted for permission to download some of the packages.</b>
<br/></li></ul></div>.<code>/setupEnv.sh</code><br/>
The script would upgrade the jdk to 1.8. By default, cloud9 comes with jdk 1.7. It will also set the default jdk as 1.8. It would also install maven required for building the code. A package to beautify json output is also installed.<br/>
<div data-section-style='6'><ul id='CSb9CAqvmj6'><li id='CSb9CAk7yQk' class='' value='1'>Run the following commands to set the JAVA_HOME to jdk 1.8
<br/></li></ul></div><code>echo 'export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk' >> ~/.bashrc</code><br/>
<code>echo 'export PATH=$JAVA_HOME/bin:$PATH' >> ~/.bashrc</code><br/>
<code>source ~/.bashrc</code><br/>
<h2 id='CSb9CAQ5QtK'>S3 Bucket to upload Lambda jar file</h2>
We will create the S3 bucket in this step which will be used later as part of the cloudformation package command. The lambda jar file created in the next steps in uploaded to this S3 bucket.<br/>
<br/>
<div data-section-style='6'><ul id='CSb9CAzLTAK'><li id='CSb9CAkjOPB' class='' value='1'>Run the following command on terminal to create a S3 bucket. You will need to pick a <i><b>unique name</b></i> like fhir-code-bucket-<<user initials>> for the bucket otherwise the command will throw an error.
<br/></li></ul></div><code>aws s3 mb s3://<<REPLACE_BUCKET_NAME>></code><br/>
<br/>
<b>Keep a note of this bucket name as it will be used in the later steps.</b><br/>
<div data-section-style='6'><ul id='CSb9CAoN4hz'><li id='CSb9CAJ52Xz' class='' value='1'>Go back to FHIRServer directory by running <code>cd ..</code>
<br/></li><li id='CSb9CAIUrI4' class=''>Build the source code by running <code>mvn install</code>
<br/></li></ul></div>The above command would download all the required libraries to compile the source and build a single jar file with all the required dependencies. The output jar can be found under target/ directory as FHIRServer-0.0.1-SNAPSHOT.jar file.<br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:231px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/m0akOAQmdhz3EVvENbVHlA?a=bC8KbUGwUtwzB83FpkPItcxmSD9tjeaawwrUaJCpAP0a' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAk7a8e' alt='' width='800' height='231' class='masked-image'></img></div></div>Go to the resources folder and check the file FHIRService-dev-swagger-apigateway.yaml. This file is the SAM(Serverless Application Model) template that will be used to deploy the generated jar as a lambda function along with other resources like DynamoDB table, API gateway resources, Cognito user pool and S3 bucket to store FHIR payloads.The SAM template will template would be transformed into a cloudformation template which can be used to deploy the resources.<br/>
<br/>
<b><i>The AWS Serverless Application Model (AWS SAM) is a model to define serverless applications. AWS SAM is natively supported by AWS CloudFormation and defines simplified syntax for expressing serverless resources. The specification currently covers APIs, Lambda functions and Amazon DynamoDB tables. SAM is available under Apache 2.0 for AWS partners and customers to adopt and extend within their own toolsets. For details on the specification, see the <a href="https://github.com/awslabs/serverless-application-model">AWS Serverless Application Model</a>.</i></b><br/>
<div data-section-style='6'><ul id='CSb9CAm0o4G'><li id='CSb9CAzx3fr' class='' value='1'>Go to <b>resources</b> directory under FHIR server in the terminal window. Run <code>cd resources/</code>
<br/></li><li id='CSb9CAep9AX' class=''>Run the following command to package the SAM template into a cloudformation template. Replace the S3 bucket name with the bucket name that was created in earlier step.
<br/></li></ul></div><code>aws cloudformation package --template-file FHIRService-dev-swagger-apigateway.yaml --output-template-file serverless-output.yaml --s3-bucket <<Replace the S3 bucket name>></code><br/>
<br/>
<b><i>Note : If you face any difficulties in copy pasting the above command, please edit command #1 in commands.txt file under the resources folder and paste it to the terminal window.</i></b><br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:207px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/xYIKRLH2ts8if51HC6eflw?a=cuu6ZcsZqr5EiSF4NGf2jq4anscZn1lTKYkq0Y4RyVka' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAHAFBY' alt='' width='800' height='206' class='masked-image'></img></div></div>The output should look like as shown above in the screenshot. The command uploads the jar file to S3 bucket and generates a cloudformation template file serverless-output.yaml file which will be used to do the actual deployment of resources.<br/>
<br/>
Feel free to open the serverless-output.yaml file in cloud9 IDE to check the contents.<br/>
<br/>
<div data-section-style='6'><ul id='CSb9CAsxsSK'><li id='CSb9CAhODsb' class='' value='1'>Run the following command to deploy the stack using cloudformation. <b>Use your own stack name like FHIRDemoService and use it in the below command.</b>
<br/></li></ul></div><code>aws cloudformation deploy --template-file /home/ec2-user/environment/FHIRServer/resources/serverless-output.yaml --stack-name <<Enter Stack Name>> --capabilities CAPABILITY_IAM</code><br/>
<br/>
<b><i>Note : If you face any difficulties in copy pasting the above command, please edit command #2 in commands.txt file under the resources folder and paste it to the terminal window.</i></b><br/>
<br/>
The command will wait until all the resources are created. Once, the command finished and stack creation is complete, navigate to API gateway and lambda services to check the services that have been deployed by the cloudformation template.<br/>
<br/>
Go to the AWS management console and search for API Gateway service. API Gateway should have the resources deployed as shown below:<br/>
<div data-section-style='19'><div class='image-mask' style='width:780px; height:488px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/pfGiXyddyIYRfKR80St6vg?a=letfLArGnfqsgmaOD3nuziq3Q3lp83I9Ad1qWpbKV8oa' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CArlVA5' alt='' width='780' height='488' class='masked-image'></img></div></div><br/>
<br/>
Go to Lambda service and Lambda deployment should be listed as below:<br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:111px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/FpLzuDTc8KaIYfFI72IgpA?a=stw0daCPw7aadEk6z2sQaHnNhOGeXMFIFitHD9vCsfoa' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CABjIhe' alt='' width='800' height='110' class='masked-image'></img></div></div><h2 id='CSb9CAFjANG'>Capability Statement</h2>
Capability statement for the FHIR server can be accessed without any authorization. It shows the various interactions that will be supported by the FHIR server. <br/>
<div data-section-style='6'><ul id='CSb9CA9msQG'><li id='CSb9CA1gDjo' class='' value='1'>Navigate to API Gateway and click on the <<Your Stack Name>> link and go under Dashboard link on the left side. It should show a link on the right side. Copy the link and save it in a document. It will be referred as the <b>API_END_POINT</b> from here on. Please make a note of it.
<br/></li></ul></div><div data-section-style='11' style='max-width:100%'><img src='https://quip-amazon.com/blob/CSb9AA67P95/Mwz206xq3o566J9fpzebAA?a=gtv4BI58kVnhjXhiObskLA5qpFsNl2ZkADI6vCRJcsga' id='CSb9CAmRjOl' alt='' width='800' height='360'></img></div><div data-section-style='6'><ul id='CSb9CA1Ygqd'><li id='CSb9CAXIDvT' class='' value='1'>Go to the cloud9 terminal window again and run the following command:
<br/></li></ul></div><code>curl -H "Accept: application/fhir+json" <<API_END_POINT>>metadata | jq</code><br/>
<br/>
The output should be similar to as shown below in screenshot:<br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:689px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/hLgXBe-RxdnAkUPoSVZeiA?a=waVK9pluwiBVGTibJxkX7uo9A4fG63shjmadyKbX7vMa' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CA6xp7r' alt='' width='800' height='689' class='masked-image'></img></div></div><h2 id='CSb9CAULgfA'>Cognito Setup</h2>
In this section we will create a user in Cognito user pool and use that for sending an authorized request to API Gateway. Amazon Cognito lets you add user sign-up, sign-in, and access control to your web and mobile apps quickly and easily.Amazon Cognito provides solutions to control access to AWS resources from your app. You can define roles and map users to different roles so your app can access only the resources that are authorized for each user.<br/>
<br/>
<div data-section-style='6'><ul id='CSb9CAR8MWv'><li id='CSb9CAkoIXL' class='' value='1'>Search for cognito in the services search bar on main page.
<br/></li><li id='CSb9CATmu2I' class=''>Click on Manage User Pools and it should show the user pools that have been created so far. There should be an entry for the stack name that was used <b>like</b> FHIRWorkshop.
<br/></li></ul></div><div data-section-style='19'><div class='image-mask' style='width:604px; height:102px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/QbCnoUu_iaQDsiBtIJqT5A?a=PNpaaaNGdxr5pZyKLCvdw8O0I9ay0Kg2MjQCAaikTcka' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CArQKHB' alt='' width='604' height='102' class='masked-image'></img></div></div><div data-section-style='6'><ul id='CSb9CAUwGhc'><li id='CSb9CAOZ2cV' class='' value='1'>Click on the FHIRWorkshop(or the stack name that was used) link from the user pool.
<br/></li><li id='CSb9CAgxUgb' class=''>Go to Users and groups under General settings.
<br/></li></ul></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:190px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/p2BzhfBCwBnS-FZ23NUsww?a=XMb0JT932aIa3tuxfP9C6al3SlXoO8ouPDL1yl6bIKIa' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CADdJpU' alt='' width='800' height='189' class='masked-image'></img></div></div><div data-section-style='6'><ul id='CSb9CA5EID1'><li id='CSb9CAgV0kD' class='' value='1'>Click on create user button to create a new user.
<br/></li><li id='CSb9CAbNleE' class=''>Provide a username which will be used to authenticate against the user pool. Also, provide a temporary password.
<br/></li></ul></div><b>Make sure to uncheck the box for “Send an invitation to this new user?” and also make sure to check the box “Mark email as verified?”</b><br/>
<div data-section-style='19'><div class='image-mask' style='width:630px; height:523px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/DPVCkvdhHzNVuG2sn6WvIQ?a=JXrNDNIxhAOVxdK5zuSa9lPTejkvzEGk7SgczMAuXHoa' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CApPP86' alt='' width='630' height='523' class='masked-image'></img></div></div><br/>
<br/>
<br/>
Click on Create user to submit.<br/>
It should now show as below with status as FORCE_CHANGE_PASSWORD<br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:175px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/4PelzHYv1xYNTdwgfNuPuw?a=36ZKRRCw2cvGngEGaYnkjsrDIlzsdwq2FDOhURxKoh0a' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CA3rUvo' alt='' width='800' height='175' class='masked-image'></img></div></div><div data-section-style='6'><ul id='CSb9CAEsEtN'><li id='CSb9CAz5ORb' class='' value='1'>Go to General settings and note down the Pool id. It will be used as part of a CLI command.
<br/></li></ul></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:74px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/FTEQm4l5W13RdTAXoehqaA?a=qBimfiYkSaaVQaWgADlUje2m2FAcr8vx74I2JcrOCUga' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAkop7a' alt='' width='800' height='74' class='masked-image'></img></div></div><div data-section-style='6'><ul id='CSb9CAZtfng'><li id='CSb9CA4I66Y' class='' value='1'>Click on App client settings under App integration. Note down the ID.
<br/></li></ul></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:143px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/Wm0XXpErEsytIDoCooJWCw?a=9CrN9LuaKam7l10y54j16Fe1yKSEaMMhVHvaAL4S7k8a' style='transform: scale3d(0.698, 0.698, 1); -webkit-transform: scale3d(0.698, 0.698, 1); -ms-transform: scale3d(0.698, 0.698, 1); -moz-transform: scale3d(0.698, 0.698, 1)' id='CSb9CAORNm1' alt='' width='1146' height='204' class='masked-image'></img></div></div>We will now authenticate against the pool that has been created.<br/>
<div data-section-style='6'><ul id='CSb9CA7WPgU'><li id='CSb9CASPTzH' class='' value='1'>Run the following command to authenticate the user from the cloud9 terminal.
<br/></li></ul></div><code>aws cognito-idp admin-initiate-auth --user-pool-id <<user-pool-id>> --client-id <<app-client-id>> --auth-flow ADMIN_NO_SRP_AUTH --auth-parameters 'USERNAME=<<username>>,PASSWORD="<<Temp password>>"'</code><br/>
<br/>
<b><i>Note : If you face any difficulties in copy pasting the above command, please edit command #3 in commands.txt file under the resources folder and paste it to the terminal window.</i></b><br/>
<br/>
The output for the command should show as below:<br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:86px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/MCFekly0BgVyqrNv4LHEpw?a=ZAiFApMtzzwnTGtwwqC3ZGZPzBpESxCCHCVqbffsq68a' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAU3Y9q' alt='' width='800' height='85' class='masked-image'></img></div></div><div data-section-style='6'><ul id='CSb9CA9p6Xb'><li id='CSb9CAvHBS8' class='' value='1'>Note down the value shown for the session tag.
<br/></li><li id='CSb9CAEwUq2' class=''>Run the following command to respond to the auth challenge with a new password.
<br/></li></ul></div><code>aws cognito-idp admin-respond-to-auth-challenge --user-pool-id <<user-pool-id>> --client-id <<app-client-id>> --challenge-name NEW_PASSWORD_REQUIRED --challenge-response 'USERNAME=<<userid>>,NEW_PASSWORD=<<new password>>' --session '<<session tag value>>'</code><br/>
<br/>
<b><i>Note : If you face any difficulties in copy pasting the above command, please edit command #4 in commands.txt file under the resources folder and paste it to the terminal window.</i></b><br/>
<br/>
The output should show as below:<br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:184px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/iLVYObtPG1w-IJJE5XckVQ?a=ij9hUGaxC91trXEkI7UCnMZyoZa1S5Lt3314Lo9Ty00a' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CA2xFjQ' alt='' width='800' height='183' class='masked-image'></img></div></div>Note down the value in the <b>IDToken</b> tag. The value is a JWT token and can be debugged at <a href="http://jwt.io">jwt.io</a><br/>
The value will be used as part of the requests that are sent to API gateway for the RESTful services that have been deployed.<br/>
<br/>
We are now ready to send requests to our FHIR server.<br/>
<br/>
Lets test a GET patient request first to make sure there is no data loaded.<br/>
<div data-section-style='6'><ul id='CSb9CAhPVcm'><li id='CSb9CAAP9Jt' class='' value='1'>Go to the cloud9 terminal window again and run the following command:
<br/></li></ul></div><code>curl -H "Accept: application/fhir+json" -H "Authorization:<<ID Token>>" <<API_END_POINT>>Patient | jq</code><br/>
The output should show as below:<br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:197px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/rLdKjnpxOpoOBewfTCSjfA?a=SIOe70UN31sC2oiSUMmN4kdXd4YyLzttYJX5d96uasYa' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAq15Qr' alt='' width='800' height='196' class='masked-image'></img></div></div>The following text should be shown as part of the output.<br/>
<br/>
<code>{"resourceType":"Bundle","id":"e4679c49-37af-4478-91d8-4741a293a975","type":"searchset","total":0,"link":[{"relation":"self"}]}</code><br/>
<br/>
It shows that the bundle of resources has no patient resources. We will load patient resources along with resources in the next step.<br/>
<h2 id='CSb9CAZMaI9'>Load test data</h2>
We will now add some test data so that it can be used by a web app in the next part of the workshop.<br/>
<div data-section-style='6'><ul id='CSb9CAkMl6C'><li id='CSb9CAu6AYA' class='' value='1'>Go back to cloud9 terminal and go to resources folder. It has a script called post-test-data.sh. It will send FHIR requests to the server and POST Bundle resource which has a Patient resource as well as several others like Observations, Encounters,Claims. The test data is located under the test-data folder.
<br/></li></ul></div><code>cd FHIRServer/resources/</code><br/>
<div data-section-style='6'><ul id='CSb9CAEu424'><li id='CSb9CAYFkaH' class='' value='1'>Open the post-test-data.sh file and replace the Authorization tag value with the IDtoken value.
<br/></li><li id='CSb9CAwcfaP' class=''>Replace the <<API_END_POINT>> value. <b>Save the file.</b>
<br/></li><li id='CSb9CAKcNmU' class=''>Go to the terminal window and change the file mode to executable by running <code>chmod u+x post-test-data.sh</code>
<br/></li><li id='CSb9CAzX1LK' class=''>Run the script by <code>./post-test-data.sh</code>. Output should look like below.
<br/></li></ul></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:125px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/O2Nqv3nmRpBV_KfM5jf-iA?a=dabUuEP1ZIP4T4EybWak47lswA49oYJlUdPHovPorZQa' style='transform: scale3d(0.698, 0.698, 1); -webkit-transform: scale3d(0.698, 0.698, 1); -ms-transform: scale3d(0.698, 0.698, 1); -moz-transform: scale3d(0.698, 0.698, 1)' id='CSb9CAvJeHf' alt='' width='1146' height='178' class='masked-image'></img></div></div><div data-section-style='6'><ul id='CSb9CAtfcmO'><li id='CSb9CA7JapE' class='' value='1'>Validate that the patients are loaded by hitting the same request which we did before loading the test data. It should now show the data loaded.
<br/></li></ul></div><br/>
<br/>
<br/>
<br/>
<h1 id='CSb9CAa3qHO'>Lab 2 : Create a Node.js application to consume FHIR messages on AWS.</h1>
<br/>
<h2 id='CSb9CAyuEK2'><b><u><b>Overview</b></u></b></h2>
<br/>
In this lab we will create a NODE.JS application which will display a list of patients and their observations which is retrieved from the FHIR endpoints created in LAB 1. <br/>
<br/>
<b><u><b><b> </b></b></u></b><br/>
<b><u><b>Steps</b></u></b><br/>
<b><u><b><b> </b></b></u></b><br/>
<b><u><b>REGION FOR LABS: US-EAST-1 : Northern Virginia</b></u></b><br/>
<b><u><b><b> </b></b></u></b><br/>
<br/>
<br/>
<b><u><b>SETUP IAM</b></u></b><br/>
<br/>
<div data-section-style='5'><ul id='CSb9CAeDkzR'><ul><li id='CSb9CAuBflq' class='' value='1'>Navigate to AWS - > IAM.
<br/></li><li id='CSb9CAoyqIT' class=''> Create a new user <b>CodeCommit.</b>
<br/></li><li id='CSb9CA8ZOjB' class='parent'><b><b><b> </b></b></b>Attach policy directly to the user. Attach the policies shown in the screenshots below. Don't attach user to a group instead click on “<b>Attach policies directly to the user”</b>. Attach the following policies. <i>Search the name of policies in the search box.</i>
<br/></li><ul><li id='CSb9CAafOBu' class=''>AWSCodeCommitFullAccess
<br/></li><li id='CSb9CAAUPCB' class=''>AWSCloud9Administrator
<br/></li><li id='CSb9CAZ8Ok5' class=''>AWSCloud9EnvironmentMember
<br/></li></ul><li id='CSb9CAO3icH' class=''>Only select “AWS Management Console access” and uncheck “<b>User must create a new password at next sign-in</b>”
<br/></li></ul></ul></div><b><b> </b></b><br/>
<b><b> </b></b><br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:557px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/FqHcfK39vOluBFvusHqj3g?a=1uKU5ki4YP3bxeONCeCSUThExaYLZCdcpPaibUDmtbwa' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAkVBvL' alt='' width='800' height='557' class='masked-image'></img></div></div><br/>
<div data-section-style='11' style='max-width:100%'><img src='https://quip-amazon.com/blob/CSb9AA67P95/eimTOgR_5b1q65GkxbrrFg?a=Uut7auagAVIHYsmM1FXNTLXUw3GC5ANUmLfrr6vakU8a' id='CSb9CAtmgSn' alt='' width='800' height='205'></img></div><div data-section-style='5'><ul id='CSb9CAlMgRR'><ul><li id='CSb9CAPcg8G' class='' value='1'>Create user.
<br/></li><li id='CSb9CAANIYb' class=''>Once the user is created , navigate to the “security credentials” tab which shows when you click on the username.
<br/></li><li id='CSb9CAYG1Up' class=''>Within the security credentials tab , locate the <b>HTTPS Git credentials for AWS CodeCommit.</b>
<br/></li><li id='CSb9CAPlkC2' class=''>Click on the “Generate”.
<br/></li><li id='CSb9CAkFFkj' class=''>In the dialog box download the credentials. These credentials are used for the repo created in CodeCommit.
<br/></li></ul></ul></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:185px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/-p_Q-k-y5jxesn-ydady2Q?a=iPP4QwkpmWX4iCwCETnD5R1HNaweJTWGUsQI7cV4tI4a' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAlHeDO' alt='' width='800' height='184' class='masked-image'></img></div></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:354px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/Qv95a9q-6Gfxpy1Xi9pTaQ?a=mzLamh5ScnLQ8TTAHPHDstv9Y3CY6aQ6rI9mriesazMa' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAiFbLT' alt='' width='800' height='353' class='masked-image'></img></div></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:415px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/meRwhyqVsT-3uqPUG3UUyg?a=H08XIh5Wz6ijz5ImYijDNJwi1uHAvbzS8MB2AkvP9xoa' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CA7c0HJ' alt='' width='800' height='415' class='masked-image'></img></div></div><br/>
<br/>
<b><u><b>Setup Source Control</b></u></b><br/>
<br/>
<div data-section-style='5'><ul id='CSb9CAbUe1O'><ul><li id='CSb9CAepCrs' class='' value='1'>Navigate to AWS Console->Code Commit.
<br/></li></ul></ul></div> <br/>
<div data-section-style='5'><ul id='CSb9CAYkNm0'><ul><li id='CSb9CAbNQAt' class='' value='1'>Create a new repository called “FHIRDashboard”.
<br/></li></ul></ul></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:573px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/XczMfnyUqsdkQn148yqmlQ?a=CMAXBZkE0zsZQERmmSOc60rdajWKavLaFDVDtiUVsu4a' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAxVWnW' alt='' width='800' height='572' class='masked-image'></img></div></div><div data-section-style='5'><ul id='CSb9CAngons'><ul><li id='CSb9CAjy95o' class='' value='1'>Copy the CLONE URL HTTPS. It will looking something like <a href="https://git-codecommit.us-east-2.amazonaws.com/v1/repos/FHIRDashboard"><b><i><b><i>https://git-codecommit.us-east-2.amazonaws.com/v1/repos/FHIRDashboard</i></b></i></b></a><b><i><b><i>.</i></b></i></b>
<br/></li></ul></ul></div> <br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:135px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/jdmRSAab5gL0z5k1Votd5g?a=xMNSKfhhTVUYairWFEvaBfiBTI7ad0a3MtaVb75pA3ga' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAFa9eZ' alt='' width='800' height='135' class='masked-image'></img></div></div><div data-section-style='5'><ul id='CSb9CAiKpQ7'><ul><li id='CSb9CAMZUJc' class='parent' value='1'>Navigate to AWS->AWS Cloud9 and create a new environment and name it ‘Terminal”. Change the following configurations
<br/></li><ul><li id='CSb9CAFPzoG' class=''><b>Environment Type: EC2.</b>
<br/></li><li id='CSb9CAQc2n5' class=''><b>Instance Type: m4.large.</b>
<br/></li><li id='CSb9CAFkdc0' class=''><b>Cost setting: 4 hours.</b>
<br/></li></ul></ul></ul></div> <br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:574px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/BjFwHw00MgdIqrl0gGEGhA?a=bHrtz1Ik2qWNaGXCgZN1Q1l1TnTd74DGTkEaIJU4Ee0a' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAr5zYf' alt='' width='800' height='574' class='masked-image'></img></div></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:586px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/XJHLQQuoDTsJyThTHX6HDg?a=Fzen6lBmi9RxpOXGivyMkagKUSspEzzipLEsHGcJUiYa' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAazyze' alt='' width='800' height='586' class='masked-image'></img></div></div><div data-section-style='5'><ul id='CSb9CAac4Uc'><ul><li id='CSb9CAOXLB6' class='' value='1'>Once the environment is running , locate the terminal windows in a bash tab.
<br/></li></ul></ul></div><p id='CSb9CAd69gG'>Create a folder called <b><i>File</i></b>(and <b><i>cd File</i></b>). Execute the following wget command from the terminal.</p>
<code>$ </code><code>w</code><i><code>get <a href="https://s3-us-west-2.amazonaws.com/fhir-workshop-mithumal/FHIRDashboard.zip">https://s3-us-west-2.amazonaws.com/fhir-workshop-mithumal/FHIRDashboard.zip</a></code></i><br/>
<br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:458px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/Yhb7P2beF46fxbKWYBvkPw?a=ZOjQCN9dijGEvba8nJktx2qhat3M2IfaOauRFVlfI5ca' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAvPqxL' alt='' width='800' height='458' class='masked-image'></img></div></div><div data-section-style='6'><ul id='CSb9CAGHOmX'><ul><li id='CSb9CAc3Oqe' class='' value='1'>Unzip the contents of the zip file . <code><b><i>unzip FHIRDashboard.zip </i></b></code>
<br/></li><li id='CSb9CAv8byi' class=''>Navigate to the folder FHIRDashboard-master. <b><i>cd</i></b> <b><i>FHIRDashboard </i></b>
<br/></li><li id='CSb9CA5SMFc' class=''>Type the following commands in AWS Cloud9 terminal window.
<br/></li></ul></ul></div><code>git init</code><br/>
<code>git add .</code><br/>
<code>git commit -m 'Initial Commit'</code><br/>
<br/>
<code>git push <CLONED_URL> --all</code><br/>
<br/>
<u><b> When prompted use the username and password from the “Git Credentials” created in the previous section.</b></u><br/>
<br/>
<i><i>You just setup a code commit repository using AWS Cloud9 and AWS CodeCommit. Go back to the AWS CodeCommit and locate the FHIRDashboard repo to view the files which are just checked in.</i></i><br/>
<i><i> </i></i><br/>
<b><u><b>NODE.JS Application</b></u></b><br/>
<div data-section-style='5'><ul id='CSb9CAJwkzb'><ul><li id='CSb9CAIT2Df' class='' value='1'><b><i><b><i>cd FHIRDashboard/</i></b></i></b>
<br/></li><li id='CSb9CAtrJcD' class=''>Locate the AuthCognito.js located in the public/js folder and change the username and passwords with your username and password<i><b>(Amazon Cognito user which is created in Lab 1) </b></i>as marked in the screenshot below. <b>WARNING: <i>Please note that we don't recommend and suggest to have passwords hardcoded in the code file. It is only to support the token generation in this lab. In a real world application use SSO or a challenge to pass the password to Amazon Cognito to get the token.</i></b>
<br/></li><li id='CSb9CAHfT59' class=''>Also change the POOL AND CLIENT ID that you got from LAB1
<br/></li><li id='CSb9CAmr7rS' class=''>
<br/></li></ul></ul></div><div data-section-style='11' style='max-width:100%'><img src='https://quip-amazon.com/blob/CSb9AA67P95/l_kY19sYAaP6IaQx3eoTnQ?a=oajI3WaH3aKlFw9cPIUSvFEjwuao7NPIQXCNGZ2lXVca' id='CSb9CAyDTEm' alt='' width='800' height='242'></img></div><div data-section-style='11' style='max-width:100%'><img src='https://quip-amazon.com/blob/CSb9AA67P95/GDRjvtNyc70wCyUrWfT6ig?a=lhbAahi1WGDlN4AZwyatzaknnXiPTZ4PaxiUaKcgcaAa' id='CSb9CAfRbvO' alt='' width='800' height='277'></img></div><div data-section-style='5'><ul id='CSb9CAGPfZk'><ul><li id='CSb9CAVov1u' class='' value='1'>Locate file FHIRPatientRouter.js located in the router folder and change the url and server within <i><b>options</b></i> with the FHIRServer URL created in LAB 1.
<br/></li></ul></ul></div><div data-section-style='11' style='max-width:100%'><img src='https://quip-amazon.com/blob/CSb9AA67P95/e7AHAx6etGHrMtNyjoa-Og?a=omiIMvarBNTlZMmwvH1mLpkXv7knYIdYN7muS2CXB8sa' id='CSb9CAdDap5' alt='' width='800' height='286'></img></div><div data-section-style='5'><ul id='CSb9CAEaE54'><ul><li id='CSb9CAvDWWe' class='' value='1'>Locate file Observation.js located in the router folder and change the url and server within <i><b>options</b></i> with the FHIRServer URL created in LAB 1.
<br/></li></ul></ul></div><div data-section-style='11' style='max-width:100%'><img src='https://quip-amazon.com/blob/CSb9AA67P95/QGkVFnKo5xFh8rD4tJzeFg?a=qR8Puc60dHzXKtDuJNMPXaIaLOkSGR3J9c5NJFLEMcYa' id='CSb9CA0sxS4' alt='' width='800' height='300'></img></div><div data-section-style='5'><ul id='CSb9CAJFDw2'><ul><li id='CSb9CAgCUTt' class='' value='1'>In the terminal window ( bash-ipaddress) type <b><i>npm start</i></b>. If successful, the window should show NODE.JS server running with node ./bin/www status in the terminal window.
<br/></li></ul></ul></div><div data-section-style='11' style='max-width:100%'><img src='https://quip-amazon.com/blob/CSb9AA67P95/V14meNYbJ1h-oKZpD8vavw?a=waoE9bu6onJ5pWFCB6TWNelZjT4bvnTE6lrIM0st7EIa' id='CSb9CAkZyIr' alt='' width='800' height='163'></img></div><div data-section-style='5'><ul id='CSb9CA8YUoc'><ul><li id='CSb9CAgsFxm' class='' value='1'> Click on preview application(Preview->Preview Application) and look for a browser window.
<br/></li></ul></ul></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:398px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/p4NWqyxR8tRz--Q7x9B-Uw?a=UCPWrkgZjtuzrYtNN0qoILQA0avt9CxUDUd5XF0kSj0a' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CA7H7dQ' alt='' width='800' height='398' class='masked-image'></img></div></div> <br/>
<div data-section-style='5'><ul id='CSb9CA6bfxA'><ul><li id='CSb9CAIje7U' class='' value='1'>In the AWS Cloud9 browser window , open the pop browser tab.
<br/></li></ul></ul></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:397px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/-ItyPmgeo54Ssgt9XQdRgw?a=5ZVY8uWJKZ0xauEzdZ8aHy9eJamftkwqYryUzK5KgDka' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAYeKC6' alt='' width='800' height='396' class='masked-image'></img></div></div> <br/>
<div data-section-style='5'><ul id='CSb9CAllur6'><ul><li id='CSb9CAeXp94' class='' value='1'>The application loads with a list of patients. When click a resource.id the observations gets displayed.
<br/></li><li id='CSb9CAi80yY' class=''>After your browse the application , hit <b>CTRL + C</b> to stop the NODE.JS application
<br/></li></ul></ul></div><div data-section-style='5'><ul id='CSb9CAtgxon'><ul><li id='CSb9CAoU14C' class='' value='1'> Go to the Terminal window ( bash-ipaddress).
<br/></li></ul></ul></div> <br/>
<div data-section-style='5'><ul id='CSb9CA3Y3na'><ul><ul><li id='CSb9CA8eL0v' class='' value='1'>Type <code><b>git</b> <b>add routes/Observation.js</b></code>
<br/></li><li id='CSb9CA7Iz5l' class=''>Type <b><code>git add public/js/AuthCognito.js ( WARNING: NEVER INCLUDE USERNAME/PASSWORD IN CODE. THIS IS ONLY FOR DEMO PURPOSES)</code></b>
<br/></li><li id='CSb9CADokXd' class=''>Type <code><b>git</b> <b>add routes/FHIRPatientRouter.js</b></code>
<br/></li><li id='CSb9CADoXGr' class=''>Type <b><code>git commit -m “changes checked in for routers"</code></b>
<br/></li><li id='CSb9CASxE89' class=''>Type <b><code>git push </code><i> Enter the username and password captured in Step 19.</i></b>
<br/></li></ul></ul></ul></div> <br/>
<i><i>You have just modified , launched , and updated the repo for the NODE.JS application which is a consumer application for FHIR server.</i></i><br/>
<h2 id='CSb9CAXtTsg'> DELETE THE RESOURCES</h2>
<div data-section-style='5'><ul id='CSb9CAo3upU'><ul><ul><li id='CSb9CALZWKY' class='' value='1'>Navigate to the Amazon S3 and delete the bucket created.<u><b> “fhirworkshop-<username>”</b></u>
<br/></li><li id='CSb9CATaRzJ' class='parent'>Navigate to the terminal window in the “Terminal” AWS cloud9 instance and type the following command to delete the code commit repository
<br/></li><ul><li id='CSb9CADMxKU' class=''><code>aws codecommit delete-repository —repository-name FHIRDashboard</code>
<br/></li></ul><li id='CSb9CAikGVM' class=''>
<br/></li><li id='CSb9CAV0AP1' class=''>Delete the IAM user. Navigate to the IAM from AWS Console and select “CodeCommit” user and delete.
<br/></li></ul></ul></ul></div><div data-section-style='19'><div class='image-mask' style='width:800px; height:207px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/nz9dhHI-_vI0v_oKmEQJBQ?a=cB1N9wTImvI4am0P6Wd9rvxZlosp3gBBx6basG1j7qEa' style='transform: scale3d(1.000, 1.000, 1); -webkit-transform: scale3d(1.000, 1.000, 1); -ms-transform: scale3d(1.000, 1.000, 1); -moz-transform: scale3d(1.000, 1.000, 1)' id='CSb9CAgQpxI' alt='' width='800' height='206' class='masked-image'></img></div></div><br/>
<div data-section-style='19'><div class='image-mask' style='width:800px; height:0px; border-radius: 0.000px'><img src='https://quip-amazon.com/blob/CSb9AA67P95/9Bj0zaPiJiVKxgnaJ3jaQA?a=axiPFVxU0iWBMuDsAswE6sFZxBoSr4gnLXpxxZEAStQa' style='transform: scale3d(0.227, 0.227, 1); -webkit-transform: scale3d(0.227, 0.227, 1); -ms-transform: scale3d(0.227, 0.227, 1); -moz-transform: scale3d(0.227, 0.227, 1)' id='CSb9CAXoYoi' alt='' width='800' height='421' class='masked-image'></img></div></div><div data-section-style='5'><ul id='CSb9CATY7OF'><ul><ul><li id='CSb9CAAPwcA' class='' value='1'>Navigate to the AWS Cloud9 console and delete both the environments. <u><b> “Terminal”</b></u>
<br/></li><li id='CSb9CABekyH' class=''>Navigate to CloudFormation. Select the stack that you just created in part 1 of the lab and click Delete Stack from the Actions link.
<br/></li><li id='CSb9CAG3Ryk' class=''>Navigate to S3 and look for a bucket by the name starting with your stack name and delete that. Also, look for the bucket that you created for uploading source code in part 1 of the lab and delete that.
<br/></li><li id='CSb9CAQmpPW' class=''>Go to AWS Cloud9 and delete the environment created as part of lab 1.
<br/></li></ul></ul></ul></div> <br/>
<br/>
<br/>
<br/>
<br/>
</body></html>