Property | Type | Description | |
---|---|---|---|
$DOWNLOAD_EMPTY | |||
$DOWNLOAD_FAILED | |||
$UNEXPECTED_FILE_PROBLEM | |||
$UNKNOWN_ERROR | |||
$UNRECOGNISED_CODE | |||
$audit | type | Audit can be disabled (eg for the first import we probably don't want to generate 78000 'GP imported' audit rows). | |
$force | type | Force already imported files to process it again. | |
$path | |||
$tempPath | |||
$timeout | integer | ||
$url | type | Override the default URL, e.g. to process a specific monthly file. |
Method | Description | |
---|---|---|
__construct ( ) | ||
actionCheckRemovedFromFile ( type $type = 'gp' ) | Checking if a database row no longer exists in the file, and if it's the case, we set the status inactive. | |
actionDownload ( string $type, string $interval = 'full' ) | Allows to download a specified file based on the type and interval. | |
actionDownloadall ( ) | Downloads all the full files listed in $this->files['full'] , Gp, Practice, CCG, CCG Assignment can be useful on the first run. | |
actionImport ( string $type, string $interval = 'full' ) | imports a specific file based on the given type and interval eg.: ProcessHscicData import --type=Gp --interval=monthly. | |
actionImportall ( ) | Imports all the full files listed in $this->files['full'], Gp, Practice, CCG, CCG Assignment. | |
actionIndex ( ) | Displaying the help if no action or param passed. | |
getHelp ( ) | Help. | |
getName ( ) : string | Returns the command name/short description. |
Method | Description | |
---|---|---|
handleException ( Exception $e ) : mixed | Simple routine for consistently handling generated Exceptions. |
Method | Description | |
---|---|---|
createTempTable ( type $dbTable ) | Creating temporary table for CheckRemovedFromFile() method. | |
download ( type $url, type $file ) | Downloads the file(url) and puts to the provided path/filename. | |
fillTempTable ( string $type, type $file ) | Fill temp table for CheckRemovedFromFile() method. | |
getFileFromUrl ( string $url ) : string | Assamble the file path and name from the url. | |
getFilePointer ( string $file ) : resource | Opens the zip file and gets the CSV file pointer and returns it. | |
getLineCountFromZip ( string $file ) : integer | Gets the line count of the CSV file in the zip. | |
getTableNameByType ( string $type ) : string | Returns the database table name based on the give type. | |
importAddress ( Address $address, array $lines ) | Imports the Address. | |
importCcg ( array $data ) | Imports the 'Ccg' CSV file. | |
importCcgAssignment ( array $data ) | Imports the 'CcgAssignment' file. | |
importGp ( array $data ) | Imports the 'Gp' CSV file. | |
importPractice ( array $data ) | Imports the 'Practice' CSV file. | |
isNewResourceFile ( type $tempFile, type $permanentFile ) : boolean | Checks if the newly downloaded file is already processed or not by comparing to the previously downloaded one. | |
mapFileConfig ( $config ) : array | ||
markInactiveMissingModels ( type $type ) | Set status to inactive on models missing from the CSV file. | |
processCSV ( string $type, string $interval, array $fields, string $file ) | Gets the zip file, extracts the CSV file (from the zip) and processes it. | |
processFile ( string $type, string $interval, array $file ) | Processing the given file. | |
tempToPermanent ( type $tempFile, type $permanentFile ) | Checks if the destination folder exists (makes it if not) than copies the file. | |
tidy ( string $string ) : string | Transform the address line to uppercase all the words. |
public actionCheckRemovedFromFile ( type $type = 'gp' ) | ||
$type | type |
public actionDownload ( string $type, string $interval = 'full' ) | ||
$type | string | like 'Gp' |
$interval | string | like 'monthly' |
public actionDownloadall ( ) |
public actionImport ( string $type, string $interval = 'full' ) | ||
$type | string | gp|Practice|Ccg|CcgAssignment |
$interval | string | full|monthly|quarterly |
public actionImportall ( ) |
public actionIndex ( ) |
protected handleException ( Exception $e ) : mixed | ||
$e | Exception | |
return | mixed |
public type $audit | ||
return | type |
public type $force | ||
return | type |