SCCVDSP ; ALB/TMP - SCHED VSTS CONVERT/ARCHIVE - TEMPLATE LISTS ; 25-NOV-97 ;;5.3;Scheduling;**211**;Aug 13, 1993 ; BLD(SCCVTYP) ; -- build list of template entries ; SCCVTYP = 'AST or 'CST' for type of template ; K ^TMP("SCCV."_SCCVTYP,$J),^TMP("SCCV."_SCCVTYP_".DX",$J) N SCCVFL,SCCVFIL,SCCVTMP,SCCV0,SCCV1,SCCVCT,SCCVDT,SCCVLDT,SCCVGAP,SCCVX N SCCV1ST,SCCVCAN S (SCCVCT,VALMCNT)=0,SCCVSCRN=1 S SCCVFIL=$S(SCCVTYP="CST":404.98,1:404.99) S SCCVCAN=+$P($G(^SD(404.91,1,"CNV")),U,9) ; ; -- find all templates S SCCVFL="^SD("_SCCVFIL_")" ; S SCCV1ST=1 S SCCVGAP=" " S SCCVDT=0,SCCVLDT=+$G(^SD(404.91,1,"CNV")) ; F S SCCVDT=$O(@SCCVFL@("C",SCCVDT)) Q:'SCCVDT D . S SCCVTMP=0 F S SCCVTMP=$O(@SCCVFL@("C",SCCVDT,SCCVTMP)) Q:'SCCVTMP S SCCV0=$G(@SCCVFL@(SCCVTMP,0)),SCCV1=$G(^(1)) D . . ; if cancelled and should be listed ... list last . . I $P(SCCV0,U,9) S:SCCVCAN SCCVX(SCCVDT,SCCVTMP)="" Q . . ; . . ; -- Check for gaps . . I 'SCCV1ST D ;Chk for date gaps between templates . . . S SCCVGAP=$S($$FMADD^XLFDT(SCCVLDT,1)=SCCVDT:" ",1:"*") . . . S SCCVLDT=$P(SCCV0,U,4) . . ; . . I SCCV1ST D ;Chk for gaps from selected start dt to 1st date . . . IF SCCVDT