3 // Copyright (C) 2011 Ken Chapple <ken@mi-squared.com>
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 require_once("CqmPatient.php");
11 /* Defines a population of patients
14 class CqmPopulation
extends RsPopulation
17 * initialize the patient population
19 public function __construct(array $patientIdArray)
21 foreach ($patientIdArray as $patientId) {
22 $this->_patients
[] = new CqmPatient($patientId);
27 * ArrayAccess Interface
29 public function offsetSet($offset, $value): void
31 if ($value instanceof CqmPatient
) {
33 $this->_patients
[] = $value;
35 $this->_patients
[$offset] = $value;
38 throw new Exception("Value must be an instance of CqmPatient");