import { api } from './request'; export interface Patient { id: string; name: string; gender?: string; birth_date?: string; blood_type?: string; id_number?: string; allergy_history?: string; medical_history_summary?: string; emergency_contact_name?: string; emergency_contact_phone?: string; phone?: string; relation?: string; status?: string; verification_status?: string; source?: string; notes?: string; version: number; } export async function listPatients() { return api.get<{ data: Patient[]; total: number }>('/health/patients', { page: 1, page_size: 100, }); } export async function createPatient(data: { name: string; gender?: string; birth_date?: string; phone?: string; id_number?: string; }) { return api.post('/health/patients', data); } export interface PatientUpdateInput { name?: string; gender?: string; birth_date?: string; phone?: string; id_number?: string; relation?: string; } export async function updatePatient(id: string, data: PatientUpdateInput, version: number) { return api.put(`/health/patients/${id}`, { ...data, version }); }