Services\ServiceManager::fhirIdToReference PHP Метод

fhirIdToReference() публичный Метод

Convert a FHIR resource type and ID to an internal service reference.
public fhirIdToReference ( string $fhir_type, string $fhir_id ) : InternalReference | null
$fhir_type string
$fhir_id string
Результат InternalReference | null Null if no mapping found
    public function fhirIdToReference($fhir_type, $fhir_id)
    {
        if (!preg_match('/^(?:(\\w+)-)?(\\d+)$/', $fhir_id, $m)) {
            return;
        }
        list(, $prefix, $id) = $m;
        foreach ($this->service_config as $service_name => $config) {
            if ($config['fhir_type'] == $fhir_type && $config['fhir_prefix'] == $prefix) {
                return new InternalReference($service_name, $id);
            }
        }
        return;
    }