add action tindakan

This commit is contained in:
renaldybrada
2026-03-13 14:36:02 +07:00
parent 89e533aa44
commit fc9b4f5761
2 changed files with 98 additions and 50 deletions

No files matched your search

+27
View File
@@ -18,6 +18,9 @@ switch ($action) {
case "searchDokterAnestesi":
searchDokterAnestesi($db, $q);
break;
case "searchTindakan":
searchTindakan($db, $q);
break;
default :
echo json_encode([
"error" => "invalid action"
@@ -32,6 +35,8 @@ function searchDPJP(PostgresDb $db, string $q) {
}
$sql_dokter_bedah = $db->query($query);
$query .= " LIMIT 10";
$arr_dokter_bedah = array();
foreach ($sql_dokter_bedah->fetchAll() as $ds) {
@@ -51,6 +56,8 @@ function searchDokterAnestesi(PostgresDb $db, string $q) {
$query .= " AND (namadokter ILIKE '%$q%' OR kode_dpjp ILIKE '%$q%')";
}
$query .= " LIMIT 10";
$sql_dokter_anestesi = $db->query($query);
$arr_dokter_anestesi = array();
@@ -64,4 +71,24 @@ function searchDokterAnestesi(PostgresDb $db, string $q) {
]);
}
function searchTindakan(PostgresDb $db, string $q) {
$query = "SELECT kode as code, keterangan as str from icd_cm";
if ($q != '') {
$query .= " where kode ilike '$q%' OR keterangan ilike '%$q%'";
}
$query .= " LIMIT 10";
$sql_tindakan = $db->query($query);
$result = array();
foreach($sql_tindakan->fetchAll() as $t) {
array_push($result, $t);
}
echo json_encode([
"message" => "success get tindakan",
"data" => $result
]);
}
?>