const URL = "/one-api/mockup/masterdata/"; export async function lookup(token, search,all ) { try { var resp = await axios.post(URL + 'samplestation/lookup', { token: token, search: search, all:all }); 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 + 'samplestation/addnewsamplestation', 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 + 'samplestation/editsamplestation', 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 + 'samplestation/deletesamplestation', { 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 + 'samplestation/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 searchcity(token,prm) { try { var resp = await axios.post(URL + 'samplestation/searchcity',{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 + 'samplestation/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 searchtestheader(token,tes) { try { var resp = await axios.post(URL + 'samplestation/searchtestheader',{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 + 'samplestation/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 + 'samplestation/getdistrict',{id:prm.M_CityID,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 + 'samplestation/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 }; } }