PHP code example of kyleweishaupt / php-icd10

1. Go to this page and download the library: Download kyleweishaupt/php-icd10 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kyleweishaupt / php-icd10 example snippets


use ICD10Parser\ICD10Parser;

// From ordered .txt file
$filePath = __DIR __ . "/data/icd10cm_order_2023.txt";
$orderedCodes = ICD10Parser::fromFile($filePath)->toArray();

// Get the first code in the file
$firstCode = $orderedCodes[0];
var_dump($firstCode);

// object(ICD10Parser\ICD10CodeOrdered) {
//   ["order"]=> int(1)
//   ["code"] =>string(3) "A00"
//   ["valid"] => bool(false)
//   ["shortDescription"] => string(7) "Cholera"
//   ["longDescription"] => string(7) "Cholera"
// }

// Get code with decimal as string
$code = $firstCode->codeFormatted(); // A001 -> A00.1

// Or get from string contents (in case file loaded or ephemeral, etc.)
$orderedCodes = ICD10Parser::fromString($stringContents)->toArray();


composer