<?php

namespace Modules\IdexxLab\Entities;

/**
 * The IDEXX VetLab in-clinic analyzer family covered by this module.
 *
 * In a real clinic these instruments connect to the IDEXX VetLab Station,
 * which consolidates results and can forward them to a practice/LIS over
 * ASTM E1394 / LIS2-A2 (or HL7) via the LabBridge Agent. Each instrument is
 * registered in LabCore's lab_devices with its `model` set to one of these
 * keys.
 *
 * (SNAP/imaging-only readers without quantitative result output are omitted.)
 */
class IdexxModelCatalog
{
    /** model key => [label, type] */
    public const MODELS = [
        'VetLabStation' => ['IDEXX VetLab Station',   'hub'],
        'CatalystOne'   => ['IDEXX Catalyst One',     'chemistry'],
        'CatalystDx'    => ['IDEXX Catalyst Dx',      'chemistry'],
        'ProCyteOne'    => ['IDEXX ProCyte One',      'hematology'],
        'ProCyteDx'     => ['IDEXX ProCyte Dx',       'hematology'],
        'LaserCyteDx'   => ['IDEXX LaserCyte Dx',     'hematology'],
        'SediVueDx'     => ['IDEXX SediVue Dx',       'urinalysis'],
        'CoagDx'        => ['IDEXX Coag Dx',          'coagulation'],
        'SNAPshotDx'    => ['IDEXX SNAPshot Dx',      'immunoassay'],
    ];

    /**
     * @return array<int,string> model labels
     */
    public static function labels(): array
    {
        return array_map(fn($m) => $m[0], self::MODELS);
    }

    public static function typeOf(string $modelKey): ?string
    {
        return self::MODELS[$modelKey][1] ?? null;
    }
}
