DGVREL3 ;ALB/MRL - FORMAT RELEASE MESSAGE/LETTER ; 2 JUN 87
;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
K ^UTILITY($J) D:'$D(DT) DT^DICRW S Y=DT X ^DD("DD") S DGD=Y,DGFAC=$S($D(^DD("SITE"))#2:^("SITE"),1:"FACILITY UNKNOWN")_$S($D(^DD("SITE",1)):" ("_^(1)_")",1:""),DGS="MAS V."_DGVREL_" INSTALLATION"
S DGC=0 I DGHOW="L" S DGT="DATE: "_DGD D S S DGT="" D S S DGT="FROM: "_DGFAC D S S DGT="" D S S DGT="SUBJ: "_DGS D S F I=1:1 S DGT=$P($T(TO+I),";;",2) Q:DGT="QUIT" D S
S DGT="1. DPT Installation: STARTED COMPLETED HOURS MINUTES" D S,L
S DGO="",$P(DGO," ",40)="",(DGHT,DGMT)=0,DGN=^DG(48,DGVREL,"R") F DGJ=5,6,7 S DGT="",DGI=$P(DGN,"^",DGJ),DGI1=$P(DGN,"^",DGJ+1) D TIME
D L S DGJ=0,DGT="",$P(DGT," ",61)="",DGI=$P(DGN,"^",5),DGI1=$P(DGN,"^",8) D TIME S DGT="" D S
S DGT="2. DG Installation: STARTED COMPLETED HOURS MINUTES" D S,L
S DGO="",$P(DGO," ",40)="",(DGHT,DGMT)=0,DGN=^DG(48,DGVREL,"R") F DGJ=1,2,3 S DGT="",DGI=$P(DGN,"^",DGJ),DGI1=$P(DGN,"^",DGJ+1) D TIME
D L S DGJ=0,DGT="",$P(DGT," ",61)="",DGI=$P(DGN,"^",1),DGI1=$P(DGN,"^",4) D TIME S DGT="" D S
G FILE:'DGVRELSD S DGT="3. SD Installation: STARTED COMPLETED HOURS MINUTES" D S,L
S DGO="",$P(DGO," ",40)="",(DGHT,DGMT)=0,DGN=^DG(48,DGVREL,"R") F DGJ=9,10,11 S DGT="",DGI=$P(DGN,"^",DGJ),DGI1=$P(DGN,"^",DGJ+1) D TIME
D L S DGJ=0,DGT="",$P(DGT," ",61)="",DGI=$P(DGN,"^",9),DGI1=$P(DGN,"^",12) D TIME S DGT="" D S
FILE S DGN=^DG(48,DGVREL,"S"),DGFILE=0 G ^DGVREL4:'$P(DGN,"^",1) F DGJ1="REGISTRATION","SCHEDULING" S DGJ=$O(^DIC(9.4,"B",DGJ1,0)) Q:'DGJ D GET
D:C=1 S S DGT="" D S S C=$S(DGVRELSD:5,1:4),DGT=C_". Patient File has '"_$S($D(^DPT(0)):+$P(^(0),"^",4),1:0)_"' Entries." D S S DGFILE=1,DGT="" D S
G ^DGVREL4
GET S DGT="" D S S C=$S('DGVRELSD:3,DGJ1="REGISTRATION":4,1:0) I C S DGT=C_". FILE NAME #ENTRIES FILE NAME #ENTRIES" D S
S DGT=" --------- -------- --------- --------" D S
S C=0 F I=0:0 S I=$O(^DIC(9.4,DGJ,4,"B",I)) Q:'I S DGF=^DIC(I,0),DGF1=^DIC(I,0,"GL"),DGF2=$S($D(@(DGF1_"0)")):+$P(@(DGF1_"0)"),"^",4),1:0),C=C+1 D:C=1 F1 I C=2 D F2 S DGT=DGT_DGT1,C=0 D S
Q
TIME I DGJ S DGT=" "_$S(DGJ=1!(DGJ=5):"PRE-",DGJ=2!(DGJ=6!(DGJ=10)):"ACTUAL ",1:"POST-")_"INIT"_DGO,DGT=$E(DGT,1,22),Y=DGI X ^DD("DD") S DGT=DGT_$E(Y_DGO,1,19) S Y=DGI1 X ^DD("DD") S DGT=DGT_$E(Y_DGO,1,19)
S X=DGI,DGX=$P(X,".",2),DGX=$E((DGX_"000"),1,4) D H^%DTC S DGX=%H_","_($E(DGX,1,2)*60*60+($E(DGX,3,4)*60)),X=DGI1,DGX1=$P(X,".",2),DGX1=$E((DGX1_"000"),1,4) D H^%DTC S DGX1=%H_","_($E(DGX1,1,2)*60*60+($E(DGX1,3,4)*60))
S X=DGX1,Y=(X-DGX)*86400,X1=$P(X,",",2),X2=$P(DGX,",",2),X3=Y-X2+X1,X=X3\3600,X1=X3#3600\60 S:'X&('X1) X1=1 S DGM=X1,DGH=X
HM S DGT=DGT_$J(DGH,5),DGT=DGT_$J(DGM,9)
S S DGC=DGC+1,^UTILITY($J,"DGVREL",DGC,0)=DGT Q
L S DGT=" ---------------- ---------------- ----- -------" D S Q
F1 S DGT=" "_$E($P(DGF,"^",1),1,24)_DGO,DGT=$E(DGT,1,28)_$J(DGF2,9)_DGO,DGT=$E(DGT,1,42)
F2 S DGT1=$E($P(DGF,"^",1),1,25)_DGO,DGT1=$E(DGT1,1,28)_$J(DGF2,8) Q
Q
TO ;
;;
;;TO: Director
;; Information Systems Center (10BA1/ADP)
;; Frear Building
;; 2 Third Street, Suite 301
;; Troy, New York 12180
;;
;;
;;QUIT
DGVREL3 ;ALB/MRL - FORMAT RELEASE MESSAGE/LETTER ; 2 JUN 87
+1 ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
+2 KILL ^UTILITY($JOB)
IF '$DATA(DT)
DO DT^DICRW
SET Y=DT
XECUTE ^DD("DD")
SET DGD=Y
SET DGFAC=$SELECT($DATA(^DD("SITE"))#2:^("SITE"),1:"FACILITY UNKNOWN")_$SELECT($DATA(^DD("SITE",1)):" ("_^(1)_")",1:"")
SET DGS="MAS V."_DGVREL_" INSTALLATION"
+3 SET DGC=0
IF DGHOW="L"
SET DGT="DATE: "_DGD
DO S
SET DGT=""
DO S
SET DGT="FROM: "_DGFAC
DO S
SET DGT=""
DO S
SET DGT="SUBJ: "_DGS
DO S
FOR I=1:1
SET DGT=$PIECE($TEXT(TO+I),";;",2)
IF DGT="QUIT"
QUIT
DO S
+4 SET DGT="1. DPT Installation: STARTED COMPLETED HOURS MINUTES"
DO S
DO L
+5 SET DGO=""
SET $PIECE(DGO," ",40)=""
SET (DGHT,DGMT)=0
SET DGN=^DG(48,DGVREL,"R")
FOR DGJ=5,6,7
SET DGT=""
SET DGI=$PIECE(DGN,"^",DGJ)
SET DGI1=$PIECE(DGN,"^",DGJ+1)
DO TIME
+6 DO L
SET DGJ=0
SET DGT=""
SET $PIECE(DGT," ",61)=""
SET DGI=$PIECE(DGN,"^",5)
SET DGI1=$PIECE(DGN,"^",8)
DO TIME
SET DGT=""
DO S
+7 SET DGT="2. DG Installation: STARTED COMPLETED HOURS MINUTES"
DO S
DO L
+8 SET DGO=""
SET $PIECE(DGO," ",40)=""
SET (DGHT,DGMT)=0
SET DGN=^DG(48,DGVREL,"R")
FOR DGJ=1,2,3
SET DGT=""
SET DGI=$PIECE(DGN,"^",DGJ)
SET DGI1=$PIECE(DGN,"^",DGJ+1)
DO TIME
+9 DO L
SET DGJ=0
SET DGT=""
SET $PIECE(DGT," ",61)=""
SET DGI=$PIECE(DGN,"^",1)
SET DGI1=$PIECE(DGN,"^",4)
DO TIME
SET DGT=""
DO S
+10 IF 'DGVRELSD
GOTO FILE
SET DGT="3. SD Installation: STARTED COMPLETED HOURS MINUTES"
DO S
DO L
+11 SET DGO=""
SET $PIECE(DGO," ",40)=""
SET (DGHT,DGMT)=0
SET DGN=^DG(48,DGVREL,"R")
FOR DGJ=9,10,11
SET DGT=""
SET DGI=$PIECE(DGN,"^",DGJ)
SET DGI1=$PIECE(DGN,"^",DGJ+1)
DO TIME
+12 DO L
SET DGJ=0
SET DGT=""
SET $PIECE(DGT," ",61)=""
SET DGI=$PIECE(DGN,"^",9)
SET DGI1=$PIECE(DGN,"^",12)
DO TIME
SET DGT=""
DO S
FILE SET DGN=^DG(48,DGVREL,"S")
SET DGFILE=0
IF '$PIECE(DGN,"^",1)
GOTO ^DGVREL4
FOR DGJ1="REGISTRATION","SCHEDULING"
SET DGJ=$ORDER(^DIC(9.4,"B",DGJ1,0))
IF 'DGJ
QUIT
DO GET
+1 IF C=1
DO S
SET DGT=""
DO S
SET C=$SELECT(DGVRELSD:5,1:4)
SET DGT=C_". Patient File has '"_$SELECT($DATA(^DPT(0)):+$PIECE(^(0),"^",4),1:0)_"' Entries."
DO S
SET DGFILE=1
SET DGT=""
DO S
+2 GOTO ^DGVREL4
GET SET DGT=""
DO S
SET C=$SELECT('DGVRELSD:3,DGJ1="REGISTRATION":4,1:0)
IF C
SET DGT=C_". FILE NAME #ENTRIES FILE NAME #ENTRIES"
DO S
+1 SET DGT=" --------- -------- --------- --------"
DO S
+2 SET C=0
FOR I=0:0
SET I=$ORDER(^DIC(9.4,DGJ,4,"B",I))
IF 'I
QUIT
SET DGF=^DIC(I,0)
SET DGF1=^DIC(I,0,"GL")
SET DGF2=$SELECT($DATA(@(DGF1_"0)")):+$PIECE(@(DGF1_"0)"),"^",4),1:0)
SET C=C+1
IF C=1
DO F1
IF C=2
DO F2
SET DGT=DGT_DGT1
SET C=0
DO S
+3 QUIT
TIME IF DGJ
SET DGT=" "_$SELECT(DGJ=1!(DGJ=5):"PRE-",DGJ=2!(DGJ=6!(DGJ=10)):"ACTUAL ",1:"POST-")_"INIT"_DGO
SET DGT=$EXTRACT(DGT,1,22)
SET Y=DGI
XECUTE ^DD("DD")
SET DGT=DGT_$EXTRACT(Y_DGO,1,19)
SET Y=DGI1
XECUTE ^DD("DD")
SET DGT=DGT_$EXTRACT(Y_DGO,1,19)
+1 SET X=DGI
SET DGX=$PIECE(X,".",2)
SET DGX=$EXTRACT((DGX_"000"),1,4)
DO H^%DTC
SET DGX=%H_","_($EXTRACT(DGX,1,2)*60*60+($EXTRACT(DGX,3,4)*60))
SET X=DGI1
SET DGX1=$PIECE(X,".",2)
SET DGX1=$EXTRACT((DGX1_"000"),1,4)
DO H^%DTC
SET DGX1=%H_","_($EXTRACT(DGX1,1,2)*60*60+($EXTRACT(DGX1,3,4)*60))
+2 SET X=DGX1
SET Y=(X-DGX)*86400
SET X1=$PIECE(X,",",2)
SET X2=$PIECE(DGX,",",2)
SET X3=Y-X2+X1
SET X=X3\3600
SET X1=X3#3600\60
IF 'X&('X1)
SET X1=1
SET DGM=X1
SET DGH=X
HM SET DGT=DGT_$JUSTIFY(DGH,5)
SET DGT=DGT_$JUSTIFY(DGM,9)
S SET DGC=DGC+1
SET ^UTILITY($JOB,"DGVREL",DGC,0)=DGT
QUIT
L SET DGT=" ---------------- ---------------- ----- -------"
DO S
QUIT
F1 SET DGT=" "_$EXTRACT($PIECE(DGF,"^",1),1,24)_DGO
SET DGT=$EXTRACT(DGT,1,28)_$JUSTIFY(DGF2,9)_DGO
SET DGT=$EXTRACT(DGT,1,42)
F2 SET DGT1=$EXTRACT($PIECE(DGF,"^",1),1,25)_DGO
SET DGT1=$EXTRACT(DGT1,1,28)_$JUSTIFY(DGF2,8)
QUIT
+1 QUIT
TO ;
+1 ;;
+2 ;;TO: Director
+3 ;; Information Systems Center (10BA1/ADP)
+4 ;; Frear Building
+5 ;; 2 Third Street, Suite 301
+6 ;; Troy, New York 12180
+7 ;;
+8 ;;
+9 ;;QUIT