1 | DIA1 ;SFISC/GFT-PROCESS TEMPLATES, RANGES FOR INPUT ;20MAR2006
|
---|
2 | ;;22.0;VA FileMan;**159**;Mar 30, 1999;Build 8
|
---|
3 | ;Per VHA Directive 2004-038, this routine should not be modified.
|
---|
4 | S D NOW^%DTC S DIADT=+$J(%,0,4) K %,DW G Q:DRS<5 R !,"STORE THESE FIELDS IN TEMPLATE: ",X:DTIME S:'$T DTOUT=1 G Q:X="" S DIC(0)="LZSEQ",DLAYGO=0 D T K DLAYGO,DIC I Y<0 G S:X'[U K DR G Q
|
---|
5 | S X=$P(^(0),U,6) I DUZ(0)'["@",X]"" F %=1:1 I DUZ(0)[$E(X,%) Q:%'>$L(X) W !?7,$C(7),"YOU HAVE NO 'WRITE ACCESS' TO THIS TEMPLATE",! G S
|
---|
6 | S DW=$S('$D(^("ROU")):1,^("ROU")'[U:1,$D(^("ROUOLD")):^("ROUOLD"),1:1),%=0,X=$P(Y,U,2)
|
---|
7 | I $O(^(0))]"" W $C(7),!,X_" TEMPLATE ALREADY EXISTS.... OK TO REPLACE" D YN^DICN W ! G S:%-1 L +^DIE(+Y) S %Y="" F %X=0:0 S %Y=$O(^DIE(+Y,%Y)) Q:%Y="" K:",%D,ROUOLD,W,"'[(","_%Y_",") ^(%Y)
|
---|
8 | S ^DIE(+Y,0)=X_U_DIADT_U_$S('%:DUZ(0),1:$P(Y(0),U,3))_U_DI_U_DUZ_U_$S('%:DUZ(0),1:$P(Y(0),U,6))_U_DT,^DIE("F"_DI,X,+Y)=1 L -^DIE(+Y)
|
---|
9 | M S %X="DR(",%Y="^DIE(+Y,""DR""," D %XY^%RCR M ^DIE(+Y,"DIAB")=^UTILITY($J)
|
---|
10 | S X=DW,DP=DIA("P"),DMAX=^DD("ROU") I X'=1,$D(^DD("OS",DISYS,"ZS")) D EN^DIEZ S DR(1,DIA("P"))=U_DNM
|
---|
11 | Q K DNM,DIAO,DI,DIAP,%,%I,DIADT,DIAT,DIE,DMAX,%X,%Y Q
|
---|
12 | ;
|
---|
13 | ALL ;Called by DIETED, DIA
|
---|
14 | S %=DI,^UTILITY($J,1,F,%,DIAP\1000)="ALL" K DA D G UP^DIA:F,S:$D(DRS) Q
|
---|
15 | .N DIA1 S DIA1=DIARLVL D A
|
---|
16 | ;
|
---|
17 | RANGE ;called by DIA, DIE17, DIETED
|
---|
18 | N DIA1 S DIA1=F+1 S %=DI I X>0 S Y=X-.000001 G B
|
---|
19 | A S Y=0
|
---|
20 | B S DA="",X=0
|
---|
21 | G S DG=Y
|
---|
22 | DR S Y=$O(^DD(%,Y)) S:Y="" Y=-1 I $D(D(F)),Y'>0!(Y>D(F)) D DG:X Q
|
---|
23 | I Y'>0 D DG:X S:$D(DR(DIA1,%))[0 DR(DIA1,%)=DA Q
|
---|
24 | I $D(^(Y,0)),X X DIC("S") G G:$T D DG G DR
|
---|
25 | X DIC("S") E G DR
|
---|
26 | S X=Y G G
|
---|
27 | ;
|
---|
28 | DG S DA=DA_$E(";",1,$L(DA))_X_$P(":"_DG,U,X'=DG)
|
---|
29 | S DQ=0 F S DQ=$O(^DD(%,"SB",DQ)) Q:DQ="" S DP=$O(^(DQ,0)) I DP'<X,DP'>DG S Y(F,DQ)=""
|
---|
30 | S DQ=-1
|
---|
31 | Y S X=$O(Y(F,0)) I X>0 K Y(F,X) S DA(F)=DA,Y(F)=Y,%(F)=%,F=F+1,DIA1=DIA1+1,%=X D A S F=F-1,DIA1=DIA1-1,%=%(F),Y=Y(F),DA=DA(F) G Y
|
---|
32 | S X="",DG=0 K DP Q
|
---|
33 | ;
|
---|
34 | TEMP ;
|
---|
35 | S DIC(0)="ZSEQ" D T K DIC Q:$D(DTOUT) G DB:Y<0
|
---|
36 | S %=$P(Y(0),U,6) G ED:DUZ(0)="@"!'$L(%) F X=1:1:$L(%) I DUZ(0)[$E(%,X) G ED
|
---|
37 | GT I $G(^("ROU"))[U S DR(1,DIA("P"))=^("ROU")
|
---|
38 | E S:$D(^("W")) DIE("W")=^("W") S %X="^DIE(+Y,""DR"",",%Y="DR(" D %XY^%RCR
|
---|
39 | S $P(^DIE(+Y,0),U,7)=DT
|
---|
40 | Q
|
---|
41 | ;
|
---|
42 | T K DIC("W") S D="F"_DI,X=$P(X,"]",1),X=$P(X,"[",1)_$P(X,"[",2),DIC="^DIE(",DIC("S")="I $P(^(0),U,4)=DI"_$P(" S %=$P(^(0),U,3) F DW=1:1:$L(%) I DUZ(0)[$E(%,DW) Q",9,DUZ(0)'="@") G IX^DIC
|
---|
43 | ;
|
---|
44 | ED I Y<1 G GT
|
---|
45 | S %=2 W !,"WANT TO EDIT '",$P(Y,U,2),"' INPUT TEMPLATE" D YN^DICN G GT:%-1
|
---|
46 | S DIE="^DIE(",DA=+Y,DR=".01;3;6" D ^DIE K DR I '$D(DA) S DB=0 G DB
|
---|
47 | S:$D(^DIE(DA,"DR"))#2 ^("DR",1,J(0))=^("DR")
|
---|
48 | S DIAA=DA,DRS=9,DIAT=$S($D(^DIE(DA,"DR",1,J(0))):^(J(0)),1:"")
|
---|
49 | M DI=^DIE(DA,"DIAB")
|
---|
50 | S F=0,(DIARTLVL,DB)=1,DIAO=0 F DXS=1:1 Q:'$D(DR(99,DXS))
|
---|
51 | DB S DI=J(0) G ^DIA
|
---|