Merge pull request 'Staging → Master: Stemcell & CPone Dashboard Live (2026-06-25)' (#1) from staging into master
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -313,7 +313,7 @@ class Transactionv5 extends MY_Controller
|
||||
public function post_auth()
|
||||
{
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
$url = $baseUrl . '/api/auth/auth.php';
|
||||
$headers = array(
|
||||
'Header-Token: ' . $dt_config['AisConfigHeaderToken']
|
||||
@@ -392,7 +392,7 @@ class Transactionv5 extends MY_Controller
|
||||
}
|
||||
// Get config
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
$url = $baseUrl . '/api/transaction_full/transaksi.php';
|
||||
|
||||
$headers = array(
|
||||
@@ -948,7 +948,7 @@ class Transactionv5 extends MY_Controller
|
||||
}
|
||||
// Get config
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
$url = $baseUrl . 'api/transaction_full/transaksi.php';
|
||||
|
||||
$headers = array(
|
||||
@@ -1477,7 +1477,7 @@ class Transactionv5 extends MY_Controller
|
||||
}
|
||||
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
$url = $baseUrl . 'api/medrec?id=' . $noreg;
|
||||
|
||||
|
||||
@@ -1513,7 +1513,7 @@ class Transactionv5 extends MY_Controller
|
||||
}
|
||||
// Get config
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
$url = $baseUrl . '/api/medrec';
|
||||
|
||||
$headers = [
|
||||
@@ -1631,7 +1631,7 @@ class Transactionv5 extends MY_Controller
|
||||
}
|
||||
// Get config
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
$url = $baseUrl . '/api/medrec';
|
||||
|
||||
$headers = [
|
||||
@@ -1748,7 +1748,7 @@ class Transactionv5 extends MY_Controller
|
||||
}
|
||||
// Get config
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
$url = $baseUrl . '/api/transaction_full/transaksi.php';
|
||||
|
||||
$headers = array(
|
||||
@@ -2248,7 +2248,7 @@ class Transactionv5 extends MY_Controller
|
||||
}
|
||||
// Get config
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
$url = $baseUrl . '/api/transaction_full/transaksi.php';
|
||||
|
||||
$headers = array(
|
||||
@@ -2744,7 +2744,7 @@ class Transactionv5 extends MY_Controller
|
||||
}
|
||||
// Get config
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
$url = $baseUrl . '/api/transaction_full/transaksi.php';
|
||||
|
||||
$headers = array(
|
||||
@@ -3242,7 +3242,7 @@ class Transactionv5 extends MY_Controller
|
||||
}
|
||||
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
$url = $baseUrl . '/api/transaksi?id=' . $id;
|
||||
|
||||
|
||||
@@ -3301,7 +3301,7 @@ class Transactionv5 extends MY_Controller
|
||||
}
|
||||
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
$url = $baseUrl . '/api/transaksi?id=' . $labnumber;
|
||||
|
||||
|
||||
@@ -3337,7 +3337,7 @@ class Transactionv5 extends MY_Controller
|
||||
}
|
||||
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
$url = $baseUrl . '/api/transaksi?id=' . $labnumber;
|
||||
|
||||
|
||||
@@ -3517,7 +3517,7 @@ class Transactionv5 extends MY_Controller
|
||||
|
||||
// Get config first before using it
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
|
||||
$headers = array(
|
||||
'Header-Token: ' . $dt_config['AisConfigHeaderToken'],
|
||||
@@ -3596,7 +3596,7 @@ class Transactionv5 extends MY_Controller
|
||||
|
||||
// Get config first before using it
|
||||
$dt_config = $this->get_config();
|
||||
$baseUrl = $dt_config['AisConfigBaseUrlSC'];
|
||||
$baseUrl = $dt_config['AisConfigBaseUrl'];
|
||||
|
||||
$headers = array(
|
||||
'Header-Token: ' . $dt_config['AisConfigHeaderToken'],
|
||||
|
||||
@@ -777,6 +777,16 @@ class Order extends MY_Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ($icd10_code != '') {
|
||||
$fn_save_icd10 = $this->save_icd10($header_id, $icd10_code, $icd10_display, $userid);
|
||||
if (!$fn_save_icd10['status']) {
|
||||
$this->db_smartone->trans_rollback();
|
||||
$message = $fn_save_icd10['message'] ?? 'Terjadi kesalahan saat menyimpan data ICD10';
|
||||
$this->sys_error($message);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db_smartone->trans_commit();
|
||||
//print_r($dt_menu);
|
||||
$xurl = '';
|
||||
@@ -3614,4 +3624,70 @@ GROUP BY T_SampleStationID ";
|
||||
return $row;
|
||||
}
|
||||
}
|
||||
|
||||
function save_icd10($header_id, $icd10_code, $icd10_name, $userid)
|
||||
{
|
||||
$check = $this->db_smartone->query(
|
||||
"SELECT T_OrderHeaderICD10ID FROM t_orderheader_icd10 WHERE T_OrderHeaderICD10T_OrderHeaderID = ? LIMIT 1",
|
||||
[$header_id]
|
||||
);
|
||||
if ($check && $check->num_rows() > 0) {
|
||||
return ['status' => true];
|
||||
}
|
||||
|
||||
$sql = "INSERT IGNORE INTO t_orderheader_icd10 (
|
||||
T_OrderHeaderICD10T_OrderHeaderID,
|
||||
T_OrderHeaderICD10Code,
|
||||
T_OrderHeaderICD10Name,
|
||||
T_OrderHeaderICD10IsActive,
|
||||
T_OrderHeaderICD10Created,
|
||||
T_OrderHeaderICD10CreatedUserID,
|
||||
T_OrderHeaderICD10LastUpdated,
|
||||
T_OrderHeaderICD10LastUpdatedUserID
|
||||
) VALUES (?, ?, ?, 'Y', NOW(), ?, NOW(), ?)";
|
||||
|
||||
$query = $this->db_smartone->query($sql, [
|
||||
$header_id,
|
||||
$icd10_code,
|
||||
$icd10_name,
|
||||
$userid,
|
||||
$userid
|
||||
]);
|
||||
|
||||
if (!$query) {
|
||||
$this->insert_log_error($this->db_smartone->last_query(), ['INSERT_T_ORDERHEADER_ICD10', 'order/save'], [
|
||||
'header_id' => $header_id,
|
||||
'icd10_code' => $icd10_code,
|
||||
'error' => $this->db_smartone->error()
|
||||
]);
|
||||
return ['status' => false, 'message' => 'error insert t_orderheader_icd10 | ' . $this->db_smartone->error()['message']];
|
||||
}
|
||||
|
||||
return ['status' => true];
|
||||
}
|
||||
|
||||
function search_icd10()
|
||||
{
|
||||
if (!$this->isLogin) {
|
||||
$this->sys_error("Invalid Token");
|
||||
exit;
|
||||
}
|
||||
|
||||
$prm = $this->sys_input;
|
||||
|
||||
$sql = "SELECT terminology.*, CONCAT(code,' | ', display) as display_name
|
||||
FROM one_terminology.terminology
|
||||
WHERE
|
||||
attribute_path = 'icd10' AND ( code LIKE CONCAT('%',?,'%') OR MATCH (display) AGAINST (? IN NATURAL LANGUAGE MODE) OR CONCAT(code,' | ', display) LIKE CONCAT('%',?,'%'))
|
||||
GROUP BY code";
|
||||
$query = $this->db_onedev->query($sql, array($prm['search'], $prm['search'], $prm['search']));
|
||||
if (!$query) {
|
||||
$this->sys_error("Gagal cari ICD10");
|
||||
}
|
||||
|
||||
$result = $query->result_array();
|
||||
|
||||
$this->sys_ok($result);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -585,13 +585,14 @@ class Px extends MY_Controller
|
||||
|
||||
$ids_str = implode(',', array_unique($test_ids));
|
||||
$sql = "SELECT T_TestID, T_TestNat_GroupID FROM t_test WHERE T_TestID IN ($ids_str)";
|
||||
$query = $this->db_smartone->query($sql);
|
||||
|
||||
$nat_group_map = [];
|
||||
if ($query) {
|
||||
foreach ($query->result_array() as $r) {
|
||||
$result = mysqli_query($this->db_smartone->conn_id, $sql);
|
||||
if ($result) {
|
||||
while ($r = mysqli_fetch_assoc($result)) {
|
||||
$nat_group_map[(int)$r['T_TestID']] = (int)$r['T_TestNat_GroupID'];
|
||||
}
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
$filtered = [];
|
||||
@@ -615,7 +616,7 @@ class Px extends MY_Controller
|
||||
$child_nat_groups[] = isset($nat_group_map[$child_id]) ? $nat_group_map[$child_id] : 0;
|
||||
}
|
||||
|
||||
$all_stemcell = !in_array(false, array_map(fn($g) => $g == 7, $child_nat_groups), true);
|
||||
$all_stemcell = !in_array(false, array_map(function($g) { return $g == 7; }, $child_nat_groups), true);
|
||||
$any_stemcell = in_array(7, $child_nat_groups);
|
||||
|
||||
if ($is_stemcell == 'Y' && !$all_stemcell) continue;
|
||||
|
||||
2580
application/controllers/mockup/mcuoffline/Resumeindividucponev8.php
Normal file
2580
application/controllers/mockup/mcuoffline/Resumeindividucponev8.php
Normal file
File diff suppressed because it is too large
Load Diff
128
docs_icd10_walk_in_registration_stemcell.md
Normal file
128
docs_icd10_walk_in_registration_stemcell.md
Normal file
@@ -0,0 +1,128 @@
|
||||
# Dokumentasi API ICD10 — Walk-in Registration Stemcell
|
||||
|
||||
Base URL dev:
|
||||
|
||||
```text
|
||||
https://devcpone.aplikasi.web.id/one-api/mockup/fo/walk_in_registration_stemcell/order
|
||||
```
|
||||
|
||||
Semua response API menggunakan format standar:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "OK",
|
||||
"data": []
|
||||
}
|
||||
```
|
||||
|
||||
Jika gagal:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "ERR",
|
||||
"message": "Pesan error"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 1. Search ICD10
|
||||
|
||||
Digunakan untuk mencari data ICD10 berdasarkan kode atau nama diagnosis. Hasil dapat digunakan untuk mengisi field `selected_icd10` pada saat registrasi.
|
||||
|
||||
**Endpoint:**
|
||||
|
||||
```http
|
||||
POST /search_icd10
|
||||
```
|
||||
|
||||
**Request body:**
|
||||
|
||||
| Field | Tipe | Wajib | Keterangan |
|
||||
|----------|--------|-------|-------------------------------------|
|
||||
| `search` | string | Ya | Kata kunci pencarian (kode / nama) |
|
||||
|
||||
**Contoh request:**
|
||||
|
||||
```json
|
||||
{
|
||||
"search": "diabetes"
|
||||
}
|
||||
```
|
||||
|
||||
**Contoh response sukses:**
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "OK",
|
||||
"data": [
|
||||
{
|
||||
"code": "E11",
|
||||
"display": "Type 2 diabetes mellitus",
|
||||
"display_name": "E11 | Type 2 diabetes mellitus"
|
||||
},
|
||||
{
|
||||
"code": "E10",
|
||||
"display": "Type 1 diabetes mellitus",
|
||||
"display_name": "E10 | Type 1 diabetes mellitus"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Contoh curl:**
|
||||
|
||||
```bash
|
||||
curl -X POST "https://devcpone.aplikasi.web.id/one-api/mockup/fo/walk_in_registration_stemcell/order/search_icd10" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer {token}" \
|
||||
-d '{"search": "diabetes"}'
|
||||
```
|
||||
|
||||
**Catatan:**
|
||||
- Pencarian mendukung kode ICD10 (contoh: `E11`), nama diagnosis, maupun kombinasi keduanya.
|
||||
- Autocomplete ICD10 pada tab Demografi modul FE `one-fo-registration-walk-in-stemcell` menggunakan endpoint ini.
|
||||
- Gunakan field `code` dan `display` dari hasil pencarian untuk mengisi `selected_icd10` pada payload `save`.
|
||||
|
||||
---
|
||||
|
||||
## 2. Save (dengan ICD10)
|
||||
|
||||
Fungsi `save` yang sudah ada kini secara otomatis menyimpan data ICD10 ke tabel `t_orderheader_icd10` jika field `selected_icd10` diisi.
|
||||
|
||||
**Endpoint:**
|
||||
|
||||
```http
|
||||
POST /save
|
||||
```
|
||||
|
||||
**Tambahan field pada request body:**
|
||||
|
||||
| Field | Tipe | Wajib | Keterangan |
|
||||
|-----------------|--------|-------|--------------------------------------------------|
|
||||
| `selected_icd10` | object | Tidak | Objek ICD10 yang dipilih dari hasil `search_icd10` |
|
||||
|
||||
**Struktur `selected_icd10`:**
|
||||
|
||||
| Field | Tipe | Keterangan |
|
||||
|-----------|--------|-------------------------|
|
||||
| `code` | string | Kode ICD10 (contoh: `E11`) |
|
||||
| `display` | string | Nama diagnosis |
|
||||
|
||||
**Contoh potongan request body:**
|
||||
|
||||
```json
|
||||
{
|
||||
"selected_icd10": {
|
||||
"code": "E11",
|
||||
"display": "Type 2 diabetes mellitus"
|
||||
},
|
||||
...field lainnya seperti biasa...
|
||||
}
|
||||
```
|
||||
|
||||
**Perilaku:**
|
||||
- Jika `selected_icd10` tidak diisi atau `code` kosong, data ICD10 tidak disimpan dan proses save tetap berjalan normal.
|
||||
- Jika `selected_icd10` diisi, sistem akan menyimpan satu record ke `t_orderheader_icd10`.
|
||||
- Satu order header hanya boleh punya satu record ICD10. Jika sudah ada, insert akan dilewati (tidak error).
|
||||
- Jika insert ICD10 gagal, seluruh transaksi save akan di-rollback.
|
||||
16
scripts/sql/2026-06-25_create_t_orderheader_icd10.sql
Normal file
16
scripts/sql/2026-06-25_create_t_orderheader_icd10.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
CREATE TABLE IF NOT EXISTS cpone.`t_orderheader_icd10` (
|
||||
`T_OrderHeaderICD10ID` INT NOT NULL AUTO_INCREMENT,
|
||||
`T_OrderHeaderICD10T_OrderHeaderID` INT NOT NULL DEFAULT 0,
|
||||
`T_OrderHeaderICD10Code` VARCHAR(25) DEFAULT NULL,
|
||||
`T_OrderHeaderICD10Name` TEXT DEFAULT NULL,
|
||||
`T_OrderHeaderICD10IsActive` CHAR(1) NOT NULL DEFAULT 'Y',
|
||||
`T_OrderHeaderICD10Created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`T_OrderHeaderICD10CreatedUserID` INT NOT NULL DEFAULT 0,
|
||||
`T_OrderHeaderICD10LastUpdated` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`T_OrderHeaderICD10LastUpdatedUserID` INT NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`T_OrderHeaderICD10ID`),
|
||||
KEY `T_OrderHeaderICD10T_OrderHeaderID` (`T_OrderHeaderICD10T_OrderHeaderID`),
|
||||
KEY `T_OrderHeaderICD10Code` (`T_OrderHeaderICD10Code`),
|
||||
KEY `T_OrderHeaderICD10IsActive` (`T_OrderHeaderICD10IsActive`),
|
||||
UNIQUE KEY `uq_orderheader_icd10` (`T_OrderHeaderICD10T_OrderHeaderID`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
@@ -0,0 +1,154 @@
|
||||
DROP PROCEDURE IF EXISTS cpone.sp_sync_kelainan_details_by_orderheader;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`admin`@`localhost` PROCEDURE `cpone`.`sp_sync_kelainan_details_by_orderheader`(IN `p_order_header_id` int)
|
||||
BEGIN
|
||||
DECLARE v_mcu_id INT DEFAULT 0;
|
||||
DECLARE v_numbering VARCHAR(150) DEFAULT '';
|
||||
DECLARE v_project_id INT DEFAULT 0;
|
||||
|
||||
SELECT oh.T_OrderHeaderMgm_McuID
|
||||
INTO v_mcu_id
|
||||
FROM cpone.t_orderheader oh
|
||||
WHERE oh.T_OrderHeaderID = p_order_header_id
|
||||
AND oh.T_OrderHeaderIsActive = 'Y'
|
||||
LIMIT 1;
|
||||
|
||||
IF v_mcu_id IS NULL OR v_mcu_id = 0 THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'T_OrderHeaderID tidak ditemukan atau tidak aktif';
|
||||
END IF;
|
||||
|
||||
SELECT COALESCE(NULLIF(mn.Mcu_NumberTableName, ''), NULLIF(mm.Mgm_McuNumber, ''), '')
|
||||
INTO v_numbering
|
||||
FROM cpone.mgm_mcu mm
|
||||
LEFT JOIN cpone_corporate.mcu_number mn
|
||||
ON mn.Mcu_NumberMgm_McuID = mm.Mgm_McuID
|
||||
AND mn.Mcu_NumberIsActive = 'Y'
|
||||
WHERE mm.Mgm_McuID = v_mcu_id
|
||||
ORDER BY mn.Mcu_NumberID DESC
|
||||
LIMIT 1;
|
||||
|
||||
SELECT Mcu_ProjectID
|
||||
INTO v_project_id
|
||||
FROM cpone_dashboard.mcu_project
|
||||
WHERE Mcu_ProjectMcuID = v_mcu_id
|
||||
LIMIT 1;
|
||||
|
||||
DELETE FROM cpone_dashboard.kelainan_details
|
||||
WHERE T_OrderHeaderID = p_order_header_id;
|
||||
|
||||
-- NONLAB
|
||||
INSERT INTO cpone_dashboard.kelainan_details (
|
||||
Numbering, Tx_KelainanID, Tx_Type, T_OrderHeaderID, T_OrderHeaderDate, T_OrderHeaderLabNumber,
|
||||
AgePatient, M_PatientID, M_PatientNoReg, M_PatientDOB, M_PatientGender, M_PatientIdentifierValue,
|
||||
M_PatientNIP, M_PatientJob, M_PatientPosisi, M_PatientDivisi, M_PatientLocation, M_PatientDepartement,
|
||||
PatientName, M_PatientName, GroupResult, Nat_TestID, Nat_TestCode, Nat_TestName, T_TestName, Result,
|
||||
Mcu_KelainanID, Mcu_KelainanName, Mcu_KelainanGroupSummaryID, Mcu_KelainanGroupSummaryName,
|
||||
Mcu_FitnessCategoryID, Mcu_FitnessCategoryName, Mcu_FitnessCategoryEng, Mcu_FitnessCategoryLevel,
|
||||
Mgm_McuID, Mcu_ProjectID
|
||||
)
|
||||
SELECT
|
||||
v_numbering,
|
||||
T_KelainanNonLabID,'NONLAB',T_OrderHeaderID,T_OrderHeaderDate,T_OrderHeaderLabNumber,
|
||||
T_OrderHeaderM_PatientAge,M_PatientID,M_PatientNoReg,M_PatientDOB,M_PatientGender,M_PatientIdentifierValue,
|
||||
M_PatientNIP,M_PatientJob,M_PatientPosisi,M_PatientDivisi,M_PatientLocation,M_PatientDepartement,
|
||||
CONCAT(IF(M_TitleName IS NULL,'',CONCAT(M_TitleName,'. ')), IF(M_PatientPrefix IS NULL,'',CONCAT(M_PatientPrefix,' ')), M_PatientName, IF(M_PatientSuffix IS NULL,'',CONCAT(M_PatientSuffix,' '))),
|
||||
M_PatientName,
|
||||
IF(Group_ResultName = 'LAB', 'LAB', Nat_TestName),
|
||||
Nat_TestID,Nat_TestCode,Nat_TestName,T_TestName,'',Mcu_KelainanID,Mcu_KelainanName,
|
||||
Mcu_KelainanGroupSummaryID,Mcu_KelainanGroupSummaryName,Mcu_FitnessCategoryID,Mcu_FitnessCategoryName,
|
||||
Mcu_FitnessCategoryEng,Mcu_FitnessCategoryLevel,
|
||||
v_mcu_id, v_project_id
|
||||
FROM cpone.t_kelainan_nonlab
|
||||
JOIN cpone.t_orderheader ON T_KelainanNonLabT_OrderHeaderID = T_OrderHeaderID AND T_OrderHeaderIsActive='Y'
|
||||
JOIN cpone.m_patient ON T_OrderHeaderM_PatientID=M_PatientID AND M_PatientIsActive='Y'
|
||||
JOIN cpone.mcu_summarynonlab ON T_KelainanNonLabMcu_SummaryNonlabID=Mcu_SummaryNonlabID AND Mcu_SummaryNonlabIsActive='Y'
|
||||
JOIN cpone.nat_test ON Mcu_SummaryNonlabNat_TestID=Nat_TestID AND Nat_TestIsActive='Y'
|
||||
JOIN cpone.t_test ON T_TestNat_TestID=Nat_TestID AND T_TestIsActive='Y'
|
||||
JOIN cpone.group_resultdetail ON Group_ResultDetailT_TestID=T_TestID AND Group_ResultDetailIsActive='Y'
|
||||
JOIN cpone.group_result ON Group_ResultDetailGroup_ResultID=Group_ResultID AND Group_ResultIsActive='Y'
|
||||
JOIN cpone.mcu_kelainan ON Mcu_SummaryNonlabMcu_KelainanID=Mcu_KelainanID AND Mcu_KelainanIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroupsummarydetail ON Mcu_KelainanGroupSummaryDetailMcu_KelainanID=Mcu_KelainanID AND Mcu_KelainanGroupSummaryDetailIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroupsummary ON Mcu_KelainanGroupSummaryDetailMcu_KelainanGroupSummaryID=Mcu_KelainanGroupSummaryID AND Mcu_KelainanGroupSummaryIsActive='Y'
|
||||
JOIN cpone.mcu_fitness_category ON Mcu_SummaryNonlabMcu_FitnessCategoryID=Mcu_FitnessCategoryID AND Mcu_FitnessCategoryIsActive='Y'
|
||||
LEFT JOIN cpone.m_title ON M_PatientM_TitleID=M_TitleID AND M_TitleIsActive='Y'
|
||||
WHERE T_KelainanNonLabIsActive='Y' AND T_OrderHeaderID=p_order_header_id;
|
||||
|
||||
-- LAB
|
||||
INSERT INTO cpone_dashboard.kelainan_details (
|
||||
Numbering, Tx_KelainanID, Tx_Type, T_OrderHeaderID, T_OrderHeaderDate, T_OrderHeaderLabNumber,
|
||||
AgePatient, M_PatientID, M_PatientNoReg, M_PatientDOB, M_PatientGender, M_PatientIdentifierValue,
|
||||
M_PatientNIP, M_PatientJob, M_PatientPosisi, M_PatientDivisi, M_PatientLocation, M_PatientDepartement,
|
||||
PatientName, M_PatientName, GroupResult, Nat_TestID, Nat_TestCode, Nat_TestName, T_TestName, Result,
|
||||
Mcu_KelainanID, Mcu_KelainanName, Mcu_KelainanGroupSummaryID, Mcu_KelainanGroupSummaryName,
|
||||
Mcu_FitnessCategoryID, Mcu_FitnessCategoryName, Mcu_FitnessCategoryEng, Mcu_FitnessCategoryLevel,
|
||||
Mgm_McuID, Mcu_ProjectID
|
||||
)
|
||||
SELECT v_numbering,T_KelainanLabID,'LAB',T_OrderHeaderID,T_OrderHeaderDate,T_OrderHeaderLabNumber,
|
||||
T_OrderHeaderM_PatientAge,M_PatientID,M_PatientNoReg,M_PatientDOB,M_PatientGender,M_PatientIdentifierValue,
|
||||
M_PatientNIP,M_PatientJob,M_PatientPosisi,M_PatientDivisi,M_PatientLocation,M_PatientDepartement,
|
||||
CONCAT(IF(M_TitleName IS NULL,'',CONCAT(M_TitleName,'. ')), IF(M_PatientPrefix IS NULL,'',CONCAT(M_PatientPrefix,' ')), M_PatientName, IF(M_PatientSuffix IS NULL,'',CONCAT(M_PatientSuffix,' '))),
|
||||
M_PatientName,IF(Group_ResultName='LAB','LAB',Nat_TestName),Nat_TestID,Nat_TestCode,Nat_TestName,T_TestName,
|
||||
IFNULL(T_OrderDetailResult,''),Mcu_KelainanID,Mcu_KelainanName,Mcu_KelainanGroupSummaryID,
|
||||
Mcu_KelainanGroupSummaryName,Mcu_FitnessCategoryID,Mcu_FitnessCategoryName,Mcu_FitnessCategoryEng,
|
||||
Mcu_FitnessCategoryLevel,
|
||||
v_mcu_id, v_project_id
|
||||
FROM cpone.t_kelainan_lab
|
||||
JOIN cpone.t_orderdetail ON T_KelainanLabT_OrderDetailID=T_OrderDetailID AND T_OrderDetailIsActive='Y'
|
||||
JOIN cpone.t_orderheader ON T_KelainanLabT_OrderHeaderID=T_OrderHeaderID AND T_OrderHeaderIsActive='Y'
|
||||
JOIN cpone.m_patient ON T_OrderHeaderM_PatientID=M_PatientID AND M_PatientIsActive='Y'
|
||||
JOIN cpone.mcu_summarylab ON T_KelainanLabMcu_SummaryLabID=Mcu_SummaryLabID AND Mcu_SummaryLabIsActive='Y'
|
||||
JOIN cpone.nat_test ON Mcu_SummaryLabNat_TestID=Nat_TestID AND Nat_TestIsActive='Y'
|
||||
JOIN cpone.t_test ON T_TestNat_TestID=Nat_TestID AND T_TestIsActive='Y'
|
||||
JOIN cpone.group_resultdetail ON Group_ResultDetailT_TestID=T_TestID AND Group_ResultDetailIsActive='Y'
|
||||
JOIN cpone.group_result ON Group_ResultDetailGroup_ResultID=Group_ResultID AND Group_ResultIsActive='Y'
|
||||
JOIN cpone.mcu_kelainan ON Mcu_SummaryLabMcu_KelainanID=Mcu_KelainanID AND Mcu_KelainanIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroupsummarydetail ON Mcu_KelainanGroupSummaryDetailMcu_KelainanID=Mcu_KelainanID AND Mcu_KelainanGroupSummaryDetailIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroupsummary ON Mcu_KelainanGroupSummaryDetailMcu_KelainanGroupSummaryID=Mcu_KelainanGroupSummaryID AND Mcu_KelainanGroupSummaryIsActive='Y'
|
||||
JOIN cpone.mcu_fitness_category ON Mcu_SummaryLabMcu_FitnessCategoryID=Mcu_FitnessCategoryID AND Mcu_FitnessCategoryIsActive='Y'
|
||||
LEFT JOIN cpone.m_title ON M_PatientM_TitleID=M_TitleID AND M_TitleIsActive='Y'
|
||||
WHERE T_KelainanLabIsActive='Y' AND T_OrderHeaderID=p_order_header_id
|
||||
GROUP BY T_KelainanLabID;
|
||||
|
||||
-- FISIK
|
||||
INSERT INTO cpone_dashboard.kelainan_details (
|
||||
Numbering, Tx_KelainanID, Tx_Type, T_OrderHeaderID, T_OrderHeaderDate, T_OrderHeaderLabNumber,
|
||||
AgePatient, M_PatientID, M_PatientNoReg, M_PatientDOB, M_PatientGender, M_PatientIdentifierValue,
|
||||
M_PatientNIP, M_PatientJob, M_PatientPosisi, M_PatientDivisi, M_PatientLocation, M_PatientDepartement,
|
||||
PatientName, M_PatientName, GroupResult, Nat_TestID, Nat_TestCode, Nat_TestName, T_TestName, Result,
|
||||
Mcu_KelainanID, Mcu_KelainanName, Mcu_KelainanGroupSummaryID, Mcu_KelainanGroupSummaryName,
|
||||
Mcu_FitnessCategoryID, Mcu_FitnessCategoryName, Mcu_FitnessCategoryEng, Mcu_FitnessCategoryLevel,
|
||||
Mgm_McuID, Mcu_ProjectID
|
||||
)
|
||||
SELECT v_numbering,T_KelainanFiskID,'FISIK',T_OrderHeaderID,T_OrderHeaderDate,T_OrderHeaderLabNumber,
|
||||
T_OrderHeaderM_PatientAge,M_PatientID,M_PatientNoReg,M_PatientDOB,M_PatientGender,M_PatientIdentifierValue,
|
||||
M_PatientNIP,M_PatientJob,M_PatientPosisi,M_PatientDivisi,M_PatientLocation,M_PatientDepartement,
|
||||
CONCAT(IF(M_TitleName IS NULL,'',CONCAT(M_TitleName,'. ')), IF(M_PatientPrefix IS NULL,'',CONCAT(M_PatientPrefix,' ')), M_PatientName, IF(M_PatientSuffix IS NULL,'',CONCAT(M_PatientSuffix,' '))),
|
||||
M_PatientName,IF(Group_ResultName='LAB','LAB',Nat_TestName),Nat_TestID,Nat_TestCode,Nat_TestName,
|
||||
CONCAT(IF(label IS NULL, Mcu_KelainanGroupName, CONCAT(label, ' - ',IF(level = 1, parent_level_1,IF(level = 2, parent_level_2, IF(level = 3,parent_level_3,parent_level_4)))))),
|
||||
IF(Mcu_FisikValueNote = '',Mcu_FisikValueLabel,Mcu_FisikValueNote),Mcu_KelainanID,Mcu_KelainanName,
|
||||
Mcu_KelainanGroupSummaryID,Mcu_KelainanGroupSummaryName,Mcu_FitnessCategoryID,Mcu_FitnessCategoryName,
|
||||
Mcu_FitnessCategoryEng,Mcu_FitnessCategoryLevel,
|
||||
v_mcu_id, v_project_id
|
||||
FROM cpone.t_kelainan_fisik
|
||||
JOIN cpone.t_orderheader ON T_KelainanFiskT_OrderHeaderID = T_OrderHeaderID AND T_OrderHeaderIsActive='Y'
|
||||
JOIN cpone.so_resultentry ON T_KelainanFiskSo_ResultEntryID = So_ResultEntryID AND So_ResultEntryIsActive='Y'
|
||||
JOIN cpone.t_orderdetail ON So_ResultEntryT_OrderDetailID = T_OrderDetailID AND T_OrderDetailIsActive='Y'
|
||||
JOIN cpone.nat_test ON Nat_TestCode = T_OrderDetailT_TestCode AND Nat_TestIsActive='Y'
|
||||
JOIN cpone.t_test ON T_TestNat_TestID = Nat_TestID AND T_TestIsActive='Y'
|
||||
JOIN cpone.group_resultdetail ON Group_ResultDetailT_TestID = T_TestID AND Group_ResultDetailIsActive='Y'
|
||||
JOIN cpone.group_result ON Group_ResultDetailGroup_ResultID = Group_ResultID AND Group_ResultIsActive='Y'
|
||||
JOIN cpone.m_patient ON T_OrderHeaderM_PatientID = M_PatientID AND M_PatientIsActive='Y'
|
||||
JOIN cpone.mcu_fisiksummary ON T_KelainanFiskMcu_FisikSummaryID = Mcu_FisikSummaryID AND Mcu_FisikSummaryIsActive='Y'
|
||||
JOIN cpone.mcu_fisiksummarydetail ON Mcu_FisikSummaryDetailMcu_FisikSummaryID = Mcu_FisikSummaryID AND Mcu_FisikSummaryDetailIsActive='Y'
|
||||
JOIN cpone.mcu_kelainan ON Mcu_FisikSummaryMcu_KelainanID = Mcu_KelainanID AND Mcu_KelainanIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroup ON Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID AND Mcu_KelainanGroupIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroupsummarydetail ON Mcu_KelainanGroupSummaryDetailMcu_KelainanID = Mcu_KelainanID AND Mcu_KelainanGroupSummaryDetailIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroupsummary ON Mcu_KelainanGroupSummaryDetailMcu_KelainanGroupSummaryID = Mcu_KelainanGroupSummaryID AND Mcu_KelainanGroupSummaryIsActive='Y'
|
||||
JOIN cpone.mcu_fitness_category ON Mcu_FisikSummaryMcu_FitnessCategoryID = Mcu_FitnessCategoryID AND Mcu_FitnessCategoryIsActive='Y'
|
||||
JOIN cpone.mcu_fisikvalue ON Mcu_FisikValueT_OrderHeaderID = T_OrderHeaderID AND Mcu_FisikValueIsActive='Y' AND Mcu_FisikValueCode = Mcu_FisikSummaryDetailCode
|
||||
LEFT JOIN cpone.fisik_template_map ON id_code = Mcu_FisikSummaryDetailCode
|
||||
LEFT JOIN cpone.m_title ON M_PatientM_TitleID = M_TitleID AND M_TitleIsActive='Y'
|
||||
WHERE T_KelainanFiskIsActive='Y' AND T_OrderHeaderID=p_order_header_id;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
@@ -0,0 +1,150 @@
|
||||
DROP PROCEDURE `sp_sync_kelainan_details_by_orderheader`;
|
||||
DELIMITER ;;
|
||||
CREATE PROCEDURE `sp_sync_kelainan_details_by_orderheader` (IN `p_order_header_id` int)
|
||||
BEGIN
|
||||
DECLARE v_mcu_id INT DEFAULT 0;
|
||||
DECLARE v_numbering VARCHAR(150) DEFAULT '';
|
||||
DECLARE v_project_id INT DEFAULT 0;
|
||||
|
||||
SELECT oh.T_OrderHeaderMgm_McuID
|
||||
INTO v_mcu_id
|
||||
FROM cpone.t_orderheader oh
|
||||
WHERE oh.T_OrderHeaderID = p_order_header_id
|
||||
AND oh.T_OrderHeaderIsActive = 'Y'
|
||||
LIMIT 1;
|
||||
|
||||
IF v_mcu_id IS NULL OR v_mcu_id = 0 THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'T_OrderHeaderID tidak ditemukan atau tidak aktif';
|
||||
END IF;
|
||||
|
||||
SELECT COALESCE(NULLIF(mn.Mcu_NumberTableName, ''), NULLIF(mm.Mgm_McuNumber, ''), '')
|
||||
INTO v_numbering
|
||||
FROM cpone.mgm_mcu mm
|
||||
LEFT JOIN cpone_corporate.mcu_number mn
|
||||
ON mn.Mcu_NumberMgm_McuID = mm.Mgm_McuID
|
||||
AND mn.Mcu_NumberIsActive = 'Y'
|
||||
WHERE mm.Mgm_McuID = v_mcu_id
|
||||
ORDER BY mn.Mcu_NumberID DESC
|
||||
LIMIT 1;
|
||||
|
||||
SELECT Mcu_ProjectID
|
||||
INTO v_project_id
|
||||
FROM cpone_dashboard.mcu_project
|
||||
WHERE Mcu_ProjectMcuID = v_mcu_id
|
||||
LIMIT 1;
|
||||
|
||||
DELETE FROM cpone_dashboard.kelainan_details
|
||||
WHERE T_OrderHeaderID = p_order_header_id;
|
||||
|
||||
INSERT INTO cpone_dashboard.kelainan_details (
|
||||
Numbering, Tx_KelainanID, Tx_Type, T_OrderHeaderID, T_OrderHeaderDate, T_OrderHeaderLabNumber,
|
||||
AgePatient, M_PatientID, M_PatientNoReg, M_PatientDOB, M_PatientGender, M_PatientIdentifierValue,
|
||||
M_PatientNIP, M_PatientJob, M_PatientPosisi, M_PatientDivisi, M_PatientLocation, M_PatientDepartement,
|
||||
PatientName, M_PatientName, GroupResult, Nat_TestID, Nat_TestCode, Nat_TestName, T_TestName, Result,
|
||||
Mcu_KelainanID, Mcu_KelainanName, Mcu_KelainanGroupSummaryID, Mcu_KelainanGroupSummaryName,
|
||||
Mcu_FitnessCategoryID, Mcu_FitnessCategoryName, Mcu_FitnessCategoryEng, Mcu_FitnessCategoryLevel,
|
||||
Mgm_McuID, Mcu_ProjectID
|
||||
)
|
||||
SELECT
|
||||
v_numbering,
|
||||
T_KelainanNonLabID,'NONLAB',T_OrderHeaderID,T_OrderHeaderDate,T_OrderHeaderLabNumber,
|
||||
T_OrderHeaderM_PatientAge,M_PatientID,M_PatientNoReg,M_PatientDOB,M_PatientGender,M_PatientIdentifierValue,
|
||||
M_PatientNIP,M_PatientJob,M_PatientPosisi,M_PatientDivisi,M_PatientLocation,M_PatientDepartement,
|
||||
CONCAT(IF(M_TitleName IS NULL,'',CONCAT(M_TitleName,'. ')), IF(M_PatientPrefix IS NULL,'',CONCAT(M_PatientPrefix,' ')), M_PatientName, IF(M_PatientSuffix IS NULL,'',CONCAT(M_PatientSuffix,' '))),
|
||||
M_PatientName,
|
||||
IF(Group_ResultName = 'LAB', 'LAB', Nat_TestName),
|
||||
Nat_TestID,Nat_TestCode,Nat_TestName,T_TestName,'',Mcu_KelainanID,Mcu_KelainanName,
|
||||
Mcu_KelainanGroupSummaryID,Mcu_KelainanGroupSummaryName,Mcu_FitnessCategoryID,Mcu_FitnessCategoryName,
|
||||
Mcu_FitnessCategoryEng,Mcu_FitnessCategoryLevel,
|
||||
v_mcu_id, v_project_id
|
||||
FROM cpone.t_kelainan_nonlab
|
||||
JOIN cpone.t_orderheader ON T_KelainanNonLabT_OrderHeaderID = T_OrderHeaderID AND T_OrderHeaderIsActive='Y'
|
||||
JOIN cpone.m_patient ON T_OrderHeaderM_PatientID=M_PatientID AND M_PatientIsActive='Y'
|
||||
JOIN cpone.mcu_summarynonlab ON T_KelainanNonLabMcu_SummaryNonlabID=Mcu_SummaryNonlabID AND Mcu_SummaryNonlabIsActive='Y'
|
||||
JOIN cpone.nat_test ON Mcu_SummaryNonlabNat_TestID=Nat_TestID AND Nat_TestIsActive='Y'
|
||||
JOIN cpone.t_test ON T_TestNat_TestID=Nat_TestID AND T_TestIsActive='Y'
|
||||
JOIN cpone.group_resultdetail ON Group_ResultDetailT_TestID=T_TestID AND Group_ResultDetailIsActive='Y'
|
||||
JOIN cpone.group_result ON Group_ResultDetailGroup_ResultID=Group_ResultID AND Group_ResultIsActive='Y'
|
||||
JOIN cpone.mcu_kelainan ON Mcu_SummaryNonlabMcu_KelainanID=Mcu_KelainanID AND Mcu_KelainanIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroupsummarydetail ON Mcu_KelainanGroupSummaryDetailMcu_KelainanID=Mcu_KelainanID AND Mcu_KelainanGroupSummaryDetailIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroupsummary ON Mcu_KelainanGroupSummaryDetailMcu_KelainanGroupSummaryID=Mcu_KelainanGroupSummaryID AND Mcu_KelainanGroupSummaryIsActive='Y'
|
||||
JOIN cpone.mcu_fitness_category ON Mcu_SummaryNonlabMcu_FitnessCategoryID=Mcu_FitnessCategoryID AND Mcu_FitnessCategoryIsActive='Y'
|
||||
LEFT JOIN cpone.m_title ON M_PatientM_TitleID=M_TitleID AND M_TitleIsActive='Y'
|
||||
WHERE T_KelainanNonLabIsActive='Y' AND T_OrderHeaderID=p_order_header_id;
|
||||
|
||||
INSERT INTO cpone_dashboard.kelainan_details (
|
||||
Numbering, Tx_KelainanID, Tx_Type, T_OrderHeaderID, T_OrderHeaderDate, T_OrderHeaderLabNumber,
|
||||
AgePatient, M_PatientID, M_PatientNoReg, M_PatientDOB, M_PatientGender, M_PatientIdentifierValue,
|
||||
M_PatientNIP, M_PatientJob, M_PatientPosisi, M_PatientDivisi, M_PatientLocation, M_PatientDepartement,
|
||||
PatientName, M_PatientName, GroupResult, Nat_TestID, Nat_TestCode, Nat_TestName, T_TestName, Result,
|
||||
Mcu_KelainanID, Mcu_KelainanName, Mcu_KelainanGroupSummaryID, Mcu_KelainanGroupSummaryName,
|
||||
Mcu_FitnessCategoryID, Mcu_FitnessCategoryName, Mcu_FitnessCategoryEng, Mcu_FitnessCategoryLevel,
|
||||
Mgm_McuID, Mcu_ProjectID
|
||||
)
|
||||
SELECT v_numbering,T_KelainanLabID,'LAB',T_OrderHeaderID,T_OrderHeaderDate,T_OrderHeaderLabNumber,
|
||||
T_OrderHeaderM_PatientAge,M_PatientID,M_PatientNoReg,M_PatientDOB,M_PatientGender,M_PatientIdentifierValue,
|
||||
M_PatientNIP,M_PatientJob,M_PatientPosisi,M_PatientDivisi,M_PatientLocation,M_PatientDepartement,
|
||||
CONCAT(IF(M_TitleName IS NULL,'',CONCAT(M_TitleName,'. ')), IF(M_PatientPrefix IS NULL,'',CONCAT(M_PatientPrefix,' ')), M_PatientName, IF(M_PatientSuffix IS NULL,'',CONCAT(M_PatientSuffix,' '))),
|
||||
M_PatientName,IF(Group_ResultName='LAB','LAB',Nat_TestName),Nat_TestID,Nat_TestCode,Nat_TestName,T_TestName,
|
||||
IFNULL(T_OrderDetailResult,''),Mcu_KelainanID,Mcu_KelainanName,Mcu_KelainanGroupSummaryID,
|
||||
Mcu_KelainanGroupSummaryName,Mcu_FitnessCategoryID,Mcu_FitnessCategoryName,Mcu_FitnessCategoryEng,
|
||||
Mcu_FitnessCategoryLevel,
|
||||
v_mcu_id, v_project_id
|
||||
FROM cpone.t_kelainan_lab
|
||||
JOIN cpone.t_orderdetail ON T_KelainanLabT_OrderDetailID=T_OrderDetailID AND T_OrderDetailIsActive='Y'
|
||||
JOIN cpone.t_orderheader ON T_KelainanLabT_OrderHeaderID=T_OrderHeaderID AND T_OrderHeaderIsActive='Y'
|
||||
JOIN cpone.m_patient ON T_OrderHeaderM_PatientID=M_PatientID AND M_PatientIsActive='Y'
|
||||
JOIN cpone.mcu_summarylab ON T_KelainanLabMcu_SummaryLabID=Mcu_SummaryLabID AND Mcu_SummaryLabIsActive='Y'
|
||||
JOIN cpone.nat_test ON Mcu_SummaryLabNat_TestID=Nat_TestID AND Nat_TestIsActive='Y'
|
||||
JOIN cpone.t_test ON T_TestNat_TestID=Nat_TestID AND T_TestIsActive='Y'
|
||||
JOIN cpone.group_resultdetail ON Group_ResultDetailT_TestID=T_TestID AND Group_ResultDetailIsActive='Y'
|
||||
JOIN cpone.group_result ON Group_ResultDetailGroup_ResultID=Group_ResultID AND Group_ResultIsActive='Y'
|
||||
JOIN cpone.mcu_kelainan ON Mcu_SummaryLabMcu_KelainanID=Mcu_KelainanID AND Mcu_KelainanIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroupsummarydetail ON Mcu_KelainanGroupSummaryDetailMcu_KelainanID=Mcu_KelainanID AND Mcu_KelainanGroupSummaryDetailIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroupsummary ON Mcu_KelainanGroupSummaryDetailMcu_KelainanGroupSummaryID=Mcu_KelainanGroupSummaryID AND Mcu_KelainanGroupSummaryIsActive='Y'
|
||||
JOIN cpone.mcu_fitness_category ON Mcu_SummaryLabMcu_FitnessCategoryID=Mcu_FitnessCategoryID AND Mcu_FitnessCategoryIsActive='Y'
|
||||
LEFT JOIN cpone.m_title ON M_PatientM_TitleID=M_TitleID AND M_TitleIsActive='Y'
|
||||
WHERE T_KelainanLabIsActive='Y' AND T_OrderHeaderID=p_order_header_id
|
||||
GROUP BY T_KelainanLabID;
|
||||
|
||||
INSERT INTO cpone_dashboard.kelainan_details (
|
||||
Numbering, Tx_KelainanID, Tx_Type, T_OrderHeaderID, T_OrderHeaderDate, T_OrderHeaderLabNumber,
|
||||
AgePatient, M_PatientID, M_PatientNoReg, M_PatientDOB, M_PatientGender, M_PatientIdentifierValue,
|
||||
M_PatientNIP, M_PatientJob, M_PatientPosisi, M_PatientDivisi, M_PatientLocation, M_PatientDepartement,
|
||||
PatientName, M_PatientName, GroupResult, Nat_TestID, Nat_TestCode, Nat_TestName, T_TestName, Result,
|
||||
Mcu_KelainanID, Mcu_KelainanName, Mcu_KelainanGroupSummaryID, Mcu_KelainanGroupSummaryName,
|
||||
Mcu_FitnessCategoryID, Mcu_FitnessCategoryName, Mcu_FitnessCategoryEng, Mcu_FitnessCategoryLevel,
|
||||
Mgm_McuID, Mcu_ProjectID
|
||||
)
|
||||
SELECT v_numbering,T_KelainanFiskID,'FISIK',T_OrderHeaderID,T_OrderHeaderDate,T_OrderHeaderLabNumber,
|
||||
T_OrderHeaderM_PatientAge,M_PatientID,M_PatientNoReg,M_PatientDOB,M_PatientGender,M_PatientIdentifierValue,
|
||||
M_PatientNIP,M_PatientJob,M_PatientPosisi,M_PatientDivisi,M_PatientLocation,M_PatientDepartement,
|
||||
CONCAT(IF(M_TitleName IS NULL,'',CONCAT(M_TitleName,'. ')), IF(M_PatientPrefix IS NULL,'',CONCAT(M_PatientPrefix,' ')), M_PatientName, IF(M_PatientSuffix IS NULL,'',CONCAT(M_PatientSuffix,' '))),
|
||||
M_PatientName,IF(Group_ResultName='LAB','LAB',Nat_TestName),Nat_TestID,Nat_TestCode,Nat_TestName,
|
||||
CONCAT(IF(label IS NULL, Mcu_KelainanGroupName, CONCAT(label, ' - ',IF(level = 1, parent_level_1,IF(level = 2, parent_level_2, IF(level = 3,parent_level_3,parent_level_4)))))),
|
||||
IF(Mcu_FisikValueNote = '',Mcu_FisikValueLabel,Mcu_FisikValueNote),Mcu_KelainanID,Mcu_KelainanName,
|
||||
Mcu_KelainanGroupSummaryID,Mcu_KelainanGroupSummaryName,Mcu_FitnessCategoryID,Mcu_FitnessCategoryName,
|
||||
Mcu_FitnessCategoryEng,Mcu_FitnessCategoryLevel,
|
||||
v_mcu_id, v_project_id
|
||||
FROM cpone.t_kelainan_fisik
|
||||
JOIN cpone.t_orderheader ON T_KelainanFiskT_OrderHeaderID = T_OrderHeaderID AND T_OrderHeaderIsActive='Y'
|
||||
JOIN cpone.so_resultentry ON T_KelainanFiskSo_ResultEntryID = So_ResultEntryID AND So_ResultEntryIsActive='Y'
|
||||
JOIN cpone.t_orderdetail ON So_ResultEntryT_OrderDetailID = T_OrderDetailID AND T_OrderDetailIsActive='Y'
|
||||
JOIN cpone.nat_test ON Nat_TestCode = T_OrderDetailT_TestCode AND Nat_TestIsActive='Y'
|
||||
JOIN cpone.t_test ON T_TestNat_TestID = Nat_TestID AND T_TestIsActive='Y'
|
||||
JOIN cpone.group_resultdetail ON Group_ResultDetailT_TestID = T_TestID AND Group_ResultDetailIsActive='Y'
|
||||
JOIN cpone.group_result ON Group_ResultDetailGroup_ResultID = Group_ResultID AND Group_ResultIsActive='Y'
|
||||
JOIN cpone.m_patient ON T_OrderHeaderM_PatientID = M_PatientID AND M_PatientIsActive='Y'
|
||||
JOIN cpone.mcu_fisiksummary ON T_KelainanFiskMcu_FisikSummaryID = Mcu_FisikSummaryID AND Mcu_FisikSummaryIsActive='Y'
|
||||
JOIN cpone.mcu_fisiksummarydetail ON Mcu_FisikSummaryDetailMcu_FisikSummaryID = Mcu_FisikSummaryID AND Mcu_FisikSummaryDetailIsActive='Y'
|
||||
JOIN cpone.mcu_kelainan ON Mcu_FisikSummaryMcu_KelainanID = Mcu_KelainanID AND Mcu_KelainanIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroup ON Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID AND Mcu_KelainanGroupIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroupsummarydetail ON Mcu_KelainanGroupSummaryDetailMcu_KelainanID = Mcu_KelainanID AND Mcu_KelainanGroupSummaryDetailIsActive='Y'
|
||||
JOIN cpone.mcu_kelainangroupsummary ON Mcu_KelainanGroupSummaryDetailMcu_KelainanGroupSummaryID = Mcu_KelainanGroupSummaryID AND Mcu_KelainanGroupSummaryIsActive='Y'
|
||||
JOIN cpone.mcu_fitness_category ON Mcu_FisikSummaryMcu_FitnessCategoryID = Mcu_FitnessCategoryID AND Mcu_FitnessCategoryIsActive='Y'
|
||||
JOIN cpone.mcu_fisikvalue ON Mcu_FisikValueT_OrderHeaderID = T_OrderHeaderID AND Mcu_FisikValueIsActive='Y' AND Mcu_FisikValueCode = Mcu_FisikSummaryDetailCode
|
||||
LEFT JOIN cpone.fisik_template_map ON id_code = Mcu_FisikSummaryDetailCode
|
||||
LEFT JOIN cpone.m_title ON M_PatientM_TitleID = M_TitleID AND M_TitleIsActive='Y'
|
||||
WHERE T_KelainanFiskIsActive='Y' AND T_OrderHeaderID=p_order_header_id;
|
||||
END;;
|
||||
DELIMITER ;
|
||||
64
staging-to-master-diff-20260625-stemcell.md
Normal file
64
staging-to-master-diff-20260625-stemcell.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# Staging → Master: Perubahan yang Belum Masuk Master
|
||||
|
||||
Dokumen ini berisi ringkasan perubahan di branch `staging` yang belum ada di `master`.
|
||||
|
||||
Dibuat: 2026-06-25
|
||||
|
||||
---
|
||||
|
||||
## Commit yang Belum Ada di Master
|
||||
|
||||
| Commit | Task Code | Deskripsi |
|
||||
|--------|-----------|-----------|
|
||||
| `edc331f` | FHM17062601CPONE | Tambah Resumeindividucponev8 dengan call sp_sync_kelainan_details_by_orderheader di generateFitnessCategory, dan simpan SQL update SP |
|
||||
| `23992e5` | C1J0ET | Update dokumentasi ICD10 tambah catatan autocomplete FE |
|
||||
| `a413465` | C1J0ET | Tambah fungsi search_icd10 dan save_icd10 di walk_in_registration_stemcell order, buat tabel t_orderheader_icd10, dan dokumentasi API untuk FE |
|
||||
| `9d524de` | — | Merge branch 'revisi_transactionv5' into staging |
|
||||
| `360c4b0` | 3Z4LPN | Fix AisConfigBaseUrlSC ke AisConfigBaseUrl di Transactionv5 |
|
||||
| `c3b82d8` | 3Z4LPN | Fix filter stemcell gagal karena CI driver state setelah SP |
|
||||
| `af27cbe` | 3Z4LPN | Fix syntax error arrow function php < 7.4 |
|
||||
|
||||
---
|
||||
|
||||
## File yang Berubah (8 file, +3123 / -18 baris)
|
||||
|
||||
| File | Perubahan |
|
||||
|------|-----------|
|
||||
| `application/controllers/ais/Transactionv4.php` | 28 baris (±) |
|
||||
| `application/controllers/ais/Transactionv5.php` | 28 baris (±) |
|
||||
| `application/controllers/mockup/fo/walk_in_registration_stemcell/Order.php` | +76 baris |
|
||||
| `application/controllers/mockup/fo/walk_in_registration_stemcell/Px.php` | 9 baris (±) |
|
||||
| `application/controllers/mockup/mcuoffline/Resumeindividucponev8.php` | +2580 baris (file baru) |
|
||||
| `docs_icd10_walk_in_registration_stemcell.md` | +128 baris (file baru) |
|
||||
| `scripts/sql/2026-06-25_create_t_orderheader_icd10.sql` | +16 baris (file baru) |
|
||||
| `scripts/sql/2026-06-25_update_sp_sync_kelainan_details_by_orderheader.sql` | +154 baris (file baru) |
|
||||
| `scripts/sql/2026-06-25_update_sp_sync_kelainan_details_by_orderheader_adminer.sql` | +150 baris (file baru) |
|
||||
|
||||
---
|
||||
|
||||
## Ringkasan Perubahan per Task
|
||||
|
||||
### 3Z4LPN — Fix Transactionv5 & Stemcell
|
||||
- `Transactionv5.php` — fix `AisConfigBaseUrlSC` → `AisConfigBaseUrl`, fix syntax error arrow function PHP < 7.4, fix filter stemcell gagal karena CI driver state setelah SP
|
||||
- `Px.php` — perubahan terkait fix stemcell
|
||||
|
||||
### C1J0ET — ICD10 Walk-in Registration Stemcell
|
||||
- `Order.php` — tambah fungsi `search_icd10` dan `save_icd10`, ICD10 otomatis disimpan ke tabel `t_orderheader_icd10` saat save order
|
||||
- `docs_icd10_walk_in_registration_stemcell.md` — dokumentasi API untuk FE
|
||||
- `scripts/sql/2026-06-25_create_t_orderheader_icd10.sql` — DDL tabel `t_orderheader_icd10`
|
||||
|
||||
### FHM17062601CPONE — CPone Dashboard Live Sync
|
||||
- `Resumeindividucponev8.php` — clone dari v7, tambah call `sp_sync_kelainan_details_by_orderheader` di akhir `generateFitnessCategory`
|
||||
- `scripts/sql/2026-06-25_update_sp_sync_kelainan_details_by_orderheader.sql` — update SP target insert ke `cpone_dashboard` (untuk MySQL CLI)
|
||||
- `scripts/sql/2026-06-25_update_sp_sync_kelainan_details_by_orderheader_adminer.sql` — update SP target insert ke `cpone_dashboard` (untuk Adminer)
|
||||
|
||||
---
|
||||
|
||||
## Catatan DB (Perlu Dijalankan Saat Merge ke Master/Production)
|
||||
|
||||
1. **Buat tabel baru** di `cpone`:
|
||||
- Jalankan: `scripts/sql/2026-06-25_create_t_orderheader_icd10.sql`
|
||||
|
||||
2. **Update stored procedure** `sp_sync_kelainan_details_by_orderheader` di `cpone`:
|
||||
- Via MySQL CLI: `scripts/sql/2026-06-25_update_sp_sync_kelainan_details_by_orderheader.sql`
|
||||
- Via Adminer: `scripts/sql/2026-06-25_update_sp_sync_kelainan_details_by_orderheader_adminer.sql`
|
||||
Reference in New Issue
Block a user