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);
}