Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. apiService.scope.$watchCollection(function()
  2.   {
  3.     //var val = apiService.model.findSuccessorWithPath(_vitals.PRESSURE).getValueNodeParentRef().length;
  4.     //Get values
  5.     var systolicValues = EhrFormHelpers.getMultiMagnitudeValuesOrZero(apiService, _vitals.PRESSURE_SYSTOLIC); //Vrne []
  6.     var diastolicValues = EhrFormHelpers.getMultiMagnitudeValuesOrZero(apiService, _vitals.PRESSURE_DIASTOLIC);
  7.  
  8.     if (systolicValues.length > 0 && diastolicValues.length > 0)
  9.     {
  10.       return [systolicValues, diastolicValues];
  11.     }
  12.     return [];
  13.   }, function(newValue, oldValue)
  14.   {
  15.     var equal = true;
  16.     //Check all fields
  17.     for (var i = 0; i < newValue[0].length; i++)
  18.     {
  19.       if (newValue[0][i] != oldValue[0][i])
  20.       {
  21.         equal = false;
  22.         break;
  23.       }
  24.       else if (newValue[1][i] != oldValue[1][i])
  25.       {
  26.         equal = false;
  27.         break;
  28.       }
  29.     }
  30.  
  31.     if (!equal)
  32.     {
  33.       _vitals.recalculatePreasureAll();
  34.     }
  35.  
  36.  
  37.   });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement