Index: PRBS.mac.rou =================================================================== diff -u -r2614 -r57579 --- PRBS.mac.rou (.../PRBS.mac.rou) (revision 2614) +++ PRBS.mac.rou (.../PRBS.mac.rou) (revision 57579) @@ -18,9 +18,43 @@ New Index Set Index="" For Set Index=$O(^PRBS("BS",Moeder,Index)) Quit:Index="" Quit:KindGevonden Do . Set Rec=^PRBS("BS",Moeder,Index) - . If $P(Rec,D,1)=Kind Set KindGevonden=1 If $P(Rec,D,3)="K" Set Result=$P(Rec,D,2) + . If $P(Rec,"\",1)=Kind Set KindGevonden=1 If $P(Rec,"\",3)="K" Set Result=$P(Rec,"\",2) Quit Result +GetMoederKindFactorRecursief(MPRNr,EndKPRNr) ;probleem met Moeder -> Kind -> SingleKind oplossen + New KindFactor,Rec,BSKey,KPRNr + Set KindFactor = 0 + Set BSKey=$O(^PRBS("BS",MPRNr,"")) + While BSKey'="" + { + Set Rec=^PRBS("BS",MPRNr,BSKey) + Set KPRNr=$P(Rec,"\",1) + If KPRNr=EndKPRNr + { + Set:$P(Rec,"\",3)="K" KindFactor=KindFactor+$P(Rec,"\",2) + } + ElseIf KPRNr,$D(^PRBS("IP",EndKPRNr,KPRNr)) + { + Set KindFactor=KindFactor+($P(Rec,"\",2)*$$GetMoederKindFactorRecursief(KPRNr,EndKPRNr)) + } + Set BSKey=$O(^PRBS("BS",MPRNr,BSKey)) + } + Quit $S(KindFactor:KindFactor,1:1) + +AantalKinderen(MPRNr) + New BSKey,AantalKinderen,KPRNr,Rec + Set AantalKinderen = 0 + Set BSKey=$O(^PRBS("BS",MPRNr,"")) + While BSKey'="" + { + Set Rec=^PRBS("BS",MPRNr,BSKey) + Set:($P(Rec,"\",3)="K")&&($P(Rec,"\")) AantalKinderen=AantalKinderen+1 + + Set BSKey=$O(^PRBS("BS",MPRNr,BSKey)) + + } + Quit AantalKinderen + VERWERK(MPRNr,Raadpl,FabKey) New %SC,zb,sMod,NoMod,BSDefCod,BSSelect,Input,List,Result,DataNoSa,CalcNoSa New:'$G(RPLPR) Input