tambah informasi provider
This commit is contained in:
@@ -222,7 +222,7 @@ class CorporateMemberController extends Controller
|
||||
'requestLogBenefits:id,request_log_id,benefit_id,amount_incurred,amount_approved,amount_not_approved,excess_paid,keterangan' => [
|
||||
'benefit'
|
||||
],
|
||||
'requestLogDailyMonitorings:id,request_log_id,created_at,subject,body_temperature,sistole,diastole,respiration_rate,analysis,lab_date,provider,examination' => [
|
||||
'requestLogDailyMonitorings:id,request_log_id,submission_date,subject,body_temperature,sistole,diastole,respiration_rate,analysis,lab_date,provider,examination' => [
|
||||
'requestLogMedicalPlans:request_log_daily_monitoring_id,plan,type',
|
||||
// 'document'
|
||||
],
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Modules\Client\Transformers\AlarmCenter;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use App\Models\Service;
|
||||
use App\Models\Organization;
|
||||
|
||||
class DataListClaimMemberResource extends JsonResource
|
||||
{
|
||||
@@ -16,10 +17,15 @@ class DataListClaimMemberResource extends JsonResource
|
||||
public function toArray($request)
|
||||
{
|
||||
$serviceData = Service::where('code', $this->service_code)->first();
|
||||
$organization = Organization::where('id', $this->organization_id)->first();
|
||||
$organizationName = '-';
|
||||
if ($organization){
|
||||
$organizationName = $organization->name;
|
||||
}
|
||||
if ($serviceData) {
|
||||
$serviceName = $serviceData->name;
|
||||
} else {
|
||||
$serviceName = $this->service_cod;
|
||||
$serviceName = $this->service_code;
|
||||
}
|
||||
|
||||
if ($this->status == 'approved' && $this->status_final_log ){
|
||||
@@ -34,6 +40,7 @@ class DataListClaimMemberResource extends JsonResource
|
||||
'admission_date' => $this->submission_date ?? null,
|
||||
'discharge_date' => $this->discharge_date ?? null,
|
||||
'code' => $this->code ?? null,
|
||||
'provider_name' => $organizationName ?? null,
|
||||
'service_type' => $serviceName,
|
||||
'status' => $status,
|
||||
];
|
||||
|
||||
@@ -111,7 +111,7 @@ class DataServiceMonitoring extends JsonResource
|
||||
'dischargeDate' => $this->discharge_date ?? null,
|
||||
'dailyMonitorings' => $this->when($this->service_code === 'IP', collect($this->requestLogDailyMonitorings)
|
||||
->groupBy(function ($requestLogDailyMonitoring) {
|
||||
return $requestLogDailyMonitoring->created_at->format('d M Y');
|
||||
return Carbon::parse($requestLogDailyMonitoring->submission_date)->format('d M Y');
|
||||
})
|
||||
->map(function ($groupedItems) {
|
||||
return collect($groupedItems)
|
||||
@@ -138,7 +138,7 @@ class DataServiceMonitoring extends JsonResource
|
||||
|
||||
|
||||
return [
|
||||
'time' => $requestLogDailyMonitoring->created_at->format('H:i') ?? null,
|
||||
'time' => Carbon::parse($requestLogDailyMonitoring->submission_date)->format('H:i') ?? null,
|
||||
'status' => 'Done' ?? null,
|
||||
'subject' => $requestLogDailyMonitoring->subject ?? null,
|
||||
'bodyTemperature' => $requestLogDailyMonitoring->body_temperature ?? null,
|
||||
@@ -168,18 +168,18 @@ class DataServiceMonitoring extends JsonResource
|
||||
return Carbon::createFromFormat('d M Y', $date)->format('Y-m-d');
|
||||
})
|
||||
->all()) ?? null,
|
||||
'laboratoriumResults' => $this->whenLoaded('requestLogDailyMonitorings', collect($this->requestLogDailyMonitorings)
|
||||
'laboratoriumResults' => $this->when($this->service_code === 'IP', collect($this->requestLogDailyMonitorings)
|
||||
->groupBy(function ($requestLogDailyMonitoring) {
|
||||
return Carbon::parse($requestLogDailyMonitoring->lab_date)->format('d M Y');
|
||||
})
|
||||
->map(function ($groupedItems) {
|
||||
return collect($groupedItems)
|
||||
->map(function ($requestLogDailyMonitoring) {
|
||||
->map(function ($test) {
|
||||
$arr_document = [];
|
||||
$document = DB::table('files')
|
||||
->where([
|
||||
'fileable_type' => 'App\Models\LaboratoriumResult',
|
||||
'fileable_id' => $requestLogDailyMonitoring->id,
|
||||
'fileable_id' => $test->id,
|
||||
'deleted_at' => null
|
||||
])
|
||||
->whereIn('type', ['laboratorium-result'])
|
||||
@@ -195,10 +195,10 @@ class DataServiceMonitoring extends JsonResource
|
||||
}
|
||||
}
|
||||
return [
|
||||
'code' => $requestLogDailyMonitoring->code,
|
||||
'date' => Carbon::parse($requestLogDailyMonitoring->lab_date)->format('d M Y') ?? null,
|
||||
'examination' => $requestLogDailyMonitoring->examination ?? null,
|
||||
'location' => $requestLogDailyMonitoring->provider ?? null,
|
||||
'code' => $test->code,
|
||||
'date' => Carbon::parse($test->lab_date)->format('d M Y') ?? null,
|
||||
'examination' => $test->examination ?? null,
|
||||
'location' => $test->provider ?? null,
|
||||
'files' => $arr_document
|
||||
];
|
||||
})
|
||||
|
||||
@@ -109,6 +109,12 @@ export default function List() {
|
||||
label: 'Code',
|
||||
isSort: true,
|
||||
},
|
||||
{
|
||||
id: 'provider_name',
|
||||
align: 'left',
|
||||
label: 'Provider',
|
||||
isSort: false,
|
||||
},
|
||||
{
|
||||
id: 'service_type',
|
||||
align: 'center',
|
||||
|
||||
@@ -364,7 +364,7 @@ export default function DetailMonitoringList() {
|
||||
/>
|
||||
</Grid>
|
||||
{
|
||||
index == (fields1.length-1) ?
|
||||
index === 0 ?
|
||||
(
|
||||
<Grid item xs={1} sx={{ textAlign: 'center' }}>
|
||||
<IconButton size='large' color='primary' onClick={() => append1({medical_plan_str: ''})}>
|
||||
@@ -374,11 +374,22 @@ export default function DetailMonitoringList() {
|
||||
)
|
||||
:
|
||||
(
|
||||
<Grid item xs={1} sx={{ textAlign: 'center' }}>
|
||||
<IconButton size='large' color='error' onClick={() => remove1(index)}>
|
||||
<RemoveIcon />
|
||||
</IconButton>
|
||||
</Grid>
|
||||
index === (fields1.length - 1) ?
|
||||
(
|
||||
<Grid item xs={1} sx={{ textAlign: 'center' }}>
|
||||
<IconButton size='large' color='error' onClick={() => remove1(index)}>
|
||||
<RemoveIcon />
|
||||
</IconButton>
|
||||
</Grid>
|
||||
)
|
||||
:
|
||||
(
|
||||
<Grid item xs={1} sx={{ textAlign: 'center' }}>
|
||||
<IconButton size='large' color='primary' onClick={() => append1({medical_plan_str: ''})}>
|
||||
<AddIcon />
|
||||
</IconButton>
|
||||
</Grid>
|
||||
)
|
||||
)
|
||||
}
|
||||
</Grid>
|
||||
@@ -410,21 +421,30 @@ export default function DetailMonitoringList() {
|
||||
/>
|
||||
</Grid>
|
||||
{
|
||||
index == (fields2.length-1) ?
|
||||
index === 0 ?
|
||||
(
|
||||
<Grid item xs={1} sx={{ textAlign: 'center' }}>
|
||||
<IconButton size='large' color='primary' onClick={() => append2({non_medikamentosa_plan_str: ''})}>
|
||||
<AddIcon />
|
||||
</IconButton>
|
||||
</Grid>
|
||||
)
|
||||
:
|
||||
(
|
||||
<Grid item xs={1} sx={{ textAlign: 'center' }}>
|
||||
<IconButton size='large' color='error' onClick={() => remove2(index)}>
|
||||
<RemoveIcon />
|
||||
</IconButton>
|
||||
</Grid>
|
||||
</Grid>
|
||||
) : (
|
||||
index == (fields2.length-1) ?
|
||||
(
|
||||
<Grid item xs={1} sx={{ textAlign: 'center' }}>
|
||||
<IconButton size='large' color='error' onClick={() => remove2(index)}>
|
||||
<RemoveIcon />
|
||||
</IconButton>
|
||||
</Grid>
|
||||
)
|
||||
:
|
||||
(
|
||||
<Grid item xs={1} sx={{ textAlign: 'center' }}>
|
||||
<IconButton size='large' color='primary' onClick={() => append2({non_medikamentosa_plan_str: ''})}>
|
||||
<AddIcon />
|
||||
</IconButton>
|
||||
</Grid>
|
||||
)
|
||||
)
|
||||
}
|
||||
</Grid>
|
||||
@@ -558,12 +578,12 @@ export default function DetailMonitoringList() {
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body1" component="div">
|
||||
Date*
|
||||
Date
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body1" component="div">
|
||||
Provider*
|
||||
Provider
|
||||
</Typography>
|
||||
</Grid>
|
||||
|
||||
@@ -585,7 +605,7 @@ export default function DetailMonitoringList() {
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Examination*
|
||||
Examination
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
|
||||
Reference in New Issue
Block a user