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

ADEKNT4.m

Go to the documentation of this file.
  1. ADEKNT4 ; IHS/HQT/MJL - COMPILE DENTAL REPORTS ; [ 03/24/1999 9:04 AM ]
  1. ;;6.0;ADE;;APRIL 1999
  1. ;
  1. ASKYQ() ;EP
  1. ;Displays periods for which objectives data
  1. ;have already been compiled in ^ADEKNT
  1. ;Asks for YEAR and QUARTER
  1. ;beginning Y2K fix
  1. ;Default is most recent YYYY.Q
  1. ;Returns YYYY.Q
  1. ;Returns 0 if no valid YYYY.Q entered or hat out
  1. ;Prompts confirmation if a YYYY.Q is entered for
  1. ;which stats have already been compiled
  1. ;end Y2K fix block
  1. ;
  1. N ADEY,ADEQ,ADEYQ,ADESET,ADECNT,DIR,DTOUT,DUOUT,DIRUT,DIROUT
  1. ;
  1. S ADEYQ=0
  1. F S ADEYQ=$O(^ADEKNT("AD",ADEYQ)) Q:ADEYQ="" D
  1. . S ADEYQ=$P(ADEYQ,".",1,2)
  1. . S ADEYQ(ADEYQ)=""
  1. . S $P(ADEYQ,".",3)=99999
  1. ;
  1. DIR ;
  1. ;beginning Y2K fix
  1. ;S DIR(0)="F^4:6"
  1. S DIR(0)="F^6:6" ;Y2000
  1. S DIR("A")="Enter YEAR.QUARTER"
  1. S DIR("A",1)="Enter the calendar year and quarter for which you wish to compile statistics"
  1. ;S DIR("A",2)="Using the format YY.Q where YY is the last 2 digits of the year"
  1. S DIR("A",2)="Using the format YYYY.Q where YYYY is the 4 digit year" ;Y2000
  1. ;S DIR("A",3)="and Q is the quarter of the year, e.g. 94.2 for the second quarter of 1994. "
  1. S DIR("A",3)="and Q is the quarter of the year, e.g. 1994.2 for the second quarter of 1994. " ;Y2000
  1. S DIR("A",4)=" "
  1. ;S DIR("?")="Enter the Year and Quarter in the form YY.Q"
  1. S DIR("?")="Enter the Year and Quarter in the form YYYY.Q" ;Y2000
  1. S DIR("B")=+$$QTR^ADEKNT5(DT)
  1. K:$D(ADEYQ(DIR("B"))) DIR("B")
  1. I '$O(ADEYQ(0)) W !,"No prior statistics are on file on this computer."
  1. E S ADEYQ=0 W !!!,"Statistics have already been compiled for the following quarters:" F S ADEYQ=$O(ADEYQ(ADEYQ)) Q:'ADEYQ D
  1. . W !,?5,ADEYQ
  1. D ^DIR
  1. I $$HAT^ADEPQA Q 0
  1. ;I X'?1.4N1"."1N W *7," ??" G DIR
  1. I X'?4N1"."1N W *7," "_DIR("?") G DIR ;Y2000
  1. S ADEY=$P(X,".")
  1. ;I $L(ADEY)>2 S ADEY=$E(ADEY,$L(ADEY)-1,$L(ADEY))
  1. ;I ADEY<80 W *7," Must be 1980 or later." G DIR
  1. I ADEY<1980 W *7," Must be 1980 or later." G DIR ;Y2000
  1. ;end Y2K fix block
  1. S ADEQ=$P(X,".",2)
  1. I ADEQ<1!(ADEQ>4) W *7," Quarter must be 1, 2, 3 or 4." G DIR
  1. I ADEY_"."_ADEQ>$$QTR^ADEKNT5(DT) W *7," Must be "_+$$QTR^ADEKNT5(DT)_" or earlier." G DIR
  1. S ADEYQ=ADEY_"."_ADEQ
  1. I '$D(ADEYQ(ADEYQ)) Q ADEYQ
  1. K DIR
  1. S DIR(0)="YA",DIR("B")="NO"
  1. W !!,"Statistics have already been compiled for period "_ADEYQ
  1. S DIR("A")="Do you want to re-compile the statistics for this period? "
  1. D ^DIR
  1. G:'Y DIR
  1. Q ADEYQ