-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsummary.js
More file actions
39 lines (36 loc) · 1.15 KB
/
Copy pathsummary.js
File metadata and controls
39 lines (36 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
addPatient.controller("summary", summaryController)
function summaryController($scope, unifiedDataModel) {
$scope.$root.isSummaryActive = false;
$scope.$on("personalDataSubmit", function() {
$scope.$apply(function() {
$scope.personalDetails = unifiedDataModel.personalDetails;
$scope.personalDetails.date = unifiedDataModel.personalDetails.date.toLocaleDateString();
if ($scope.personalDetails.dob !== undefined) {
$scope.personalDetails.dob = unifiedDataModel.personalDetails.dob.toLocaleDateString();
}
})
})
$scope.$on("diagnosisDataSubmit", function() {
$scope.$apply(function() {
$scope.diagnosisDetails = unifiedDataModel.diagnosisDetails;
})
})
}
summaryController.prototype.addDiagnosis = function($scope) {
$scope.$apply(function() {
$scope.$root.isSummaryActive = false;
$scope.$root.isDDActive = true;
})
}
addPatient.directive("adddiagnosis", function(unifiedDataModel) {
return {
link: function(scope, elem, attrs) {
elem.bind("click", function() {
scope.$apply(function() {
scope.$root.isSummaryActive = false;
scope.$root.isDDActive = true;
})
});
}
}
});