ADEKNS ; IHS/HQT/MJL -REPORTS INSTALL ; [ 03/24/1999 9:04 AM ]
;;6.0;ADE;;APRIL 1999
;
;
;This routine runs at post-init
;initiates the compilation of dental data.
;The routine follows these steps:
;1) Checks the quarter prior to the current qtr
; for existence of dental data.
;2) If data exists, queues itself to compile data for
; that prior quarter
;3) Compiles data for the current quarter.
;This queueing loop continues until there's no dental data
;left to compile.
;
;Enter at top for interactive session
I '$D(^ADEKOB(1,0)) D G END
. W !!,"The DENTAL PROGRAM OBJECTIVES File and its "
. W !,"data global (^ADEKOB) must be installed before running this routine."
Q:'$$CONFIRM()
EN ;EP -Enter here to bypass interactive prompts
;called here by post-init
I '$D(^ADEKOB(1,0)) G END
N ADEYQ,ADESELOB,ZTDTH
S ADEYQ=$$QTR^ADEKNT5(DT)
S ADESELOB="ALL"
S ZTDTH=$H
K ^ADEUTL("ADEKNT_TIME")
D QUEUE(ZTDTH,$P(ADEYQ,U),ADESELOB)
END Q
;
;
QUEUE(ZTDTH,ADEYQ,ADESELOB) ;EP
;- Call to reque ADEKNS to run at time ZTDTH ($H-format)
; to compile data for YR.Q ADEYQ for objectives ADESELOB
N ZTRTN,ZTDESC,ZTIO,ZTSAVE
S ZTRTN="START^ADEKNS",ZTDESC="DENTAL STATS "_ADEYQ,ZTIO="",ZTSAVE("ADEYQ")="",ZTSAVE("ADESELOB")="" D ^%ZTLOAD
;
Q
;
START ;EP
;TASKMAN ENTERS HERE
;
;If the quarter previous to ADEYQ has dental data,
; then this routine requeues itself to compile that quarter.
;Called with ADEYQ and ADESELOB defined
N ADEPRE
S ADEPRE=$$BACK^ADEKRP(ADEYQ)
;Y2K - FHL 09/03/98
;I $$HASDATA(ADEPRE) D
;Y2K - FHL 09/03/98
I ADEPRE,$$HASDATA(ADEPRE) D
. S ZTDTH=$$ADDMIN^ADEKNT3($H,(15*60)) ;Default requeue is 10 hours
. I $D(^ADEUTL("ADEKNT_TIME")) S ZTDTH=$$ADDMIN^ADEKNT3($H,^("ADEKNT_TIME"))
. D QUEUE(ZTDTH,ADEPRE,ADESELOB)
;
;Do current quarter
D KNS^ADEKNT(ADEYQ,ADESELOB)
;
K ADEYQ,ADESELOB
Q
;
HASDATA(ADEYQ) ;EP
;RETURNS TRUE IF THE PERIOD ADEYQ CONTAINS DENTAL DATA
;OTW FALSE
S ADEYQ=$$PERIOD^ADEKNT5($P(ADEYQ,"."),+$P(ADEYQ,".",2))
;Y2K - FHL 09/03/98
Q:'ADEYQ 0
I '$D(^ADEPCD("AC")) Q 0
I ($O(^ADEPCD("AC",$P(ADEYQ,U,2)),-1))'<($P(ADEYQ,U,5)) Q 1
Q 0
;
CONFIRM() ;Return 1 if ok to go, otw 0
N DIR
S DIR(0)="YA",DIR("B")="YES"
W !!,"This routine (^ADEKNS) will compile dental program statistics"
W !,"using the data in the Dental program files."
;W !!,"You should complete installation of the DENTAL ENHANCED REPORTS"
;W !,"Package BEFORE running this routine, including the assignment of"
;W !,"mail groups to the new Bulletin."
W !!,"This routine need only be run one time at initial installation."
W !,"No harm will be done, however, if the routine runs more than once.",!
S DIR("A")="Continue? "
D ^DIR
I $$HAT^ADEPQA Q 0
Q Y
ADEKNS ; IHS/HQT/MJL -REPORTS INSTALL ; [ 03/24/1999 9:04 AM ]
+1 ;;6.0;ADE;;APRIL 1999
+2 ;
+3 ;
+4 ;This routine runs at post-init
+5 ;initiates the compilation of dental data.
+6 ;The routine follows these steps:
+7 ;1) Checks the quarter prior to the current qtr
+8 ; for existence of dental data.
+9 ;2) If data exists, queues itself to compile data for
+10 ; that prior quarter
+11 ;3) Compiles data for the current quarter.
+12 ;This queueing loop continues until there's no dental data
+13 ;left to compile.
+14 ;
+15 ;Enter at top for interactive session
+16 IF '$DATA(^ADEKOB(1,0))
Begin DoDot:1
+17 WRITE !!,"The DENTAL PROGRAM OBJECTIVES File and its "
+18 WRITE !,"data global (^ADEKOB) must be installed before running this routine."
End DoDot:1
GOTO END
+19 IF '$$CONFIRM()
QUIT
EN ;EP -Enter here to bypass interactive prompts
+1 ;called here by post-init
+2 IF '$DATA(^ADEKOB(1,0))
GOTO END
+3 NEW ADEYQ,ADESELOB,ZTDTH
+4 SET ADEYQ=$$QTR^ADEKNT5(DT)
+5 SET ADESELOB="ALL"
+6 SET ZTDTH=$HOROLOG
+7 KILL ^ADEUTL("ADEKNT_TIME")
+8 DO QUEUE(ZTDTH,$PIECE(ADEYQ,U),ADESELOB)
END QUIT
+1 ;
+2 ;
QUEUE(ZTDTH,ADEYQ,ADESELOB) ;EP
+1 ;- Call to reque ADEKNS to run at time ZTDTH ($H-format)
+2 ; to compile data for YR.Q ADEYQ for objectives ADESELOB
+3 NEW ZTRTN,ZTDESC,ZTIO,ZTSAVE
+4 SET ZTRTN="START^ADEKNS"
SET ZTDESC="DENTAL STATS "_ADEYQ
SET ZTIO=""
SET ZTSAVE("ADEYQ")=""
SET ZTSAVE("ADESELOB")=""
DO ^%ZTLOAD
+5 ;
+6 QUIT
+7 ;
START ;EP
+1 ;TASKMAN ENTERS HERE
+2 ;
+3 ;If the quarter previous to ADEYQ has dental data,
+4 ; then this routine requeues itself to compile that quarter.
+5 ;Called with ADEYQ and ADESELOB defined
+6 NEW ADEPRE
+7 SET ADEPRE=$$BACK^ADEKRP(ADEYQ)
+8 ;Y2K - FHL 09/03/98
+9 ;I $$HASDATA(ADEPRE) D
+10 ;Y2K - FHL 09/03/98
+11 IF ADEPRE
IF $$HASDATA(ADEPRE)
Begin DoDot:1
+12 ;Default requeue is 10 hours
SET ZTDTH=$$ADDMIN^ADEKNT3($HOROLOG,(15*60))
+13 IF $DATA(^ADEUTL("ADEKNT_TIME"))
SET ZTDTH=$$ADDMIN^ADEKNT3($HOROLOG,^("ADEKNT_TIME"))
+14 DO QUEUE(ZTDTH,ADEPRE,ADESELOB)
End DoDot:1
+15 ;
+16 ;Do current quarter
+17 DO KNS^ADEKNT(ADEYQ,ADESELOB)
+18 ;
+19 KILL ADEYQ,ADESELOB
+20 QUIT
+21 ;
HASDATA(ADEYQ) ;EP
+1 ;RETURNS TRUE IF THE PERIOD ADEYQ CONTAINS DENTAL DATA
+2 ;OTW FALSE
+3 SET ADEYQ=$$PERIOD^ADEKNT5($PIECE(ADEYQ,"."),+$PIECE(ADEYQ,".",2))
+4 ;Y2K - FHL 09/03/98
+5 IF 'ADEYQ
QUIT 0
+6 IF '$DATA(^ADEPCD("AC"))
QUIT 0
+7 IF ($ORDER(^ADEPCD("AC",$PIECE(ADEYQ,U,2)),-1))'<($PIECE(ADEYQ,U,5))
QUIT 1
+8 QUIT 0
+9 ;
CONFIRM() ;Return 1 if ok to go, otw 0
+1 NEW DIR
+2 SET DIR(0)="YA"
SET DIR("B")="YES"
+3 WRITE !!,"This routine (^ADEKNS) will compile dental program statistics"
+4 WRITE !,"using the data in the Dental program files."
+5 ;W !!,"You should complete installation of the DENTAL ENHANCED REPORTS"
+6 ;W !,"Package BEFORE running this routine, including the assignment of"
+7 ;W !,"mail groups to the new Bulletin."
+8 WRITE !!,"This routine need only be run one time at initial installation."
+9 WRITE !,"No harm will be done, however, if the routine runs more than once.",!
+10 SET DIR("A")="Continue? "
+11 DO ^DIR
+12 IF $$HAT^ADEPQA
QUIT 0
+13 QUIT Y