const URL = "/one-api/mockup/masterdata/"; export async function lookup(prm) { try { var resp = await axios.post(URL + 'abnormalv4/lookup', 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 lookupbyname(prm) { try { var resp = await axios.post(URL + 'abnormalv4/lookupabnormalbyname', 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 getsexreg(token) { try { var resp = await axios.post(URL + 'abnormalv4/getsexreg',{token:token}); 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(prm) { try { var resp = await axios.post(URL + 'abnormalv4/addnewabnormal', 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 update(prm) { try { var resp = await axios.post(URL + 'abnormalv4/editabnormal', 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 xdelete(token,id) { try { var resp = await axios.post(URL + 'abnormalv4/deleteabnormal', { id: id, token:token }); 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 selectnonlab(token) { try { var resp = await axios.post(URL + 'abnormalv4/selectnonlab',{token:token}); 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 searchdetail(token,prm) { try { var resp = await axios.post(URL + 'abnormalv4/searchdetail',{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 + 'abnormalv4/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 searchinstrument(token,tes) { try { var resp = await axios.post(URL + 'abnormalv4/searchinstrument',{token:token,search:tes}); 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 searchtemplate(token,tes) { try { var resp = await axios.post(URL + 'abnormalv4/searchtemplate',{token:token,search:tes}); 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 getdistrict(token,prm) { try { var resp = await axios.post(URL + 'abnormalv4/getdistrict',{id:prm.Nat_NormalValueDetailID,token:token}); 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 getkelurahan(token,prm) { try { var resp = await axios.post(URL + 'abnormalv4/getkelurahan',{token:token,id:prm.M_DistrictID}); if (resp.status != 200) { return { status: "ERR", message: resp.statusText }; } let data = resp.data; return data; } catch(e) { return { status: "ERR", message: e.message }; } }