Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel11 #720

Merged
merged 5 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions GaelO2/app/Models/Center.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ class Center extends Model
protected $primaryKey = 'code';
public $incrementing = false;

protected $casts = [
'code' => 'integer',
'name' => 'string',
'country_code' => 'string'
];

protected function casts(): array
{
return [
'code' => 'integer',
'name' => 'string',
'country_code' => 'string'
];
}

public function country()
{
return $this->belongsTo(Country::class, 'country_code', 'code');
Expand Down
11 changes: 7 additions & 4 deletions GaelO2/app/Models/CenterUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ class CenterUser extends Model
{
use HasFactory;

protected $casts = [
'user_id' => 'integer',
'center_code' => 'integer'
];
protected function casts(): array
{
return [
'user_id' => 'integer',
'center_code' => 'integer'
];
}

/**
* The table associated with the model.
Expand Down
14 changes: 8 additions & 6 deletions GaelO2/app/Models/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ class Country extends Model
protected $primaryKey = 'code';
public $incrementing = false;

protected $casts = [
'code' => 'string',
'country_us' => 'string',
'country_fr' => 'string'
];

protected function casts(): array
{
return [
'code' => 'string',
'country_us' => 'string',
'country_fr' => 'string'
];
}
}
45 changes: 24 additions & 21 deletions GaelO2/app/Models/DicomSeries.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,30 @@ class DicomSeries extends Model
protected $keyType = 'string';
public $incrementing = false;

protected $casts = [
'series_uid' => 'string',
'study_instance_uid' => 'string',
'orthanc_id' => 'string',
'acquisition_date' => 'date:Y-m-d',
'acquisition_time' => 'datetime:H:i:s',
'modality' => 'string',
'series_description' => 'string',
'injected_dose' => 'integer',
'radiopharmaceutical' => 'string',
'half_life' => 'integer',
'injected_time' => 'datetime:H:i:s',
'injected_datetime' => 'datetime',
'patient_weight' => 'integer',
'number_of_instances' => 'integer',
'series_number' => 'string',
'disk_size' => 'integer',
'uncompressed_disk_size' => 'integer',
'manufacturer' => 'string',
'model_name' => 'string'
];
protected function casts(): array
{
return [
'series_uid' => 'string',
'study_instance_uid' => 'string',
'orthanc_id' => 'string',
'acquisition_date' => 'date:Y-m-d',
'acquisition_time' => 'datetime:H:i:s',
'modality' => 'string',
'series_description' => 'string',
'injected_dose' => 'integer',
'radiopharmaceutical' => 'string',
'half_life' => 'integer',
'injected_time' => 'datetime:H:i:s',
'injected_datetime' => 'datetime',
'patient_weight' => 'integer',
'number_of_instances' => 'integer',
'series_number' => 'string',
'disk_size' => 'integer',
'uncompressed_disk_size' => 'integer',
'manufacturer' => 'string',
'model_name' => 'string'
];
}

public function dicomStudy()
{
Expand Down
39 changes: 21 additions & 18 deletions GaelO2/app/Models/DicomStudy.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,27 @@ class DicomStudy extends Model
protected $keyType = 'string';
public $incrementing = false;

protected $casts = [
'study_uid' => 'string',
'orthanc_id' => 'string',
'visit_id' => 'integer',
'user_id' => 'integer',
'upload_date' => 'datetime',
'acquisition_date' => 'date:Y-m-d',
'acquisition_time' => 'datetime:H:i:s',
'anon_from_orthanc_id' => 'string',
'study_description' => 'string',
'patient_orthanc_id' => 'string',
'patient_name' => 'string',
'patient_id' => 'string',
'number_of_series' => 'integer',
'number_of_instances' => 'integer',
'disk_size' => 'integer',
'uncompressed_disk_size' => 'integer'
];
protected function casts(): array
{
return [
'study_uid' => 'string',
'orthanc_id' => 'string',
'visit_id' => 'integer',
'user_id' => 'integer',
'upload_date' => 'datetime',
'acquisition_date' => 'date:Y-m-d',
'acquisition_time' => 'datetime:H:i:s',
'anon_from_orthanc_id' => 'string',
'study_description' => 'string',
'patient_orthanc_id' => 'string',
'patient_name' => 'string',
'patient_id' => 'string',
'number_of_series' => 'integer',
'number_of_instances' => 'integer',
'disk_size' => 'integer',
'uncompressed_disk_size' => 'integer'
];
}

public function dicomSeries()
{
Expand Down
27 changes: 15 additions & 12 deletions GaelO2/app/Models/Documentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@ class Documentation extends Model
{
use SoftDeletes, HasFactory;

protected $casts = [
'id' => 'integer',
'name' => 'string',
'document_date' => 'datetime',
'study_name' => 'string',
'version' => 'string',
'investigator' => 'boolean',
'controller' => 'boolean',
'monitor' => 'boolean',
'reviewer' => 'boolean',
'path' => 'string'
];
protected function casts(): array
{
return [
'id' => 'integer',
'name' => 'string',
'document_date' => 'datetime',
'study_name' => 'string',
'version' => 'string',
'investigator' => 'boolean',
'controller' => 'boolean',
'monitor' => 'boolean',
'reviewer' => 'boolean',
'path' => 'string'
];
}

public function study()
{
Expand Down
40 changes: 21 additions & 19 deletions GaelO2/app/Models/Patient.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,27 @@ class Patient extends Model
protected $keyType = 'string';
public $incrementing = false;

protected $casts = [
'id' => 'string',
'code' => 'string',
'firstname' => 'string',
'lastname' => 'string',
'gender' => GenderEnum::class,
'birth_day' => 'integer',
'birth_month' => 'integer',
'birth_year' => 'integer',
'registration_date' => 'date',
'investigator_name' => 'string',
'center_code' => 'integer',
'study_name' => 'string',
'inclusion_status' => InclusionStatusEnum::class,
'withdraw_reason' => 'string',
'withdraw_date' => 'date',
'metadata' => 'array',
];

protected function casts(): array
{
return [
'id' => 'string',
'code' => 'string',
'firstname' => 'string',
'lastname' => 'string',
'gender' => GenderEnum::class,
'birth_day' => 'integer',
'birth_month' => 'integer',
'birth_year' => 'integer',
'registration_date' => 'date',
'investigator_name' => 'string',
'center_code' => 'integer',
'study_name' => 'string',
'inclusion_status' => InclusionStatusEnum::class,
'withdraw_reason' => 'string',
'withdraw_date' => 'date',
'metadata' => 'array',
];
}

public function center()
{
Expand Down
27 changes: 15 additions & 12 deletions GaelO2/app/Models/Review.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ class Review extends Model

protected $guarded = [];

protected $casts = [
'id' => 'integer',
'study_name' => 'string',
'visit_id' => 'integer',
'user_id' => 'integer',
'review_date' => 'datetime',
'validated' => 'boolean',
'local' => 'boolean',
'adjudication' => 'boolean',
'sent_files' => 'array',
'review_data' => 'array',
];
protected function casts(): array
{
return [
'id' => 'integer',
'study_name' => 'string',
'visit_id' => 'integer',
'user_id' => 'integer',
'review_date' => 'datetime',
'validated' => 'boolean',
'local' => 'boolean',
'adjudication' => 'boolean',
'sent_files' => 'array',
'review_data' => 'array',
];
}

//Default value because db does not accept default value json
protected $attributes = [
Expand Down
23 changes: 13 additions & 10 deletions GaelO2/app/Models/ReviewStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@ class ReviewStatus extends Model
protected $table = 'reviews_status';
protected $guarded = [];

protected $casts = [
'id' => 'integer',
'visit_id' => 'integer',
'study_name' => 'string',
'review_available' => 'boolean',
'target_lesions' => 'array',
'review_status' => ReviewStatusEnum::class,
'review_conclusion_value' => 'string',
'review_conclusion_date' => 'datetime'
];
protected function casts(): array
{
return [
'id' => 'integer',
'visit_id' => 'integer',
'study_name' => 'string',
'review_available' => 'boolean',
'target_lesions' => 'array',
'review_status' => ReviewStatusEnum::class,
'review_conclusion_value' => 'string',
'review_conclusion_date' => 'datetime'
];
}

//Default value because db does not accept default value json
protected $attributes = [
Expand Down
15 changes: 9 additions & 6 deletions GaelO2/app/Models/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ class Role extends Model

protected $guarded = [];

protected $casts = [
'name' => RoleEnum::class,
'user_id' => 'integer',
'study_name' => 'string',
'validated_documentation_version' => 'string'
];
protected function casts(): array
{
return [
'name' => RoleEnum::class,
'user_id' => 'integer',
'study_name' => 'string',
'validated_documentation_version' => 'string'
];
}

public function user()
{
Expand Down
23 changes: 13 additions & 10 deletions GaelO2/app/Models/Study.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ class Study extends Model
protected $keyType = 'string';
public $incrementing = false;

protected $casts = [
'name' => 'string',
'code' => 'string',
'patient_code_length' => 'integer',
'contact_email' => 'string',
'controller_show_all' => 'boolean',
'monitor_show_all' => 'boolean',
'ancillary_of' => 'string',
'documentation_mandatory' => 'boolean'
];
protected function casts(): array
{
return [
'name' => 'string',
'code' => 'string',
'patient_code_length' => 'integer',
'contact_email' => 'string',
'controller_show_all' => 'boolean',
'monitor_show_all' => 'boolean',
'ancillary_of' => 'string',
'documentation_mandatory' => 'boolean'
];
}

public function patients()
{
Expand Down
23 changes: 13 additions & 10 deletions GaelO2/app/Models/Tracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ class Tracker extends Model
{
use HasFactory;

protected $casts = [
'id' => 'integer',
'study_name' => 'string',
'user_id' => 'integer',
'date' => 'datetime',
'role' => 'string',
'visit_id' => 'integer',
'action_type' => 'string',
'action_details' => 'array'
];
protected function casts(): array
{
return [
'id' => 'integer',
'study_name' => 'string',
'user_id' => 'integer',
'date' => 'datetime',
'role' => 'string',
'visit_id' => 'integer',
'action_type' => 'string',
'action_details' => 'array'
];
}

protected $attributes = [
'action_details' => '{}',
Expand Down
Loading