add glukosa

This commit is contained in:
Hanan Askarim
2026-06-22 14:44:52 +07:00
parent 8df5ffb743
commit 94170e9de2
3 changed files with 144 additions and 1 deletions

View File

@@ -366,6 +366,91 @@ child_test.T_TestParentT_TestID != 0 -> pakai parent test
Contoh: anak Hematologi Lengkap akan digabung sebagai parent Hematologi Lengkap.
## Glucose Result
Endpoint:
```http
POST /glucose
```
Header:
```http
Authorization: Bearer {access_token}
```
Request body:
```json
{
"T_OrderHeaderLabNumber": "R2606110001"
}
```
Contoh curl:
```bash
curl -X POST "https://devcpone.aplikasi.web.id/one-api/tools/wynacom/glucose" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer TOKEN_VALUE" \
-d '{"T_OrderHeaderLabNumber":"R2606110001"}'
```
Contoh PHP `curl_init()`:
```php
<?php
$baseUrl = 'https://devcpone.aplikasi.web.id/one-api/tools/wynacom';
$accessToken = 'TOKEN_VALUE';
$ch = curl_init($baseUrl . '/glucose');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Bearer ' . $accessToken
));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(
'T_OrderHeaderLabNumber' => 'R2606110001'
)));
$response = curl_exec($ch);
if (curl_errno($ch)) {
die('Curl error: ' . curl_error($ch));
}
curl_close($ch);
$glucoseResponse = json_decode($response, true);
print_r($glucoseResponse);
```
Contoh response:
```json
{
"status": "OK",
"data": [
{
"cpone_test_code": "10530200",
"cpone_test_name": "Glukosa Darah 2 Jam PP",
"lis_test_code": "00000251",
"result_glucosa": "120"
}
]
}
```
Sumber data:
- `order_glucose.OrderGlucoseResult` sebagai `result_glucosa`
- `t_test.T_TestSasCode` sebagai `cpone_test_code`, dipotong 8 digit dari depan
- `t_test.T_TestName` sebagai `cpone_test_name`
- `nat_testmap.Nat_TestMapCode` sebagai `lis_test_code`
## Error Umum
Token tidak dikirim: