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

AGADDR.m

Go to the documentation of this file.
AGADDR ; IHS/ASDS/EFG - REGISTRATION MAILING LIST PRINT/EDIT (1 OF 2) ; 
 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
 ;PROGRAMMER NOTE:  THIS ROUTINE IS CALLED BY A CHS OPTION.
 ;
VAR S AGV("TOT")=0,AGV("LINE")="IHSIHSIHSIHSIHSIHSIHSIHS" K IOP,AG,DFN
 D:'$D(DUZ(2)) SET^XBSITE I DUZ(2)<1 S DUZ(2)=$P(^AUTTSITE(1,0),U)
 W !?5,"1)  Print an Existing List",!!?5,"2)  Add/Edit a List",!!?9,"Select Option (1-2) '^' to Exit " D READ^AG G END1:$D(DFOUT)!$D(DUOUT)!$D(DTOUT)!$D(DLOUT),PEXIST:Y?1"1".E,END1:Y'?1"2"
GNEW LOCK  W ! S DIC="^AGADLIST(",DIC(0)="QAZEML",DLAYGO=9009065,DIC("S")="I $P(^(0),U,5)=DUZ" D ^DIC G VAR:+Y<1
 S (AGLIST,DA)=+Y,DIE=DIC,DR=.01 D ^DIE K DIC,DIE,DR,DA
 I '$D(^AGADLIST(AGLIST)) G VAR
 LOCK ^AGADLIST(AGLIST):1 I '$T W *7,!!,"MAILING LIST IN USE BY ANOTHER USER  -- TRY LATER" H 3 G VAR
 I $P(^AGADLIST(AGLIST,0),U,2)="" K DIC,DR S DA=AGLIST,DIE="^AGADLIST(",DR="2////"_DT_";4////"_DUZ D ^DIE
 D NEWLST^AGADDR1
GNEW2 S DIC("W")="D ^AGSCANP" D SET^AUPNLKZ,PTLK^AG,RESET^AUPNLKZ G VAR:'$D(DFN)
 I $D(^AGADLIST(AGLIST,1,"B",DFN)) W !,*7,"Already on File  -- Want to Delete (Y/N) NO//" D READ^AG G VAR:$D(DFOUT)!$D(DUOUT)!$D(DTOUT),DEL:Y?1"Y".E,GNEW2
 S AGV("P3")=AGV("P3")+1,AGV("P4")=AGV("P4")+1
 S:'($D(^AGADLIST(AGLIST,1,0))) ^AGADLIST(AGLIST,1,0)="^9009065.05P^^"
 K DIC S DIC(0)="AEQML",DIC="^AGADLIST("_AGLIST_",1,",DA(1)=AGLIST,X=DFN K DD,DO D FILE^DICN
 G GNEW2
DEL S X="",X=$O(^AGADLIST(AGLIST,1,"B",DFN,X))
 G:+X'>0 GNEW2
 S DA=X,DIK="^AGADLIST("_AGLIST_",1,",DA(1)=AGLIST D ^DIK
 W !,*7,?5,"Patient Deleted"
 G GNEW2
PEXIST W ! S DIC="^AGADLIST(",DIC(0)="QAZEM",DIC("A")="Enter the NAME of the list to Print ",DIC("S")="I $P(^(0),U,5)=DUZ"
 D ^DIC G VAR:+Y<1 S AGLIST=+Y K DIC D NEWLST^AGADDR1
 I AGV("P4")<1 W !!,"Enter <RETURN> to Continue" D READ^AG G VAR
 G VAROLD^AGADDR1
END ;EP
 D ^%ZISC
END1 ;EP
 LOCK
 K AG,AGADRS1,AGADRS2,AGLIST,AGNAME,DA,DFN,DIC,DR,G,AGL,I,AGV,AG("LKDATA"),AG("LKPRINT"),AGV,R,AGV,X,Y D:$D(ZTQUEUED) KILL^%ZTLOAD
 Q