Show additional patient information in Dashboard Appointment
This commit is contained in:
@@ -18,7 +18,7 @@ class AppointmentController extends Controller
|
||||
public function index()
|
||||
{
|
||||
$appointments = Appointment::query()
|
||||
->with('doctor.user', 'doctor.speciality', 'appointmentDetail', 'healthCare', 'user')
|
||||
->with('doctor.user', 'doctor.speciality', 'appointmentDetail', 'healthCare', 'user', 'user.detail')
|
||||
->latest()
|
||||
->paginate(15);
|
||||
return response()->json(Helper::paginateResources(AppointmentResource::collection($appointments)));
|
||||
|
||||
@@ -39,4 +39,9 @@ class User extends Model
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
return $this->hasOne(UserDetail::class, 'nIDUser', 'nID');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,13 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class UserDetail extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
const CREATED_AT = 'dCreateOn';
|
||||
const UPDATED_AT = 'dUpdateOn';
|
||||
const DELETED_AT = 'dDeleteOn';
|
||||
|
||||
protected $connection = 'oldlms';
|
||||
|
||||
protected $table = 'tm_users_detail';
|
||||
|
||||
}
|
||||
|
||||
@@ -211,6 +211,10 @@ export default function List() {
|
||||
<Grid item xs={2}>Metode Pembayaran</Grid><Grid item xs="10">: {row.payment_method}</Grid>
|
||||
<Grid item xs={2}>HIS RegID</Grid><Grid item xs="10">: {row.his_detail?.sRegID}</Grid>
|
||||
<Grid item xs={2}>HIS Medrec</Grid><Grid item xs="10">: {row.his_detail?.Medrec}</Grid>
|
||||
<Grid item xs={2}>No HP</Grid><Grid item xs="10">: {row.patient.sPhone ?? ''}</Grid>
|
||||
<Grid item xs={2}>E-mail</Grid><Grid item xs="10">: {row.patient.sEmail ?? ''}</Grid>
|
||||
<Grid item xs={2}>Alamat</Grid><Grid item xs="10">: {row.patient.detail.sAlamat ?? ''}</Grid>
|
||||
<Grid item xs={2}>KTP</Grid><Grid item xs="10">: {row.patient.detail.sKTP ?? ''}</Grid>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Collapse>
|
||||
|
||||
Reference in New Issue
Block a user