public function getCode($codes, $type)
    {
        foreach ($codes as $code) {
            if ($code->type === $type) {
                return $code->type === 'external_code' ? substr($code->value, 3) : $code->value;
            }
        }

        return;
    }