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

APCLAP2P.m

Go to the documentation of this file.
  1. APCLAP2P ; IHS/CMI/LAB - print all visit report ;
  1. ;;2.0;IHS PCC SUITE;**7,20**;MAY 14, 2009;Build 25
  1. START ;
  1. S APCL80S="-------------------------------------------------------------------------------"
  1. D NOW^%DTC S Y=X D DD^%DT S APCLDT=Y
  1. S Y=APCLBD D DD^%DT S APCLBDD=Y S Y=APCLED D DD^%DT S APCLEDD=Y
  1. S (APCLTOT,APCLPG,APCLVLOC)=0 D HEAD
  1. K APCLQUIT
  1. F S APCLVLOC=$O(^XTMP("APCLAP2",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC)) Q:APCLVLOC=""!($D(APCLQUIT)) D SORT
  1. I APCLTOTL,APCLPROC'="LOS" D
  1. .S APCLGTOT=0
  1. .S APCLLTT="ALL LOCATIONS COMBINED"
  1. .I $Y>(IOSL-6) D HEAD Q:$D(APCLQUIT)
  1. .W !,APCLLTT W:APCLPROC'="LOS" !
  1. .S APCLSORT="" F S APCLSORT=$O(^XTMP("APCLAP2",APCLJOB,APCLBTH,"ALLLOC",APCLSORT)) Q:APCLSORT=""!($D(APCLQUIT)) D
  1. ..S APCLSRT2="" F S APCLSRT2=$O(^XTMP("APCLAP2",APCLJOB,APCLBTH,"ALLLOC",APCLSORT,APCLSRT2)) Q:APCLSRT2=""!($D(APCLQUIT)) D
  1. ...I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
  1. ...S APCLPRNT=APCLSORT I APCLPROC="DATE" S Y=APCLPRNT D DD^%DT S APCLPRNT=Y
  1. ...W:APCLPROC'="LOS" !?5,$E(APCLPRNT,1,25) W ?35,$E(APCLSRT2,1,20),?60,$J(^XTMP("APCLAP2",APCLJOB,APCLBTH,"ALLLOC",APCLSORT,APCLSRT2),8)
  1. ...S APCLGTOT=APCLGTOT+^XTMP("APCLAP2",APCLJOB,APCLBTH,"ALLLOC",APCLSORT,APCLSRT2)
  1. .Q:APCLPROC="LOS"
  1. .;W !?60,"--------",!
  1. .;W ?50,"TOTAL:",?60,$J(APCLGTOT,8),!
  1. G:$D(APCLQUIT) DONE
  1. I $Y>(IOSL-5) D HEAD G:$D(APCLQUIT) DONE
  1. W !?60,"--------",!
  1. W ?52,"Total:",?60,$J(APCLTOT,8),!
  1. DONE ;
  1. D DONE^APCLOSUT
  1. K ^XTMP("APCLAP2",APCLJOB,APCLBTH)
  1. Q
  1. SORT ;
  1. I $Y>(IOSL-6) D HEAD Q:$D(APCLQUIT)
  1. W !,$P(^DIC(4,APCLVLOC,0),U) W:APCLPROC'="LOS" !
  1. S APCLSORT="" F S APCLSORT=$O(^XTMP("APCLAP2",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT)) Q:APCLSORT=""!($D(APCLQUIT)) D P
  1. Q:APCLPROC="LOS"
  1. W !?60,"--------",!
  1. W ?50,"Subtotal:",?60,$J(^XTMP("APCLAP2",APCLJOB,APCLBTH,"SUBTOTAL",APCLVLOC),8),!
  1. Q
  1. P ;
  1. S APCLSRT2="" F S APCLSRT2=$O(^XTMP("APCLAP2",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT,APCLSRT2)) Q:APCLSRT2=""!($D(APCLQUIT)) D
  1. .S:'$D(^XTMP("APCLAP2",APCLJOB,APCLBTH,"SUBTOTAL",APCLVLOC)) ^XTMP("APCLAP2",APCLJOB,APCLBTH,"SUBTOTAL",APCLVLOC)=0
  1. .I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
  1. .;S APCLSRT2=$O(^XTMP("APCLAP2",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT,""))
  1. .S APCLPRNT=APCLSORT I APCLPROC="DATE" S Y=APCLPRNT D DD^%DT S APCLPRNT=Y
  1. .W:APCLPROC'="LOS" !?5,$E(APCLPRNT,1,25) W ?35,$E(APCLSRT2,1,20),?60,$J(^XTMP("APCLAP2",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT,APCLSRT2),8)
  1. .S APCLTOT=APCLTOT+^XTMP("APCLAP2",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT,APCLSRT2)
  1. .S ^XTMP("APCLAP2",APCLJOB,APCLBTH,"SUBTOTAL",APCLVLOC)=^XTMP("APCLAP2",APCLJOB,APCLBTH,"SUBTOTAL",APCLVLOC)+^XTMP("APCLAP2",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT,APCLSRT2)
  1. Q
  1. I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCLQUIT="" Q
  1. HEAD1 ;
  1. W:$D(IOF) @IOF S APCLPG=APCLPG+1
  1. W !
  1. W ?58,APCLDT,?72,"Page ",APCLPG,!
  1. S APCLLENG=31+$L(APCLTITL)
  1. W ?((80-APCLLENG)/2),"NUMBER OF AMBULATORY VISITS BY ",APCLTITL,!
  1. S APCLLOCT=$S(APCLLOC=0:"ALL",1:"SELECTED")
  1. S APCLLENG=21+$L(APCLLOCT)
  1. W ?((80-APCLLENG)/2),"LOCATION OF VISITS: ",APCLLOCT,!
  1. S X="Chart Reviews are "_$S('APCLCRYN:"not ",1:"")_"included." W $$CTR(X,80),!
  1. W ?18,"VISIT DATES: ",APCLBDD," TO ",APCLEDD,!
  1. W !,"LOCATION OF VISIT"
  1. W !?5,APCLHD1,?35,APCLHD2,?60,"# VISITS",!
  1. W APCL80S,!
  1. Q
  1. ;
  1. CTR(X,Y) ;EP - Center X in a field Y wide.
  1. Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
  1. ;----------