Merge remote-tracking branch 'origin/staging' into origin/production
This commit is contained in:
@@ -217,7 +217,7 @@ class CorporateMemberController extends Controller
|
||||
'service:code,name',
|
||||
'files',
|
||||
])
|
||||
->find($request_log_id, ['id', 'submission_date', 'discharge_date', 'member_id', 'service_code', 'organization_id']);
|
||||
->find($request_log_id, ['id', 'submission_date', 'discharge_date', 'member_id', 'service_code', 'organization_id', 'diagnosis']);
|
||||
|
||||
$dataBenefit = [];
|
||||
if (count($data->requestLogBenefits) > 0) {
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Modules\Client\Transformers\AlarmCenter;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Carbon;
|
||||
use App\Models\Icd;
|
||||
|
||||
class DataServiceMonitoring extends JsonResource
|
||||
{
|
||||
@@ -49,6 +50,34 @@ class DataServiceMonitoring extends JsonResource
|
||||
];
|
||||
}
|
||||
|
||||
$diagnosis = '-';
|
||||
$main_diagnosis = '-';
|
||||
if ($this->diagnosis){
|
||||
$diagnosis = explode(',', $this->diagnosis);
|
||||
if (count($diagnosis)>0){
|
||||
|
||||
foreach($diagnosis as $key => $d){
|
||||
$icd = Icd::where('code', $d)->first('name');
|
||||
if($key == 0){
|
||||
if ($icd){
|
||||
$main_diagnosis = $icd->name;
|
||||
} else {
|
||||
$main_diagnosis = $d;
|
||||
}
|
||||
$diagnosis = '-';
|
||||
}
|
||||
|
||||
if ($key > 0){
|
||||
if ($icd) {
|
||||
$diagnosis .= $icd->name . ', ';
|
||||
} else {
|
||||
$diagnosis .= $d .', ';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'companyName' => $this->member->currentCorporate->name ?? null,
|
||||
'serviceCode' => $this->service_code ?? null,
|
||||
@@ -59,6 +88,8 @@ class DataServiceMonitoring extends JsonResource
|
||||
'email' => $this->member->email ?? ($this->member->person->email ?? null),
|
||||
'serviceName' => $this->service->name ?? ($this->service_code ?? null),
|
||||
'files' => $files,
|
||||
'mainDiagnose' => $main_diagnosis,
|
||||
'comparativeDiagnosis' => $diagnosis,
|
||||
'benefits' => collect($this->requestLogBenefits)->map(function ($requestLogBenefit) {
|
||||
return [
|
||||
'amountIncurred' => $requestLogBenefit->amount_incurred,
|
||||
|
||||
@@ -367,8 +367,15 @@ export default function ServiceMonitoring() {
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12} paddingY={2}>
|
||||
<Typography component={'h6'} fontWeight={700} fontSize={18}>
|
||||
{loading ? <Skeleton animation="wave" width={175} /> : 'Detail Letter Of Guarante'}
|
||||
</Typography>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Card>
|
||||
|
||||
</Grid>
|
||||
<Grid item container xs={12} spacing={5}>
|
||||
<Grid item container xs={12} md={6}>
|
||||
@@ -1103,7 +1110,7 @@ export default function ServiceMonitoring() {
|
||||
{data &&
|
||||
data.laboratoriumResults &&
|
||||
Object.keys(data.laboratoriumResults).length > 0 ? (
|
||||
Object.keys(data.dailyMonitorings).map((date, dateIndex) => (
|
||||
Object.keys(data.laboratoriumResults).map((date, dateIndex) => (
|
||||
<Card
|
||||
sx={{
|
||||
padding: 3,
|
||||
@@ -1114,60 +1121,37 @@ export default function ServiceMonitoring() {
|
||||
key={dateIndex}
|
||||
>
|
||||
<Stack>
|
||||
<Typography variant="subtitle1">{date ? date : '-'}</Typography>
|
||||
{data.laboratoriumResults[date].map(
|
||||
(laboratoriumResult, laboratoriumResultIndex) => (
|
||||
<Card
|
||||
key={laboratoriumResultIndex}
|
||||
sx={{ marginTop: 3, paddingX: 2.5, paddingY: 2 }}
|
||||
>
|
||||
<Label>
|
||||
{laboratoriumResult.code ? laboratoriumResult.code : '-'}
|
||||
</Label>
|
||||
<Table sx={{ marginY: 2 }}>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Date</TableCell>
|
||||
<TableCell>Examination</TableCell>
|
||||
<TableCell>Location</TableCell>
|
||||
{/* <TableCell /> */}
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<Label>
|
||||
{laboratoriumResult.date ? laboratoriumResult.date : '-'}
|
||||
</Label>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{laboratoriumResult.examination
|
||||
? laboratoriumResult.examination
|
||||
: '-'}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{laboratoriumResult.location
|
||||
? laboratoriumResult.location
|
||||
: '-'}
|
||||
</TableCell>
|
||||
{/* <TableMoreMenu
|
||||
actions={
|
||||
<>
|
||||
<MenuItem
|
||||
onClick={() => handleDownloadClick(laboratoriumResult.file)}
|
||||
>
|
||||
<DownloadIcon />
|
||||
Download
|
||||
</MenuItem>
|
||||
</>
|
||||
}
|
||||
/> */}
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</Card>
|
||||
)
|
||||
)}
|
||||
<Typography variant="subtitle1">{date ? date : '-'}</Typography>
|
||||
{data.laboratoriumResults[date]?.map((laboratoriumResult, laboratoriumResultIndex) => (
|
||||
<Card key={laboratoriumResultIndex} sx={{ marginTop: 3, paddingX: 2.5, paddingY: 2 }}>
|
||||
<Label>{laboratoriumResult.code || '-'}</Label>
|
||||
<Table sx={{ marginY: 2 }}>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Date</TableCell>
|
||||
<TableCell>Examination</TableCell>
|
||||
<TableCell>Location</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell><Label>{laboratoriumResult.date || '-'}</Label></TableCell>
|
||||
<TableCell>{laboratoriumResult.examination || '-'}</TableCell>
|
||||
<TableCell>{laboratoriumResult.location || '-'}</TableCell>
|
||||
{/* <TableMoreMenu
|
||||
actions={
|
||||
<>
|
||||
<MenuItem onClick={() => handleDownloadClick(laboratoriumResult.file)}>
|
||||
<DownloadIcon /> Download
|
||||
</MenuItem>
|
||||
</>
|
||||
}
|
||||
/> */}
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</Card>
|
||||
))}
|
||||
</Stack>
|
||||
</Card>
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user