Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ADEKNS

ADEKNS.m

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