diff --git a/app/Models/MedicalHistoryCorrection.php b/app/Models/MedicalHistoryCorrection.php index e16ff40..5873240 100644 --- a/app/Models/MedicalHistoryCorrection.php +++ b/app/Models/MedicalHistoryCorrection.php @@ -21,13 +21,17 @@ class MedicalHistoryCorrection extends Model 'user_id', 'mis_user_id', 'comment', + 'delivery_from_address', + 'delivery_from_object_id', ]; protected $casts = [ - 'birth_date' => 'datetime', - 'recipient_date' => 'datetime', - 'extract_date' => 'datetime', - 'death_date' => 'datetime', + 'birth_date' => 'date:Y-m-d', + 'recipient_date' => 'datetime:Y-m-d H:i:s', + 'extract_date' => 'datetime:Y-m-d H:i:s', + 'death_date' => 'datetime:Y-m-d H:i:s', + 'male' => 'boolean', + 'delivery_from_object_id' => 'integer' ]; public function medicalHistory() diff --git a/app/Models/ReportNursePatient.php b/app/Models/ReportNursePatient.php index 4fb79ee..3fefb8f 100644 --- a/app/Models/ReportNursePatient.php +++ b/app/Models/ReportNursePatient.php @@ -22,7 +22,9 @@ class ReportNursePatient extends Model 'visit_result_id', 'comment', 'user_id', - 'profit_type_id' + 'profit_type_id', + 'delivery_from_address', + 'delivery_from_object_id', ]; protected $casts = [ @@ -31,6 +33,7 @@ class ReportNursePatient extends Model 'extract_date' => 'datetime:Y-m-d H:i:s', 'death_date' => 'datetime:Y-m-d H:i:s', 'male' => 'boolean', + 'delivery_from_object_id' => 'integer' ]; public function migrations(): \Illuminate\Database\Eloquent\Relations\HasMany diff --git a/database/migrations/2026_07_08_082352_add_column_delivery.php b/database/migrations/2026_07_08_082352_add_column_delivery.php new file mode 100644 index 0000000..744e816 --- /dev/null +++ b/database/migrations/2026_07_08_082352_add_column_delivery.php @@ -0,0 +1,38 @@ +string('delivery_from_address')->nullable(); + $table->unsignedBigInteger('delivery_from_object_id')->nullable(); + }); + Schema::table('report_nurse_patients', function (Blueprint $table) { + $table->string('delivery_from_address')->nullable(); + $table->unsignedBigInteger('delivery_from_object_id')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('medical_history_corrections', function (Blueprint $table) { + $table->dropColumn('delivery_from_address'); + $table->dropColumn('delivery_from_object_id'); + }); + Schema::table('report_nurse_patients', function (Blueprint $table) { + $table->dropColumn('delivery_from_address'); + $table->dropColumn('delivery_from_object_id'); + }); + } +};