2 // Copyright (C) 2011 Ken Chapple <ken@mi-squared.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 require_once("AmcPatient.php");
10 /* Defines a population of patients
13 class AmcPopulation
extends RsPopulation
16 * initialize the patient population
18 public function __construct(array $patientIdArray)
20 foreach ($patientIdArray as $patientId) {
21 $this->_patients
[]= new AmcPatient($patientId);
26 * ArrayAccess Interface
28 public function offsetSet($offset, $value)
30 if ($value instanceof AmcPatient
) {
32 $this->_patients
[] = $value;
34 $this->_patients
[$offset] = $value;
37 throw new Exception("Value must be an instance of AmcPatient");