Flatten nested repos
This commit is contained in:
107
test/vuex/one-fo-verification-simple-barcode/api/patient.js
Normal file
107
test/vuex/one-fo-verification-simple-barcode/api/patient.js
Normal file
@@ -0,0 +1,107 @@
|
||||
const URL = "/one-api/mockup/fo/verification/";
|
||||
|
||||
export async function search(token, nolab, nama, status) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/search', {
|
||||
token:token,
|
||||
nolab: nolab,
|
||||
nama: nama,
|
||||
status: status
|
||||
});
|
||||
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_barcodes(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 addnewlabel(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/addnewlabel',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(token, patient, status) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/save', {
|
||||
token:token,
|
||||
patient: patient,
|
||||
status: status
|
||||
});
|
||||
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(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/verify', 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
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user