HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1017-azure #17~24.04.1-Ubuntu SMP Mon Dec 1 20:10:50 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /mnt/data/ghayatcom/ghayatcom-api/app/Http/Resources/HealthRecordResource.php
<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

/**
 * App\Http\Resources
 *
 * @property integer $id
 * @property mixed $appointment_id
 * @property mixed $symptom_name
 * @property mixed $diagnosis
 * @property mixed $treatment_given
 * @property mixed $recommeded_follow_up
 * @property mixed $other_comments
 * @property mixed $template_id
 * @property mixed $other_symptom
 * @property mixed $infertility
 * @property mixed $different_diagnosis
 * @property mixed $template_symptoms
 * @property mixed $grading
 * @property mixed $stds
 * @property mixed $contraception
 * @property mixed $dribbling
 * @property mixed $pain_scale
 * @property mixed $last_menstrual_period
 * @property mixed $pregnant
 * @property mixed $miscarriages
 * @property mixed $pregnancies
 * @property mixed $length_of_periods
 * @property mixed $libido
 * @property mixed $template_symptoms_str
 * @property mixed $templateSymptoms
 * @method array symptoms_list()
 */

class HealthRecordResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        // return parent::toArray($request);
        return [
            'id' => $this->id,
            "appointment_id"=> $this->appointment_id,
            "symptom"=> $this->symptom_name,
            "diagnosis"=> $this->diagnosis,
            "different_diagnosis"=> $this->different_diagnosis,
            "treatment_given"=> $this->treatment_given,
            "recommended_follow_up"=> $this->recommeded_follow_up,
            "other_comments"=> $this->other_comments,
            "template_id"=> $this->template_id,
            // "template_symptoms"=> $this->template_symptoms,
            "symptoms_list" => $this->templateSymptoms,
            "other_symptom"=> $this->other_symptom,
            "grading"=> $this->grading,
            "infertility"=> $this->infertility,
            "stds"=> $this->stds,
            "contraception"=> $this->contraception,
            "dribbling"=> $this->dribbling,
            "pain_scale"=> $this->pain_scale,
            "last_menstrual_period"=>$this->last_menstrual_period,
            "pregnant"=> $this->pregnant,
            "miscarriages"=> $this->miscarriages,
            "pregnancies"=> $this->pregnancies,
            "length_of_periods"=> $this->length_of_periods,
            "libido"=> $this->libido
        ];
    }
}