BDMDIC ; IHS/CMI/LAB - FILEMAN INTERFACE UTILITY ;
;;2.0;DIABETES MANAGEMENT SYSTEM;**2**;JUN 14, 2007
;;UTILITY ROUTINE USED TO MANAGE ALL INTERFACE TO FILEMAN
;;WITH FEW EXCEPTIONS, THIS IS THE ONLY PLACE IN ARMS FROM WHICH
;;FILEMAN ENTRY POINTS ARE CALLED
DIC ;EP;
Q:$D(BDMOUT)
K DTOUT,DUOUT,BDMQUIT,BDMOUT
D ^DIC
S:$D(DUOUT) BDMQUIT=""
S:$D(DTOUT)!(X="^^") (BDMQUIT,BDMOUT)=""
K DIC,DA,DD,DR,DINUM,D,DLAYGO
Q
MIX ;EP;
Q:$D(BDMOUT)
K DTOUT,DUOUT,BDMQUIT,BDMOUT
D MIX^DIC1
S:$D(DTOUT)!$D(DUOUT)!(X="^^") (BDMQUIT,BDMOUT)=""
K DIC,DA,DD,DR,DINUM,D,DLAYGO
Q
IX ;EP;
Q:$D(BDMOUT)
K DTOUT,DUOUT,BDMQUIT,BDMOUT
D IX^DIC
S:$D(DTOUT)!$D(DUOUT)!(X="^^") (BDMQUIT,BDMOUT)=""
K DIC,DA,DD,DR,DINUM,D,DLAYGO
Q
DIE ;EP;
Q:$D(BDMOUT)
Q:'DA
K DTOUT,DUOUT,BDMQUIT,BDMOUT
L +@(DIE_DA_")"):4 I '$T S BDMQUIT="" Q:'$D(IOST)#2 W:$E(IOST,1,2)="C-" !!,"Entry being edited by another user. Please try Later.",! H 3 Q
S BDMDIDA=DA
D ^DIE
L -@(DIE_BDMDIDA_")"):0
I $D(DTOUT)!$D(DUOUT) S (BDMQUIT,BDMOUT)=""
K DIE,DA,DR,BDMDIDA
Q
DDS ;EP;FOR SCREENMAN CALLS
S DDSFILE=DIE
D ^DDS
K DDSFILE,BDMSCRN
Q
FILE ;EP;
K DD,DO,DTOUT,DUOUT,BDMQUIT,BDMOUT
D FILE^DICN
S:$D(DTOUT)!$D(DUOUT)!(X="^^") (BDMQUIT,BDMOUT)=""
K DIC,DA,DD,DR,DINUM,DLAYGO
Q
DIR ;EP;
I $D(BDMOUT) K DIR S Y="" Q
K DTOUT,DUOUT,BDMQUIT,BDMOUT
D ^DIR
S BDMY=Y
S:$D(DIRUT)!$D(DIROUT)!$D(DUOUT) BDMQUIT=""
S:X="^^"!$D(DTOUT) (BDMQUIT,BDMOUT)=""
K DIR,DIRUT,DIROUT,DUOUT,DTOUT
Q
DIK ;EP;
K DTOUT,DUOUT,BDMQUIT,BDMOUT
D ^DIK
K DIK
Q
IX1 ;EP;
Q:$D(BDMOUT)
K DTOUT,DUOUT,BDMQUIT,BDMOUT
D IX1^DIK
K DIK,DA
Q
DIQ1 ;EP;
D EN^DIQ1
K DIC,DA,DR,DIQ
Q
WP ;EP;TO BROWSE WORD PROCESSING FIELD
Q:'$D(BDMILE)#2!'$D(BDMIEN)#2!'$D(BDMIELD)
K BDMSCRN
D WP^DDBR(BDMILE,BDMIEN,BDMIELD,"N",$G(BDMTTLE))
Q
BDMDIC ; IHS/CMI/LAB - FILEMAN INTERFACE UTILITY ;
+1 ;;2.0;DIABETES MANAGEMENT SYSTEM;**2**;JUN 14, 2007
+2 ;;UTILITY ROUTINE USED TO MANAGE ALL INTERFACE TO FILEMAN
+3 ;;WITH FEW EXCEPTIONS, THIS IS THE ONLY PLACE IN ARMS FROM WHICH
+4 ;;FILEMAN ENTRY POINTS ARE CALLED
DIC ;EP;
+1 IF $DATA(BDMOUT)
QUIT
+2 KILL DTOUT,DUOUT,BDMQUIT,BDMOUT
+3 DO ^DIC
+4 IF $DATA(DUOUT)
SET BDMQUIT=""
+5 IF $DATA(DTOUT)!(X="^^")
SET (BDMQUIT,BDMOUT)=""
+6 KILL DIC,DA,DD,DR,DINUM,D,DLAYGO
+7 QUIT
MIX ;EP;
+1 IF $DATA(BDMOUT)
QUIT
+2 KILL DTOUT,DUOUT,BDMQUIT,BDMOUT
+3 DO MIX^DIC1
+4 IF $DATA(DTOUT)!$DATA(DUOUT)!(X="^^")
SET (BDMQUIT,BDMOUT)=""
+5 KILL DIC,DA,DD,DR,DINUM,D,DLAYGO
+6 QUIT
IX ;EP;
+1 IF $DATA(BDMOUT)
QUIT
+2 KILL DTOUT,DUOUT,BDMQUIT,BDMOUT
+3 DO IX^DIC
+4 IF $DATA(DTOUT)!$DATA(DUOUT)!(X="^^")
SET (BDMQUIT,BDMOUT)=""
+5 KILL DIC,DA,DD,DR,DINUM,D,DLAYGO
+6 QUIT
DIE ;EP;
+1 IF $DATA(BDMOUT)
QUIT
+2 IF 'DA
QUIT
+3 KILL DTOUT,DUOUT,BDMQUIT,BDMOUT
+4 LOCK +@(DIE_DA_")"):4
IF '$TEST
SET BDMQUIT=""
IF '$DATA(IOST)#2
QUIT
IF $EXTRACT(IOST,1,2)="C-"
WRITE !!,"Entry being edited by another user. Please try Later.",!
HANG 3
QUIT
+5 SET BDMDIDA=DA
+6 DO ^DIE
+7 LOCK -@(DIE_BDMDIDA_")"):0
+8 IF $DATA(DTOUT)!$DATA(DUOUT)
SET (BDMQUIT,BDMOUT)=""
+9 KILL DIE,DA,DR,BDMDIDA
+10 QUIT
DDS ;EP;FOR SCREENMAN CALLS
+1 SET DDSFILE=DIE
+2 DO ^DDS
+3 KILL DDSFILE,BDMSCRN
+4 QUIT
FILE ;EP;
+1 KILL DD,DO,DTOUT,DUOUT,BDMQUIT,BDMOUT
+2 DO FILE^DICN
+3 IF $DATA(DTOUT)!$DATA(DUOUT)!(X="^^")
SET (BDMQUIT,BDMOUT)=""
+4 KILL DIC,DA,DD,DR,DINUM,DLAYGO
+5 QUIT
DIR ;EP;
+1 IF $DATA(BDMOUT)
KILL DIR
SET Y=""
QUIT
+2 KILL DTOUT,DUOUT,BDMQUIT,BDMOUT
+3 DO ^DIR
+4 SET BDMY=Y
+5 IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DUOUT)
SET BDMQUIT=""
+6 IF X="^^"!$DATA(DTOUT)
SET (BDMQUIT,BDMOUT)=""
+7 KILL DIR,DIRUT,DIROUT,DUOUT,DTOUT
+8 QUIT
DIK ;EP;
+1 KILL DTOUT,DUOUT,BDMQUIT,BDMOUT
+2 DO ^DIK
+3 KILL DIK
+4 QUIT
IX1 ;EP;
+1 IF $DATA(BDMOUT)
QUIT
+2 KILL DTOUT,DUOUT,BDMQUIT,BDMOUT
+3 DO IX1^DIK
+4 KILL DIK,DA
+5 QUIT
DIQ1 ;EP;
+1 DO EN^DIQ1
+2 KILL DIC,DA,DR,DIQ
+3 QUIT
WP ;EP;TO BROWSE WORD PROCESSING FIELD
+1 IF '$DATA(BDMILE)#2!'$DATA(BDMIEN)#2!'$DATA(BDMIELD)
QUIT
+2 KILL BDMSCRN
+3 DO WP^DDBR(BDMILE,BDMIEN,BDMIELD,"N",$GET(BDMTTLE))
+4 QUIT