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

ADEPLBL1.m

Go to the documentation of this file.
ADEPLBL1 ; IHS/HQT/MJL  - MAILING LABELS PART 2 ;10:17 PM  [ 03/24/1999   9:04 AM ]
 ;;6.0;ADE;;APRIL 1999
 ;------->SELECT FILE
INQ ;K Y,DIC,DUOUT,DTOUT S DIC="^DIC(",DIC(0)="AEQZ"
 ;S DIC("S")="I +Y=9000001!($D(^DD(9000001,0,""PT"",+Y)))"
 ;D ^DIC
 ;I Y<1 S DUOUT=1 Q
 S Y=9000001 ;Force file to PATIENT file
 S ADEFN=+Y,ADEDIC=^DIC(ADEFN,0,"GL")
 ;------->KILL ANY OLD MAILING LIST TEMPLATES FOR THIS FILE & USER
 K Y,DIC S DIC="^DIBT(",DIC(0)="Z",X="ADE MAILING LIST"
 S DIC("S")="I $P(^DIBT(Y,0),U,4)=ADEFN,$P(^DIBT(Y,0),U,5)=DUZ"
 D ^DIC
 I Y>0 D KTEM
 ;------->SET UP TEMPLATE
 K Y,DIC S DIC="^DIBT(",DIC(0)="QZ",X="ADE MAILING LIST"
 K DD,DO D FILE^DICN
 S ADETEM=+Y
 S DR="2///NOW;4///"_ADEFN_";5///"_DUZ,DIE="^DIBT(",DA=ADETEM
 D ^DIE
 S ^DIBT(ADETEM,"DIS",0)="^"
 ;------->GET FILE ENTRIES
ENTRIES S ADECNT=0
E1 K Y,DIC S DIC=ADEDIC,DIC(0)="AEQZ"
 S DIC("A")="Select PATIENT NAME for Mailing Label: "
 D ^DIC
 I Y<1 S:'+ADECNT DUOUT=1 Q
 S ^DIBT(ADETEM,1,+Y)="",ADECNT=ADECNT+1
 G E1
KTEM S DIK="^DIBT(",DA=+Y D ^DIK
 Q