Files
FE_CPONE/test/vuex/one-courier-mobile/api/patient.js
2026-04-27 10:13:31 +07:00

100 lines
2.2 KiB
JavaScript

const URL = "/one-api/mockup/courier_mobile/";
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
};
}
}