Compare commits
No commits in common. "a7228b8a6151945fa134452bdc81c07827a8dbfa" and "927c51e16dfacc0a651725bfc49331f7341b125d" have entirely different histories.
a7228b8a61
...
927c51e16d
@ -50,19 +50,4 @@ public static function worklist_stats(int $days, int $workflow_level)
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public static function activeRads(): array
|
||||
{
|
||||
return cache()
|
||||
->remember('active_rads',
|
||||
now()->addMinutes(5),
|
||||
fn () => DB::table('users')
|
||||
->join('model_has_roles', 'users.id', '=', 'model_has_roles.model_id')
|
||||
->join('roles', 'model_has_roles.role_id', '=', 'roles.id')
|
||||
->where('roles.name', Role::Radiologist->value)
|
||||
->where('users.is_active', true)
|
||||
->orderBy('users.display_name')
|
||||
->pluck('users.display_name', 'users.id')
|
||||
->toArray());
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ interface IUserStudyLister
|
||||
{
|
||||
public function setRadiologist(int $radiologist_id): self;
|
||||
|
||||
public function setWorkflowLevel(WorkflowLevel $level): self;
|
||||
public function setWorkflowLevel(WorkflowLevel $status): self;
|
||||
|
||||
public function setPerPage(int $size): self;
|
||||
|
||||
|
@ -48,9 +48,9 @@ public function setRadiologist(int $radiologist_id): self
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setWorkflowLevel(WorkflowLevel $level): self
|
||||
public function setWorkflowLevel(WorkflowLevel $status): self
|
||||
{
|
||||
$this->workflowLevel = $level;
|
||||
$this->workflowLevel = $status;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -71,6 +71,7 @@ public function get(?int $user_id = null): LengthAwarePaginator
|
||||
$query = $this->applySearch($query);
|
||||
$query = $this->applyRadiologist($query);
|
||||
$query = $this->applyWorkflowLevel($query);
|
||||
$query = $this->applyReportStatus($query);
|
||||
$query = $this->applyArchived($query);
|
||||
$query = $this->applyLocked($query);
|
||||
$query = $this->applyDateFilters($query);
|
||||
|
@ -13,27 +13,22 @@
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Support\Str;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
class DepartmentResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Department::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-building-storefront';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
TextInput::make('guid')
|
||||
->label('Unique ID')
|
||||
->default(sprintf('DEP-%s', Str::of(Uuid::uuid4())->lower()))
|
||||
->disabled()
|
||||
->dehydrated()
|
||||
->required()
|
||||
->maxLength(40)
|
||||
->unique(ignoreRecord: true),
|
||||
->default(sprintf('FAC-%s', Uuid::uuid4())),
|
||||
Toggle::make('is_active')
|
||||
->required(),
|
||||
Select::make('organization_id')
|
||||
@ -49,10 +44,15 @@ public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
IconColumn::make('is_active')->boolean(),
|
||||
TextColumn::make('name')->searchable(),
|
||||
TextColumn::make('organization.name')->sortable(),
|
||||
TextColumn::make('guid')->searchable(),
|
||||
TextColumn::make('guid')
|
||||
->searchable(),
|
||||
IconColumn::make('is_active')
|
||||
->boolean(),
|
||||
TextColumn::make('organization.name')
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('name')
|
||||
->searchable(),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
|
@ -1,126 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\DAL\Radiologists;
|
||||
use App\Filament\Resources\DicomRoutingRuleResource\Pages;
|
||||
use App\Models\DicomRoutingRule;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class DicomRoutingRuleResource extends Resource
|
||||
{
|
||||
protected static ?string $model = DicomRoutingRule::class;
|
||||
protected static ?string $modelLabel = 'Routing Rules';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-academic-cap';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Toggle::make('is_active')
|
||||
->required(),
|
||||
Select::make('organization_id')
|
||||
->label('Organization')
|
||||
->relationship('organization', 'name')
|
||||
->required(),
|
||||
Select::make('department_id')
|
||||
->label('Department')
|
||||
->relationship('department', 'name'),
|
||||
Select::make('user_id')
|
||||
->label('Radiologist')
|
||||
->relationship('radiologist', 'display_name')
|
||||
->options(Radiologists::activeRads()),
|
||||
Select::make('assignment_panel_id')
|
||||
->label('Panel')
|
||||
->relationship('panel', 'name'),
|
||||
TextInput::make('name')
|
||||
->maxLength(255),
|
||||
Textarea::make('condition')
|
||||
->columnSpanFull()
|
||||
->required(),
|
||||
TextInput::make('priority')
|
||||
->required()
|
||||
->numeric()
|
||||
->default(0),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
IconColumn::make('is_active')
|
||||
->label('')
|
||||
->boolean(),
|
||||
TextColumn::make('name')
|
||||
->searchable(),
|
||||
TextColumn::make('condition')
|
||||
->label('Rule')
|
||||
->limit(20)
|
||||
->searchable(),
|
||||
TextColumn::make('priority')
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('organization.name')
|
||||
->label('Org')
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('department.name')
|
||||
->label('Dept')
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('user_id')
|
||||
->label('Rad')
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('assignment_panel_id')
|
||||
->label('Panel')
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => Pages\ListDicomRoutingRules::route('/'),
|
||||
'create' => Pages\CreateDicomRoutingRule::route('/create'),
|
||||
'edit' => Pages\EditDicomRoutingRule::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\DicomRoutingRuleResource\Pages;
|
||||
|
||||
use App\Filament\Resources\DicomRoutingRuleResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateDicomRoutingRule extends CreateRecord
|
||||
{
|
||||
protected static string $resource = DicomRoutingRuleResource::class;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\DicomRoutingRuleResource\Pages;
|
||||
|
||||
use App\Filament\Resources\DicomRoutingRuleResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditDicomRoutingRule extends EditRecord
|
||||
{
|
||||
protected static string $resource = DicomRoutingRuleResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\DicomRoutingRuleResource\Pages;
|
||||
|
||||
use App\Filament\Resources\DicomRoutingRuleResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListDicomRoutingRules extends ListRecords
|
||||
{
|
||||
protected static string $resource = DicomRoutingRuleResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -3,14 +3,12 @@
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\DicomServerResource\Pages;
|
||||
use App\Models\Department;
|
||||
use App\Models\DicomServer;
|
||||
use App\Services\GeoLocation;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Forms\Get;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
@ -32,7 +30,6 @@ public static function form(Form $form): Form
|
||||
->required(),
|
||||
TextInput::make('server_name')
|
||||
->required()
|
||||
->unique(ignoreRecord: true)
|
||||
->maxLength(255),
|
||||
Select::make('geo_code')
|
||||
->required()
|
||||
@ -51,11 +48,12 @@ public static function form(Form $form): Form
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('ae_title')
|
||||
->maxLength(24),
|
||||
->maxLength(255),
|
||||
TextInput::make('username')
|
||||
->maxLength(40),
|
||||
->maxLength(255),
|
||||
TextInput::make('password')
|
||||
->maxLength(40),
|
||||
->password()
|
||||
->maxLength(255),
|
||||
TextInput::make('wado_path')
|
||||
->maxLength(255),
|
||||
TextInput::make('stone_viewer_path')
|
||||
@ -64,21 +62,10 @@ public static function form(Form $form): Form
|
||||
->maxLength(255),
|
||||
TextInput::make('meddream_viewer_path')
|
||||
->maxLength(255),
|
||||
Select::make('organization_id')
|
||||
->label('Organization')
|
||||
->live()
|
||||
->relationship('organization', 'name'),
|
||||
Select::make('department_id')
|
||||
->label('Department')
|
||||
->options(function (Get $get) {
|
||||
$organization_id = $get('organization_id');
|
||||
$result = [];
|
||||
if ($organization_id != null) {
|
||||
$result = Department::active()->organization($organization_id)->pluck('name', 'id')->toArray();
|
||||
}
|
||||
|
||||
return $result;
|
||||
}),
|
||||
TextInput::make('organization_id')
|
||||
->numeric(),
|
||||
TextInput::make('department_id')
|
||||
->numeric(),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -101,12 +88,11 @@ public static function table(Table $table): Table
|
||||
->label('WADO'),
|
||||
TextColumn::make('dicom_port')
|
||||
->label('DICOM'),
|
||||
TextColumn::make('ae_title')
|
||||
->label('AET')
|
||||
->searchable(),
|
||||
TextColumn::make('rest_api_endpoint')
|
||||
->label('REST')
|
||||
->url(fn (DicomServer $srv) => $srv->rest_api_endpoint, shouldOpenInNewTab: true)
|
||||
->searchable(),
|
||||
TextColumn::make('ae_title')
|
||||
->label('AET')
|
||||
->searchable(),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
use App\Filament\Resources\OrganizationResource\Pages;
|
||||
use App\Models\Organization;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Forms\Form;
|
||||
@ -15,34 +14,28 @@
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Support\Str;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
class OrganizationResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Organization::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-building-office-2';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
TextInput::make('guid')
|
||||
->label('Unique ID')
|
||||
->default(sprintf('ORG-%s', Str::of(Uuid::uuid4())->lower()))
|
||||
->disabled()
|
||||
->dehydrated()
|
||||
->required()
|
||||
->maxLength(40)
|
||||
->unique(ignoreRecord: true),
|
||||
Toggle::make('is_active')
|
||||
->required(),
|
||||
->default(sprintf('INS-%s', Uuid::uuid4())),
|
||||
TextInput::make('name')
|
||||
->required()
|
||||
->unique(ignoreRecord: true)
|
||||
->maxLength(255),
|
||||
TextArea::make('address')
|
||||
Toggle::make('is_active')
|
||||
->required(),
|
||||
TextInput::make('address')
|
||||
->maxLength(255),
|
||||
TextInput::make('logo_path')
|
||||
->maxLength(255),
|
||||
@ -53,9 +46,16 @@ public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
IconColumn::make('is_active')->boolean(),
|
||||
TextColumn::make('name')->searchable(),
|
||||
TextColumn::make('guid')->searchable(),
|
||||
TextColumn::make('guid')
|
||||
->searchable(),
|
||||
TextColumn::make('name')
|
||||
->searchable(),
|
||||
IconColumn::make('is_active')
|
||||
->boolean(),
|
||||
TextColumn::make('address')
|
||||
->searchable(),
|
||||
TextColumn::make('logo_path')
|
||||
->searchable(),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
|
@ -7,6 +7,7 @@
|
||||
use App\Models\User;
|
||||
use App\Services\ACL\RoleService;
|
||||
use App\Services\TimezoneList;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\Select;
|
||||
@ -40,7 +41,7 @@ public static function form(Form $form): Form
|
||||
|
||||
return $form
|
||||
->schema([
|
||||
TextInput::make('guid')
|
||||
Forms\Components\TextInput::make('guid')
|
||||
->label('Unique ID')
|
||||
->default(sprintf('USR-%s', Str::of(Uuid::uuid4())->lower()))
|
||||
->disabled()
|
||||
|
@ -21,7 +21,7 @@ public function rules(): array
|
||||
'referring_physician_name' => ['nullable'],
|
||||
'institution_name' => ['nullable'],
|
||||
'priority' => ['required', 'integer'],
|
||||
'cancel_read' => ['accepted'],
|
||||
'cancel_read' => ['nullable', 'boolean'],
|
||||
|
||||
/*
|
||||
'referring_physician_id' => ['nullable', 'exists:users,id'],
|
||||
|
@ -4,8 +4,9 @@
|
||||
|
||||
use App\Models\Traits\Active;
|
||||
use App\Models\Traits\HasOrganization;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Department extends BaseModel
|
||||
class Department extends Model
|
||||
{
|
||||
use Active;
|
||||
use HasOrganization;
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
use App\Models\Traits\Active;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
|
||||
class DicomRoutingRule extends BaseModel
|
||||
{
|
||||
@ -19,14 +20,14 @@ public function department(): BelongsTo
|
||||
return $this->belongsTo(Department::class);
|
||||
}
|
||||
|
||||
public function panel(): BelongsTo
|
||||
public function panel(): HasOne
|
||||
{
|
||||
return $this->belongsTo(AssignmentPanel::class, 'assignment_panel_id');
|
||||
return $this->hasOne(AssignmentPanel::class);
|
||||
}
|
||||
|
||||
public function radiologist(): BelongsTo
|
||||
public function radiologist(): HasOne
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
return $this->hasOne(User::class);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
|
@ -10,12 +10,12 @@ class DicomServer extends BaseModel
|
||||
{
|
||||
use Active;
|
||||
|
||||
public function organization(): BelongsTo
|
||||
public function institute(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Organization::class);
|
||||
}
|
||||
|
||||
public function department(): BelongsTo
|
||||
public function facility(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Department::class);
|
||||
}
|
||||
|
@ -17,8 +17,7 @@
|
||||
|
||||
final class StudiesSync
|
||||
{
|
||||
public const SYNC_AGENT = '$$_pacs_agent_$$';
|
||||
|
||||
public const string SYNC_AGENT = '$$_pacs_agent_$$';
|
||||
private Collection $study_ids;
|
||||
|
||||
private Collection $insert_queue;
|
||||
@ -148,29 +147,6 @@ public function transformData(mixed $orthanc_src): array
|
||||
|
||||
$inst_name = data_get($orthanc_src, 'MainDicomTags.InstitutionName');
|
||||
$patient_name = data_get($orthanc_src, 'PatientMainDicomTags.PatientName');
|
||||
$name_parts = tokenizeString($patient_name);
|
||||
$patient_age = data_get($orthanc_src, 'RequestedTags.PatientAge');
|
||||
if (blank($patient_age) && ! empty($name_parts)) {
|
||||
// try to get age from last part of patient name
|
||||
$last = end($name_parts);
|
||||
if (preg_match('/^\d+[YMD]$/i', $last)) {
|
||||
$patient_age = $last;
|
||||
/*
|
||||
// sanitize patient name
|
||||
array_pop($name_parts);
|
||||
$patient_name = implode(' ', $name_parts);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
if ($patient_age !== null) {
|
||||
$age = strtoupper(ltrim($patient_age, '0'));
|
||||
if (strlen($age) > 1) {
|
||||
$patient_age = $age;
|
||||
}
|
||||
}
|
||||
|
||||
// $patient_name = trim($patient_name, '.^ ');
|
||||
|
||||
$descr = $this->getStudyDescription($orthanc_src);
|
||||
$study = [
|
||||
@ -184,7 +160,7 @@ public function transformData(mixed $orthanc_src): array
|
||||
'patient_id' => data_get($orthanc_src, 'PatientMainDicomTags.PatientID'),
|
||||
'patient_name' => $patient_name,
|
||||
'patient_sex' => data_get($orthanc_src, 'PatientMainDicomTags.PatientSex'),
|
||||
'patient_age' => $patient_age,
|
||||
'patient_age' => data_get($orthanc_src, 'RequestedTags.PatientAge'),
|
||||
|
||||
'accession_number' => data_get($orthanc_src, 'MainDicomTags.AccessionNumber'),
|
||||
'referring_physician_name' => data_get($orthanc_src, 'MainDicomTags.ReferringPhysicianName'),
|
||||
@ -206,40 +182,16 @@ public function transformData(mixed $orthanc_src): array
|
||||
$study['workflow_level'] = $stable_study
|
||||
? WorkflowLevel::Unassigned->value
|
||||
: WorkflowLevel::Received->value;
|
||||
|
||||
$patient_birthdate = null;
|
||||
$study['patient_birthdate'] = null;
|
||||
$dob = data_get($orthanc_src, 'PatientMainDicomTags.PatientBirthDate');
|
||||
if (filled($dob)) {
|
||||
try {
|
||||
$patient_birthdate = Carbon::parse($dob);
|
||||
} catch (Exception $e) {
|
||||
Log::error('Failed to parse PatientMainDicomTags.PatientBirthDate: {dob}', ['dob' => $dob, 'exception' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($patient_birthdate == null && $patient_age !== null) {
|
||||
try {
|
||||
// $age = (int) preg_replace('/[^0-9]/', '', $patient_age);
|
||||
$age_num = (int) filter_var($patient_age, FILTER_SANITIZE_NUMBER_INT);
|
||||
$now = now();
|
||||
switch (strtoupper(substr($patient_age, -1))) {
|
||||
case 'Y':
|
||||
$patient_birthdate = $now->subYears($age_num);
|
||||
break;
|
||||
case 'M':
|
||||
$patient_birthdate = $now->subMonths($age_num);
|
||||
break;
|
||||
case 'D':
|
||||
$patient_birthdate = $now->subDays($age_num);
|
||||
break;
|
||||
}
|
||||
$study['patient_birthdate'] = Carbon::parse($dob);
|
||||
} catch (Exception) {
|
||||
Log::error('Failed to parse patient_age: {age}', ['age' => $patient_age]);
|
||||
Log::error('Failed to parse PatientMainDicomTags.PatientBirthDate: {dob}', ['dob' => $dob]);
|
||||
}
|
||||
}
|
||||
|
||||
$study['patient_birthdate'] = $patient_birthdate;
|
||||
|
||||
// check for priority in patient name or description
|
||||
if (preg_match('/\b(urgent|stat)\b/i', implode(' ', [$descr, $patient_name]))) {
|
||||
$this->setValue($study, 'priority', Priority::Stat->value);
|
||||
@ -331,9 +283,7 @@ private function getStudyDicomTags(string $study_uuid): array
|
||||
}
|
||||
|
||||
// randomly sample few instances for tags collection
|
||||
$selectedInstances = count($instances) <= $this->maxInstances
|
||||
? $instances
|
||||
: array_intersect_key($instances, array_flip(array_rand($instances, $this->maxInstances)));
|
||||
$selectedInstances = count($instances) <= $this->maxInstances ? $instances : array_rand(array_flip($instances), $this->maxInstances);
|
||||
|
||||
$tags = collect();
|
||||
foreach ($selectedInstances as $instance) {
|
||||
|
@ -123,13 +123,11 @@ function me(User|int|null $user = null): User
|
||||
{
|
||||
if (is_int($user) && $user > 0) {
|
||||
return User::find($user);
|
||||
}
|
||||
|
||||
if ($user instanceof User) {
|
||||
} elseif ($user instanceof User) {
|
||||
return $user;
|
||||
} else {
|
||||
return auth()->user();
|
||||
}
|
||||
|
||||
return auth()->user();
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,10 +141,3 @@ function formatTitle(string $str): string
|
||||
->toString();
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('tokenizeString')) {
|
||||
function tokenizeString(string $str): array
|
||||
{
|
||||
return preg_split('/\W+/', trim($str), -1, PREG_SPLIT_NO_EMPTY);
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ public function up(): void
|
||||
{
|
||||
Schema::create('organizations', static function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('guid', 40)->unique()->index()->default(DB::raw("concat('ORG-', gen_random_uuid())"));
|
||||
$table->string('guid', 40)->unique()->index()->default(DB::raw("concat('INS-', gen_random_uuid())"));
|
||||
$table->string('name')->unique();
|
||||
$table->boolean('is_active')->default(false);
|
||||
$table->string('address')->nullable();
|
||||
|
@ -11,7 +11,7 @@ public function up(): void
|
||||
{
|
||||
Schema::create('departments', static function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('guid', 40)->unique()->index()->default(DB::raw("concat('DEP-', gen_random_uuid())"));
|
||||
$table->string('guid', 40)->unique()->index()->default(DB::raw("concat('FAC-', gen_random_uuid())"));
|
||||
$table->boolean('is_active')->default(false)->index();
|
||||
$table->foreignIdFor(Organization::class)->constrained()->cascadeOnDelete();
|
||||
$table->string('name');
|
||||
|
@ -32,23 +32,11 @@
|
||||
<h5 class="mb-0">Patient Information</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@include('staff.meta.partials._text', ['name' => 'patient_id', 'label' => 'Patient ID', 'value' => $study->patient_id])
|
||||
@include('staff.meta.partials._text', ['name' => 'patient_name', 'label' => 'Patient Name', 'value' => $study->patient_name])
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
@include('staff.meta.partials._text', ['name' => 'patient_id', 'label' => 'Patient ID', 'value' => $study->patient_id])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@include('staff.meta.partials._text', ['name' => 'accession_number', 'label' => 'Accession number', 'value' => $study->accession_number])
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
@include('staff.meta.partials._text', ['name' => 'patient_sex', 'label' => 'Sex', 'value' => $study->patient_sex])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@include('staff.meta.partials._date', ['name' => 'patient_birthdate', 'label' => 'Birth Date', 'value' => $study->patient_birthdate?->toDateString()])
|
||||
</div>
|
||||
</div>
|
||||
@include('staff.meta.partials._text', ['name' => 'patient_sex', 'label' => 'Sex', 'value' => $study->patient_sex])
|
||||
@include('staff.meta.partials._date', ['name' => 'patient_birthdate', 'label' => 'Birth Date', 'value' => $study->patient_birthdate?->toDateString()])
|
||||
@include('staff.meta.partials._text', ['name' => 'accession_number', 'label' => 'Accession number', 'value' => $study->accession_number])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -59,24 +47,10 @@
|
||||
<h5 class="mb-0">Study Information</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
@include('staff.meta.partials._text', ['name' => 'study_description', 'label' => 'Study Description', 'value' => $study->study_description])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@include('staff.meta.partials._text', ['name' => 'body_part_examined', 'label' => 'Body Part Examined', 'value' => $study->body_part_examined])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
@include('staff.meta.partials._text', ['name' => 'institution_name', 'label' => 'Institution', 'value' => $study->institution_name])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@include('staff.meta.partials._text', ['name' => 'referring_physician_name', 'label' => 'Referring Physician', 'value' => $study->referring_physician_name])
|
||||
</div>
|
||||
</div>
|
||||
@include('staff.meta.partials._text', ['name' => 'study_description', 'label' => 'Study Description', 'value' => $study->study_description])
|
||||
@include('staff.meta.partials._text', ['name' => 'body_part_examined', 'label' => 'Body Part Examined', 'value' => $study->body_part_examined])
|
||||
@include('staff.meta.partials._text', ['name' => 'institution_name', 'label' => 'Institution', 'value' => $study->institution_name])
|
||||
@include('staff.meta.partials._text', ['name' => 'referring_physician_name', 'label' => 'Referring Physician', 'value' => $study->referring_physician_name])
|
||||
|
||||
<label class="form-check-label">Priority</label>
|
||||
<div class="col my-2">
|
||||
|
Loading…
Reference in New Issue
Block a user