Highway to PSR2
[openemr.git] / library / classes / rulesets / Amc / library / AmcPopulation.php
blobdcb6fb69de37ef07d698847d8a5eb44721b6f43a
1 <?php
2 // Copyright (C) 2011 Ken Chapple <ken@mi-squared.com>
3 //
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.
8 //
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) {
31 if ($offset == "") {
32 $this->_patients[] = $value;
33 } else {
34 $this->_patients[$offset] = $value;
36 } else {
37 throw new Exception("Value must be an instance of AmcPatient");