chore: complete integration of flex-3.20 (alpine 3.20) into ci (#7538)
[openemr.git] / library / classes / rulesets / Cqm / library / CqmPopulation.php
blob3c0cbb471756db7e5384e204a78ef6180dfa76be
1 <?php
3 // Copyright (C) 2011 Ken Chapple <ken@mi-squared.com>
4 //
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.
9 //
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) {
32 if ($offset == "") {
33 $this->_patients[] = $value;
34 } else {
35 $this->_patients[$offset] = $value;
37 } else {
38 throw new Exception("Value must be an instance of CqmPatient");