init biotest web
This commit is contained in:
119
one-klinik-biotest/test/vuex/one-clinic-form/api/patient.js
Normal file
119
one-klinik-biotest/test/vuex/one-clinic-form/api/patient.js
Normal file
@@ -0,0 +1,119 @@
|
||||
const URL = "/be_clinic.php";
|
||||
|
||||
export async function search(nik, name, dob, hp, current_page) {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
cmd:"getpatient",
|
||||
nik: nik,
|
||||
name: name,
|
||||
dob: dob,
|
||||
hp: hp,
|
||||
current_page:current_page
|
||||
});
|
||||
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 getcompanyclinic() {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
cmd:"getcompany",
|
||||
});
|
||||
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 getnurseclinic() {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
cmd:"getnurse",
|
||||
});
|
||||
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 getdoctorclinic() {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
cmd:"getdoctor",
|
||||
});
|
||||
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 addclinic(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
cmd:"add",
|
||||
orderDate: prm.orderDate,
|
||||
M_PatientID: prm.M_PatientID,
|
||||
NurseID: prm.NurseID,
|
||||
M_CompanyID: prm.M_CompanyID,
|
||||
Keluhan: prm.Keluhan,
|
||||
Objective: prm.Objective,
|
||||
Kesimpulan: prm.Kesimpulan,
|
||||
Saran: prm.Saran
|
||||
});
|
||||
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