<title></title> <link rel="stylesheet" type="text/css" href="symptom_selector/selector.css?v=1"> <link rel="stylesheet" type="text/css" href="symptom_selector/fontawesome/assets/css/font-awesome.min.css" /> <script src="libs/jquery-1.12.2.min.js"></script> <script src="libs/json2.js"></script><!-- json for ie7 --> <script src="libs/jquery.imagemapster.min.js?v=1.1"></script> <script src="libs/typeahead.bundle.js"></script> <script src="symptom_selector/selector.js?v=3.3"></script> <?php // session_start(); // this causes some issues with certain servers, try this if it's working with this line or not. if (!isset($_SESSION['userToken']) || !isset($_SESSION['tokenExpireTime']) || time() >= $_SESSION['tokenExpireTime']) { require 'token_generator.php'; $tokenGenerator = new TokenGenerator("YOUR_USERNAME", "YOUR_PASSWORD", "https://sandbox-authservice.priaid.ch/login"); $token = $tokenGenerator->loadToken(); $_SESSION['userToken'] = $token->{'Token'}; $_SESSION['tokenExpireTime'] = time() + $token->{'ValidThrough'}; } $token = $_SESSION['userToken']; ?> <script type="text/javascript"> var userToken = <?php echo "'" . $token . "'"; ?> ; $(document).ready(function () { $("#symptomSelector").symptomSelector(
public function simulate() { if (!$this->checkRequiredParameters()) { return; } $tokenGenerator = new TokenGenerator($this->config['username'], $this->config['password'], $this->config['authServiceUrl']); $token = $tokenGenerator->loadToken(); if (!isset($token)) { exit; } $this->diagnosisClient = new DiagnosisClient($token, $this->config['healthServiceUrl'], 'en-gb'); print '<html><body>'; print '<h3>Body locations</h3>'; $bodyLocations = $this->diagnosisClient->loadBodyLocations(); if (!isset($bodyLocations)) { exit; } $this->printSimpleObject($bodyLocations); // get random body location $locRandomIndex = rand(0, count($bodyLocations) - 1); $locRandomId = $bodyLocations[$locRandomIndex]['ID']; $locRandomName = $bodyLocations[$locRandomIndex]['Name']; $bodySublocations = $this->diagnosisClient->loadBodySublocations($locRandomId); if (!isset($bodySublocations)) { exit; } print "<h3>Body Subocations for {$locRandomName}({$locRandomId})</h3>"; $this->printSimpleObject($bodySublocations); // get random body sublocation $sublocRandomIndex = rand(0, count($bodySublocations) - 1); $sublocRandomId = $bodySublocations[$sublocRandomIndex]['ID']; $sublocRandomName = $bodySublocations[$sublocRandomIndex]['Name']; $symptoms = $this->diagnosisClient->loadSublocationSymptoms($sublocRandomId, 'man'); print "<h3>Symptoms in body sublocation {$sublocRandomName}({$sublocRandomId})</h3>"; if (!isset($symptoms)) { exit; } if (count($symptoms) == 0) { die("No symptoms for selected body sublocation"); } $this->printSimpleObject($symptoms); // get diagnosis $randomSymptomIndex = rand(0, count($symptoms) - 1); $randomSymptomId = $symptoms[$randomSymptomIndex]['ID']; $randomSymptomName = $symptoms[$randomSymptomIndex]['Name']; $selectedSymptoms = array($randomSymptomId); $diagnosis = $this->diagnosisClient->loadDiagnosis($selectedSymptoms, 'male', 1988); if (!isset($diagnosis)) { exit; } print "<h3>Calculated diagnosis for {$randomSymptomName}({$randomSymptomId})</h3>"; $this->printDiagnosis($diagnosis); // get specialisations $specialisations = $this->diagnosisClient->loadSpecialisations($selectedSymptoms, 'male', 1988); if (!isset($specialisations)) { exit; } print "<h3>Calculated specialisations for {$randomSymptomName}({$randomSymptomId})</h3>"; $this->printSpecialisations($specialisations); // get proposed symptoms $proposedSymptoms = $this->diagnosisClient->loadProposedSymptoms($selectedSymptoms, 'male', 1988); if (!isset($proposedSymptoms)) { exit; } print "<h3>Proposed symptoms for selected {$randomSymptomName}({$randomSymptomId})</h3>"; $this->printSimpleObject($proposedSymptoms); // get red flag text $redFlagText = $this->diagnosisClient->loadRedFlag($randomSymptomId); if (!isset($redFlagText)) { exit; } print "<h3>Red flag text for selected {$randomSymptomName}({$randomSymptomId})</h3>"; print $redFlagText; // get issue info reset($diagnosis); while (list($key, $val) = each($diagnosis)) { $this->loadIssueInfo($val['Issue']['ID']); } print '</body></html>'; }