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

SDAMOCC.m

Go to the documentation of this file.
  1. SDAMOCC ;IOFIO BAYPINES/TEH - AM Mgt Reports ; 12/1/91
  1. ;;5.3;Scheduling;**487**;Aug 13, 1993
  1. ;
  1. EN ; main entry point
  1. N DIC,SDBEG,SDEND,SDSEL,VAUTD,VAUTC,SDSORT,SDAMLIST,Y,VAUTNI,VAUTSTR,VAUTVB,DIRUT
  1. EN1 I '$$INIT G ENQ
  1. ;
  1. ASKBDT ;
  1. W !!,$$LINE("Date Range Selection"),!
  1. S %DT="AEX",%DT("A")="Select Beginning Date: "
  1. D ^%DT S SDBEG=Y
  1. I X="^" Q
  1. I Y=-1 W !!,"Invalid Date!",! G ASKBDT
  1. K %DT,Y
  1. ASKEDT ;
  1. S %DT="AEX",%DT("A")="Select Ending Date: "
  1. D ^%DT S SDEND=Y
  1. I X="^" Q
  1. I Y=-1 W !!,"Invalid Date!",! G ASKEDT
  1. I SDEND<SDBEG W !!,"Ending Date must be equal to or greater than Beginning Date." G ASKEDT
  1. K %DT,Y
  1. ;I '$$RANGE G ENQ
  1. S SDSEL=1
  1. S SDSEL=SDSEL+4 ; for backwards compatibility
  1. G STATS^SDAMOC
  1. ENQ Q
  1. ;
  1. INIT() ; -- init vars
  1. Q 1
  1. ;
  1. RANGE() ; select date range
  1. ; input: none
  1. ; output: SDBEG := begin date
  1. ; SDEND := end date
  1. ; return: was selection made [ 1|yes 0|no]
  1. ;
  1. W !!,$$LINE("Date Range Selection")
  1. Q $$RANGE^SDAMQ(.SDBEG,.SDEND)
  1. ;
  1. SELECT() ; -- get selection criteria
  1. ; input: none
  1. ; output: SDSEL := criteria selected
  1. ; return: was selection made [ 1|yes 0|no]
  1. ;
  1. W !!,$$LINE("Statisitcs Criteria")
  1. S X="S^"
  1. S X=X_"1:Statistics;"
  1. S X=X_"2:Division(s) Only Statistics"
  1. S DIR(0)=X,DIR("A")="Which Visits",DIR("B")="Statistics"
  1. D ^DIR K DIR S SDSEL=$S($D(DIRUT):0,1:+Y)
  1. Q SDSEL>0
  1. ;
  1. DIV() ; -- get division data
  1. ; input: none
  1. ; output: VAUTD := divs selected (VAUTD=1 for all)
  1. ; return: was selection made [ 1|yes 0|no]
  1. ;
  1. W:$P($G(^DG(43,1,"GL")),U,2) !!,$$LINE("Division Selection")
  1. D ASK2^SDDIV I Y<0 K VAUTD
  1. Q $D(VAUTD)>0
  1. ;
  1. CLINIC() ; -- get clinic data
  1. ; input: VAUTD := divisions selected
  1. ; output: VAUTC := clinic selected (VAUTC=1 for all)
  1. ; return: was selection made [ 1|yes 0|no]
  1. ;
  1. W !!,$$LINE("Clinic Selection")
  1. D CLINIC^SDAMO0
  1. I Y<0 K VAUTC
  1. CLINICQ Q $D(VAUTC)>0
  1. ;
  1. STOP() ; -- get stop code data
  1. ; output: VAUTC := stop codes selected (VAUTC=1 for all)
  1. ; return: was selection made [ 1|yes 0|no]
  1. ;
  1. W !!,$$LINE("Stop Codes Selection")
  1. S DIC="^DIC(40.7,",VAUTSTR="stop code",VAUTVB="VAUTC",VAUTNI=2
  1. D FIRST^VAUTOMA
  1. I Y<0 K VAUTC
  1. STOPQ Q $D(VAUTC)>0
  1. ;
  1. ;
  1. LINE(STR) ; -- print line
  1. ; input: STR := text to insert
  1. ; output: none
  1. ; return: text to use
  1. ;
  1. N X
  1. S:STR]"" STR=" "_STR_" "
  1. S $P(X,"_",(IOM/2)-($L(STR)/2))=""
  1. Q X_STR_X
  1. ;