Merge branch 'main' into zakaria
This commit is contained in:
commit
65302d0c5a
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,4 +3,5 @@
|
||||
!public/
|
||||
!cmod.7z
|
||||
!.gitignore
|
||||
!env
|
||||
!env
|
||||
!_message/
|
||||
@ -83,6 +83,7 @@ $routes->POST('api/patients/save', 'API_HISPatients::save');
|
||||
// API - For TM
|
||||
$routes->get('api/his/dictTests', 'API_HIS::dictTests');
|
||||
$routes->get('api/his/results/(:any)', 'API_HIS::results/$1');
|
||||
$routes->POST('api/his/requests', 'API_HIS::requests');
|
||||
// admin
|
||||
$routes->group('admin', ['filter' => 'role:admin'], static function ($routes) {
|
||||
$routes->get('', 'AdminController::index');
|
||||
|
||||
@ -5,6 +5,82 @@ use CodeIgniter\RESTful\ResourceController;
|
||||
|
||||
class API_HIS extends ResourceController {
|
||||
protected $format = 'json';
|
||||
|
||||
public function requests() {
|
||||
/*
|
||||
"reference_id": "4f52-8e25-48009b4f52-8e25-48009b4f52-8e25-48009b",
|
||||
"created": "2024-10-19T00:47:06.424654Z",
|
||||
"company_name": "company_name",
|
||||
"branch": "PBMC Bali",
|
||||
"total_patient_export_count": 2,
|
||||
"total_test_export_count": 4,
|
||||
"patient": {
|
||||
"rm_number": "1B0912243",
|
||||
"patient_first_name": "Jenifer",
|
||||
"patient_last_name": "Ngo",
|
||||
"patient_dob": "1999-11-12",
|
||||
"patient_sex": "F",
|
||||
"patient_phone": "62815456655885",
|
||||
"visit_number": "BV002304",
|
||||
"visit_description": null,
|
||||
"visit_date_time": "2024-10-19T00:47:06.424654Z",
|
||||
"agent_name": "Apollo Group",
|
||||
"agent": true/false,
|
||||
"treating_doctor": "Frida Susanti Sp.Ked",
|
||||
"visit_type": "MCU",
|
||||
"tests": [
|
||||
{
|
||||
"test_ref_id": "4f52-8e25-48009b04f52-8e25-4800900",
|
||||
"service_id": "SL00140"
|
||||
},
|
||||
{
|
||||
"test_ref_id": "4f52-8e25-48009b04f52-8e25-4800901",
|
||||
"service_id": "SL00142"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"reference_id": "4f52-8e25-48009b4f52-8e25-48009b4f52-8e25-48009b",
|
||||
"created": "2024-10-19T00:47:06.424654Z",
|
||||
"company_name": "company_name",
|
||||
"branch": "PBMC Bali",
|
||||
"total_patient_export_count": 2,
|
||||
"total_test_export_count": 4,
|
||||
"patient": {
|
||||
"rm_number": "1B0912243",
|
||||
"patient_first_name": "Jenifer",
|
||||
"patient_last_name": "Ngo",
|
||||
"patient_dob": "1999-11-12",
|
||||
"patient_sex": "F",
|
||||
"patient_phone": "62815456655885",
|
||||
"visit_number": "BV002304",
|
||||
"visit_description": null,
|
||||
"visit_date_time": "2024-10-19T00:47:06.424654Z",
|
||||
"agent_name": "Apollo Group",
|
||||
"agent": true,
|
||||
"treating_doctor": "Frida Susanti Sp.Ked",
|
||||
"visit_type": "MCU",
|
||||
"tests": [
|
||||
{
|
||||
"test_ref_id": "4f52-8e25-48009b04f52-8e25-4800900",
|
||||
"service_id": "SL00140"
|
||||
},
|
||||
{
|
||||
"test_ref_id": "4f52-8e25-48009b04f52-8e25-4800901",
|
||||
"service_id": "SL00142"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
*/
|
||||
$input = $this->request->getRawInput();
|
||||
if (empty($input)) { return $this->fail('No JSON data received', 400); }
|
||||
|
||||
var_dump($input);
|
||||
|
||||
//return $this->respond($input, 200);
|
||||
}
|
||||
|
||||
public function dictTests() {
|
||||
$db = \Config\Database::connect();
|
||||
|
||||
@ -10,7 +10,7 @@ class API_HISOrders extends ResourceController {
|
||||
$db = \Config\Database::connect();
|
||||
$date1 = $this->request->getPost('date1');
|
||||
$date2 = $this->request->getPost('date2');
|
||||
$sql = "select o.ORDERID, o.VISITNUMBER, o.VISITDATE, o.PAYERNAME, o.TREATDOC, p.PATNUMBER, p.SEX, p.PATNAME,
|
||||
$sql = "select o.ORDERID, o.LOC, o.VISITNUMBER, o.VISITDATE, o.PAYERNAME, o.TREATDOC, p.PATNUMBER, p.SEX, p.PATNAME,
|
||||
TESTS=stuff(( select ', '+t.HISCODE from
|
||||
( select t.HISCODE from cmod.dbo.CM_HIS_TESTS t
|
||||
where t.ORDERID=o.ORDERID and t.TESTSTATUS is null
|
||||
@ -43,6 +43,7 @@ class API_HISOrders extends ResourceController {
|
||||
//Object { patid: "9", visitnumber: "9989", visitdate: "2024-12-13", treatdoc: "alam", payername: "mala", tests: (2) […] }
|
||||
$orderid = $this->request->getPost('orderid');
|
||||
$patid = $this->request->getPost('patid');
|
||||
$loc = $this->request->getPost('loc');
|
||||
$visitnumber = $this->request->getPost('visitnumber');
|
||||
$visitdate = $this->request->getPost('visitdate');
|
||||
$treatdoc = $this->request->getPost('treatdoc');
|
||||
@ -50,10 +51,10 @@ class API_HISOrders extends ResourceController {
|
||||
$tests = $this->request->getPost('tests');
|
||||
|
||||
if($orderid == '0') {
|
||||
$sql = "INSERT INTO cmod.dbo.CM_HIS_ORDERS (PATID, VISITNUMBER, VISITDATE, TREATDOC, PAYERNAME)
|
||||
VALUES ('$patid', '$visitnumber', '$visitdate', '$treatdoc', '$payername')";
|
||||
$sql = "INSERT INTO cmod.dbo.CM_HIS_ORDERS (PATID, LOC, VISITNUMBER, VISITDATE, TREATDOC, PAYERNAME)
|
||||
VALUES ('$patid', '$loc', '$visitnumber', '$visitdate', '$treatdoc', '$payername')";
|
||||
} else {
|
||||
$sql = "UPDATE cmod.dbo.CM_HIS_ORDERS set PATID='$patid', VISITNUMBER='$visitnumber', VISITDATE='$visitdate',
|
||||
$sql = "UPDATE cmod.dbo.CM_HIS_ORDERS set PATID='$patid', LOC='$loc', VISITNUMBER='$visitnumber', VISITDATE='$visitdate',
|
||||
TREATDOC='$treatdoc', PAYERNAME='$payername' where ORDERID='$orderid'";
|
||||
}
|
||||
|
||||
|
||||
@ -58,8 +58,13 @@ $visitdate = $now;
|
||||
<td><input type="datetime" id="visitdate" class="form-control form-control-sm" value='<?=$visitdate;?>'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Treating Doctor</td>
|
||||
<td colspan='3'><input type="text" id="treatdoc" class="form-control form-control-sm"></td>
|
||||
<td>Location</td>
|
||||
<td colspan='3'>
|
||||
<select id='loc' class='form-control'>
|
||||
<option name='DPS'>Denpasar</option>
|
||||
<option name='SBY'>Surabaya</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Payer Name</td>
|
||||
@ -182,7 +187,7 @@ function orderDetail(orderid) {
|
||||
success: function(response) {
|
||||
var data = response['orders'];
|
||||
$('#payername').val(data[0].PAYERNAME);
|
||||
$('#treatdoc').val(data[0].TREATDOC);
|
||||
$('#loc').val(data[0].LOC);
|
||||
$('#visitdate').val(data[0].VISITDATE);
|
||||
$('#visitnumber').val(data[0].VISITNUMBER);
|
||||
patSelect(data[0].PATID);
|
||||
@ -205,11 +210,12 @@ function save() {
|
||||
if(confirm) {
|
||||
var orderid = $("#orderid").val();
|
||||
var patid = $("#patid").val();
|
||||
var loc = $("#loc").val();
|
||||
var visitnumber = $("#visitnumber").val();
|
||||
var visitdate = $("#visitdate").val();
|
||||
var treatdoc = $("#treatdoc").val();
|
||||
var payername = $("#payername").val();
|
||||
let data = { orderid:orderid, patid:patid, visitnumber:visitnumber, visitdate:visitdate, treatdoc:treatdoc, payername:payername ,tests:new Array() };
|
||||
let data = { orderid:orderid, loc:loc, patid:patid, visitnumber:visitnumber, visitdate:visitdate, treatdoc:treatdoc, payername:payername ,tests:new Array() };
|
||||
for (let i = 1; i <= 50; i++) {
|
||||
let className = `.test${i}`;
|
||||
let value = $(className).val();
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
<table id="myTable" class="table">
|
||||
<thead>
|
||||
<th>VisitDate</th>
|
||||
<th>Loc.</th>
|
||||
<th>Visit#</th>
|
||||
<th>MR#</th>
|
||||
<th>Patient Name</th>
|
||||
@ -60,6 +61,7 @@ function index() {
|
||||
var data = response['data'];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
orderid = data[i].ORDERID;
|
||||
loc = data[i].LOC;
|
||||
visitdate = data[i].VISITDATE;
|
||||
visitnumber = data[i].VISITNUMBER;
|
||||
patnumber = data[i].PATNUMBER;
|
||||
@ -69,7 +71,7 @@ function index() {
|
||||
editBtn = '<button class="btn btn-sm btn-warning" onclick="edit(\''+ orderid +'\')"><i class="bi bi-pencil"></i> edit</button>';
|
||||
resendBtn = '<button class="btn btn-sm btn-primary" onclick="resend(\''+ visitnumber +'\')"><i class="bi bi-send"></i> resend</button>';
|
||||
let datarow = '<tr class="align-middle">' +
|
||||
'<td>' + visitdate + '</td> <td>' + visitnumber + '</td> <td>' + patnumber + '</td> <td>' + patname +
|
||||
'<td>' + visitdate + '</td> <td>' + loc + '</td> <td>' + visitnumber + '</td> <td>' + patnumber + '</td> <td>' + patname +
|
||||
'</td> <td>' + payername + '</td> <td>' + tests + '</td> ' +
|
||||
'<td>' + resendBtn + ' ' + editBtn + '</td>' +
|
||||
'</tr>';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user