function rxStringBreaker($rxString) { $cleanRxString = cleanRxString($rxString); $splitRxString = splitRxString($cleanRxString); $rxChunks = explode(":", $splitRxString); //print_r($rxChunks); $returnRx = new RxObject(); if (count($rxChunks) > 0) { $returnRx->sph = removeLetters($rxChunks[0]); } else { $returnRx->sph = 0; } if (count($rxChunks) > 1) { $returnRx->cyl = removeLetters($rxChunks[1]); } else { $returnRx->cyl = 0; } if (count($rxChunks) > 2) { $returnRx->axis = removeLetters($rxChunks[2]); } else { $returnRx->axis = 0; } $checkSph = checkSphereRange($returnRx->sph); $checkCyl = checkSphereRange($returnRx->cyl); $checkAxis = checkAxisRange($returnRx->axis); if (!$checkSph || !$checkCyl || !$checkAxis) { return null; } return $returnRx; }
public function isValidK() { //make sure each of these things is true if (!$this->num1 || !$this->num2) { return 0; } $n1OK = $this->num1->isValidK(); $n2OK = $this->num2->isValidK(); $m1OK = checkAxisRange($this->meridian1); $m2OK = checkAxisRange($this->meridian2); return $n1OK && $n2OK && $m1OK && $m2OK ? 1 : 0; }
public function isValidRx() { //make sure each of these things is true $valid = checkSphereRange($this->sph); $valid += checkCylinderRange($this->cyl); $valid += checkAxisRange($this->axis); if ($valid < 3) { return 0; } return 1; }