2026-02-12 07:32:31 +07:00
|
|
|
import { get, post, patch, del } from './client.js';
|
|
|
|
|
|
|
|
|
|
export async function fetchVisits(params = {}) {
|
|
|
|
|
const query = new URLSearchParams(params).toString();
|
|
|
|
|
return get(query ? `/api/patvisit?${query}` : '/api/patvisit');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function fetchVisit(id) {
|
|
|
|
|
return get(`/api/patvisit/${encodeURIComponent(id)}`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function fetchVisitsByPatient(patientId) {
|
|
|
|
|
return get(`/api/patvisit/patient/${encodeURIComponent(patientId)}`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function createVisit(data) {
|
|
|
|
|
return post('/api/patvisit', data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function updateVisit(data) {
|
|
|
|
|
return patch('/api/patvisit', data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function deleteVisit(id) {
|
|
|
|
|
return del('/api/patvisit', { body: JSON.stringify({ InternalPVID: id }) });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function createADT(data) {
|
|
|
|
|
return post('/api/patvisitadt', data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function updateADT(data) {
|
|
|
|
|
return patch('/api/patvisitadt', data);
|
|
|
|
|
}
|
2026-02-15 17:58:42 +07:00
|
|
|
|
|
|
|
|
export async function fetchVisitADTHistory(visitId) {
|
|
|
|
|
return get(`/api/patvisitadt/visit/${encodeURIComponent(visitId)}`);
|
|
|
|
|
}
|