refx - details

This commit is contained in:
Dr Masroor Ehsan 2024-12-30 09:14:59 +06:00
parent fb85254d01
commit ba3fc9d806
4 changed files with 12 additions and 10 deletions

View File

@ -16,9 +16,9 @@ class Study extends BaseModel
'report_status' => ReportStatus::class,
];
public function history(): HasOne
public function details(): HasOne
{
return $this->hasOne(StudyHistory::class);
return $this->hasOne(StudyDetails::class);
}
public function attachments(): HasMany

View File

@ -4,8 +4,10 @@
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class StudyHistory extends BaseModel
class StudyDetails extends BaseModel
{
protected $table = 'study_details';
public function study(): BelongsTo
{
return $this->belongsTo(Study::class);

View File

@ -31,11 +31,6 @@ public function up(): void
$table->string('accession_number')->nullable();
$table->string('study_description')->nullable();
$table->string('body_part_examined')->nullable();
$table->string('station_name')->nullable();
$table->string('operators_name')->nullable();
$table->string('manufacturer')->nullable();
$table->string('manufacturer_model_name')->nullable();
$table->string('software_versions')->nullable();
$table->string('referring_physician_name')->nullable();
$table->string('study_modality', 4)->nullable();

View File

@ -8,7 +8,7 @@
{
public function up(): void
{
Schema::create('study_histories', function (Blueprint $table) {
Schema::create('study_details', function (Blueprint $table) {
$table->id();
$table->foreignId('study_id')->index()->constrained('studies')->cascadeOnDelete();
$table->foreignId('user_id')->constrained('users');
@ -16,12 +16,17 @@ public function up(): void
$table->text('surgical_history')->nullable();
$table->text('lab_results')->nullable();
$table->text('clinical_diagnosis')->nullable();
$table->string('station_name')->nullable();
$table->string('operators_name')->nullable();
$table->string('manufacturer')->nullable();
$table->string('manufacturer_model_name')->nullable();
$table->string('software_versions')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('study_histories');
Schema::dropIfExists('study_details');
}
};