Deploy Ladill Care / deploy (push) Successful in 1m26s
Add a template-driven assessment system with universal intake, clinical pathways, disease instruments (stroke MVP + extended, diabetes, and ten specialty packs), scoring, patient outcome trends, REST/API + FHIR export, and Enterprise org-level assessment analytics. Seed packs and design/licensing docs ship for deploy and pre-GA review.
41 lines
1.2 KiB
PHP
41 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Care;
|
|
|
|
use App\Models\Organization;
|
|
|
|
/**
|
|
* Product rollout flags stored under organization settings.rollout.*
|
|
* Distinct from PlanService entitlements (lab/pharmacy/billing plan features).
|
|
*/
|
|
class CareFeatures
|
|
{
|
|
public const ASSESSMENTS_ENGINE = 'assessments_engine';
|
|
|
|
public const PATHWAY_SUGGESTIONS = 'pathway_suggestions';
|
|
|
|
public const ASSESSMENT_REQUIRED_ON_COMPLETE = 'assessment_required_on_complete';
|
|
|
|
public function enabled(Organization $organization, string $flag): bool
|
|
{
|
|
$settings = $organization->settings ?? [];
|
|
$rollout = is_array($settings['rollout'] ?? null) ? $settings['rollout'] : [];
|
|
|
|
return (bool) ($rollout[$flag] ?? false);
|
|
}
|
|
|
|
/**
|
|
* @param array<string, mixed> $flags
|
|
*/
|
|
public function setFlags(Organization $organization, array $flags): Organization
|
|
{
|
|
$settings = $organization->settings ?? [];
|
|
$rollout = is_array($settings['rollout'] ?? null) ? $settings['rollout'] : [];
|
|
$settings['rollout'] = array_merge($rollout, $flags);
|
|
$organization->settings = $settings;
|
|
$organization->save();
|
|
|
|
return $organization->fresh();
|
|
}
|
|
}
|