/** * @param \ConsultBundle\Entity\UserInfo $userInfo * * @return \ConsultBundle\Entity\User|\ConsultBundle\Entity\UserInfo|null */ public function retrieveUserProfileNew(UserInfo $userInfo) { if (empty($userInfo) || empty($userInfo->getPractoAccountId())) { return null; } $accountId = $userInfo->getPractoAccountId(); $postData = array('service' => 'software', 'practo_account_id' => $accountId, 'signed' => 'service,practo_account_id,signed'); $postData = $this->signEndpointPostData($postData, $this->accountsSigningKey); $body = new PostBody(); $body->replaceFields($postData); $request = new Request('POST', $this->accountHost . "/_enquire_profile", [], $body); $client = new Client(); $res = $client->send($request); $userInfo = $this->populateUserFromAccounts($res->json(), $userInfo); return $userInfo; }
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; }