This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi.http
133 lines (100 loc) · 3.9 KB
/
api.http
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
### Healthcheck
GET http://localhost:3002/health
##################################################
@AuthorizationMedico=<Coloque o IdToken gerado pelo Cognito aqui>
@AuthorizationPaciente=<Coloque o IdToken gerado pelo Cognito aqui>
##################################################
@CognitoClientId=<Coloque o Client ID do Cognito aqui>
# Para provisionar o Cognito na AWS clone o repositório Health-Med-iac e siga as instruções no README
### Fazer login de médico
POST https://cognito-idp.us-east-1.amazonaws.com
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AWSCognitoIdentityProviderService.InitiateAuth
{
"AuthFlow": "USER_PASSWORD_AUTH",
"AuthParameters": {
"USERNAME": "194528-SP",
"PASSWORD": "Mudar@123"
},
"ClientId": "{{CognitoClientId}}"
}
### Fazer login de paciente
POST https://cognito-idp.us-east-1.amazonaws.com
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AWSCognitoIdentityProviderService.InitiateAuth
{
"AuthFlow": "USER_PASSWORD_AUTH",
"AuthParameters": {
"USERNAME": "00000000191",
"PASSWORD": "Mudar@123"
},
"ClientId": "{{CognitoClientId}}"
}
# DICA
# O Token de Authorization pode ser consultado no campo "IdToken" na response do Cognito
##################################################
### Listar todos os médicos
GET http://localhost:3000/medico
### Buscar médicos com filtro
GET http://localhost:3000/medico?especialidade=dermatologia&distancia=10&avaliacao=9
### Consultar um médico específico
GET http://localhost:3000/medico/87299678-a39f-46ff-a849-79c35f561945
##################################################
### Ver todos os horários na agenda do médico
GET http://localhost:3000/agenda/medico/87299678-a39f-46ff-a849-79c35f561945
### Criar horário na agenda do médico
POST http://localhost:3000/agenda
Content-Type: application/json
Authorization: Bearer {{AuthorizationMedico}}
{
"data": "2024-09-01",
"horaInicio": "09:00:00",
"horaFim": "09:50:00",
"reservado": true
}
### Editar horário na agenda do médico
PUT http://localhost:3000/agenda/d832d9b9-cfd5-4960-8214-c4452800cf94
Content-Type: application/json
Authorization: Bearer {{AuthorizationMedico}}
{
"data": "2024-09-01",
"horaInicio": "14:00:00",
"horaFim": "14:50:00",
"reservado": true
}
### Excluir horário da agenda do médico
DELETE http://localhost:3000/agenda/d832d9b9-cfd5-4960-8214-c4452800cf94
Authorization: Bearer {{AuthorizationMedico}}
### Reservar horário na agenda do médico
PATCH http://localhost:3000/agenda/book/d832d9b9-cfd5-4960-8214-c4452800cf94
### Liberar horário na agenda do médico
PATCH http://localhost:3000/agenda/free/d832d9b9-cfd5-4960-8214-c4452800cf94
##################################################
### Agendar consulta
POST http://localhost:3000/consulta
Content-Type: application/json
Authorization: Bearer {{AuthorizationPaciente}}
{
"agendaId": "6a9d3e75-06e2-4066-aa4a-9c2a5f44ba3f"
}
### Alterar status da consulta
PUT http://localhost:3000/consulta/status/1dd766b8-b543-4d96-be7f-1ecc3c268312?status=recusada
##################################################
### Listar arquivos no prontuário do paciente
GET http://localhost:3000/prontuario
Authorization: Bearer {{AuthorizationPaciente}}
### Compartilhar um arquivo do prontuário
GET http://localhost:3000/prontuario/share/radiografia-de-demonstracao.jpg
Authorization: Bearer {{AuthorizationPaciente}}
### Upload de arquivo
POST http://localhost:3000/prontuario
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Authorization: Bearer {{AuthorizationPaciente}}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"
title
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="radiografia-de-demonstracao.jpg"
Content-Type: image/jpeg
< ./docs/exames-demonstracao/radiografia-de-demonstracao-1.jpg
------WebKitFormBoundary7MA4YWxkTrZu0gW--