Files
FE_CPONE/test/vuex/cpone-nonlab-upload-document/api/patient.js
2026-04-27 10:13:31 +07:00

173 lines
4.0 KiB
JavaScript

const URL = "/one-api/mockup/cpone-nonlab-upload-document/";
export async function search_patient(prm) {
try {
var resp = await axios.post(URL + 'patient/search_patient', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search(prm) {
try {
var resp = await axios.post(URL + 'patient/search', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchcompany(token, prm) {
try {
var resp = await axios.post(URL + 'patient/searchcompany', { token: token, search: prm });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function lookup_statuses(prm) {
try {
var resp = await axios.post(URL + 'patient/lookup_statuses', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getdatabarcodes(prm) {
try {
var resp = await axios.post(URL + 'patient/lookup_barcodes', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function serahkan(prm) {
try {
var resp = await axios.post(URL + 'patient/serahkan', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function uploadDocument(prm) {
try {
var resp = await axios.post(URL + 'patient/uploadDocument', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getdocument(prm) {
try {
var resp = await axios.post(URL + 'patient/getdocument', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function deleteFile(prm) {
try {
var resp = await axios.post(URL + 'patient/deleteFile', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}