-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathhip.yaml
More file actions
2640 lines (2613 loc) · 84.5 KB
/
hip.yaml
File metadata and controls
2640 lines (2613 loc) · 84.5 KB
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
openapi: 3.0.0
info:
version: "0.5"
title: Health Repository Provider / Bridge Specifications (HIP)
description: >
The following are the specifications for the APIs to be implemented at the Health Repository end if an entity is only serving the role of a HIP. The specs are essentially duplicates from the Gateway and Health Repository, but put together so as to make it clear to *HIPs* which set of APIs they should implement to participate in the network.
1. The APIs are organized by the flows - **discovery**, **link**, **consent flow**, **data flow**, **user auth** and **monitoring**. They represent the APIs that are expected to be available at the HIP end by the Gateway.
2. For majority of the APIs, there are corresponding callback APIs on the Gateway. e.g for **/care-context/discover** API on HIP end, its expected that a corresponding callback API **/care-context/on-discover** on Gateway is called. Such APIs are organized under the **Gateway** label.
3. Gateway relevant APIs for HIPs are grouped under **Gateway** label. These include the APIs that HIPs may require to call on the Gateway. For example, to notify a CM that requested data is transferred, HIP would call **/health-information/notify** API on gateway. Or for example, to get a session or to do a hip-initiated purpose for linking care-contexts.
4. APIs under **data transfer** are meant to be implemented by the HIU. However, these have been marked here to give indication to the HIPs about the data contract.
servers:
- url: https://ncg-dev.projecteka.in/api-bridge1
description: Dev
tags:
- name: discovery
- name: link
- name: consent flow
- name: data flow
- name: data transfer
- name: user auth
- name: monitoring
- name: Gateway
paths:
/v0.5/care-contexts/discover:
post:
tags:
- discovery
summary: Discover patient's accounts
description: >
Request for patient care context discover, made by Gateway intended for a specific HIP. It is expected that HIP will subsequently return either zero or one patient record with (potentially masked) associated care contexts
1. **At least one of the verified identifier matches**
2. **Name (fuzzy), gender matches**
3. **If YoB was given, age band(+-2) matches**
4. **If unverified identifiers were given, one of them matches**
5. **If more than one patient records would be found after aforementioned steps, then patient who matches most verified and unverified identifiers would be returned.**
6. **If there would be still more than one patients (after ranking) error would be returned**
7. **Intended HIP should be able to resolve and identify results returned in the subsequent link confirmation request via the specified transactionId**
8. **Intended HIP should store the discovery results with transactionId and care contexts discovered for subsequent link initiation**
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-HIP-ID"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatientDiscoveryRequest'
application/xml:
schema:
$ref: '#/components/schemas/PatientDiscoveryRequest'
responses:
'202':
description: Request accepted
'400':
description: >
**Causes:**
* Empty verified identifiers.
* Format mismatch of any of attributes.
| type | Format/Allowed Values|
| ------- | ---------------- |
| gender | M/F/O/U |
| MOBILE | valid mobile number with proper country code |
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/links/link/init:
post:
tags:
- link
summary: Link patient's care contexts
description: >
Request from Gateway to links care contexts associated with only one patient
1. **Validate account reference number and care context reference number**
2. **Validate transactionId in the request with discovery request entry to check whether there was a discovery
and were these care contexts discovered or not for a given patient**
3. **Before eventual link confirmation, HIP needs to authenticate the request with the patient(eg: OTP verification)**
4. **HIP should communicate the mode of authentication of a successful request to Consent Manager**
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-HIP-ID"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatientLinkReferenceRequest'
application/xml:
schema:
$ref: '#/components/schemas/PatientLinkReferenceRequest'
responses:
'202':
description: Request accepted
'400':
description: >
**Causes:**
* Consent manager user id is not provided
* Patient reference number is not provided
* Care context references are not provided
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/links/link/confirm:
post:
tags:
- link
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-HIP-ID"
summary: Token submission by Consent Manager for link confirmation
description: >
API to submit the token that was sent by HIP during the link request.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LinkConfirmationRequest'
application/xml:
schema:
$ref: '#/components/schemas/LinkConfirmationRequest'
responses:
'202':
description: accepted
'400':
description: >
**Causes:**
* Token is not provided
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/health-information/hip/request:
post:
tags:
- data flow
summary: Health information data request
description: >
API called by CM to request Health information from HIP against a validated consent artefact. The transactionId is the correlation id that HIP should use use when pushing data to the **dataPushUrl**.
parameters:
- $ref: '#/components/parameters/authorization'
- $ref: '#/components/parameters/X-HIP-ID'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/HIPHealthInformationRequest'
application/xml:
schema:
$ref: '#/components/schemas/HIPHealthInformationRequest'
responses:
'202':
description: Request accepted.
'400':
description: >
**Causes:**
* Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Token is invalid or Link has expired
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/health-information/transfer:
post:
tags:
- data transfer
summary: health information transfer API
description: >
**NOTE**: This API is actually the callback URL that is passed as **dataPushUrl** in the data request API - /v0.5/health-information/hip/request. This API is directly called by HIP Data Bridge and is not mediated via CM, and hence not routed through the Gateway.
1. This API should be implemented at HIU side. It maybe implemented by the Data Bridge representing the HIU.
2. Entry elements maybe ***content*** or ***link***, although for version 1, entry ***content*** is preferred.
3. Entry ***content*** (or even link reference content) must be encrypted by means of Diffie Hellman Key Exchange, utilizing the HIU keymaterials that are passed through the data request API - /v0.5/health-information/hip/request.
4. Media contains the mimetype of content, and for v1, it is "application/fhir+json"
5. checksum is Md5 checksum of the data conent, before encryption
6. Please refer to the ProjectEKA WIKI for the format of FHIR bundle that is passed through content
parameters:
- $ref: '#/components/parameters/authorization'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DataNotification'
application/xml:
schema:
$ref: '#/components/schemas/DataNotification'
responses:
'202':
description: Data accepted.
'401':
description: >
**Causes:**
* Invalid/Expired/Empty token.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream services are down
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/consents/hip/notify:
post:
tags:
- consent flow
summary: Consent notification
description: |
Notification of consents to health information providers consent request granted, consent revoked, consent expired. Only the GRANTED and REVOKED status notifications will be sent to HIP.
1. If consent is granted, status=GRANTED, then consentDetail contains the consent artefact details and signature is available.
2. If consent is revoked, then status=REVOKED, and consentId specifes which consent artefact is revoked.
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-HIP-ID"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/HIPConsentNotification'
application/xml:
schema:
$ref: '#/components/schemas/HIPConsentNotification'
responses:
'202':
description: Request Accepted
'401':
description: >
**Causes:**
* Invalid/Expired/Empty token.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream services are down
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/heartbeat:
get:
tags:
- monitoring
summary: Get consent request status
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/HeartbeatResponse'
application/xml:
schema:
$ref: '#/components/schemas/HeartbeatResponse'
/v0.5/links/link/on-add-contexts:
post:
tags:
- link
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-HIP-ID"
summary: callback API for HIP initiated patient linking /link/add-context
description: >
If the accessToken is valid for purpose of linking, and specified details provided, CM will send "acknoweldgement.status" as SUCCESS. If any error occcurred, for example invalid token, or other required patient or care-context information not provided, then "error" attribute conveys so.
1. **accessToken must be valid and must be for the purpose of linking**
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatientCareContextLinkResponse'
application/xml:
schema:
$ref: '#/components/schemas/PatientCareContextLinkResponse'
responses:
'202':
description: accepted
'400':
description: >
**Causes:**
* resp not specified
* atleast acknowledgement or error should be specified
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/users/auth/on-fetch-modes:
post:
tags:
- user auth
summary: Identification result for a consent-manager user-id
description: |
If a patient is found then **auth** attribute contains the supported modes for the specified purpose.
Otherwise, error is raised for invalid requests or for non-existent id.
Note in addition to the "Authorization" header, one of the following headers must be specified
1. specify **X-HIU-ID** if the requester is HIU (identified from /auth/fetch-modes requester.id)
2. specify **X-HIP-ID** if the requester is HIP (identified from /auth/fetch-modes requester.id)
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-HIP-ID"
- $ref: "#/components/parameters/X-HIU-ID"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatientAuthModeQueryResponse'
application/xml:
schema:
$ref: '#/components/schemas/PatientAuthModeQueryResponse'
responses:
'202':
description: Request Accepted
'400':
description: >
Invalid request, required attributes not provided
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/users/auth/on-init:
post:
tags:
- user auth
summary: Response to user authentication initialization from HIP
description: >
If the patient's id is valid, CM will return a transactionId as initialization of user auth. If the request is valid, then 'auth.mode' will convey how the authentication should be done. The authentication can be mediated or direct. For example, if the auth.modeis DIRECT, then HIP/HIU is not expected to send over anything as part of /auth/confirm, rather way for CM to notify them when patient approves so. For other mediated authentication modes, HIP or HIU is epected to send over eiter codes (OTP or similar) or demographic info as part of the /users/auth/confirm request accompanied with the transactionId. Note, for DIRECT authentication, CM will subsequently call /users/auth/notify call (Not spec'd yet)
1. **auth.mode** conveys whats the mode of authentication is, and what is expected from HIP/HIU in the subsequent /auth/confirm API call. Possible values, MOBILE_OTP - for OTP sent to mobile, AADHAAR_OTP - if an OTP was sent as part of Aadhaar authentication. DEMOGRAPHICS - If it is expected that the HIP/HIU sends over demographi details in the /auth/confirm API call.
2. **meta.expiry** conveys the expiry time of the token and the authentication session
3. **NOTE**, only one of **X-HIP-ID** or **X-HIU-ID** will be sent as part of header, not both.
The error section in the body, represents the potential errors that may have occurred. Possible reasons:
1. **Patient id is invalid**
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-HIP-ID"
- $ref: "#/components/parameters/X-HIU-ID"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatientAuthInitResponse'
application/xml:
schema:
$ref: '#/components/schemas/PatientAuthInitResponse'
responses:
'202':
description: Request accepted
'400':
description: >
**Causes:**
* required information not provided
* neither authInit nor error specified
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/users/auth/on-confirm:
post:
tags:
- user auth
summary: Request sending token, otp or other authentication details from HIP for confirmation
description: >
This API is called by HIPs to confirm authentication of users. The transactionId retuned by the previous /uses/auth/on-init API must be used along with necessary "mode" specific details.
1. **auth.accessToken** - is specific to the purpose mentioned in the /auth/init. This token needs to be used for initiating the intended action. For example for HIP initiated linking of care-contexts
2. **NOTE**, only one of **X-HIP-ID** or **X-HIU-ID** will be sent as part of header, not both.
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-HIP-ID"
- $ref: "#/components/parameters/X-HIU-ID"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatientAuthConfirmResponse'
application/xml:
schema:
$ref: '#/components/schemas/PatientAuthConfirmResponse'
responses:
'202':
description: Request accepted
'400':
description: >
**Causes:**
* required details not provided
* neither auth nor error specified
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/care-contexts/on-discover:
post:
tags:
- Gateway
summary: Response to patient's account discovery request
description: >
Result of patient care-context discovery request at HIP end. If a matching patient found with zero or more care contexts associated, it is specified as result attribute. If the prior discovery request, resulted in errors then it is specified in the error attribute. Reasons of errors can be
1. **more than one definitive match for the given request**
2. **no verified identifer was specified**
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-CM-ID"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatientDiscoveryResult'
application/xml:
schema:
$ref: '#/components/schemas/PatientDiscoveryResult'
responses:
'202':
description: Request accepted
'400':
description: >
**Causes:**
* Format mismatch of any of attributes.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/links/link/on-init:
post:
tags:
- Gateway
summary: Response to patient's care context link request
description: >
Result of patient care-context link request from HIP end. This happens in context of previous discovery of patient found at HIP end, therefore the link requests ought to be in reference to the patient reference and care-context references previously returned by the HIP. The correlation of discovery and link request is maintained through the transactionId. HIP should have
1. **Validated transactionId in the request to check whether there was a discovery done previously, and the link request corresponds to returned patient care care context references**
2. **Before returning the response, HIP should have sent an authentication request to the patient(eg: OTP verification)**
3. **HIP should communicate the mode of authentication of a successful request**
4. **HIP subsequently should expect the token passed via /link/confirm against the link.referenceNumber passed in this call**
The error section in the body, represents the potential errors that may have occurred. Possible reasons:
1. **Patient reference number is invalid**
2. **Care context reference numbers are invalid**
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-CM-ID"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatientLinkReferenceResult'
application/xml:
schema:
$ref: '#/components/schemas/PatientLinkReferenceResult'
responses:
'202':
description: Request accepted
'400':
description: >
**Causes:**
* Format mismatch of any of attributes.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/links/link/on-confirm:
post:
tags:
- Gateway
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-CM-ID"
summary: Token authenticated by HIP, indicating completion of linkage of care-contexts
description: >
Returns a list of linked care contexts with patient reference number.
1. **Validated and linked account reference number**
2. **Validated that the token sent from Consent Manager is same as the one generated by HIP**
3. **Verified that same Consent Manager which made the link request is sending the token**
4. **Results of unmasked linked care contexts with patient reference number**
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatientLinkResult'
application/xml:
schema:
$ref: '#/components/schemas/PatientLinkResult'
responses:
'202':
description: accepted
'400':
description: >
**Causes:**
* resp not specified
* atleast patient or error should be specified
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/consents/hip/on-notify:
post:
tags:
- Gateway
summary: Consent notification
description: >
This API is called by HIP as acknowledgement to notification of consents, in cases of consent revocation and expiration.
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-CM-ID"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/HIPConsentNotificationResponse'
application/xml:
schema:
$ref: '#/components/schemas/HIPConsentNotificationResponse'
responses:
'202':
description: Request Accepted
'401':
description: >
**Causes:**
* Invalid/Expired/Empty token.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream services are down
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/health-information/hip/on-request:
post:
tags:
- Gateway
summary: Health information data request
description: >
API called by HIP to acknowledge Health information request receipt. Either the **hiRequest** or **error** must be specified. **hiRequest** element returns the same transactionId as before with a status indicating that the request is acknowledged.
parameters:
- $ref: '#/components/parameters/authorization'
- $ref: '#/components/parameters/X-CM-ID'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/HIPHealthInformationRequestAcknowledgement'
application/xml:
schema:
$ref: '#/components/schemas/HIPHealthInformationRequestAcknowledgement'
responses:
'202':
description: Request accepted.
'400':
description: >
**Causes:**
* Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Token is invalid or Link has expired
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/users/auth/fetch-modes:
post:
tags:
- Gateway
summary: Get a patient's authentication modes by her consent-manager user-id relevant to specified purpose
description: >
This API is meant for identify supported authentication modes for a patient given a specific purpose. The supported purposes are KYC, LINK, KYC_AND_LINK
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-CM-ID"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatientAuthModeQueryRequest'
application/xml:
schema:
$ref: '#/components/schemas/PatientAuthModeQueryRequest'
responses:
'202':
description: Request Accepted
'400':
description: >
Invalid request, required attributes not provided
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: >
**Causes:**
* Downstream system(s) is down.
* Unhandled exceptions.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v0.5/users/auth/init:
post:
tags:
- Gateway
summary: Initialize authentication from HIP
description: >
This API is called by HIPs to initiate authentication of users. A transactionId is retuned by the corresponding callback API for confirmation of user auth.
parameters:
- $ref: "#/components/parameters/authorization"
- $ref: "#/components/parameters/X-CM-ID"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatientAuthInitRequest'
application/xml:
schema:
$ref: '#/components/schemas/PatientAuthInitRequest'
responses:
'202':
description: Request accepted
'400':
description: >
**Causes:**
* patient id is not provided
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >
**Causes:**
* Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'