protected function populatePatientInfo(UserInfo $userInfo, $practoAccountId = null) { $patientInfo = new DetailPatientInfoResponse(); $patientInfo->setAllergies($userInfo->getAllergies()); $patientInfo->setMedications($userInfo->getMedications()); $patientInfo->setPrevDiagnosedConditions($userInfo->getPrevDiagnosedConditions()); $patientInfo->setHeightInCms($userInfo->getHeightInCms()); $patientInfo->setWeightInKgs($userInfo->getWeightInKgs()); $patientInfo->setBloodGroup($userInfo->getBloodGroup()); $patientInfo->setAge($userInfo->getAge()); $patientInfo->setGender($userInfo->getGender()); $patientInfo->setOccupation($userInfo->getOccupation()); $patientInfo->setLocation($userInfo->getLocation()); $patientInfo->setAllergyStatus($userInfo->getAllergyStatus()); $patientInfo->setPrevDiagnosedConditionsStatus($userInfo->getDiagnosedConditionStatus()); $patientInfo->setMedicationStatus($userInfo->getMedicationStatus()); $this->setPatientInfo($patientInfo); }
/** * @param integer $practoAccountId * @return boolean */ public function setConsultEnabled($practoAccountId) { $userEntry = $this->helper->getRepository(ConsultConstants::USER_ENTITY_NAME)->findBy(array('practoAccountId' => $practoAccountId, 'isRelative' => 0), array('createdAt' => 'ASC')); if (empty($userEntry)) { $userEntry = new UserInfo(); $userEntry->setPractoAccountId($practoAccountId); } else { $userEntry = $userEntry[0]; } $userEntry->setIsEnabled(true); $this->helper->persist($userEntry, true); $userEntry = $this->helper->getRepository(ConsultConstants::USER_ENTITY_NAME)->findBy(array('practoAccountId' => $practoAccountId, 'isRelative' => 0), array('createdAt' => 'ASC')); if (empty($userEntry)) { @($error['error'] = 'No entry was made'); throw new ValidationError($error); } return $userEntry[0]->getIsEnabled(); }
/** * @param UserInfo $userInfo * @return DetailPatientInfoResponse $patientInfo */ private function populatePatientInfo(UserInfo $userInfo) { $patientInfo = new DetailPatientInfoResponse(); $patientInfo->setId($userInfo->getId()); $patientInfo->setAllergies($userInfo->getAllergies()); $patientInfo->setMedications($userInfo->getMedications()); $patientInfo->setPrevDiagnosedConditions($userInfo->getPrevDiagnosedConditions()); $patientInfo->setHeightInCms($userInfo->getHeightInCms()); $patientInfo->setWeightInKgs($userInfo->getWeightInKgs()); $patientInfo->setBloodGroup($userInfo->getBloodGroup()); $patientInfo->setAge($userInfo->getAge()); $patientInfo->setGender($userInfo->getGender()); $patientInfo->setOccupation($userInfo->getOccupation()); $patientInfo->setLocation($userInfo->getLocation()); $patientInfo->setName($userInfo->getName()); $patientInfo->setAllergyStatus($userInfo->getAllergyStatus()); $patientInfo->setPrevDiagnosedConditionsStatus($userInfo->getDiagnosedConditionStatus()); $patientInfo->setMedicationStatus($userInfo->getMedicationStatus()); $patientInfo->setProfilePicture($userInfo->getProfilePicture()); return $patientInfo; }
protected function populatePatientInfo(UserInfo $userInfo, $practoAccountId = null) { $patientInfo = new BasicPatientInfoResponse(); $patientInfo->setAge($userInfo->getAge()); $patientInfo->setGender($userInfo->getGender()); $patientInfo->setLocation($userInfo->getLocation()); if ($userInfo->getPractoAccountId() == $practoAccountId) { $this->isOwner = true; $patientInfo->setId($userInfo->getId()); } $this->patientInfo = $patientInfo; }
/** * @param array $userProfile * @param \ConsultBundle\Entity\UserInfo $user * * @return \ConsultBundle\Entity\User|\ConsultBundle\Entity\UserInfo|null */ private function populateUserFromAccounts(array $userProfile, UserInfo $user) { if (is_null($userProfile)) { return null; } if (empty($user)) { $user = new UserInfo(); } if (array_key_exists('dob', $userProfile)) { $dob = new \DateTime($userProfile['dob']); $age = $dob->diff(new \DateTime())->y; $user->setAge($age); } if (array_key_exists('gender', $userProfile)) { $user->setGender($userProfile['gender']); } if (array_key_exists('height', $userProfile)) { $user->setHeightInCms($userProfile['height']); } if (array_key_exists('weight', $userProfile)) { $user->setWeightInKgs($userProfile['weight']); } if (array_key_exists('blood_group', $userProfile)) { $user->setBloodGroup($userProfile['blood_group']); } if (array_key_exists('name', $userProfile)) { $user->setName($userProfile['name']); } if (array_key_exists('profile_picture', $userProfile)) { $user->setName($userProfile['profilePicture']); } return $user; }