forked from girishgupta211-zz/Health-Democracy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApi-doc.txt
165 lines (153 loc) · 4.85 KB
/
Api-doc.txt
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
Api DEtails:
1. Register Patient:
Header: {'Content-Type': 'application/json'}
Url: http://localhost:7000/eth/registerPatient
Type: POST
Data: { name: name, (type: string) // Name of patient
mobileNo: mobileNo,(type: number) // Mobile no of Patient
dob:dob, (type: number)// DOb of Patient
bloodGroup: bloodGroup,(type: string) // BloodGroup of patient
address: address, (type: string) // Address of Patient
from: from (type: string) // Adress from which transaction is to be sent
}
Response: {"success":"true",
"data":{
'txHash': txHash,
'patientsAddress':patientAddress
}
}
2. Get Patient Details
Header: {'Content-Type': 'application/json'}
Url: http://localhost:7000/eth/getPatinetDetails
Type: POST
Data: {
id : patientsId (type: string)// Patients's id
}
Response: {"success":"true",
data":{
'txHash': txHash,
'txIndex':txIndex,
'blockHash': blockHash,
'blockNumber':blockNumber,
'gasUsed':gasUsed,
'cumulativeGasUsed':cumulativeGasUsed
}
}
3.Add Prescription:
Header: {'Content-Type': 'application/json'}
Url: http://localhost:7000/eth/addPrescription
Type: POST
Ddata = {
'patientId': patientId,
'prescription': {
name:name, (type: string) // name of Medicine
timesADay: timesADay, (type: Number)// how many times a day patient should take medicines
fromdate: fromDate,(type:Date) // from which date patient should start takeing medicine
tillDate: tillDate, (type:Date) // till what date patient should take medicine
doctorId: doctorId (type: string)// id of doctor who prescribed medicine
}
}
Response: {"success":"true","data":"Prescription added successfully"}
4. Get Transaction Reciept:
Url: http://localhost:7000/eth/getTransactionReceipt
Type: POST
Data = {
txHash: txHash (type: string)// Transaction Hash whose Receipt is needed.
}
Response:
{"success":"true",
"data":{
'txHash': txHash,
'txIndex':txIndex,
'blockHash': blockHash,
'blockNumber':blockNumber,
'gasUsed':gasUsed,'
'cumulativeGasUsed':cumulativeGasUsed
}
5. Get Schedule
Header: {'Content-Type': 'application/json'}
Url: http://localhost:7000/eth/getSchedule
Type: POST
data = {'patientId': patientId }
Response:
{
"success": "true",
"data": [
{
"result": {
"success": true,
"data": [
{
"_id": "5978dc17a2b7123ae69f6b3d",
"patientId": "0x1309d6120d98aaf56913c7ab7b5964a95ecb8697",
"medicineName": "name2",
"date": "2017-06-26T18:30:00.000Z",
"time": 1,
"status": "pending",
"__v": 0
},
{
"_id": "5978e8ab7fd7ce412fbb1931",
"patientId": "0x1309d6120d98aaf56913c7ab7b5964a95ecb8697",
"medicineName": "name2",
"date": "2017-06-26T18:30:00.000Z",
"time": 2,
"status": "pending",
"__v": 0
}
]
}
}
]
}
6. Get PrescriptionLogs
Header: {'Content-Type': 'application/json'}
Url: http://localhost:7000/eth/getPrescriptionLogs
Type: POST
data = {'patientId': patientId } (optional)
Response:
{
"success": "true",
"data": [
{
"result": {
"success": true,
"data": [
{
"_id": "5978e8ab7fd7ce412fbb1932",
"patientId": "0x1309d6120d98aaf56913c7ab7b5964a95ecb8697",
"__v": 0,
"prescription": [
{
"medicineName": "name1",
"timesADay": 3,
"fromDate": "2017-06-22T18:30:00.000Z",
"tillDate": "2017-06-25T18:30:00.000Z",
"doctorId": "doc1",
"_id": "5978e8ab7fd7ce412fbb1934"
},
{
"medicineName": "name2",
"timesADay": 3,
"fromDate": "2017-06-23T18:30:00.000Z",
"tillDate": "2017-06-26T18:30:00.000Z",
"doctorId": "doc2",
"_id": "5978e8ab7fd7ce412fbb1933"
}
]
}
]
}
}
]
}
7. updateMedicineTakeStatus
Header: {'Content-Type': 'application/json'}
Url: http://localhost:7000/eth/updateMedicineTakeStatus
Type: POST
data = {'patientId':'0x1309d6120d98aaf56913c7ab7b5964a95ecb8697', 'medicineName':'name2', 'date':'06/27/2017', 'time':'2', 'status':'taken'}
Response:
{
"success": "true",
"message": "status upadated sucessfully"
}