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

AMHRDSP.m

Go to the documentation of this file.
AMHRDSP ; IHS/CMI/LAB - display record in detail ;
 ;;4.0;IHS BEHAVIORAL HEALTH;**1,5**;JUN 02, 2010;Build 18
 ;
 ;CALLER passes AMHR as record ien
EN ;EP
 Q:'$G(AMHR)
 Q:'$D(^AMHREC(AMHR,0))
 D DSPLY
 D EOJ
 Q
 ;
DSPLY ;
 W:$D(IOF) @IOF
 NEW D0,DA,DIC,DIQ,DR,DL,DK,DX,S
 S AMHBRK=0 ;ACC
 S AMHVDSH="----------------------"
 W !?13,"********** CONFIDENTIAL PATIENT INFORMATION **********"
 S X="",$P(X,"~",80)="" W !!,X,!!,AMHVDSH,"     BH RECORD     ",AMHVDSH
 S DIC="^AMHREC(",DA=AMHR D EN^DIQ
DSPLY1 ;DISPLAY V FILE DATA
 S AMHVFLE=9002011 F AMHVL=0:0 S AMHVFLE=$O(^DIC(AMHVFLE)) Q:AMHVFLE>9002011.49!(AMHVFLE'=+AMHVFLE)!(AMHBRK)  D DSPLY2 Q:AMHBRK  ;ACC
 I 'AMHBRK S X="",$P(X,"~",80)="" W !!,X,!!
 Q
 ;
DSPLY2 S AMHVNM=$P(^DIC(AMHVFLE,0),U)
 S AMHVDG=^DIC(AMHVFLE,0,"GL"),AMHVIGR=AMHVDG_"""AD"",AMHR,AMHVDFN)"
 S AMHVDFN=""!(AMHBRK) F AMHVI=1:1 S AMHVDFN=$O(@AMHVIGR) Q:AMHVDFN=""  D DSPLY3 Q:AMHBRK  ;ACC
 Q
 ;
DSPLY3 ;
 I $Y>(IOSL-5) D
 .I '$D(ZTQUEUED),$E(IOST)="C" W !!,"Enter to continue, '^' to halt " R AMHX:DTIME S:'$T AMHBRK=1 S:AMHX="^" AMHBRK=1 K S
 .W:$D(IOF) @IOF
 .Q
 Q:AMHBRK
 I AMHVI<2 S X=20-$L(AMHVNM),Y=X\2,Z=X-Y W !,AMHVDSH," ",$J("",Z),AMHVNM,$J("",Y)," ",AMHVDSH
 S DIC=AMHVDG,DA=AMHVDFN,DIQ(0)="C" D EN^DIQ
 Q
 ;
EOJ ; EOJ CLEANUP
 I 'AMHBRK,$E(IOST)="C",'$D(ZTQUEUED) S DIR(0)="EO",DIR("A")="End of record display, press <ENTER> to continue" K DA D ^DIR K DIR
 K X,Y
 K AMHVDFN,AMHVDG,AMHVDSH,AMHVFLE,AMHVI,AMHVIGR,AMHVL,AMHVNM,AMHX,AMHBRK
 Q