Add full Vaccination, Pathology, and Infusion specialty clinical suites.
Deploy Ladill Care / deploy (push) Successful in 34s
Deploy Ladill Care / deploy (push) Successful in 34s
Mirror Oncology-depth stage flows, workspace controllers, clinical forms, reports/print, demo seed, and suite tests. Pathology stays clinic specialty complementary to the Lab app. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -165,6 +165,9 @@ class SpecialtyModuleController extends Controller
|
||||
'oncology' => 'history',
|
||||
'renal' => 'history',
|
||||
'surgery' => 'history',
|
||||
'vaccination' => 'eligibility',
|
||||
'pathology' => 'request',
|
||||
'infusion' => 'assessment',
|
||||
default => (collect(array_keys($shellTabs))
|
||||
->first(fn (string $tab) => $clinical->recordTypeForTab($module, $tab) !== null)
|
||||
?? 'clinical_notes'),
|
||||
@@ -248,6 +251,9 @@ class SpecialtyModuleController extends Controller
|
||||
'oncology' => 'history',
|
||||
'renal' => 'history',
|
||||
'surgery' => 'history',
|
||||
'vaccination' => 'eligibility',
|
||||
'pathology' => 'request',
|
||||
'infusion' => 'assessment',
|
||||
default => (collect(array_keys($shellTabs))
|
||||
->first(fn (string $tab) => $clinical->recordTypeForTab($module, $tab) !== null)
|
||||
?? 'clinical_notes'),
|
||||
@@ -915,6 +921,104 @@ class SpecialtyModuleController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ($module === 'vaccination' && in_array($recordType, ['vax_eligibility', 'vax_consent', 'vax_admin'], true)) {
|
||||
$workflow = app(\App\Services\Care\Vaccination\VaccinationWorkflowService::class);
|
||||
$stageService = app(\App\Services\Care\SpecialtyVisitStageService::class);
|
||||
$suggested = match ($recordType) {
|
||||
'vax_eligibility' => $workflow->stageFromEligibility($record->payload ?? []),
|
||||
'vax_consent' => $workflow->stageFromConsent($record->payload ?? []),
|
||||
'vax_admin' => $workflow->stageFromAdmin($record->payload ?? []),
|
||||
default => null,
|
||||
};
|
||||
$current = $visit->specialty_stage;
|
||||
$early = ['check_in', 'waiting', null, ''];
|
||||
$order = [
|
||||
'check_in' => 0,
|
||||
'eligibility' => 1,
|
||||
'consent' => 2,
|
||||
'administer' => 3,
|
||||
'observation' => 4,
|
||||
'completed' => 5,
|
||||
];
|
||||
if ($suggested && (! $current || in_array($current, $early, true))) {
|
||||
try {
|
||||
$stageService->setStage($organization, $visit, 'vaccination', $suggested, $this->ownerRef($request), $this->ownerRef($request));
|
||||
} catch (\InvalidArgumentException) {
|
||||
}
|
||||
} elseif ($suggested && $suggested !== $current && ($order[$suggested] ?? 0) > ($order[$current] ?? 0)) {
|
||||
try {
|
||||
$stageService->setStage($organization, $visit, 'vaccination', $suggested, $this->ownerRef($request), $this->ownerRef($request));
|
||||
} catch (\InvalidArgumentException) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($module === 'pathology' && in_array($recordType, ['path_request', 'path_specimen', 'path_processing', 'path_report'], true)) {
|
||||
$workflow = app(\App\Services\Care\Pathology\PathologyWorkflowService::class);
|
||||
$stageService = app(\App\Services\Care\SpecialtyVisitStageService::class);
|
||||
$suggested = match ($recordType) {
|
||||
'path_request' => $workflow->stageFromRequest($record->payload ?? []),
|
||||
'path_specimen' => $workflow->stageFromSpecimen($record->payload ?? []),
|
||||
'path_processing' => $workflow->stageFromProcessing($record->payload ?? []),
|
||||
'path_report' => $workflow->stageFromReport($record->payload ?? []),
|
||||
default => null,
|
||||
};
|
||||
$current = $visit->specialty_stage;
|
||||
$early = ['check_in', 'waiting', null, ''];
|
||||
$order = [
|
||||
'check_in' => 0,
|
||||
'request' => 1,
|
||||
'specimen' => 2,
|
||||
'processing' => 3,
|
||||
'report' => 4,
|
||||
'verified' => 5,
|
||||
'completed' => 6,
|
||||
];
|
||||
if ($suggested && (! $current || in_array($current, $early, true))) {
|
||||
try {
|
||||
$stageService->setStage($organization, $visit, 'pathology', $suggested, $this->ownerRef($request), $this->ownerRef($request));
|
||||
} catch (\InvalidArgumentException) {
|
||||
}
|
||||
} elseif ($suggested && $suggested !== $current && ($order[$suggested] ?? 0) > ($order[$current] ?? 0)) {
|
||||
try {
|
||||
$stageService->setStage($organization, $visit, 'pathology', $suggested, $this->ownerRef($request), $this->ownerRef($request));
|
||||
} catch (\InvalidArgumentException) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($module === 'infusion' && in_array($recordType, ['infusion_assessment', 'infusion_protocol', 'infusion_session'], true)) {
|
||||
$workflow = app(\App\Services\Care\Infusion\InfusionWorkflowService::class);
|
||||
$stageService = app(\App\Services\Care\SpecialtyVisitStageService::class);
|
||||
$suggested = match ($recordType) {
|
||||
'infusion_assessment' => $workflow->stageFromAssessment($record->payload ?? []),
|
||||
'infusion_protocol' => $workflow->stageFromProtocol($record->payload ?? []),
|
||||
'infusion_session' => $workflow->stageFromSession($record->payload ?? []),
|
||||
default => null,
|
||||
};
|
||||
$current = $visit->specialty_stage;
|
||||
$early = ['check_in', 'waiting', null, ''];
|
||||
$order = [
|
||||
'check_in' => 0,
|
||||
'assessment' => 1,
|
||||
'protocol' => 2,
|
||||
'session' => 3,
|
||||
'monitoring' => 4,
|
||||
'completed' => 5,
|
||||
];
|
||||
if ($suggested && (! $current || in_array($current, $early, true))) {
|
||||
try {
|
||||
$stageService->setStage($organization, $visit, 'infusion', $suggested, $this->ownerRef($request), $this->ownerRef($request));
|
||||
} catch (\InvalidArgumentException) {
|
||||
}
|
||||
} elseif ($suggested && $suggested !== $current && ($order[$suggested] ?? 0) > ($order[$current] ?? 0)) {
|
||||
try {
|
||||
$stageService->setStage($organization, $visit, 'infusion', $suggested, $this->ownerRef($request), $this->ownerRef($request));
|
||||
} catch (\InvalidArgumentException) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->route('care.specialty.workspace', [
|
||||
'module' => $module,
|
||||
@@ -1392,6 +1496,25 @@ class SpecialtyModuleController extends Controller
|
||||
$surgeryPostop = null;
|
||||
$surgeryStageCodes = [];
|
||||
$surgeryStageFlow = [];
|
||||
$vaccinationEligibility = null;
|
||||
$vaccinationConsent = null;
|
||||
$vaccinationAdmin = null;
|
||||
$vaccinationObservation = null;
|
||||
$vaccinationStageCodes = [];
|
||||
$vaccinationStageFlow = [];
|
||||
$pathologyRequest = null;
|
||||
$pathologySpecimen = null;
|
||||
$pathologyProcessing = null;
|
||||
$pathologyReport = null;
|
||||
$pathologyVerification = null;
|
||||
$pathologyStageCodes = [];
|
||||
$pathologyStageFlow = [];
|
||||
$infusionAssessment = null;
|
||||
$infusionProtocol = null;
|
||||
$infusionSession = null;
|
||||
$infusionMonitoring = null;
|
||||
$infusionStageCodes = [];
|
||||
$infusionStageFlow = [];
|
||||
$activeTab = (string) $request->query('tab', array_key_first($shell->workspaceTabs($module)) ?: 'overview');
|
||||
$clinical = app(SpecialtyClinicalRecordService::class);
|
||||
|
||||
@@ -1616,6 +1739,34 @@ class SpecialtyModuleController extends Controller
|
||||
$surgeryStageFlow = app(\App\Services\Care\Surgery\SurgeryWorkflowService::class)->stageFlow();
|
||||
}
|
||||
|
||||
if ($module === 'vaccination') {
|
||||
$vaccinationEligibility = $clinical->findForVisit($workspaceVisit, 'vaccination', 'vax_eligibility');
|
||||
$vaccinationConsent = $clinical->findForVisit($workspaceVisit, 'vaccination', 'vax_consent');
|
||||
$vaccinationAdmin = $clinical->findForVisit($workspaceVisit, 'vaccination', 'vax_admin');
|
||||
$vaccinationObservation = $clinical->findForVisit($workspaceVisit, 'vaccination', 'vax_observation');
|
||||
$vaccinationStageCodes = collect($shell->stages('vaccination'))->pluck('code')->all();
|
||||
$vaccinationStageFlow = app(\App\Services\Care\Vaccination\VaccinationWorkflowService::class)->stageFlow();
|
||||
}
|
||||
|
||||
if ($module === 'pathology') {
|
||||
$pathologyRequest = $clinical->findForVisit($workspaceVisit, 'pathology', 'path_request');
|
||||
$pathologySpecimen = $clinical->findForVisit($workspaceVisit, 'pathology', 'path_specimen');
|
||||
$pathologyProcessing = $clinical->findForVisit($workspaceVisit, 'pathology', 'path_processing');
|
||||
$pathologyReport = $clinical->findForVisit($workspaceVisit, 'pathology', 'path_report');
|
||||
$pathologyVerification = $clinical->findForVisit($workspaceVisit, 'pathology', 'path_verification');
|
||||
$pathologyStageCodes = collect($shell->stages('pathology'))->pluck('code')->all();
|
||||
$pathologyStageFlow = app(\App\Services\Care\Pathology\PathologyWorkflowService::class)->stageFlow();
|
||||
}
|
||||
|
||||
if ($module === 'infusion') {
|
||||
$infusionAssessment = $clinical->findForVisit($workspaceVisit, 'infusion', 'infusion_assessment');
|
||||
$infusionProtocol = $clinical->findForVisit($workspaceVisit, 'infusion', 'infusion_protocol');
|
||||
$infusionSession = $clinical->findForVisit($workspaceVisit, 'infusion', 'infusion_session');
|
||||
$infusionMonitoring = $clinical->findForVisit($workspaceVisit, 'infusion', 'infusion_monitoring');
|
||||
$infusionStageCodes = collect($shell->stages('infusion'))->pluck('code')->all();
|
||||
$infusionStageFlow = app(\App\Services\Care\Infusion\InfusionWorkflowService::class)->stageFlow();
|
||||
}
|
||||
|
||||
if ($patientHeader !== null) {
|
||||
$patientHeader['clinical_alerts'] = $clinicalAlerts;
|
||||
}
|
||||
@@ -1785,6 +1936,25 @@ class SpecialtyModuleController extends Controller
|
||||
'surgeryPostop' => $surgeryPostop,
|
||||
'surgeryStageCodes' => $surgeryStageCodes,
|
||||
'surgeryStageFlow' => $surgeryStageFlow,
|
||||
'vaccinationEligibility' => $vaccinationEligibility,
|
||||
'vaccinationConsent' => $vaccinationConsent,
|
||||
'vaccinationAdmin' => $vaccinationAdmin,
|
||||
'vaccinationObservation' => $vaccinationObservation,
|
||||
'vaccinationStageCodes' => $vaccinationStageCodes,
|
||||
'vaccinationStageFlow' => $vaccinationStageFlow,
|
||||
'pathologyRequest' => $pathologyRequest,
|
||||
'pathologySpecimen' => $pathologySpecimen,
|
||||
'pathologyProcessing' => $pathologyProcessing,
|
||||
'pathologyReport' => $pathologyReport,
|
||||
'pathologyVerification' => $pathologyVerification,
|
||||
'pathologyStageCodes' => $pathologyStageCodes,
|
||||
'pathologyStageFlow' => $pathologyStageFlow,
|
||||
'infusionAssessment' => $infusionAssessment,
|
||||
'infusionProtocol' => $infusionProtocol,
|
||||
'infusionSession' => $infusionSession,
|
||||
'infusionMonitoring' => $infusionMonitoring,
|
||||
'infusionStageCodes' => $infusionStageCodes,
|
||||
'infusionStageFlow' => $infusionStageFlow,
|
||||
'queueStubs' => $modules->queueStubsFor($organization, $module),
|
||||
'branchId' => $branchId,
|
||||
'branchLabel' => $branchLabel,
|
||||
|
||||
Reference in New Issue
Block a user