AnonymiseVFCommand::getHosNum PHP Method

getHosNum() private method

private getHosNum ( type $file, type $field ) : type
$file type
$field type
return type
    private function getHosNum($file, $field)
    {
        $matches = array();
        preg_match('/__OE_PATIENT_ID_([0-9]*)__/', $field, $matches);
        if (count($matches) < 2) {
            echo 'Failed to extract patient ID in ' . basename($file) . '; moving to ' . $this->errorDir . PHP_EOL;
            $this->move($this->errorDir, $file);
            continue;
        }
        return str_pad($matches[1], 7, '0', STR_PAD_LEFT);
    }