PHP 클래스 ProcessHscicDataCommand

(C) Moorfields Eye Hospital NHS Foundation Trust, 2008-2011 (C) OpenEyes Foundation, 2011-2012 This file is part of OpenEyes. OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see .
저자: OpenEyes ([email protected])
상속: extends CConsoleCommand
파일 보기 프로젝트 열기: openeyes/openeyes

공개 프로퍼티들

프로퍼티 타입 설명
$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.

공개 메소드들

메소드 설명
__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.

보호된 메소드들

메소드 설명
handleException ( Exception $e ) : mixed Simple routine for consistently handling generated Exceptions.

비공개 메소드들

메소드 설명
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.

메소드 상세

__construct() 공개 메소드

public __construct ( )

actionCheckRemovedFromFile() 공개 메소드

Checking if a database row no longer exists in the file, and if it's the case, we set the status inactive.
public actionCheckRemovedFromFile ( type $type = 'gp' )
$type type

actionDownload() 공개 메소드

Allows to download a specified file based on the type and interval.
public actionDownload ( string $type, string $interval = 'full' )
$type string like 'Gp'
$interval string like 'monthly'

actionDownloadall() 공개 메소드

Downloads all the full files listed in $this->files['full'] , Gp, Practice, CCG, CCG Assignment can be useful on the first run.
public actionDownloadall ( )

actionImport() 공개 메소드

imports a specific file based on the given type and interval eg.: ProcessHscicData import --type=Gp --interval=monthly.
public actionImport ( string $type, string $interval = 'full' )
$type string gp|Practice|Ccg|CcgAssignment
$interval string full|monthly|quarterly

actionImportall() 공개 메소드

Imports all the full files listed in $this->files['full'], Gp, Practice, CCG, CCG Assignment.
public actionImportall ( )

actionIndex() 공개 메소드

Displaying the help if no action or param passed.
public actionIndex ( )

getHelp() 공개 메소드

Help.
public getHelp ( )

getName() 공개 메소드

Returns the command name/short description.
public getName ( ) : string
리턴 string

handleException() 보호된 메소드

Simple routine for consistently handling generated Exceptions.
protected handleException ( Exception $e ) : mixed
$e Exception
리턴 mixed

프로퍼티 상세

$DOWNLOAD_EMPTY 공개적으로 정적으로 프로퍼티

public static $DOWNLOAD_EMPTY

$DOWNLOAD_FAILED 공개적으로 정적으로 프로퍼티

public static $DOWNLOAD_FAILED

$UNEXPECTED_FILE_PROBLEM 공개적으로 정적으로 프로퍼티

public static $UNEXPECTED_FILE_PROBLEM

$UNKNOWN_ERROR 공개적으로 정적으로 프로퍼티

public static $UNKNOWN_ERROR

$UNRECOGNISED_CODE 공개적으로 정적으로 프로퍼티

public static $UNRECOGNISED_CODE

$audit 공개적으로 프로퍼티

Audit can be disabled (eg for the first import we probably don't want to generate 78000 'GP imported' audit rows).
public type $audit
리턴 type

$force 공개적으로 프로퍼티

Force already imported files to process it again.
public type $force
리턴 type

$path 공개적으로 프로퍼티

public $path

$tempPath 공개적으로 프로퍼티

public $tempPath

$timeout 공개적으로 프로퍼티

public int $timeout
리턴 integer

$url 공개적으로 프로퍼티

Override the default URL, e.g. to process a specific monthly file.
public type $url
리턴 type