BNIRDSG ; IHS/CMI/LAB - record display ;
;;1.0;BNI CPHD ACTIVITY DATASYSTEM;;DEC 20, 2006
;
EN(BNIRIEN,BNIARRY,BNIGUI) ;EP
I $G(BNIARRY)="" S BNIARRY="^TMP(""BNIVDSG"",$J)"
Q:'$D(BNIRIEN)
Q:'BNIRIEN
Q:'$D(^BNIREC(BNIRIEN,0))
S BNICTR=0
D BUILD
D XIT
Q
;
SET ;set array
S BNICTR=BNICTR+1
S @BNIARRY@(BNICTR,0)=BNISTR
S BNISTR=""
Q
BUILD ; build array
K BNIAR
D TERM^VALM0
I $G(BNIGUI) S (IOINHI,IOINORM)=""
S BNIVREC=^BNIREC(BNIRIEN,0)
S BNIH="Record IEN",BNIV=BNIRIEN D BUILD1
S BNISTR="" D SET
VISIT ;
S BNISTR="=============== "_IOINHI_"CPHAD ACTIVITY RECORD"_IOINORM_" ===============",X=(80-$L(BNISTR)\2) D SET ;$J("",X)_BNISTR D SET
D ENP^XBDIQ1(90510,BNIRIEN,".01:1299","BNIAR(","E")
S F=0 F S F=$O(BNIAR(F)) Q:F'=+F I BNIAR(F)]"" D
.S BNIH=$P(^DD(90510,F,0),U)
.S BNIV=BNIAR(F)
.D BUILD1
I $O(^BNIREC(BNIRIEN,14,0)) D
.S BNISTR="" D SET
.S BNIH=$P(^DD(90510,1400,0),U)
.S BNIV="" D BUILD1
.S F=0 F S F=$O(^BNIREC(BNIRIEN,14,F)) Q:F'=+F D
..S BNISTR=$G(^BNIREC(BNIRIEN,14,F,0)) D SET
S BNISTR="" D SET
;Q:'$P(BNIVREC,U,9)
NFT ;
S BNISTR="Record Edited by:" D SET
K BNIAR S Y=0 F S Y=$O(^BNIREC(BNIRIEN,15,Y)) Q:Y'=+Y D
.S %=$$FMTE^XLFDT($P(^BNIREC(BNIRIEN,15,Y,0),U))
.S J=$P(^BNIREC(BNIRIEN,15,Y,0),U,2),J=$P($G(^VA(200,+J,0)),U)
.S BNISTR=%_" "_J D SET
S BNISTR="" D SET
Q
BUILD1 ;
I $D(BNINARR) S BNISTR="",BNISTR=$$SETSTR^VALM1(BNIV,BNISTR,1,$L(BNIV)) D SET Q
S BNISTR=$E(BNIH,1,23)_":",BNISTR=$$SETSTR^VALM1(BNIV,BNISTR,26,$L(BNIV))
D SET
Q
I $L(BNISTR)>39 D SET
S BNIV=" "_BNIV_" ",X=BNIH_": "_BNIV
I $L(BNISTR),$L(X)>40 D SET
I $L(BNISTR) S BNISTR=$$SETSTR^VALM1(X,BNISTR,40,$L(X))
I '$L(BNISTR) S BNISTR=X
K BNIV,BNIH,X
Q
XIT ;
K BNIAR,BNIARRY,BNICTR,BNIH,BNISTR,BNIV,BNIVDFN,BNIVDG,BNIVFLE,BNIVI,BNIRIEN,BNIVIGR,BNIFL,BNIVNM,BNIVREC,BNIH,BNINARR
K DO,D0,DA,DI,DIC,DIQ,DR,F,X,Y,Z,F1
Q
BNIRDSG ; IHS/CMI/LAB - record display ;
+1 ;;1.0;BNI CPHD ACTIVITY DATASYSTEM;;DEC 20, 2006
+2 ;
EN(BNIRIEN,BNIARRY,BNIGUI) ;EP
+1 IF $GET(BNIARRY)=""
SET BNIARRY="^TMP(""BNIVDSG"",$J)"
+2 IF '$DATA(BNIRIEN)
QUIT
+3 IF 'BNIRIEN
QUIT
+4 IF '$DATA(^BNIREC(BNIRIEN,0))
QUIT
+5 SET BNICTR=0
+6 DO BUILD
+7 DO XIT
+8 QUIT
+9 ;
SET ;set array
+1 SET BNICTR=BNICTR+1
+2 SET @BNIARRY@(BNICTR,0)=BNISTR
+3 SET BNISTR=""
+4 QUIT
BUILD ; build array
+1 KILL BNIAR
+2 DO TERM^VALM0
+3 IF $GET(BNIGUI)
SET (IOINHI,IOINORM)=""
+4 SET BNIVREC=^BNIREC(BNIRIEN,0)
+5 SET BNIH="Record IEN"
SET BNIV=BNIRIEN
DO BUILD1
+6 SET BNISTR=""
DO SET
VISIT ;
+1 ;$J("",X)_BNISTR D SET
SET BNISTR="=============== "_IOINHI_"CPHAD ACTIVITY RECORD"_IOINORM_" ==============="
SET X=(80-$LENGTH(BNISTR)\2)
DO SET
+2 DO ENP^XBDIQ1(90510,BNIRIEN,".01:1299","BNIAR(","E")
+3 SET F=0
FOR
SET F=$ORDER(BNIAR(F))
IF F'=+F
QUIT
IF BNIAR(F)]""
Begin DoDot:1
+4 SET BNIH=$PIECE(^DD(90510,F,0),U)
+5 SET BNIV=BNIAR(F)
+6 DO BUILD1
End DoDot:1
+7 IF $ORDER(^BNIREC(BNIRIEN,14,0))
Begin DoDot:1
+8 SET BNISTR=""
DO SET
+9 SET BNIH=$PIECE(^DD(90510,1400,0),U)
+10 SET BNIV=""
DO BUILD1
+11 SET F=0
FOR
SET F=$ORDER(^BNIREC(BNIRIEN,14,F))
IF F'=+F
QUIT
Begin DoDot:2
+12 SET BNISTR=$GET(^BNIREC(BNIRIEN,14,F,0))
DO SET
End DoDot:2
End DoDot:1
+13 SET BNISTR=""
DO SET
+14 ;Q:'$P(BNIVREC,U,9)
NFT ;
+1 SET BNISTR="Record Edited by:"
DO SET
+2 KILL BNIAR
SET Y=0
FOR
SET Y=$ORDER(^BNIREC(BNIRIEN,15,Y))
IF Y'=+Y
QUIT
Begin DoDot:1
+3 SET %=$$FMTE^XLFDT($PIECE(^BNIREC(BNIRIEN,15,Y,0),U))
+4 SET J=$PIECE(^BNIREC(BNIRIEN,15,Y,0),U,2)
SET J=$PIECE($GET(^VA(200,+J,0)),U)
+5 SET BNISTR=%_" "_J
DO SET
End DoDot:1
+6 SET BNISTR=""
DO SET
+7 QUIT
BUILD1 ;
+1 IF $DATA(BNINARR)
SET BNISTR=""
SET BNISTR=$$SETSTR^VALM1(BNIV,BNISTR,1,$LENGTH(BNIV))
DO SET
QUIT
+2 SET BNISTR=$EXTRACT(BNIH,1,23)_":"
SET BNISTR=$$SETSTR^VALM1(BNIV,BNISTR,26,$LENGTH(BNIV))
+3 DO SET
+4 QUIT
+5 IF $LENGTH(BNISTR)>39
DO SET
+6 SET BNIV=" "_BNIV_" "
SET X=BNIH_": "_BNIV
+7 IF $LENGTH(BNISTR)
IF $LENGTH(X)>40
DO SET
+8 IF $LENGTH(BNISTR)
SET BNISTR=$$SETSTR^VALM1(X,BNISTR,40,$LENGTH(X))
+9 IF '$LENGTH(BNISTR)
SET BNISTR=X
+10 KILL BNIV,BNIH,X
+11 QUIT
XIT ;
+1 KILL BNIAR,BNIARRY,BNICTR,BNIH,BNISTR,BNIV,BNIVDFN,BNIVDG,BNIVFLE,BNIVI,BNIRIEN,BNIVIGR,BNIFL,BNIVNM,BNIVREC,BNIH,BNINARR
+2 KILL DO,D0,DA,DI,DIC,DIQ,DR,F,X,Y,Z,F1
+3 QUIT