@@ -55,23 +55,7 @@ function getPriorityCategory(score) {
5555 return '' ;
5656}
5757
58- function calculateAge ( birthDate ) {
59- const today = new Date ( ) ;
60- const birth = new Date ( birthDate ) ;
61-
62- let age = today . getFullYear ( ) - birth . getFullYear ( ) ;
63- const monthDiff = today . getMonth ( ) - birth . getMonth ( ) ;
64-
65- if ( monthDiff < 0 || ( monthDiff === 0 && today . getDate ( ) < birth . getDate ( ) ) ) {
66- age -- ;
67- }
68-
69- return age ;
70- }
71-
72-
7358module . exports = [
74-
7559 //ANC Home Visit: 12, 20, 26, 30, 34, 36, 38, 40 weeks (Known LMP)
7660 {
7761 name : 'anc.pregnancy_home_visit.known_lmp' ,
@@ -119,10 +103,10 @@ module.exports = [
119103 } ,
120104 resolvedIf : checkTaskResolvedForHomeVisit ,
121105 priority : function ( contact , report ) {
106+ console . warn ( 'CONTACT' , contact ) ;
122107 console . warn ( 'REPORT' , report ) ;
123108 const taskTypeScore = 8 ;
124- const age = calculateAge ( contact . contact . date_of_birth ) ;
125- const individualScore = ( age > 35 || age < 2 ) ? 2 : 0 ;
109+ const individualScore = 2 ;
126110 const score = taskTypeScore + individualScore ;
127111 return {
128112 level : score ,
@@ -161,12 +145,11 @@ module.exports = [
161145
162146 } ,
163147 priority : function ( contact , report ) {
164- console . warn ( 'CONTACT MARY' , contact ) ;
165- console . warn ( 'REPORT MARY' , report ) ;
166- const score = 6 ;
148+ console . warn ( 'CONTACT' , contact ) ;
149+ console . warn ( 'REPORT' , report ) ;
167150 return {
168- level : 'high ' ,
169- label : getPriorityCategory ( score ) ,
151+ level : 'medium ' ,
152+ label : '' ,
170153 } ;
171154 } ,
172155 actions : [ {
0 commit comments