| POST /api/login |
{
email: String,
password: String
}
|
{
result,
user:{
id,
firstname,
lastname,
middlename,
role,
email
}
}
|
Login |
| GET /api/user/active |
- |
{
id,
firstname,
lastname,
middlename,
role,
email
}
|
Current authenticated user |
| GET /api/users/doctors/list |
{
department: departmentId (optional),
speciality: specialityId (optional),
status: active/inactive
}
|
[{
id,
firstname,
lastname,
middlename,
photo,
speciality:{
id,
name
},
email,
status
}]
|
- Return Doctors list
- Filter by department, if given
- Filter by speciality, if given
- Filter by status, if given
|
| GET /api/users/doctors/view/{id} |
- |
{
id,
firstname,
lastname,
middlename,
photo,
gender,
dob: YYYY-mm-dd,
birth_place,
passport: AA0000000,
passport_given_date: YYYY-mm-dd,
passport_given_place,
speciality:{
id,
name
},
email,
phone,
address,
status
}
|
Doctor info |
| POST /api/users/doctors/save |
{
id: (For updating)
firstname,
lastname,
middlename,
photo: File,
gender,
dob: dd.mm.YYYY,
birth_place,
passport: AA0000000,
passport_given_date: dd.mm.YYYY,
passport_given_place,
speciality_id,
email,
phone,
address,
status,
old_password (For updating),
password
}
|
{
result: success/error,
data: {
id,
firstname,
lastname,
middlename,
photo,
gender,
dob: YYYY-mm-dd,
birth_place,
passport: AA0000000,
passport_given_date: YYYY-mm-dd,
passport_given_place,
speciality:{
id,
name
},
email,
phone,
address,
status
}
}
|
- Create User instance with role 'doctor'
- save photo (if given) to /public/uploads/doctors folder, set full url to photo field
- If password and old_password are given, check old_password and if it is valid, then update password (using bcrypt)
|
| DELETE /api/users/doctors/delete/{id} |
- |
{
result: 'success'||'error'
}
|
- Delete Doctor (User with role 'doctor') instance with given id
|
| GET /api/patients/list |
- |
[
{
id,
photo,
patient_id,
user_id,
firstname,
lastname,
middlename,
gender,
dob: YYYY-mm-dd,
passport: AA0000000,
address,
phone,
created_at: YYYY-mm-dd H:i
}
]
|
Patients list with full information |
| GET /api/patients/view/{id} |
- |
{
id,
photo,
patient_id,
user_id,
firstname,
lastname,
middlename,
gender,
dob: YYYY-mm-dd,
passport: AA0000000,
address,
blood_group,
current_condition,
phone,
created_at: YYYY-mm-dd H:i,
user: {
id: 1,
name,
lastname,
middlename,
email
},
patient_career_infos: [
{
id: 1,,
position,
organization,
start_date: YYYY-mm,
end_date: YYYY-mm,
address,
note,
currently_working: Boolean
}
]
}
|
Full information of a single patient |
| POST /api/patients/save |
{
id: (For updating)
photo: File
firstname,
lastname,
middlename,
patient_id: P00001,
gender: male/female,
dob: dd.mm.YYYY,
birth_place,
passport: AA0000000,
passport_given_date: dd.mm.YYYY,
passport_given_place,
phone,
email,
address,
career_infos: (JSON String)[{
organization,
position,
start_date: mm.YYYY,
end_date: mm.YYYY,
currently_working: Boolean
address
}],
blood_group,
current_condition
}
|
{
result: success/error,
data: {
id,
photo,
patient_id,
user_id,
firstname,
lastname,
middlename,
gender,
dob: YYYY-mm-dd,
passport: AA0000000,
address,
phone,
created_at: YYYY-mm-dd H:i,
}
}
|
- Create Patient instance, fill all informations
- save photo (if given) to /public/uploads/patients folder, set full url to photo field
- user_id will be id of authenticated user
- create PatientCareerInfo instance (if career info is given)
- if id is given, it should update patient (photo might not be given to update, then old photo should remain)
|
| DELETE /api/patients/delete/{id} |
- |
{
result: 'success'||'error'
}
|
- Delete Patient instance with given id
|
| GET /api/patients/generate-id |
- |
{
patient_id: P00001
}
|
- Generate unique ID for patient, It consists of one letter (prefix) and five digits
- This ID is key for a Patient and its MedicalCard
- In future, prefix will be customizable in settings
- Number part of ID should be get by incrementing rule
|
| GET /api/departments/list |
- |
[{
id,
name,
description,
status
}]
|
Departments list |
| GET /api/departments/view/{id} |
- |
{
id,
name,
description,
status,
created_at
}
|
Full information of a single department |
| POST /api/departments/save |
{
id: (for updating),
name,
description,
status
}
|
{
result: 'success'||'error',
message: (if error),
data: {
id,
name,
description,
status
}
}
|
Create/Update Department instance |
| DELETE /api/departments/delete/{id} |
- |
{
result: 'success'||'error'
}
|
- Delete Department instance with given id
- Update Specialities: set department_id of all Specialities of this Department to 0 (zero)
|
| GET /api/departments/specialities/list |
- |
[{
id,
department:{
id,
name,
status
},
name,
description,
status
}]
|
Specialities list |
| GET /api/departments/specialities/view/{id} |
- |
{
id,
department:{
id,
name,
status
},
name,
description,
status
}
|
Speciality info |
| POST /api/departments/specialities/save |
{
id: (for updating),
department_id,
name,
description,
status
}
|
{
result: 'success'||'error',
message: (if error),
data: {
id,
department:{
id,
name,
status
},
name,
description,
status
}
}
|
Create/Update Speciality instance |
| DELETE /api/departments/specialities/delete/{id} |
- |
{
result: 'success'||'error'
}
|
- Delete Speciality instance with given id
- Update Users: set speciality_id of all Doctors (Users with role 'doctor') with this Speciality to 0 (zero)
|