Summary Table
| Categories |
Total Count |
| PII |
0 |
| URL |
0 |
| DNS |
0 |
| EKL |
0 |
| IP |
0 |
| PORT |
0 |
| VsID |
0 |
| CF |
0 |
| AI |
0 |
| VPD |
0 |
| PL |
0 |
| Other |
0 |
File Content
define(['angular', 'app'], function (angular, app) {
"use strict";
app.service('patient', function ($http, $q, mhpuser) {
var patient = {},
isReady;
patient.fetch = function () {
if (isReady) {
return isReady.promise;
}
isReady = $q.defer();
mhpuser.fetch().then(
function (mhpuser) {
$http.get(mhpuser['link']['patient']).success(function (response) {
var patientLinks = new Object();
response['link'].forEach(function (link) {
patientLinks[link['title']] = link['href'];
});
//fix self uri
patientLinks['self'] = patientLinks['undefined'];
delete patientLinks['undefined'];
response['link'] = patientLinks;
isReady.resolve(response);
}).error(function (error) {
isReady.reject(error);
isReady = null;
});
},
function (error) {
isReady.reject(error);
isReady = null;
}
);
return isReady.promise;
};
return patient;
});
});