BEHURTNL ;MSC/IND/DKM - List routine version information ;04-May-2006 08:19;DKM
;;1.2;BEH UTILITIES;;Mar 20, 2007
;=================================================================
ALL ;EP - Show version info for selected routines
W !!,"Show version info for selected routines.",!!
D DOIT(-1)
Q
SINCE ;EP - Show version info for routines modified after a specified date
W !!,"Show version info for routines changed since a given date/time.",!!
D DOIT()
Q
DOIT(DAT) ;
N UCI,NUM,X,Y,Z
X ^%ZOSF("UCI")
S UCI=Y,NUM=$$BLDLST(.DAT)
Q:'NUM
D ^%ZIS
Q:POP
U IO
W !!,$$SNGPLR^CIAU(NUM,"routine"),$S(DAT>0:" changed since "_$$ENTRY^CIAUDT(DAT),1:"")," on [",UCI,"] ",$$ENTRY^CIAUDT,!!
S X=$C(1)
F S X=$O(^TMP("BEHURTNL",$J,X)) Q:'$L(X) D
.S Z=^TMP("BEHURTNL",$J,X)
.S $P(Z,U)=$$ENTRY^CIAUDT(+Z),$P(Z,U,4)=$TR($P(Z,U,4),"*")
.W !,X
.F Y=1,2,4,3 W ?($P("10^30^50^1",U,Y)-1)," ",$P(Z,U,Y)
K ^TMP("BEHURTNL",$J)
R:$E(IOST,1,2)="C-" !!,"Press ENTER to continue...",X:DTIME,!
D ^%ZISC
Q
BLDLST(DATE) ;EP - Build the list of routines
N RTN,LP,Y,Z,CNT
K ^TMP("BEHURTNL",$J)
I '$G(DATE) D Q:DATE'>0 0
.N %DT
.S %DT="AEPTS"
.D ^%DT
.S DATE=Y
W !!
S Y=$$GETCH^CIAU("Select by (B)UILD or (R)OUTINE: ","BR",,,,"R")
Q:"BR"'[Y 0
W !!
I Y'="B" D
.X ^%ZOSF("RSEL")
.M ^TMP("BEHURTNL",$J)=^UTILITY($J)
.K ^UTILITY($J)
E F LP=1:1 D Q:Y'>0
.N DIC
.S DIC=9.6,DIC(0)="AET",DIC("A")="Select Build #"_LP_": "
.D ^DIC
.S Y=+Y
.D:Y>0 BUILD(Y)
S CNT=0,RTN=$C(1)
F S RTN=$O(^TMP("BEHURTNL",$J,RTN)) Q:'$L(RTN) D
.S Y=$$TRIM^XLFSTR($TR($P($T(+1^@RTN),";",3),"[]"))
.S Z=$P(Y," "),Y=$TR($P(Y," ",2,99)," ")
.S Y=Z_$S($L(Y):"@"_Y,1:"")
.S Z=$$DT^CIAU(Y,"PTS")
.;S:Z'>0 Z=$$HTFM^XLFDT($G(^ROUTINE(RTN,0)))
.S:Z<0 Z=0
.I Z<DATE K ^TMP("BEHURTNL",$J,RTN)
.E S CNT=CNT+1,^TMP("BEHURTNL",$J,RTN)=Z_U_$TR($P($T(+2^@RTN),";;",2,999),";",U)
Q CNT
; Extract routine names from build
BUILD(BLD) ;
N X
S:BLD'=+BLD BLD=+$$FIND1^DIC(9.6,,"X",BLD)
Q:BLD'>0
M ^TMP("BEHURTNL",$J)=^XPD(9.6,BLD,"KRN",9.8,"NM","B")
S X=0
F S X=$O(^XPD(9.6,BLD,10,X)) Q:'X D BUILD($P($G(^(X,0)),U))
Q
BEHURTNL ;MSC/IND/DKM - List routine version information ;04-May-2006 08:19;DKM
+1 ;;1.2;BEH UTILITIES;;Mar 20, 2007
+2 ;=================================================================
ALL ;EP - Show version info for selected routines
+1 WRITE !!,"Show version info for selected routines.",!!
+2 DO DOIT(-1)
+3 QUIT
SINCE ;EP - Show version info for routines modified after a specified date
+1 WRITE !!,"Show version info for routines changed since a given date/time.",!!
+2 DO DOIT()
+3 QUIT
DOIT(DAT) ;
+1 NEW UCI,NUM,X,Y,Z
+2 XECUTE ^%ZOSF("UCI")
+3 SET UCI=Y
SET NUM=$$BLDLST(.DAT)
+4 IF 'NUM
QUIT
+5 DO ^%ZIS
+6 IF POP
QUIT
+7 USE IO
+8 WRITE !!,$$SNGPLR^CIAU(NUM,"routine"),$SELECT(DAT>0:" changed since "_$$ENTRY^CIAUDT(DAT),1:"")," on [",UCI,"] ",$$ENTRY^CIAUDT,!!
+9 SET X=$CHAR(1)
+10 FOR
SET X=$ORDER(^TMP("BEHURTNL",$JOB,X))
IF '$LENGTH(X)
QUIT
Begin DoDot:1
+11 SET Z=^TMP("BEHURTNL",$JOB,X)
+12 SET $PIECE(Z,U)=$$ENTRY^CIAUDT(+Z)
SET $PIECE(Z,U,4)=$TRANSLATE($PIECE(Z,U,4),"*")
+13 WRITE !,X
+14 FOR Y=1,2,4,3
WRITE ?($PIECE("10^30^50^1",U,Y)-1)," ",$PIECE(Z,U,Y)
End DoDot:1
+15 KILL ^TMP("BEHURTNL",$JOB)
+16 IF $EXTRACT(IOST,1,2)="C-"
READ !!,"Press ENTER to continue...",X:DTIME,!
+17 DO ^%ZISC
+18 QUIT
BLDLST(DATE) ;EP - Build the list of routines
+1 NEW RTN,LP,Y,Z,CNT
+2 KILL ^TMP("BEHURTNL",$JOB)
+3 IF '$GET(DATE)
Begin DoDot:1
+4 NEW %DT
+5 SET %DT="AEPTS"
+6 DO ^%DT
+7 SET DATE=Y
End DoDot:1
IF DATE'>0
QUIT 0
+8 WRITE !!
+9 SET Y=$$GETCH^CIAU("Select by (B)UILD or (R)OUTINE: ","BR",,,,"R")
+10 IF "BR"'[Y
QUIT 0
+11 WRITE !!
+12 IF Y'="B"
Begin DoDot:1
+13 XECUTE ^%ZOSF("RSEL")
+14 MERGE ^TMP("BEHURTNL",$JOB)=^UTILITY($JOB)
+15 KILL ^UTILITY($JOB)
End DoDot:1
+16 IF '$TEST
FOR LP=1:1
Begin DoDot:1
+17 NEW DIC
+18 SET DIC=9.6
SET DIC(0)="AET"
SET DIC("A")="Select Build #"_LP_": "
+19 DO ^DIC
+20 SET Y=+Y
+21 IF Y>0
DO BUILD(Y)
End DoDot:1
IF Y'>0
QUIT
+22 SET CNT=0
SET RTN=$CHAR(1)
+23 FOR
SET RTN=$ORDER(^TMP("BEHURTNL",$JOB,RTN))
IF '$LENGTH(RTN)
QUIT
Begin DoDot:1
+24 SET Y=$$TRIM^XLFSTR($TRANSLATE($PIECE($TEXT(+1^@RTN),";",3),"[]"))
+25 SET Z=$PIECE(Y," ")
SET Y=$TRANSLATE($PIECE(Y," ",2,99)," ")
+26 SET Y=Z_$SELECT($LENGTH(Y):"@"_Y,1:"")
+27 SET Z=$$DT^CIAU(Y,"PTS")
+28 ;S:Z'>0 Z=$$HTFM^XLFDT($G(^ROUTINE(RTN,0)))
+29 IF Z<0
SET Z=0
+30 IF Z<DATE
KILL ^TMP("BEHURTNL",$JOB,RTN)
+31 IF '$TEST
SET CNT=CNT+1
SET ^TMP("BEHURTNL",$JOB,RTN)=Z_U_$TRANSLATE($PIECE($TEXT(+2^@RTN),";;",2,999),";",U)
End DoDot:1
+32 QUIT CNT
+33 ; Extract routine names from build
BUILD(BLD) ;
+1 NEW X
+2 IF BLD'=+BLD
SET BLD=+$$FIND1^DIC(9.6,,"X",BLD)
+3 IF BLD'>0
QUIT
+4 MERGE ^TMP("BEHURTNL",$JOB)=^XPD(9.6,BLD,"KRN",9.8,"NM","B")
+5 SET X=0
+6 FOR
SET X=$ORDER(^XPD(9.6,BLD,10,X))
IF 'X
QUIT
DO BUILD($PIECE($GET(^(X,0)),U))
+7 QUIT