-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapi.constants.js
More file actions
88 lines (86 loc) · 2.96 KB
/
api.constants.js
File metadata and controls
88 lines (86 loc) · 2.96 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
// SPDX-FileCopyrightText: Copyright (C) 2022 Opal Health Informatics Group at the Research Institute of the McGill University Health Centre <john.kildea@mcgill.ca>
//
// SPDX-License-Identifier: Apache-2.0
(function () {
'use strict';
/**
* @description Constants used to make requests to the listener going through the new backend and define available routes.
* @author David Gagne
* @date 2022-06-10
*/
angular
.module('OpalApp')
.constant("ApiConstants", {
/** Response codes **/
SUCCESS: '200',
CREATED: '201',
/** Headers for new api request */
REQUEST_HEADERS: {
'Content-Type': 'application/json',
'Accept-Language': 'fr',
},
/** Django backend available routes. Note: Trailing slashes are required */
ROUTES: {
HOME: {
method: 'get',
url: '/api/app/home/',
},
CHECK_IN: {
method: 'get',
url: '/api/app/appointments/',
},
CHART: {
method: 'get',
url: '/api/app/chart/',
},
GENERAL: {
method: 'get',
url: '/api/app/general/'
},
HOSPITAL_SETTINGS: {
SITES: {
method: 'get',
url: '/api/sites/'
},
INSTITUTION: {
method: 'get',
url: '/api/institution/',
}
},
PATIENTS: {
method: 'get',
url: '/api/caregivers/patients/'
},
USER: {
GET: {
method: 'get',
url: '/api/caregivers/profile/',
},
PATCH: {
method: 'patch',
url: '/api/caregivers/profile/',
},
},
CAREGIVERS: {
method: 'get',
url: '/api/patients/legacy/<PATIENT_ID>/caregivers/',
},
RELATIONSHIP_TYPES: {
method: 'get',
url: '/api/relationship-types/'
},
QUANTITY_SAMPLES: {
method: 'post',
url: '/api/patients/<PATIENT_UUID>/health-data/quantity-samples/'
},
DATABANK_CONSENT: {
method: 'post',
url: '/api/patients/<PATIENT_UUID>/databank/consent/'
},
IPS: {
method: 'get',
url: '/api/patients/<PATIENT_UUID>/ips/',
},
}
});
})();