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

BATLRP.m

Go to the documentation of this file.
  1. BATLRP ; IHS/CMI/LAB - ;
  1. ;;1.0;IHS ASTHMA REGISTER;;FEB 19, 2003
  1. ;
  1. EN ;
  1. W:$D(IOF) @IOF
  1. W !!,$$CTR^BATU("*** Print ASTHMA REMINDER LETTER for Patient's on the Asthma Register ***"),!!
  1. W "This option will produce an Asthma Visit Reminder Letter for patients on the ",!,"asthma register.",!!
  1. W !!,"You will be presented with a list of all patients on the register with an",!,"active or unreviewed status whose last asthma visit (visit on which",!,"asthma data elements were entered) was over 6 months ago.",!
  1. W !,"You can then choose to print a letter for all of these patients or choose",!,"selected patients for whom a letter should be printed.",!!
  1. S DIR(0)="Y",DIR("A")="Do you wish to continue",DIR("B")="Y" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) D EXIT Q
  1. I 'Y D EXIT Q
  1. GATHER ;gather up and display in list man
  1. K BATPATS
  1. D EN^BATLRP1
  1. I '$D(BATPATS) W !!,"No patients selected." H 2 D EXIT Q
  1. ZIS ;
  1. W ! S DIR(0)="S^P:PRINT Output;B:BROWSE Output on Screen",DIR("A")="Do you wish to",DIR("B")="P" K DA D ^DIR K DIR
  1. I $D(DIRUT) D EXIT Q
  1. S BATOPT=Y
  1. I Y="B" D BROWSE,EXIT Q
  1. S XBRP="PRINT^BATLRP",XBRC="",XBRX="EXIT^BATLRP",XBNS="BAT"
  1. D ^XBDBQUE
  1. D EXIT
  1. Q
  1. BROWSE ;
  1. S XBRP="VIEWR^XBLM(""PRINT^BATLRP"")"
  1. S XBRC="",XBRX="EXIT^BATLRP",XBIOP=0 D ^XBDBQUE
  1. Q
  1. PRINT ;EP
  1. S BATAL=$O(^BATAL("B","ASTHMA VISIT REMINDER",0))
  1. S BATPG=1 K BATQ
  1. S BATCNT=0 F S BATCNT=$O(BATPATS(BATCNT)) Q:BATCNT'=+BATCNT D
  1. .S BATDFN=BATPATS(BATCNT)
  1. .K ^TMP($J,"ASTHMA LETTER")
  1. .D SET^BATLOP(BATDFN)
  1. .W:$D(IOF) @IOF
  1. .S BATX=0 F S BATX=$O(^TMP($J,"ASTHMA LETTER",BATX)) Q:BATX'=+BATX!($D(BATQ)) D
  1. ..I $Y>(IOSL-3) D HEADER Q:$D(BATQ)
  1. ..W !,^TMP($J,"ASTHMA LETTER",BATX)
  1. K ^TMP($J,"ASTHMA LETTER")
  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 BATQ="" Q
  1. HEAD1 ;
  1. W:$D(IOF) @IOF
  1. Q
  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. ;----------
  1. EXIT ;
  1. D EN^XBVK("BAT")
  1. D ^XBFMK
  1. Q