BuildHierarch2 ; Parameters: Ref,Product Kill @Ref New tmpAr,iG,iS,lbExprHG,lbExprG,lbExprS,MetaG,MetaS New Version Set Version=1 Set tmpAr(1)=%this Set lbExprHG=$$bhiExprToList(..ChildExpr) Set KeyG="" For Set MetaG=..Groepen.GetNext(.KeyG) Quit:(KeyG="") Do . Set iG=$LF(lbExprHG,MetaG.Code) . Set tmpAr(1,iG)=MetaG . Set LBExprS=$$bhiExprToList(MetaG.ChildExpr) . Set KeyS="" . For Set MetaS=MetaG.SubGroepen.GetNext(.KeyS) Quit:(KeyS="") Do .. Set iS=$LF(LBExprS,MetaS.Code) .. Set tmpAr(1,iG,iS)=MetaS Merge @Ref=tmpAr Quit BuildHierarch ; Parameters: Ref,Product Quit Kill @Ref New tmpAr,iG,iS,iI,LBExprG,LBExprS,LBExprI,MetaG,MetaS,MetaI,tmpLU New Version Set Version=1 Set tmpAr(1)=$LB(..Code) Set LBExprG=$$bhiExprToList(..ChildExpr) For iG=1:1:$LL(LBExprG) Do . Set MetaG=..GroepenGetChildAt($LI(LBExprG,iG)_"||"_Version) . Quit:('MetaG) . Set tmpAr(1,iG)=$LB(MetaG.Code, $LI(LBExprG,iG)_"||"_Version) ; $LI(LBExprG,iG) . Set LBExprS=$$bhiExprToList(MetaG.ChildExpr) . For iS=1:1:$LL(LBExprS) Do .. Set MetaS=MetaG.SubGroepenGetChildAt($LI(LBExprS,iS)_"||"_Version) .. Quit:('MetaS) .. Set tmpAr(1,iG,iS)=$LB(MetaS.Code, $LI(LBExprS,iS)_"||"_Version) ; $LI(LBExprS,iS) .. Set LBExprI=$$bhiExprToList(MetaS.ChildExpr) .. For iI=1:1:$LL(LBExprI) Do:($$bhiItemExists($LI(LBExprI,iI),Version)) ... Set tmpAr(1,iG,iS,iI)=$LB($LI(LBExprI,iI), $LI(LBExprI,iI)_"||"_Version) Merge @Ref=tmpAr Quit bhiExprToList(sExpr) ; Analyse Expression New i,LB Set LB="" For i=1:1:$L(sExpr,"+") Set LB=LB_$LB($P(sExpr,"+",i)) Quit LB bhiItemExists(ItemCode,Version) If +$G(Product) Quit (Product.DataItemsGetChildAt(ItemCode)>0) Else Quit ##class(Prod.GAMeta.Item).%ExistsId(ItemCode_"||"_Version) Quit 0