DIEZ1 ;SFISC/GFT-COMPILE INPUT TEMPLATE ;9:27 AM 22 Oct 1999 [ 04/02/2003 8:25 AM ]
;;22.0;VA FileMan;**1001**;APR 1, 2003
;;22.0;VA FileMan;**4,11**;Mar 30, 1999
;Per VHA Directive 10-93-142, this routine should not be modified.
D QF^DIEZ2 S L=2,X="DE S DIE="_Q_",DIC=DIE,DP="_DP_",DL="_DL_",DIEL="_DIEZL_",DU="""" K DG,DE,DB Q:$O("_DIE_"DA,""""))=""""",DS=-1 D L S X=""
DL S DS=$O(^UTILITY($J,U,DS)) S:DS="" DS=-1 I DS<0 K ^UTILITY($J,U) G CN
S DSN=DS S:+DS'=DS DSN=""""_DSN_"""" S DPP=0,X=X_" I $D(^("_DSN_")) S %Z=^("_DSN_")"
DP S DPP=$O(^UTILITY($J,U,DS,DPP)) I DPP="" D L S X="" G DL
S %=$O(^(DPP,0)) I +DPP=DPP S Y="P(%Z,U,"_DPP_") S:%]"""" DE("_%_")=%"
E S Y="E(%Z,"_+$E(DPP,2,9)_","_+$P(DPP,",",2)_") S:%'?."" "" DE("_%_")=%"
F %=%:0 S %=$O(^(%)) Q:'% S Y=Y_",DE("_%_")=%"
I $L(X)+$L(Y)>240 D L S X=" I "
S X=X_" S %=$"_Y G DP
;
CN F X=" K %Z Q"," ;","W "_$S($D(^DIE(DIEZ,"W")):"S DQ(DQ)=DLB_U_DV_U_U_DW "_^("W"),1:"W !?DL+DL-2,DLB_"": """) D L
F %=1:1 S X=$E($T(TEXT+%),4,999) Q:X="" D L
SAVE I $L(DNM_DRN)>8 S DIEZQ=1 W:'$G(DIEZS) $C(7),!,DNM_DRN_$$EZBLD^DIALOG(1503) S:$G(DIEZRLA)]"" DIEZRLAF=0 Q
S X=DNM_DRN D:'$D(DISYS) OS^DII X ^DD("OS",DISYS,"ZS") N DIR D BLD^DIALOG(8025,DNM_DRN,"","DIR") W:'$G(DIEZS) !,DIR S:$G(DIEZRLA)]"" @DIEZRLA@(DNM_DRN)="",DIEZRLAF=1
S DRN(+DRN)=U,T=0,DRN=DQ Q
;
L S L=L+.001,^UTILITY($J,0,L)=X Q
;
;DIALOG #1503 'routine name is too long...'
; #8025 'routine filed'
;
TEXT ;;
;; Q
;;O D W W Y W:$X>45 !?9
;; I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
;; W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
;;TR R X:DTIME E S (DTOUT,X)=U W $C(7)
;; Q
;;A K DQ(DQ) S DQ=DQ+1
;;B G @DQ
;;RE G PR:$D(DE(DQ)) D W,TR
;;N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
;;RD G QS:X?."?" I X["^" D D G ^DIE17
;; I X="@" D D G Z^DIE2
;; I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
;;T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I W:'$D(DB(DQ)) " "_% G V
;; K DDER G X
;;P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
;; G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
;; I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
;;V D @("X"_DQ) K YS
;;Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
;;X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
;; S X="?BAD"
;;QS S DZ=X D D,QQ^DIEQ G B
;;D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
;;Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
;;PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
;;R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
;; I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
;; X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
;;RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
;;I I DV'["I",DV'["#" G RD
;; D E^DIE0 G RD:$D(X),PR
;; Q
;;SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
;; I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
;; D ^DIR I 'DDER S %=Y(0),X=Y
;; Q
;;SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
;; I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
;; E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
;; Q
;;NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
;;KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
DIEZ1 ;SFISC/GFT-COMPILE INPUT TEMPLATE ;9:27 AM 22 Oct 1999 [ 04/02/2003 8:25 AM ]
+1 ;;22.0;VA FileMan;**1001**;APR 1, 2003
+2 ;;22.0;VA FileMan;**4,11**;Mar 30, 1999
+3 ;Per VHA Directive 10-93-142, this routine should not be modified.
+4 DO QF^DIEZ2
SET L=2
SET X="DE S DIE="_Q_",DIC=DIE,DP="_DP_",DL="_DL_",DIEL="_DIEZL_",DU="""" K DG,DE,DB Q:$O("_DIE_"DA,""""))="""""
SET DS=-1
DO L
SET X=""
DL SET DS=$ORDER(^UTILITY($JOB,U,DS))
IF DS=""
SET DS=-1
IF DS<0
KILL ^UTILITY($JOB,U)
GOTO CN
+1 SET DSN=DS
IF +DS'=DS
SET DSN=""""_DSN_""""
SET DPP=0
SET X=X_" I $D(^("_DSN_")) S %Z=^("_DSN_")"
DP SET DPP=$ORDER(^UTILITY($JOB,U,DS,DPP))
IF DPP=""
DO L
SET X=""
GOTO DL
+1 SET %=$ORDER(^(DPP,0))
IF +DPP=DPP
SET Y="P(%Z,U,"_DPP_") S:%]"""" DE("_%_")=%"
+2 IF '$TEST
SET Y="E(%Z,"_+$EXTRACT(DPP,2,9)_","_+$PIECE(DPP,",",2)_") S:%'?."" "" DE("_%_")=%"
+3 FOR %=%:0
SET %=$ORDER(^(%))
IF '%
QUIT
SET Y=Y_",DE("_%_")=%"
+4 IF $LENGTH(X)+$LENGTH(Y)>240
DO L
SET X=" I "
+5 SET X=X_" S %=$"_Y
GOTO DP
+6 ;
CN FOR X=" K %Z Q"," ;","W "_$SELECT($DATA(^DIE(DIEZ,"W")):"S DQ(DQ)=DLB_U_DV_U_U_DW "_^("W"),1:"W !?DL+DL-2,DLB_"": """)
DO L
+1 FOR %=1:1
SET X=$EXTRACT($TEXT(TEXT+%),4,999)
IF X=""
QUIT
DO L
SAVE IF $LENGTH(DNM_DRN)>8
SET DIEZQ=1
IF '$GET(DIEZS)
WRITE $CHAR(7),!,DNM_DRN_$$EZBLD^DIALOG(1503)
IF $GET(DIEZRLA)]""
SET DIEZRLAF=0
QUIT
+1 SET X=DNM_DRN
IF '$DATA(DISYS)
DO OS^DII
XECUTE ^DD("OS",DISYS,"ZS")
NEW DIR
DO BLD^DIALOG(8025,DNM_DRN,"","DIR")
IF '$GET(DIEZS)
WRITE !,DIR
IF $GET(DIEZRLA)]""
SET @DIEZRLA@(DNM_DRN)=""
SET DIEZRLAF=1
+2 SET DRN(+DRN)=U
SET T=0
SET DRN=DQ
QUIT
+3 ;
L SET L=L+.001
SET ^UTILITY($JOB,0,L)=X
QUIT
+1 ;
+2 ;DIALOG #1503 'routine name is too long...'
+3 ; #8025 'routine filed'
+4 ;
TEXT ;;
+1 ;; Q
+2 ;;O D W W Y W:$X>45 !?9
+3 ;; I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
+4 ;; W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
+5 ;;TR R X:DTIME E S (DTOUT,X)=U W $C(7)
+6 ;; Q
+7 ;;A K DQ(DQ) S DQ=DQ+1
+8 ;;B G @DQ
+9 ;;RE G PR:$D(DE(DQ)) D W,TR
+10 ;;N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
+11 ;;RD G QS:X?."?" I X["^" D D G ^DIE17
+12 ;; I X="@" D D G Z^DIE2
+13 ;; I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
+14 ;;T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I W:'$D(DB(DQ)) " "_% G V
+15 ;; K DDER G X
+16 ;;P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
+17 ;; G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
+18 ;; I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
+19 ;;V D @("X"_DQ) K YS
+20 ;;Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
+21 ;;X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
+22 ;; S X="?BAD"
+23 ;;QS S DZ=X D D,QQ^DIEQ G B
+24 ;;D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
+25 ;;Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
+26 ;;PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
+27 ;;R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
+28 ;; I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
+29 ;; X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
+30 ;;RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
+31 ;;I I DV'["I",DV'["#" G RD
+32 ;; D E^DIE0 G RD:$D(X),PR
+33 ;; Q
+34 ;;SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
+35 ;; I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
+36 ;; D ^DIR I 'DDER S %=Y(0),X=Y
+37 ;; Q
+38 ;;SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
+39 ;; I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
+40 ;; E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
+41 ;; Q
+42 ;;NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
+43 ;;KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")