-
Notifications
You must be signed in to change notification settings - Fork 24
/
apiary.apib
13381 lines (10743 loc) · 759 KB
/
apiary.apib
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
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
FORMAT: 1A
HOST: https://api.ehealth.gov.ua
# GENERAL MIS API
**Version: 9.8.8 v.3**
This is a **MIS-related consumers part** of API documentation for Ukrainian Health Services government institution back-end, that should provide:
* Master Patients Index (MPI)
* Global Medical Institutions and Doctors Registries
* Partnership Relation Management (PRM) module that describes business relations between this 3 entities.
This API design in based on [Nebo #15 API Design Manifest](https://docs.apimanifest.apiary.io/).
## Context Switching for end-users
Since Doctor may have multiple work-places, you MUST fetch list of possible work-contexts and apply `legal_entity_id` filter on each request, where this parameter is available.
Thus you will make sure that end-user understand from which context entities are managed.
If our API returns only one work context, you are free to hide context picker.
# Group Public. Medical Service Provider Integration Layer
the below table reflects actual API endpoints for all the ehealth environments
Env | Host
--------|-----
DEMO | https://api-demo.ehealth.gov.ua
PREPROD | https://api-preprod.ehealth.gov.ua
PROD | https://api.ehealth.gov.ua
##oAuth [/api/oauth]
1. Client UI: redirects user to Login UI with `client_id`, `redirect_uri` and `response_type=code` query params;
2. Login UI: completes [Session]() auth flow with `apps:create` scope;
3. Login UI: renders page with Approval (which lists requested scopes);
4. User: approves scopes;
5. Login UI: sends `POST /apps` request and redirects user to location returned in `Location` header;
6. Client: exchanges `code` from query parameters to an `access_token` by sending `POST /tokens` request with `grant_type=authorization_code`.
7. Client Back-End: stores `refresh_token` (in back-end!) and sends `access_token` to Client UI;
8. Client UI: stores `access_token` (in local storage, cookie, etc.) and makes all future requests with `Auhtorization: Bearer <access_token>` header.
**Notes:**
- If User already has approval with insufficient scopes, all steps are required, but Login UI MAY render page that shows only newly added scopes.
- When `access_token` expires, Client repeats steps 6-8 but via `grant_type=refresh_token`.
**API-key:**
- For identifiers MIS clients (as a brocker) we use term API-key. MIS must be **mandatory** send API-key when called e-Health API.
- API-key its a `mis_client_secret` - Medical Information System secret key issued upon integration request.
- API-key dispatched in Request HEADER as a `API-key` attribute.
- If MIS don't send API-key in Request HEADER, API return 401 error wih message "API-KEY header required".
**X-Custom-PSK:**
- For identifiers of MIS clients we use header X-Custom-PSK.
- We use X-Custom-PSK header for check hosting provider. If X-Custom-PSK is correct we get access to `kong` MIS routes.
- Each MIS must mandatory send X-Custom-PSK when called any eHealth API.
Example:
```
HEADERS
Content-Type: application/json
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
API-key: uXhEczJ56adsfh3Ri9SUkc4en
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
```
**Sequence Diagram**
![oAuth Sequence](https://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgb0F1dGggRmxvdwoKQ2xpZW50IC0-IExvZ2luIFVJOiByZWRpcmVjdCB0bwANCSB3aXRoIGBjACoFX2lkYCwgYAAgCF91cmlgIGFuZCBgcmVzcG9uc2VfdHlwZT1jb2RlYCBxdWVyeSBwYXJhbXMKAEcJAGUNY29tcGxldGUgU2Vzc2lvbiBhdXRoIGZsb3cAJA1Vc2VyOiByZW5kZXIgcGFnZQCBEAZBcHByb3ZhbCAod2hpY2ggbGlzdHMgcmVxdWVzdGVkIHNjb3BlcykKVXNlcgCBXA5hADUFZQAbBwCBEA0Agh8FU2VydmVyOiBzZW5kIGBQT1NUIC9hcHBzYABWCAoAHAsAgjcOSFRUUCAyMDEsAIEVCmFuZCBMb2NhdGlvbiBoZWFkZXIAggMNAIMGBgCCdQt1c2VyIHRvIHVybCByZXR1cm5lZCBpbiBgAD4IYAA_CACDPQoAgSYSAIExBnRva2Vucz9ncmFudACDGAZhdXRob3JpegCBCwVfY29kZSAtIGV4Y2hhbmdlIGAAgzcGZnJvbQCDNgxldGVycyB0byBhbiBgYWNjZXNzXwBWBWAAgXsQAIIzDnRvcmUgcmVmcmVzaCAAgQcFAIIrEACBdggAJQZgACUHAFYHIChpbiBiYWNrLWVuZCEpAIRoBQCDDwYAdw0gdG8Agj8HIFVJCm5vdGUgb3ZlcgBMEAAmDihpbiBsb2NhbACBIQVhZ2UsIGNvb2tpZSwgZXRjLgBnBm1ha2VzIGFsbCBmdXR1AIFHBQCEWgVzAIYSB0F1aHQAgkQJOiBCZWFyZXIgPACCFgw-AIMlCQo&s=modern-blue)
### Login [GET /sign-in{?client_id,redirect_uri,scope,email,user_data,state}]
**Attention!**
Use following HOSTs for oAuth 2.0 Authentication
Env | Host
--------|-----
DEMO | https://api-demo.ehealth.gov.ua
PREPROD | https://api-preprod.ehealth.gov.ua
PROD | https://api.ehealth.gov.ua
You MUST redirect your users to this URL to obtain oAuth Code Grant (which is later exchanged to Access Token).
User will see rendered login page, which structure differ by a list of requested scopes and security measures applied by DevOps team.
For security purposes, we will set `X-Frame-Options: deny` header that will disallow opening this page in an iframe.
+ Parameters
+ `client_id`: `6498d88e-97fb-47e2-85a5-99e884f888aa` (string, required) - Medical Service provider ID issued after legal_entity registration. Used to identify the context of the MSP/Pharmacy.
+ `redirect_uri`: https://example.com/ (string, required) - URL where user will be redirected after authentification. This url will receive `code` and `state` parameters in query string.
+ scope: `capitation_contracts:view capitation_contracts:create patients:view patients:create` (string, required) - List of scopes that is required in application business logic, separated by space. Different login forms will be shown based on scopes that you requested.
+ email: [email protected]
+ `user_data`: `base64_string` - Auth request signed on client side
+ state: `eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9` (string, optional) - Randomly generated, opaque, and non-guessable string generated by client that will be transferred to client with grant code
+ Response 200 (text/html; charset=UTF-8)
+ Headers
### Logout [POST /auth/logout]
This endpoint is used to terminate users authenticated session based on a valid access token.
Refresh token from authenticated session will also be expired.
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Response 200 (application/json)
+ Attributes (`Response_OK`)
### Get Nonce [GET /oauth/nonce]
This WS allows to get nonce (one time JWT) for active client of the system.
Field `client_secret` must be passed if client type = TRUSTED_PIS.
Nonce payload example:
```
{
"aud": "mithril-login",
"exp": 1523439201,
"iat": 1523438301,
"iss": "EHealth",
"jti": "efe1f08e-d4b4-4cef-a02c-78ea4a1dda25",
"nbf": 1523438300,
"nonce": 123,
"sub": 123,
"typ": "access"
}
```
+ Request (application/json)
+ Headers
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ `client_id`: `30074b6e-fbab-4dc1-9d37-88c21dab1847` (string, required)
+ `client_secret`: `c2778f3064753ea70de870a53795f5c9` (string, optional)
+ Response 200 (application/json)
+ Attributes (`Response_OK`)
+ data (object)
+ token: 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJtaXRocmlsLWxvZ2luIiwiZXhwIjoxNTIzNDM5MjAxLCJpYXQiOjE1MjM0MzgzMDEsImlzcyI6IkVIZWFsdGgiLCJqdGkiOiJlZmUxZjA4ZS1kNGI0LTRjZWYtYTAyYy03OGVhNGExZGRhMjUiLCJuYmYiOjE1MjM0MzgzMDAsIm5vbmNlIjoxMjMsInN1YiI6MTIzLCJ0eXAiOiJhY2Nlc3MifQ.UZ6S92h3nAG-GKY_XUE1Rc6uR_BuqR8ufUJfMhhKtNmt7DkkQlU49qPXjL0LFddVz1E2DXi2a-BQ0FG-DHsTHA' (string, required)
### Authorize an Approval [POST /oauth/apps/authorize]
This endpoint should be reachable only by the eHealth authorization front-end application.
It will update or create Approval. It's idempotent.
After creating Approval user should be redirected to `redirect_url` with `code` query parameter.
+ Request (application/json)
+ Headers
Authorization: Bearer 432fsdfg543252345tfgdsgdft2345 - access_token with the `app:authorize` scope
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes
+ app (required)
+ client_id: `client-1380df72-275a-11e7-93ae-92361f002671` (string, required) - ID of client that is granted with access to user's resources.
+ scope: `notebooks:read notebooks:create patients:read` (string, required) - List of scopes that are granted to the client on the user's behalf.
+ `redirect_uri`: `http://example.com/my_success_login_page` (string, required) - URL of client where user will be redirected on Approval creation.
+ Response 201 (application/json)
+ Headers
Location: http://example.com/my_success_login_page?code=authorization_code-cTdHUE9jN29yWHo0VTAwL3lwSVRoUT09
+ Attributes (`Response_OK`)
+ meta (`Response__Meta`)
+ code: 201 (number)
+ data (`Approval_Response_v2`)
+ urgent
+ `redirect_uri`: `http://example.com/my_success_login_page?code=authorization_code-cTdHUE9jN29yWHo0VTAwL3lwSVRoUT09`
+ Response 200 (application/json)
+ Headers
Location: http://example.com/my_success_login_page?code=authorization_code-cTdHUE9jN29yWHo0VTAwL3lwSVRoUT09
+ Attributes (`Response_OK`)
+ data (`Approval_Response`)
### Exchange oAuth Code Grant to Access Token [POST /oauth/tokens]
After obtaining oAuth Code Grant, it should be exchanged to an `access_token` **on your back-end**.
General recommendations:
- Never expose `client_secret` to your front-end.
- Also we recommend to avoid pushing it to the application source code, to limit number of developers that have access to it.
Exposed client credentials may be blocked for a security reasons, you will need to contact administrator to receive a new credentials.
+ Request (application/json)
+ Headers
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ token (object)
+ `client_id`: `6498d88e-97fb-47e2-85a5-99e884f888aa` (string, required) - Medical Service provider ID issued after legal_entity registration. Used to identify the context of the MSP/Pharmacy.
+ client_secret: `msp-001-secret-key` (string, required) - Medical Information System secret key issued upon integration request. Used to identify application developer.
+ code: 299383828 (string, required) - oAuth code grant.
+ `grant_type`: authorization_code (string, fixed, required) - oAuth Grant Type. Currently only `authorization_code` is supported.
+ redirect_uri: https://example.com/ (string, required) - URL where user will be redirected after authentification. This url will receive `code` and `state` parameters in query string.
+ scope: `capitation_contracts:view capitation_contracts:create patients:view patients:create` (string, required) - List of scopes that is required in application business logic, separated by space. Different login forms will be shown based on scopes that you requested.
+ Response 201 (application/json)
+ Attributes (`Response_OK`)
+ meta (Response__Meta)
+ code: 201 (number)
+ data (`Access_Token`)
### Use Refresh Token for Access Token extension [POST /oauth/tokens]
Currently `access_token` and `refresh_token` are configured to have same lifetime, so we don't expect you to refresh it.
In future, you will be able to refresh access tokens to extend `access_token` lifetime.
+ Request (application/json)
+ Headers
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ token (object)
+ `client_id`: `6498d88e-97fb-47e2-85a5-99e884f888aa` (string, required) - Medical Service provider ID issued after legal_entity registration. Used to identify the context of the MSP/Pharmacy.
+ client_secret: `msp-001-secret-key` (string, required) - Medical Service provider secret key issued upon integration request. Used to identify MSP.
+ refresh_token: `my-oauth-refresh-token` (string, required) - oAuth refresh token.
+ `grant_type`: refresh_token (string, fixed) - oAuth Grant Type. Currently only `authorization_code` is supported.
+ Response 201 (application/json)
+ Attributes (`Response_OK`)
+ meta (Response__Meta)
+ code: 201 (number)
+ data (`Access_Token_1`)
## Dictionaries [/api/dictionaries]
Methods is used to retreive eHealth dictionaries
Response **$.data** object contains a list of all dictionaries.
### Get dictionaries [GET]
Each dictionary is an object that contains *{key}*:*{value}* pairs where:
* ***{key}*** is a dictionary record
* ***{value}*** is a dictionary record description
+ Parameters
+ `name`: `eHealth/LOINC/observation_codes` (string, optional) - dictionary name
+ `is_active`: true (boolean, optional) - dictionary status
+ Request (application/json)
+ Headers
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Response 200 (application/json)
+ Attributes (`Response_OK`)
+ data (array[`Dictionary`])
### Get dictionaries v2 [GET /api/v2/dictionaries{?name,is_active,value_code,value_description,value_is_active}]
Each dictionary is an object that contains not only a code and description of a value, but also a status of the value. In addition, it can represent hierarchical dictionaries with subordinate (child) values
+ Parameters
+ `name`: `eHealth/ICF/classifiers` (string, optional) - dictionary name
+ `is_active`: true (boolean, optional) - dictionary status
+ `value_code`: `b1142` (string, optional) - code of the dictionary value
+ `value_description`: `Орієнтація в особі` (string, optional) - description of the dictionary value
+ `value_is_active`: true (string, optional) - status of the dictionary value
+ Request (application/json)
+ Headers
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Response 200 (application/json)
+ Attributes (`Response_OK`)
+ data (array[`Dictionary_v2`])
+ (object)
+ include `Dictionary_v2`
+ name: `eHealth/ICPC2/condition_codes` (string, required) - Unique dictionary name
+ description: `Коди станів за ICPC2` (string, required) - dictionary description for a user
+ values (array, required)
+ (Dictionary_value)
+ code: `D88` (string, required) - code of the dictionary value
+ description: `Апендицит` (string, required) - description of the code
## OTP Verification [/api/verifications]
Method is used to verify that provided in declarartion request phone number is valid and is in service
### Initialize OTP Verification [POST]
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ `phone_number`: `+380508887700` (string, required)
+ Response 200 (application/json)
+ Attributes (`Response__Process_OK`)
+ data (`OTP`)
### Complete OTP Verification [PATCH /api/verifications/{phone_number}/actions/complete]
+ Parameters
+ `phone_number`: `+380508887700` (string, required)
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ code: 3782 (number)
+ Response 200 (application/json)
+ Attributes (`Response__Process_OK`)
+ data (`OTP`)
### Find Verifications by Phone Number [GET /api/verifications/{phone_number}]
+ Parameters
+ `phone_number`: `+380508887700` (string, required)
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Response 200 (application/json)
+ Attributes (`Response_OK`)
+ data (`Response_verification_by_phone`)
### Verify phone number [POST /api/sms_verifications]
This endpoint is used to verify submitted phone number as a part of person registration process.
In case number needs verification - generate and send OTP, in case phone does not need verification - return OK.
+ Request (application/json)
+ Headers
Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjYWJpbmV0LXJlZ2lzdHJhdGlvbiIsImVtYWlsIjoiYXByb2tvcHBoYXJtZGlyNEB1a3IubmV0IiwiZXhwIjoxNjgyNjkzNTc3LCJpYXQiOjE2ODI2NjQ3NzcsImlzcyI6IkVIZWFsdGgiLCJqdGkiOiIxOTAyYTkyYS00MDcyLTQ3MWEtYmU4NS1iZWU0MzQzNmNlYjEiLCJuYmYiOjE2ODI2NjQ3NzYsInN1YiI6ImFwcm9rb3BwaGFybWRpcjRAdWtyLm5ldCIsInR5cCI6ImFjY2VzcyJ9.EXTuYRQenjqzsjNAJ5agmEbSHcg_XRKwc3VOGAtSjfMOy4uIJ_BBMUeUWSVzy4_OezPjEIiVcnaLTN4pZbtgow
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ `factor`: `+380501112233` (string, required) - phone number that needs to be verified.
+ `type`: SMS (enum, required) - verification type.
- SMS
+ `content_hash`: `76dea970d89477ed03dc5289f297443c` (string, optional) - MD5 hash of content with phone number that needs to be verified.
+ Response 200 (application/json)
+ Attributes (`Response_OK`)
+ meta (`Response__Meta`)
+ code: 200 (number)
+ data (object, required)
+ `result`: `OTP sent` (enum, required) - phone verification result.
- `OTP sent`
- `Verified`
+ urgent (object, required)
+ `next_step`: `REQUEST_OTP` (string, optional) - next step that needs to be taken in phone verification process.
## Person Requests [/api/person_requests]
[Person Request]() is a life-cycle entity that is used to create person WITHOUT [Declarations]().
### Create/Update Person Request [POST /api/person_requests]
This method will be deprecated. Use **Create/Update Person Request v2**.
This method is used to create Person Request (as part of Person creation w/o declaration process).
Upon successful completion of the whole process, a person is created in MPI.
**NOTE:** Also this method allows you to update the person’s data according to his id, which was previously found.
A block with information about authentication methods must be transferred when the person is created. But it is prohibited to transfer it when updating the person.
This table shows which fields can be set for specific action:
Actions | person.id | person.authentication_methods
----------|---------------|--------------------
**Create** | - | required
**Update** | required | -
There are three methods of authentication - OTP, OFFLINE and the THIRD_PERSON. A person > 14 years can have OTP or OFFLINE.
A person < 14 years can only have authentication method = THIRD PERSON.
More detailed information - https://e-health-ua.atlassian.net/wiki/x/KoAfIw
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ person (required)
+ id: `13001c60-45a0-4b5a-b425-9505e1de18bd`(string, optional) - MPI id of the person
+ include (`Person_info_Public`, required)
+ patient_signed: false (boolean, required) - Факт подписания заявки на збереження/створення персоны.
+ `process_disclosure_data_consent`: true (boolean, required) - Согласие на раскрытие персональных данных
+ authorize_with: `cc949559-5dfe-420f-ac05-065e443b2cc6` (string, optional)- identifier of person's auth method
+ Response 201 (application/json)
+ Attributes (`Response__Process_OK`)
+ meta (Response__Meta)
+ code: 201 (number)
+ data (object)
+ status: SIGNED (enum, optional)
- NEW
- APPROVED
- SIGNED
- CANCELLED
- REJECTED
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ person (required)
+ id: `13001c60-45a0-4b5a-b425-9505e1de18bd`(string, optional) - MPI id of the person
+ include (`Person_info_Public`, required)
+ patient_signed: false (boolean, required) - Факт подписания заявки на декларацию.
+ `process_disclosure_data_consent`: true (boolean, required) - Согласие на раскрытие персональных данных
+ channel: `MIS` (enum, required) - channel that invoke person request create service
+ authorize_with: `cc949559-5dfe-420f-ac05-065e443b2cc6` (string, optional)- identifier of person's auth method
+ urgent (object, required)
+ `authentication_method_current` (array[`Authentication_Method`], required)
<!--+ `authentication_methods` (array [`Authentication_Methods_Patient_Response`], required)-->
+ documents (array[`media_content`], optional)
+ Response 422 (application/json)
+ Attributes (`Response_Error`)
+ meta (Response__Meta)
+ code: 422
+ error
+ type: unverified (string, required)
+ message: `Unverified phone number` (string, required)
### Create/Update Person Request v2 [POST /api/v2/person_requests]
This method is used to create Person Request (as part of Person creation w/o declaration process).
Upon successful completion of the whole process, a person is created in MPI.
**NOTE:** Also this method allows you to update the person’s data according to his id, which was previously found.
A block with information about authentication methods must be transferred when the person is created. But it is prohibited to transfer it when updating the person.
A block with information about confidant person can be transferred when the person is created. But it is prohibited to transfer it when updating the person.
This table shows which fields can be set for specific action:
Actions | person.id | person.authentication_methods| person.confidant_person
----------|---------------|--------------------|--------------------
**Create** | - | required | optional
**Update** | required | - | -
There are three methods of authentication - OTP, OFFLINE and the THIRD_PERSON. A person > 14 years can have OTP or OFFLINE.
A person < 14 years can only have authentication method = THIRD PERSON.
Link to THIRD PERSON (`authentication_methods.value`) must be equal to confidant_person_id
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ person (required)
+ id: `13001c60-45a0-4b5a-b425-9505e1de18bd`(string, optional) - MPI id of the person
+ include (`Person_info_Public_request_v2_with_new_confidant_data`, required)
+ patient_signed: false (boolean, required) - Факт подписания заявки на збереження/створення персоны.
+ `process_disclosure_data_consent`: true (boolean, required) - Согласие на раскрытие персональных данных
+ authorize_with: `cc949559-5dfe-420f-ac05-065e443b2cc6` (string, optional)- identifier of person's auth method
+ Response 201 (application/json)
+ Attributes (`Response__Process_OK`)
+ meta (Response__Meta)
+ code: 201 (number)
+ data (object)
+ status: SIGNED (enum, optional)
- NEW
- APPROVED
- SIGNED
- CANCELLED
- REJECTED
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ person (required)
+ id: `13001c60-45a0-4b5a-b425-9505e1de18bd`(string, optional) - MPI id of the person
+ include (`Person_info_Public_response_v2_with_new_confidant_data_object`, required)
+ patient_signed: false (boolean, required) - Факт подписания заявки на декларацию.
+ `process_disclosure_data_consent`: true (boolean, required) - Согласие на раскрытие персональных данных
+ channel: `MIS` (enum, required) - channel that invoke person request create service
+ authorize_with: `cc949559-5dfe-420f-ac05-065e443b2cc6` (string, optional)- identifier of person's auth method
+ urgent (object, required)
+ `authentication_method_current` (array[`Authentication_Method`], required)
<!--+ `authentication_methods` (array [`Authentication_Methods_Patient_Response`], required)-->
+ documents (array[`media_content`], optional)
+ Response 422 (application/json)
+ Attributes (`Response_Error`)
+ meta (Response__Meta)
+ code: 422
+ error
+ type: unverified (string, required)
+ message: `Unverified phone number` (string, required)
### Approve Person Request [PATCH /api/person_requests/{id}/actions/approve]
This method will be deprecated. Use **Approve Person Request v2**.
Use this method to approve previously created Person Request.
In case if authentication_method is OTP or THIRD_PERSON, request example:
```
{
"verification_code": 6598
}
```
In case if authentication_method is OFFLINE or N/A, request body should be empty.
Before approve patient's scanned documents should be uploaded to the ([Signed URL's](https://cloud.google.com/storage/docs/access-control/create-signed-urls-program)).
All links are generated for one one-page document in jpeg format. Document should be no more than 10MB.
Clients can use signed URL's to directly access [s3 storage](https://storage.ehealth.gov.ua/) and upload files via API.
More detailed information - https://e-health-ua.atlassian.net/wiki/x/QgAjIw
+ Parameters
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ `verification_code`: 6598 (number, optional) - required if authentication_method is OTP
+ Response 201 (application/json)
+ Attributes (`Response__Process_OK`)
+ meta (Response__Meta)
+ code: 201 (number)
+ data (object)
+ status: SIGNED (enum, optional)
- NEW
- APPROVED
- SIGNED
- CANCELLED
- REJECTED
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ person (required)
+ id: `13001c60-45a0-4b5a-b425-9505e1de18bd`(string, optional) - MPI id of the person
+ include (`Person_info_Public`, required)
+ patient_signed: false (boolean, required) - Факт подписания заявки на декларацию.
+ `process_disclosure_data_consent`: true (boolean, required) - Согласие на раскрытие персональных данных
+ content: `Person content` (string, required) - HTML document that MUST be shown to a - Should be defined on the client side.end-user and signed by hes key.
+ channel: `MIS` (enum, required) - channel that invoke patient create service
+ authorize_with: `cc949559-5dfe-420f-ac05-065e443b2cc6` (string, optional)- identifier of person's auth method
+ Response 422 (application/json)
+ Attributes (`Response_Error`)
+ meta (Response__Meta)
+ code: 422
+ error
+ type: forbidden (string, required)
+ message: `Invalid verification code` (string, required)
### Approve Person Request v2 [PATCH /api/v2/person_requests/{id}/actions/approve]
Use this method to approve previously created Person Request.
In case if authentication_method is OTP or THIRD_PERSON, request example:
```
{
"verification_code": 6598
}
```
In case if authentication_method is OFFLINE or N/A, request body should be empty.
Before approve patient's scanned documents should be uploaded to the ([Signed URL's](https://cloud.google.com/storage/docs/access-control/create-signed-urls-program)).
All links are generated for one one-page document in jpeg format. Document should be no more than 10MB.
Clients can use signed URL's to directly access [s3 storage](https://storage.ehealth.gov.ua/) and upload files via API.
+ Parameters
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ `verification_code`: 6598 (number, optional) - required if authentication_method is OTP
+ Response 201 (application/json)
+ Attributes (`Response__Process_OK`)
+ meta (Response__Meta)
+ code: 201 (number)
+ data (object)
+ status: SIGNED (enum, optional)
- NEW
- APPROVED
- SIGNED
- CANCELLED
- REJECTED
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ person (required)
+ id: `13001c60-45a0-4b5a-b425-9505e1de18bd`(string, optional) - MPI id of the person
+ include (`Person_info_Public_response_v2_with_new_confidant_data_object`, required)
+ patient_signed: false (boolean, required) - Факт подписания заявки на декларацию.
+ `process_disclosure_data_consent`: true (boolean, required) - Согласие на раскрытие персональных данных
+ content: `Person content` (string, required) - HTML document that MUST be shown to a - Should be defined on the client side.end-user and signed by hes key.
+ channel: `MIS` (enum, required) - channel that invoke patient create service
+ authorize_with: `cc949559-5dfe-420f-ac05-065e443b2cc6` (string, optional)- identifier of person's auth method
+ Response 422 (application/json)
+ Attributes (`Response_Error`)
+ meta (Response__Meta)
+ code: 422
+ error
+ type: forbidden (string, required)
+ message: `Invalid verification code` (string, required)
### Reject Person Request [PATCH /api/person_requests/{id}/actions/reject]
This method will be deprecated. Use **Reject Person Request v2**.
Use this method to reject previously created Person Request.
More detailed information - https://e-health-ua.atlassian.net/wiki/x/MYDAIw
+ Parameters
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Response 201 (application/json)
+ Attributes (`Response__Process_OK`)
+ meta (Response__Meta)
+ code: 200 (number)
+ data (object)
+ status: SIGNED (enum, optional)
- NEW
- APPROVED
- SIGNED
- CANCELLED
- REJECTED
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required
+ person (required)
+ id: `13001c60-45a0-4b5a-b425-9505e1de18bd`(string, optional) - MPI id of the person
+ include (`Person_info_Public`, required)
+ patient_signed: false (boolean, required) - Факт подписания заявки на декларацию.
+ `process_disclosure_data_consent`: true (boolean, required) - Согласие на раскрытие персональных данных
+ content: `Person content` (string, optional) - HTML document that MUST be shown to a - Should be defined on the client side.end-user and signed by hes key.
+ channel: `MIS` (enum, required) - channel that invoke patient create service
+ authorize_with: `cc949559-5dfe-420f-ac05-065e443b2cc6` (string, optional)- identifier of person's auth method
### Reject Person Request v2 [PATCH /api/v2/person_requests/{id}/actions/reject]
Use this method to reject previously created Person Request.
+ Parameters
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Response 201 (application/json)
+ Attributes (`Response__Process_OK`)
+ meta (Response__Meta)
+ code: 200 (number)
+ data (object)
+ status: SIGNED (enum, optional)
- NEW
- APPROVED
- SIGNED
- CANCELLED
- REJECTED
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ person (required)
+ id: `13001c60-45a0-4b5a-b425-9505e1de18bd`(string, optional) - MPI id of the person
+ include (`Person_info_Public_response_v2_with_new_confidant_data_object`, required)
+ patient_signed: false (boolean, required) - Факт подписания заявки на декларацию.
+ `process_disclosure_data_consent`: true (boolean, required) - Согласие на раскрытие персональных данных
+ content: `Person content` (string, optional) - HTML document that MUST be shown to a - Should be defined on the client side.end-user and signed by hes key.
+ channel: `MIS` (enum, required) - channel that invoke patient create service
+ authorize_with: `cc949559-5dfe-420f-ac05-065e443b2cc6` (string, optional)- identifier of person's auth method
### Sign Person Request [PATCH /api/person_requests/{id}/actions/sign]
This method will be depricated.
This method is used to sign Person Request. Method receives signed message (pkcs7) including signed content, digital signature and signer public key in `signed_content` property.
All signature fields will be validated (including signer certificate authority).
This service will store signed copy of Person Request in Media Content Storage, created or update MPI records if signature is all checks is passed.
Signed content MUST consists of JSON object with Person Request data and printout template. Object that need to be signed is returned by `Get Person request by ID` or `Approve Person request` response, `JSON.Path: $.data`.
Person must re-read and sign person request print form and after that `patient_signed` should be changed to TRUE.
Person request can be signed either by doctor or admin (user with scope `person_request:write`) from legal entity as in person request.
More detailed information - https://e-health-ua.atlassian.net/wiki/x/QQAiIw
Look at [**Dummy Sign Person Request**](https://uaehealthapi.docs.apiary.io/#reference/dummy-methods/dummy-for-person-request/sign-person-request) for more details.
+ Parameters
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
msp_drfo: 2534157686
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ `signed_content`: `ewogICJzdGF0dXMiOiAiQVBQUk9WRUQiLAogICJpZCI6ICJlZWViYjg2ZC01Y2JhLTQzYzktODg1Yi02NDgyZWNhZjgyNmIiLAogICJwZXJzb24iOiB7CiAgICAiaWQiOiAiMTMwMDFjNjAtNDVhMC00YjVhLWI0MjUtOTUwNWUxZGUxOGJkIiwKICAgICJmaXJzdF9uYW1lIjogItCf0LXRgtGA0L4iLAogICAgImxhc3RfbmFtZSI6ICLQhtCy0LDQvdC+0LIiLAogICAgInNlY29uZF9uYW1lIjogItCc0LjQutC+0LvQsNC50L7QstC40YciLAogICAgImJpcnRoX2RhdGUiOiAiMjAwOS0wNy0wNSIsCiAgICAiYmlydGhfY291bnRyeSI6ICLQo9C60YDQsNGX0L3QsCIsCiAgICAiYmlydGhfc2V0dGxlbWVudCI6ICLQktGW0L3QvdC40YbRjyIsCiAgICAiZ2VuZGVyIjogIk1BTEUiLAogICAgImVtYWlsIjogImVtYWlsQGV4YW1wbGUuY29tIiwKICAgICJub190YXhfaWQiOiBmYWxzZSwKICAgICJ0YXhfaWQiOiAiMzk5OTg2OTM5NCIsCiAgICAic2VjcmV0IjogInNlY3JldCIsCiAgICAiZG9jdW1lbnRzIjogWwogICAgICB7CiAgICAgICAgInR5cGUiOiAiQklSVEhfQ0VSVElGSUNBVEUiLAogICAgICAgICJudW1iZXIiOiAi0JDQkDEyMDUxOCIsCiAgICAgICAgImlzc3VlZF9ieSI6ICLQoNC+0LrQuNGC0L3Rj9C90YHRjNC60LjQvCDQoNCSINCT0KMg0JzQktChINCa0LjRl9Cy0YHRjNC60L7RlyDQvtCx0LvQsNGB0YLRliIsCiAgICAgICAgImlzc3VlZF9hdCI6ICIyMDE3LTAyLTI4IiwKICAgICAgICAiZXhwaXJhdGlvbl9kYXRlIjogIjIwMjctMDItMjgiCiAgICAgIH0KICAgIF0sCiAgICAiYWRkcmVzc2VzIjogWwogICAgICB7CiAgICAgICAgInR5cGUiOiAiUkVTSURFTkNFIiwKICAgICAgICAiY291bnRyeSI6ICJVQSIsCiAgICAgICAgImFyZWEiOiAi0JbQuNGC0L7QvNC40YDRgdGM0LrQsCIsCiAgICAgICAgInJlZ2lvbiI6ICLQkdC10YDQtNC40YfRltCy0YHRjNC60LjQuSIsCiAgICAgICAgInNldHRsZW1lbnQiOiAi0JrQuNGX0LIiLAogICAgICAgICJzZXR0bGVtZW50X3R5cGUiOiAiQ0lUWSIsCiAgICAgICAgInNldHRsZW1lbnRfaWQiOiAiYjA3NWYxNDgiLAogICAgICAgICJzdHJlZXRfdHlwZSI6ICJTVFJFRVQiLAogICAgICAgICJzdHJlZXQiOiAi0LLRg9C7LiDQndGW0LbQuNC90YHRjNC60LAiLAogICAgICAgICJidWlsZGluZyI6ICIxNSIsCiAgICAgICAgImFwYXJ0bWVudCI6ICIyMyIsCiAgICAgICAgInppcCI6ICIwMjA5MCIKICAgICAgfQogICAgXSwKICAgICJwaG9uZXMiOiBbCiAgICAgIHsKICAgICAgICAidHlwZSI6ICJNT0JJTEUiLAogICAgICAgICJudW1iZXIiOiAiKzM4MDUwMzQxMDg3MCIKICAgICAgfQogICAgXSwKICAgICJhdXRoZW50aWNhdGlvbl9tZXRob2RzIjogWwogICAgICB7CiAgICAgICAgInR5cGUiOiAiVEhJUkRfUEVSU09OIiwKICAgICAgICAidmFsdWUiOiAiKzM4MDUwODg4NzcwMCIsCiAgICAgICAgImFsaWFzIjogImh1c2JhbmQiCiAgICAgIH0KICAgIF0sCiAgICAidW56ciI6ICIyMDA5MDcwNS0wMDAxMSIsCiAgICAiZW1lcmdlbmN5X2NvbnRhY3QiOiB7CiAgICAgICJmaXJzdF9uYW1lIjogItCf0LXRgtGA0L4iLAogICAgICAibGFzdF9uYW1lIjogItCG0LLQsNC90L7QsiIsCiAgICAgICJzZWNvbmRfbmFtZSI6ICLQnNC40LrQvtC70LDQudC+0LLQuNGHIiwKICAgICAgInBob25lcyI6IFsKICAgICAgICB7CiAgICAgICAgICAidHlwZSI6ICJNT0JJTEUiLAogICAgICAgICAgIm51bWJlciI6ICIrMzgwNTAzNDEwODcwIgogICAgICAgIH0KICAgICAgXQogICAgfSwKICAgICJjb25maWRhbnRfcGVyc29uIjogWwogICAgICB7CiAgICAgICAgInJlbGF0aW9uX3R5cGUiOiAiUFJJTUFSWSIsCiAgICAgICAgImZpcnN0X25hbWUiOiAi0J/QtdGC0YDQviIsCiAgICAgICAgImxhc3RfbmFtZSI6ICLQhtCy0LDQvdC+0LIiLAogICAgICAgICJzZWNvbmRfbmFtZSI6ICLQnNC40LrQvtC70LDQudC+0LLQuNGHIiwKICAgICAgICAiYmlydGhfZGF0ZSI6ICIxOTcyLTEwLTI2IiwKICAgICAgICAiYmlydGhfY291bnRyeSI6ICLQo9C60YDQsNGX0L3QsCIsCiAgICAgICAgImJpcnRoX3NldHRsZW1lbnQiOiAi0JLRltC90L3QuNGG0Y8iLAogICAgICAgICJnZW5kZXIiOiAiTUFMRSIsCiAgICAgICAgInRheF9pZCI6ICIyNjU5NzE5MzUwIiwKICAgICAgICAic2VjcmV0IjogInNlY3JldCIsCiAgICAgICAgImRvY3VtZW50c19wZXJzb24iOiBbCiAgICAgICAgICB7CiAgICAgICAgICAgICJ0eXBlIjogIlBBU1NQT1JUIiwKICAgICAgICAgICAgIm51bWJlciI6ICLQkNCQMTIwNTE4IiwKICAgICAgICAgICAgImlzc3VlZF9ieSI6ICLQoNC+0LrQuNGC0L3Rj9C90YHRjNC60LjQvCDQoNCSINCT0KMg0JzQktChINCa0LjRl9Cy0YHRjNC60L7RlyDQvtCx0LvQsNGB0YLRliIsCiAgICAgICAgICAgICJpc3N1ZWRfYXQiOiAiMjAxNy0wMi0yOCIKICAgICAgICAgIH0KICAgICAgICBdLAogICAgICAgICJkb2N1bWVudHNfcmVsYXRpb25zaGlwIjogWwogICAgICAgICAgewogICAgICAgICAgICAidHlwZSI6ICJQQVNTUE9SVCIsCiAgICAgICAgICAgICJudW1iZXIiOiAi0JDQkDEyMDUxOCIsCiAgICAgICAgICAgICJpc3N1ZWRfYnkiOiAi0KDQvtC60LjRgtC90Y/QvdGB0YzQutC40Lwg0KDQkiDQk9CjINCc0JLQoSDQmtC40ZfQstGB0YzQutC+0Zcg0L7QsdC70LDRgdGC0ZYiLAogICAgICAgICAgICAiaXNzdWVkX2F0IjogIjIwMTctMDItMjgiCiAgICAgICAgICB9CiAgICAgICAgXSwKICAgICAgICAicGhvbmVzIjogWwogICAgICAgICAgewogICAgICAgICAgICAidHlwZSI6ICJNT0JJTEUiLAogICAgICAgICAgICAibnVtYmVyIjogIiszODA1MDM0MTA4NzAiCiAgICAgICAgICB9CiAgICAgICAgXSwKICAgICAgICAiZW1haWwiOiAiZW1haWxsQGV4YW1wbGUuY29tIgogICAgICB9CiAgICBdLAogICAgInByZWZlcnJlZF93YXlfY29tbXVuaWNhdGlvbiI6ICJlbWFpbCIKICB9LAogICJwYXRpZW50X3NpZ25lZCI6IHRydWUsCiAgInByb2Nlc3NfZGlzY2xvc3VyZV9kYXRhX2NvbnNlbnQiOiB0cnVlLAogICJjb250ZW50IjogIjxodG1sPjxib2R5PjxwPnNpZ25lZCBwZXJzb24gZGF0YTwvcD48L2JvZHk+PC9odG1sPiIsCiAgImNoYW5uZWwiOiAiTUlTIgp9` (string, required)
+ Response 200 (application/json)
+ Attributes (`Response__Process_OK`)
+ data (`Patient_short`)
### Sign Person Request v2 [PATCH /api/v2/person_requests/{id}/actions/sign]
This method is used to sign Person Request. Method receives signed message (pkcs7) including signed content, digital signature and signer public key in `signed_content` property.
All signature fields will be validated (including signer certificate authority).
This service will store signed copy of Person Request in Media Content Storage, created or update MPI records if signature is all checks is passed.
Signed content MUST consists of JSON object with Person Request data and printout template. Object that need to be signed is returned by `Get Person request by ID v2` or `Approve Person request v2` response, `JSON.Path: $.data`.
Person must re-read and sign person request print form and after that `patient_signed` should be changed to TRUE.
Person request can be signed either by doctor or admin (user with scope `person_request:write`) from legal entity as in person request.
Look at [**Dummy Sign Person Request**](https://uaehealthapi.docs.apiary.io/#reference/dummy-methods/dummy-for-person-request/sign-person-request) for more details.
+ Parameters
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
msp_drfo: 2534157686
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ `signed_content`: `ewogICJzdGF0dXMiOiAiQVBQUk9WRUQiLAogICJpZCI6ICJlZWViYjg2ZC01Y2JhLTQzYzktODg1Yi02NDgyZWNhZjgyNmIiLAogICJwZXJzb24iOiB7CiAgICAiaWQiOiAiMTMwMDFjNjAtNDVhMC00YjVhLWI0MjUtOTUwNWUxZGUxOGJkIiwKICAgICJmaXJzdF9uYW1lIjogItCf0LXRgtGA0L4iLAogICAgImxhc3RfbmFtZSI6ICLQhtCy0LDQvdC+0LIiLAogICAgInNlY29uZF9uYW1lIjogItCc0LjQutC+0LvQsNC50L7QstC40YciLAogICAgImJpcnRoX2RhdGUiOiAiMjAwOS0wNy0wNSIsCiAgICAiYmlydGhfY291bnRyeSI6ICLQo9C60YDQsNGX0L3QsCIsCiAgICAiYmlydGhfc2V0dGxlbWVudCI6ICLQktGW0L3QvdC40YbRjyIsCiAgICAiZ2VuZGVyIjogIk1BTEUiLAogICAgImVtYWlsIjogImVtYWlsQGV4YW1wbGUuY29tIiwKICAgICJub190YXhfaWQiOiBmYWxzZSwKICAgICJ0YXhfaWQiOiAiMzk5OTg2OTM5NCIsCiAgICAic2VjcmV0IjogInNlY3JldCIsCiAgICAiZG9jdW1lbnRzIjogWwogICAgICB7CiAgICAgICAgInR5cGUiOiAiQklSVEhfQ0VSVElGSUNBVEUiLAogICAgICAgICJudW1iZXIiOiAi0JDQkDEyMDUxOCIsCiAgICAgICAgImlzc3VlZF9ieSI6ICLQoNC+0LrQuNGC0L3Rj9C90YHRjNC60LjQvCDQoNCSINCT0KMg0JzQktChINCa0LjRl9Cy0YHRjNC60L7RlyDQvtCx0LvQsNGB0YLRliIsCiAgICAgICAgImlzc3VlZF9hdCI6ICIyMDE3LTAyLTI4IiwKICAgICAgICAiZXhwaXJhdGlvbl9kYXRlIjogIjIwMjctMDItMjgiCiAgICAgIH0KICAgIF0sCiAgICAiYWRkcmVzc2VzIjogWwogICAgICB7CiAgICAgICAgInR5cGUiOiAiUkVTSURFTkNFIiwKICAgICAgICAiY291bnRyeSI6ICJVQSIsCiAgICAgICAgImFyZWEiOiAi0JbQuNGC0L7QvNC40YDRgdGM0LrQsCIsCiAgICAgICAgInJlZ2lvbiI6ICLQkdC10YDQtNC40YfRltCy0YHRjNC60LjQuSIsCiAgICAgICAgInNldHRsZW1lbnQiOiAi0JrQuNGX0LIiLAogICAgICAgICJzZXR0bGVtZW50X3R5cGUiOiAiQ0lUWSIsCiAgICAgICAgInNldHRsZW1lbnRfaWQiOiAiYjA3NWYxNDgiLAogICAgICAgICJzdHJlZXRfdHlwZSI6ICJTVFJFRVQiLAogICAgICAgICJzdHJlZXQiOiAi0LLRg9C7LiDQndGW0LbQuNC90YHRjNC60LAiLAogICAgICAgICJidWlsZGluZyI6ICIxNSIsCiAgICAgICAgImFwYXJ0bWVudCI6ICIyMyIsCiAgICAgICAgInppcCI6ICIwMjA5MCIKICAgICAgfQogICAgXSwKICAgICJwaG9uZXMiOiBbCiAgICAgIHsKICAgICAgICAidHlwZSI6ICJNT0JJTEUiLAogICAgICAgICJudW1iZXIiOiAiKzM4MDUwMzQxMDg3MCIKICAgICAgfQogICAgXSwKICAgICJhdXRoZW50aWNhdGlvbl9tZXRob2RzIjogWwogICAgICB7CiAgICAgICAgInR5cGUiOiAiVEhJUkRfUEVSU09OIiwKICAgICAgICAidmFsdWUiOiAiKzM4MDUwODg4NzcwMCIsCiAgICAgICAgImFsaWFzIjogImh1c2JhbmQiCiAgICAgIH0KICAgIF0sCiAgICAidW56ciI6ICIyMDA5MDcwNS0wMDAxMSIsCiAgICAiZW1lcmdlbmN5X2NvbnRhY3QiOiB7CiAgICAgICJmaXJzdF9uYW1lIjogItCf0LXRgtGA0L4iLAogICAgICAibGFzdF9uYW1lIjogItCG0LLQsNC90L7QsiIsCiAgICAgICJzZWNvbmRfbmFtZSI6ICLQnNC40LrQvtC70LDQudC+0LLQuNGHIiwKICAgICAgInBob25lcyI6IFsKICAgICAgICB7CiAgICAgICAgICAidHlwZSI6ICJNT0JJTEUiLAogICAgICAgICAgIm51bWJlciI6ICIrMzgwNTAzNDEwODcwIgogICAgICAgIH0KICAgICAgXQogICAgfSwKICAgICJjb25maWRhbnRfcGVyc29uIjogWwogICAgICB7CiAgICAgICAgInJlbGF0aW9uX3R5cGUiOiAiUFJJTUFSWSIsCiAgICAgICAgImZpcnN0X25hbWUiOiAi0J/QtdGC0YDQviIsCiAgICAgICAgImxhc3RfbmFtZSI6ICLQhtCy0LDQvdC+0LIiLAogICAgICAgICJzZWNvbmRfbmFtZSI6ICLQnNC40LrQvtC70LDQudC+0LLQuNGHIiwKICAgICAgICAiYmlydGhfZGF0ZSI6ICIxOTcyLTEwLTI2IiwKICAgICAgICAiYmlydGhfY291bnRyeSI6ICLQo9C60YDQsNGX0L3QsCIsCiAgICAgICAgImJpcnRoX3NldHRsZW1lbnQiOiAi0JLRltC90L3QuNGG0Y8iLAogICAgICAgICJnZW5kZXIiOiAiTUFMRSIsCiAgICAgICAgInRheF9pZCI6ICIyNjU5NzE5MzUwIiwKICAgICAgICAic2VjcmV0IjogInNlY3JldCIsCiAgICAgICAgImRvY3VtZW50c19wZXJzb24iOiBbCiAgICAgICAgICB7CiAgICAgICAgICAgICJ0eXBlIjogIlBBU1NQT1JUIiwKICAgICAgICAgICAgIm51bWJlciI6ICLQkNCQMTIwNTE4IiwKICAgICAgICAgICAgImlzc3VlZF9ieSI6ICLQoNC+0LrQuNGC0L3Rj9C90YHRjNC60LjQvCDQoNCSINCT0KMg0JzQktChINCa0LjRl9Cy0YHRjNC60L7RlyDQvtCx0LvQsNGB0YLRliIsCiAgICAgICAgICAgICJpc3N1ZWRfYXQiOiAiMjAxNy0wMi0yOCIKICAgICAgICAgIH0KICAgICAgICBdLAogICAgICAgICJkb2N1bWVudHNfcmVsYXRpb25zaGlwIjogWwogICAgICAgICAgewogICAgICAgICAgICAidHlwZSI6ICJQQVNTUE9SVCIsCiAgICAgICAgICAgICJudW1iZXIiOiAi0JDQkDEyMDUxOCIsCiAgICAgICAgICAgICJpc3N1ZWRfYnkiOiAi0KDQvtC60LjRgtC90Y/QvdGB0YzQutC40Lwg0KDQkiDQk9CjINCc0JLQoSDQmtC40ZfQstGB0YzQutC+0Zcg0L7QsdC70LDRgdGC0ZYiLAogICAgICAgICAgICAiaXNzdWVkX2F0IjogIjIwMTctMDItMjgiCiAgICAgICAgICB9CiAgICAgICAgXSwKICAgICAgICAicGhvbmVzIjogWwogICAgICAgICAgewogICAgICAgICAgICAidHlwZSI6ICJNT0JJTEUiLAogICAgICAgICAgICAibnVtYmVyIjogIiszODA1MDM0MTA4NzAiCiAgICAgICAgICB9CiAgICAgICAgXSwKICAgICAgICAiZW1haWwiOiAiZW1haWxsQGV4YW1wbGUuY29tIgogICAgICB9CiAgICBdLAogICAgInByZWZlcnJlZF93YXlfY29tbXVuaWNhdGlvbiI6ICJlbWFpbCIKICB9LAogICJwYXRpZW50X3NpZ25lZCI6IHRydWUsCiAgInByb2Nlc3NfZGlzY2xvc3VyZV9kYXRhX2NvbnNlbnQiOiB0cnVlLAogICJjb250ZW50IjogIjxodG1sPjxib2R5PjxwPnNpZ25lZCBwZXJzb24gZGF0YTwvcD48L2JvZHk+PC9odG1sPiIsCiAgImNoYW5uZWwiOiAiTUlTIgp9` (string, required)
+ Response 200 (application/json)
+ Attributes (`Response__Process_OK`)
+ data (`Patient_short`)
### Get Person Request by ID [GET /api/person_requests/{id}]
This method will be depricated. Use **Get Person Request by ID v2** instead.
+ Parameters
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required) - request identifier
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Response 200 (application/json)
+ Attributes (`Response_OK`)
+ meta (Response__Meta)
+ code: 201 (number)
+ data (object)
+ status: SIGNED (enum, optional)
- NEW
- APPROVED
- SIGNED
- CANCELLED
- REJECTED
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ person (required)
+ id: `13001c60-45a0-4b5a-b425-9505e1de18bd`(string, optional) - MPI id of the person
+ include (`Person_info_Public`, required)
+ patient_signed: false (boolean, required) - Факт подписания заявки на декларацию.
+ `process_disclosure_data_consent`: true (boolean, required) - Согласие на раскрытие персональных данных
+ content: `Person content` (string, optional) - HTML document that MUST be shown to a - Should be defined on the client side.end-user and signed by hes key.
+ channel: `MIS` (enum, required) - channel that invoke person request create service
- MIS
+ authorize_with: `cc949559-5dfe-420f-ac05-065e443b2cc6` (string, optional)- identifier of person's auth method
+ urgent (object, required)
+ `authentication_method_current` (array[`Authentication_Method`], required)
<!--+ `authentication_methods` (array [`Authentication_Methods_Patient_Response`], required)-->
+ documents (array[`media_content`], optional)
### Get Person Request by ID v2 [GET /api/v2/person_requests/{id}]
Use this method to obtain Person Request details.
+ Parameters
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required) - request identifier
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Response 200 (application/json)
+ Attributes (`Response_OK`)
+ meta (Response__Meta)
+ code: 201 (number)
+ data (object)
+ status: SIGNED (enum, optional)
- NEW
- APPROVED
- SIGNED
- CANCELLED
- REJECTED
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ person (required)
+ id: `13001c60-45a0-4b5a-b425-9505e1de18bd`(string, optional) - MPI id of the person
+ include (`Person_info_Public_response_v2_with_new_confidant_data_object`, required)
+ patient_signed: false (boolean, required) - Факт подписания заявки на декларацию.
+ `process_disclosure_data_consent`: true (boolean, required) - Согласие на раскрытие персональных данных
+ content: `Person content` (string, optional) - HTML document that MUST be shown to a - Should be defined on the client side.end-user and signed by hes key.
+ channel: `MIS` (enum, required) - channel that invoke person request create service
- MIS
+ authorize_with: `cc949559-5dfe-420f-ac05-065e443b2cc6` (string, optional)- identifier of person's auth method
+ urgent (object, required)
+ `authentication_method_current` (array[`Authentication_Method`], required)
<!--+ `authentication_methods` (array [`Authentication_Methods_Patient_Response`], required)-->
+ documents (array[`media_content`], optional)
### Get Person Requests List [GET /api/person_requests{?legal_entity_id,status,page,page_size}]
Use this method to obtain list of Person Requests.
If you want to reduce amount of data that is going trough your application, use `status` filter and show only requests that Doctor or Admin is interested in current UI.
Service returns only person request related to the same legal entity as the user.
Method returns shortened details, to obtain full information - get Person Request by it's ID using appropriate version of endpoint based on `version` value in response.
That is, for `version: 1` use [**Get Person Request by ID**](#reference/public.-medical-service-provider-integration-layer/person-requests/get-person-request-by-id) endpoint, for `version: 2` use [**Get Person Request by ID V2**](https://uaehealthapi.docs.apiary.io/#reference/public.-medical-service-provider-integration-layer/person-requests/get-person-request-by-id-v2) endpoint.
More detailed information - https://e-health-ua.atlassian.net/wiki/x/BADDIw
+ Parameters
+ status: APPROVED (enum, optional)
- NEW
- APPROVED
- SIGNED
- REJECTED
- CANCELLED
+ page: 2 (number, optional) - Page number.
+ page_size: 50 (number, optional) - A limit on the number of objects to be returned, between 1 and 300. Default: 50
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Response 200 (application/json)
+ Attributes (`Response_Collection_V2`)
+ data (array[`Patient_Request_Short`])
### Resend Authorization OTP on Person Request [POST /api/person_requests/{id}/actions/resend_otp]
This method is used when you need to re-send SMS to a person who approve creating or updating data about himself.
More detailed information - https://e-health-ua.atlassian.net/wiki/x/N4DrJ
+ Parameters
+ id: `eeebb86d-5cba-43c9-885b-6482ecaf826b` (string, required)
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
<!--+ Attributes (object)
+ type: `THIRD_PERSON` (enum, optional)
- OTP
- OFFLINE
- THIRD_PERSON
+ alias: `husband` (string, optional)-->
+ Response 200 (application/json)
+ Attributes (`Response__Process_OK`)
+ data (`OTP`)
## Declaration Requests [/api/declaration_requests]
[Declaration Request]() is a life-cycle entity that is used to perform operations on [Declarations]().
After declaration request is signed and/or verified (depends on verification logic) it will be automatically moved to [Declarations]().
### Create Declaration Request V3 [POST /api/v3/declaration_requests]
This method is used to create Declaration Request (as part of Declaration creation process) via new api.
This method method allows you to create a declaration only for an existing person.
To create declaration request based on active declaration in reorganized legal entity, `parent_declaration_id` must be passed in request.
+ Request (application/json)
+ Headers
Authorization: Bearer c2778f3064753ea70de870a53795f5c9
api-key: uXhEczJ56adsfh3Ri9SUkc4en
X-Custom-PSK: a2aa05c76f3f2d91870f923a53cc8aa8f23bbc01a8238d1c2c26d4299715a7e4
+ Attributes (object)
+ include `Declaration_Request_Online`
+ authorize_with: `cc949559-5dfe-420f-ac05-065e443b2cc6` (string, optional)- identifier of person's auth method
+ parent_declaration_id: `8c7753fc-a647-435f-8e43-4ff4546431f6` (string, optional) - identifier of parent declaration in reorganized legal entity
+ Response 201 (application/json)
+ Attributes (`Response__Process_OK`)
+ meta (Response__Meta)
+ code: 201 (number)
+ data (object)
+ id: `b075f148-7f93-4fc2-b2ec-2d81b19a9b7b` (string, required)
+ start_date: `2017-03-02` (string, required) - Should be defined on the client side.
+ end_date: `2017-03-02` (string, required) - Will be defined on eHealth side if it's not set.
+ `person_id`: `4d0d790c-cbf1-44f5-ab21-ba8db67da161` (string, required) - Person ID
+ `employee_id`: `1a8b10ea-ba09-40f2-8f9e-55608e9208c6` (string, required) - Employee ID with `type=DOCTOR` selected from available Employees as a third contract party.
+ `division_id`: `d290f1ee-6c54-4b01-90e6-d701748f0851` (string, required)
+ declaration_number: `0000-12H4-245D` (string, required) - unique number of declaration.
+ declaration_id: `8311ab82-e341-4da0-8a95-235ec9885e23` (string, required) - presetted id for future declaration
+ parent_declaration_id: `8c7753fc-a647-435f-8e43-4ff4546431f6` (string, optional) - identifier of parent declaration
+ status: `NEW` (string, required)
+ `status_reason`: `not relevant` (string, optional) - `Dictionary DECLARATION_REQUEST_STATUS_REASON`
+ `system_declaration_limit`: 900 (number, optional) - Current doctor's limit based on speciality_officio
+ `current_declaration_count`: 675 (number, optional) - Number of declarations assigned to doctor