VistA-WorldVistAEHR/r/VA_FILEMAN-ARJT-DI-DD-DM-DT.../DIOZ.m

78 lines
3.3 KiB
Mathematica

DIOZ ;SFISC/TKW - COMPILED SORT TEMPLATE ;11/29/94 09:53
;;22.0;VA FileMan;;Mar 30, 1999
;Per VHA Directive 10-93-142, this routine should not be modified.
ENCU ;MARK A SORT TEMPLATE FOR ROUTINE COMPILATION
I $G(DUZ(0))'="@" W !,$C(7),$$EZBLD^DIALOG(101) Q
EN1 N DDH,DIC,DIR,DIROUT,DIRUT,DUOUT,DTOUT,X,Y,DIOZ
D OS^DII:'$D(DISYS) I $G(^DD("OS",DISYS,"ZS"))="" W $C(7),!,$$EZBLD^DIALOG(820) Q
D DIC Q:Y<0 S DIOZ=+Y
S DIR(0)="Y"
I $G(^DIBT(+Y,"ROU"))="" D Q
.D BLD^DIALOG(8029,$$EZBLD^DIALOG(8035),"","DIR(""A"")")
.S DIR("B")="YES" D BLD^DIALOG(9014,"","","DIR(""?"")"),^DIR Q:'Y
.S ^DIBT(DIOZ,"ROU")="^DISZ",^("ROUOLD")="DISZ"
.W !!,$C(7),DIR("?",2),!,DIR("?")
.Q
S X(1)=$$EZBLD^DIALOG(8035),X(2)="DISZ" D BLD^DIALOG(8028,.X,"","DIR(""A"")")
S DIR("B")="NO" D BLD^DIALOG(9019,"","","DIR(""?"")"),^DIR Q:'Y
K ^DIBT(DIOZ,"ROU")
W !!,$C(7),DIR("?",2),!,DIR("?")
Q
;
DIC S DIC="^DIBT(",DIC(0)="AEIQ",DIC("W")="W ?40,""FILE #"",$P(^(0),U,4) W:$D(^(""ROU"")) ?60,""Compiled"""
S DIC("S")="I '$P(^(0),U,8),Y'<1,$O(^DIBT(+Y,2,0))"
D ^DIC Q
;
ENC ;CREATE COMPILED SORT ROUTINE
D OS^DII:'$D(DISYS) I $G(^DD("OS",DISYS,"ZS"))="" D BLD^DIALOG(820) G QSV
I $O(^TMP("DIBTC",$J,""))="" D BLD^DIALOG(1501) G QSV
N %,%H,%I,DIROUT,DIRUT,DTOUT,DUOUT,DRN,I,J,K,X,Y,DIR
D NEW G:$D(DIERR) QSV
S K=2,I="" F S I=$O(^TMP("DIBTC",$J,I)) Q:I="" F J=0:0 S J=$O(^TMP("DIBTC",$J,I,J)) Q:'J S X=^(J) I X]"" S K=K+1,^UTILITY($J,0,K)=X
F I=1:1 S X=$P($T(TXT+I),";",3) Q:X="" S K=K+1,^UTILITY($J,0,K)=X
S X=$P(DIBTPGM,U,2) X ^DD("OS",DISYS,"ZS")
K ^TMP("DIBTC",$J)
Q
;
NEW I DIBTPGM'?1"^"1.7U1.4N D NXTNO(.DRN) Q:$D(DIERR) S DIBTPGM=DIBTPGM_$E("000",1,(4-$L(DRN)))_DRN
D NOW^%DTC,YX^%DTC
K ^UTILITY($J,0)
S ^UTILITY($J,0,1)=$P(DIBTPGM,U,2)_" ; GENERATED FROM '"_$P(^DIBT(DIBT1,0),U,1)_"' SORT TEMPLATE (#"_DIBT1_"), FILE:"_DP_", USER:"_$S($G(^VA(200,+DUZ,0))]"":$P(^(0),U),1:$P($G(^DIC(3,+DUZ,0)),U))_" ; "_Y
S ^UTILITY($J,0,2)=$T(DIOZ+1)
Q
;
NXTNO(DRN) ; GET NEXT AVAILABLE ROUTINE NUMBER
N DILOCK S DRN=0 D Q:DRN
N1 . S DILOCK=0,DRN=$O(^DI(.83,"C","n",DRN)) Q:'DRN D N3 G:DILOCK N1
N2 S DILOCK=0,DRN=$$NXTNO^DICLIB("^DI(.83,","","U") I DRN>9999 D BLD^DIALOG(1502) Q
D N3 G:DILOCK N2
Q
N3 L +^DI(.83,DRN,0):10 I '$T S DILOCK=1 Q
S ^DI(.83,DRN,0)=DRN_"^y",^DI(.83,"B",DRN,DRN)="",^DI(.83,"C","y",DRN)="" K ^DI(.83,"C","n",DRN) L -^DI(.83,DRN,0) Q
Q
;
ENRLS(DRN) ; MAKE ROUTINE NUMBER AVAILABLE FOR REUSE & DELETE ROUTINE
N DICLEAN,X S DRN=+$G(DRN),DICLEAN='DRN G:DRN R1
R S DRN=$O(^DI(.83,DRN)) Q:'DRN
R1 I $G(^DI(.83,DRN,0))]"" S $P(^(0),U,2)="n",^DI(.83,"C","n",DRN)="" K ^DI(.83,"C","y",DRN)
I $G(^%ZOSF("DEL"))]"" S X="DISZ"_$E("000",1,(4-$L(DRN)))_DRN X ^%ZOSF("DEL")
G:DICLEAN R
Q
;
QSV D:$G(DRN) ENRLS(DRN) K DIBTPGM
QER Q:$G(DIQUIET)
D MSG^DIALOG("W") S DIERR=1 Q
;
;DIALOG #101 'only those with programmer's access'
; #820 'no way to save routines on the system'
; #1501 'There is no code to save for this compiled...'
; #1502 'All available routine numbers...are in use...'
; #8028 '...currently compiled under namespace...'
; #8029 '...not currently compiled.'
; #8035 'Sort template'
; #9014 (help) 'if YES...Sort logic will be compiled...'
; #9019 (help) 'if YES...Sort logic...will NOT be compiled...'
;
TXT ;;
;;M X $S($D(DPQ):DX(DIXX),1:^UTILITY($J,99,DIXX))