PHP Class OEModule\PASAPI\resources\Patient

Inheritance: extends BaseResource
显示文件 Open project: openeyes/openeyes

Public Properties

Property Type Description
$isNewResource

Protected Properties

Property Type Description
$model_class
$resource_type

Public Methods

Method Description
save ( ) If this Patient resource points to an already existing Patient, then update otherwise create a new one.
saveModel ( Patient $patient ) : boolean | null Assign the Patient resource attributes to the given Patient model and save it.
shouldValidateRequired ( ) : boolean
validate ( ) : boolean As a primary resource (i.e. mapped to external resource) we need to ensure we have an id for tracking the resource in the system.

Private Methods

Method Description
deleteAddresses ( Contact $contact, $except_ids = [] )
mapAddresses ( Contact $contact ) Will create or update addresses for the given contact based on matching by postcode.
mapEthnicGroup ( Patient $patient ) Handle mapping the ethnic group resource to the patient model.
mapGender ( Patient $patient )
mapGp ( Patient $patient ) Handle mapping of the Gp resource code to the patient model.
mapNhsNumberStatus ( Patient $patient )
mapPractice ( Patient $patient ) Handle mapping of the resource PracticeCode to the Patient model.

Method Details

save() public method

If this Patient resource points to an already existing Patient, then update otherwise create a new one.
public save ( )

saveModel() public method

Assign the Patient resource attributes to the given Patient model and save it.
public saveModel ( Patient $patient ) : boolean | null
$patient Patient
return boolean | null

shouldValidateRequired() public method

public shouldValidateRequired ( ) : boolean
return boolean

validate() public method

As a primary resource (i.e. mapped to external resource) we need to ensure we have an id for tracking the resource in the system.
public validate ( ) : boolean
return boolean

Property Details

$isNewResource public_oe property

public $isNewResource

$model_class protected_oe static_oe property

protected static $model_class

$resource_type protected_oe static_oe property

protected static $resource_type