119 lines
2.4 KiB
JavaScript
119 lines
2.4 KiB
JavaScript
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
|
|
};
|
|
}
|
|
} |