import request from './request';

export const getPatients = (params) => {
  return request.get('/b/patients', { params });
};

export const getPatientDoctors = (params) => {
  return request.get('/b/patients/doctors', { params });
};

export const getPatientById = (id) => {
  return request.get(`/b/patients/${id}`);
};

export const createPatient = (data) => {
  return request.post('/b/patients', data);
};

export const updatePatient = (id, data) => {
  return request.patch(`/b/patients/${id}`, data);
};

export const createPatientSurgery = (id, data) => {
  return request.post(`/b/patients/${id}/surgeries`, data);
};

export const updatePatientSurgery = (patientId, surgeryId, data) => {
  return request.patch(`/b/patients/${patientId}/surgeries/${surgeryId}`, data);
};

export const deletePatient = (id) => {
  return request.delete(`/b/patients/${id}`);
};

export const getPatientLifecycle = (id) => {
  return request.get(`/b/patients/${id}/lifecycle`);
};
