Files
FE_CPONE/test/vuex/one-patient-list-barcode-vv-7-cpone-promise/api/patient.js
2026-04-27 10:13:31 +07:00

361 lines
8.1 KiB
JavaScript

const URL = "/one-api/mockup/patientlistbarcode-vv-7-cpone-promise/";
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 searchdoctor(token, prm) {
try {
var resp = await axios.post(URL + 'patient/searchdoctor', { 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 searchtest(token, prm) {
try {
var resp = await axios.post(URL + 'patient/searchtest', { 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_promises(prm) {
try {
var resp = await axios.post(URL + 'patient/lookup_promises', 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 getdatadob(prm) {
try {
var resp = await axios.post(URL + 'patient/getdatadob', 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 updatedob(prm) {
try {
var resp = await axios.post(URL + 'patient/updatedob', 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 gettimelinedelivery(prm) {
try {
var resp = await axios.post(URL + 'patient/gettimelinedelivery', 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 save_promises(prm) {
try {
var resp = await axios.post(URL + 'patient/save_promises', 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 getbranch(prm) {
try {
var resp = await axios.post(URL + 'patient/getbranch', 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 get_order_promise_details(prm) {
try {
var resp = await axios.post(URL + 'patient/get_order_promise_details', 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 get_orderdetail_without_promise(prm) {
try {
var resp = await axios.post(URL + 'patient/get_orderdetail_without_promise', 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 save_new_promise(prm) {
try {
var resp = await axios.post(URL + 'patient/save_new_promise', 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 save_new_additional_promise(prm) {
try {
var resp = await axios.post(URL + 'patient/save_new_additional_promise', 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 get_promises(prm) {
try {
var resp = await axios.post(URL + 'patient/get_promises', 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 remove_test_from_promise(prm) {
try {
var resp = await axios.post(URL + 'patient/remove_test_from_promise', 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 get_detail_order(prm) {
try {
var resp = await axios.post(URL + 'patient/get_detail_order', 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
};
}
}