Test(KPRNr) do StartTimer^vhLib new result set result = 0 new idxFabKey,idxBSKey,Info set idxFabKey="" for { set idxFabKey=$order(^HADPR("F",idxFabKey)) quit:idxFabKey="" continue:'$data(^HADPR("F",idxFabKey,"F")) set idxBSKey="" set Found=0 for { set idxBSKey = $order(^HADPR("F",idxFabKey,"AR",idxBSKey)) quit:idxBSKey="" quit:Found set Info = ^HADPR("F",idxFabKey,"AR",idxBSKey) set Found = $p(Info,"\",1)=KPRNr if Found set result = result + $P(Info,"\",2) } } do StopTimer^vhLib write "Interval : ",$$GetInterval^vhLib(),! quit result