209 lines
5.0 KiB
JavaScript
209 lines
5.0 KiB
JavaScript
// API :
|
|
// search bank
|
|
// paramater : query , page , rowPerPage
|
|
const URL =
|
|
"/one-api/mockup/sampling/handling/";
|
|
|
|
export async function search(nolab, search) {
|
|
try {
|
|
var resp = await axios.post(URL + 'handling_patient/search', {
|
|
search: search,
|
|
nolab: nolab
|
|
});
|
|
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_sent() {
|
|
// try {
|
|
// var resp = await axios.post(URL + 'receive_patient/search_sent', {});
|
|
// 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 verify(token, orderid, laststatusid, datax) {
|
|
try {
|
|
var resp = await axios.post(URL + 'handling_patient/verify', {
|
|
token: token,
|
|
orderid: orderid,
|
|
laststatusid: laststatusid,
|
|
data: datax
|
|
});
|
|
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 verify_process(token, orderid, laststatusid) {
|
|
try {
|
|
var resp = await axios.post(URL + 'handling_patient/verify_process', {
|
|
token: token,
|
|
orderid: orderid,
|
|
laststatusid: laststatusid
|
|
});
|
|
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 reject(token, orderid, laststatusid, datax) {
|
|
try {
|
|
var resp = await axios.post(URL + 'handling_patient/reject', {
|
|
token: token,
|
|
orderid: orderid,
|
|
laststatusid: laststatusid,
|
|
data: datax
|
|
});
|
|
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 reject_process(token, orderid, laststatusid) {
|
|
try {
|
|
var resp = await axios.post(URL + 'handling_patient/reject_process', {
|
|
token: token,
|
|
orderid: orderid,
|
|
laststatusid: laststatusid
|
|
});
|
|
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_requirement() {
|
|
try {
|
|
var resp = await axios.post(URL + 'handling_patient/get_requirement', {});
|
|
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_requirement(token, order_id, sample_id, status, reqs) {
|
|
try {
|
|
var resp = await axios.post(URL + 'handling_patient/save_requirement', {
|
|
token: token,
|
|
order_id: order_id,
|
|
sample_id: sample_id,
|
|
status: status,
|
|
reqs: reqs
|
|
});
|
|
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_requirement_process(token, order_id, sample_id, status, reqs) {
|
|
try {
|
|
var resp = await axios.post(URL + 'handling_patient/save_requirement_process', {
|
|
token: token,
|
|
order_id: order_id,
|
|
sample_id: sample_id,
|
|
status: status,
|
|
reqs: reqs
|
|
});
|
|
if (resp.status != 200) {
|
|
return {
|
|
status: "ERR",
|
|
message: resp.statusText
|
|
};
|
|
}
|
|
let data = resp.data;
|
|
return data;
|
|
} catch(e) {
|
|
return {
|
|
status: "ERR",
|
|
message: e.message
|
|
};
|
|
}
|
|
} |