PXBDPOV ;ISL/JVS - DISPLAY POV (DIAGNOSIS) ;7/24/96 08:41
;;1.0;PCE PATIENT CARE ENCOUNTER;;Aug 12, 1996
;
;
EN0 ;---Main entry point
;
I '$D(IOCUU) D TERM^PXBCC
;
HEAD ;--HEADER ON LIST
S HEAD="- - E N C O U N T E R D I A G N O S I S (ICD9 CODES) - -"
W !,IOCUU,?(IOM-$L(HEAD))\2,IOINHI,HEAD
W IOINLOW,IOELEOL K HEAD
;
I $D(CLINIC) D POV^PXBUTL2(CLINIC)
I PXBCNT<11 D DPOV1
I PXBCNT>10&($D(PXBNPOV)) D DPOV4("SAME")
I PXBCNT>10&('$D(PXBNPOV)) D DPOV4("BEGIN")
Q
;
;
DPOV1 ;--Display the POV Data
N ENTRY
D UNDON^PXBCC
W !,"No.",?5,"ICD",?13,"DESCRIPTION",?64,"PROBLEM LIST"
W IOEDEOP
D UNDOFF^PXBCC
;
;
S J=0 F S J=$O(PXBSAM(J)) Q:J="" D
.S ENTRY=$G(PXBSAM(J)) I $D(PXBNPOV($P(ENTRY,"^",1))) S $P(ENTRY,"^",1)=$P(ENTRY,"^",1)_"*"
.W !,J,?4,$J($P($P(ENTRY,"^",1),".",1),4),".",$P($P(ENTRY,"^",1),".",2),?13,$E($P(ENTRY,"^",3),1,30),?44 W:$P(ENTRY,"^",4)["PRI" $P(ENTRY,"^",4)
.I $P(ENTRY,"^",4)["PRI" W ?71,$P(ENTRY,"^",5)
.E W ?74,$P(ENTRY,"^",5)
.D DIS
;---Write no entries if none exsist
I '$D(PXBSAM) D NONE^PXBUTL(3)
;-------------UNCOMMENT TO LIST CLINIC POV TO SCREEN-----
;D DEF^PXBDPOV("A")
;----------------------------------------------------
D DEF^PXBDPOV("D") I '$D(FIRST) K PXBDPOV
Q
;
;
;
DPOV4(SIGN) ;--Display the PROVIDER Data
;
;SIGN=
; '+' add 10 to the starting point in ^TMP("PXBDPOV",$J)
; '-' subtract 10 from the starting point but not less that 0
; 'BEGIN' start at the beginning
; 'SAME' start stays where it's at
; '3'--any number set start to that number
;
N PXBSTART
I SIGN="BEGIN" S ^TMP("PXBDPOV",$J,"START")=0,PXBSTART=0
I SIGN="SAME" S PXBSTART=^TMP("PXBDPOV",$J,"START")
I SIGN="+" S PXBSTART=($G(^TMP("PXBDPOV",$J,"START"))+(10)) S:PXBSTART'<PXBCNT PXBSTART=(PXBCNT-(10)) S ^TMP("PXBDPOV",$J,"START")=PXBSTART
I SIGN="-" S PXBSTART=$G(^TMP("PXBDPOV",$J,"START"))-10,^TMP("PXBDPOV",$J,"START")=PXBSTART I PXBSTART<0 S PXBSTART=0 S ^TMP("PXBDPOV",$J,"START")=0
I +SIGN>0&(SIGN#10) S PXBSTART=$P((SIGN/10),".")*10 S:PXBSTART<10 PXBSTART=0 Q:^TMP("PXBDPOV",$J,"START")=PXBSTART S ^TMP("PXBDPOV",$J,"START")=PXBSTART
I +SIGN>0&'(SIGN#10) S PXBSTART=(($P((SIGN/10),".")*10)-10) S:PXBSTART<10 PXBSTART=0 Q:^TMP("PXBDPOV",$J,"START")=PXBSTART S ^TMP("PXBDPOV",$J,"START")=PXBSTART
;
;
I SIGN'="BEGIN" D LOC^PXBCC(3,0) W IOEDEOP
;
HEAD4 ;--HEADER ON LIST
S HEAD="- - E N C O U N T E R D I A G N O S I S (ICD9 CODES) - -"
W !,IOCUU,?(IOM-$L(HEAD))\2,IOINHI,HEAD ;----F W $C(32) Q:$X=(IOM-(1))
W IOINLOW,IOELEOL K HEAD
;
;
N ENTRY,J
D UNDON^PXBCC
W !,"No.",?5,"ICD",?13,"DESCRIPTION",?64,"PROBLEM LIST"
W IOEDEOP
D UNDOFF^PXBCC
;
;
S J=PXBSTART F S J=$O(PXBSAM(J)) Q:J="" Q:J=(PXBSTART+(11)) D
.S ENTRY=$G(PXBSAM(J)) I $D(PXBNCPT($P(ENTRY,"^",1))) S $P(ENTRY,"^",1)=$P(ENTRY,"^",1)_"*"
.W !,J,?4,$J($P($P(ENTRY,"^",1),".",1),4),".",$P($P(ENTRY,"^",1),".",2),?13,$E($P(ENTRY,"^",3),1,30),?44 W:$P(ENTRY,"^",4)["PRI" IOINHI,$P(ENTRY,"^",4),IOINLOW
.I $P(ENTRY,"^",4)["PRI" W ?81,$P(ENTRY,"^",5)
.E W ?74,$P(ENTRY,"^",5)
.D DIS
I SIGN'="BEGIN" W !!
;------------UNCOMMENT TO LIST PORVIDERS TO SCREEN--------
;D DEF^PXBDPOV("A")
;---------------------------------------------------------
D DEF^PXBDPOV("D") I '$D(FIRST) K PXBDPOV
Q
;
;
DEF(CODE) ;---PROCESS DEFAULT LIST OF DIAGNOSIS
; I CODE="D" JUST SEND DEFAULT
; I CODE="A" JUST SEND THE ARRAY OF PROVIDERS
D POV^PXBUTL2(CLINIC,3)
N POV,X,CLNAME,STOP,LIST,NAME,NUMBER
I '$D(IORC) D TERM^PXBCC
I '$D(CODE) W !,"SEND PARAMETER = TO 'D'efault OR 'A'rray" Q
I $G(CODE)="D",$D(PXBPMT("DEF")) S NAME=$O(PXBPMT("DEF",0)) S PXBDPOV=NAME
I $G(CODE)="A" K PXBPMT("DEF") D
.S (POV,STOP)="" F S POV=$O(PXBPMT("POV",POV)) Q:POV="" Q:STOP=0 D
..I '$D(PXBKY(POV)) S STOP=0
.I STOP="" Q
.S CLNAME=$P(^SC(CLINIC,0),"^",1)
.S X="Other ICD CODES associated with "_CLNAME_" clinic."
.W:PXBCNT<7 ! W !,?(IOM-$L(X))/2,IOINHI,X,IOINLOW K X
.S (POV,LIST)="" F S POV=$O(PXBPMT("POV",POV)) Q:POV="" D
..I $D(PXBKY(+POV)) Q
..S LIST=LIST_POV_" " I $L(LIST," ")>2 W !,?(IOM-$L(LIST))/2,LIST S LIST=""
I $G(LIST)]"" W !,?(IOM-$L(LIST))/2,LIST
Q
;
DIS ;----DISPLAY
Q
I $D(PXBPMT("POV",$P($P(ENTRY,"^",1),"*"))) W:PXBCNT>11 IORVON W ?37," --Clinic Associated--",IORVOFF
Q
;
PXBDPOV ;ISL/JVS - DISPLAY POV (DIAGNOSIS) ;7/24/96 08:41
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;;Aug 12, 1996
+2 ;
+3 ;
EN0 ;---Main entry point
+1 ;
+2 IF '$DATA(IOCUU)
DO TERM^PXBCC
+3 ;
HEAD ;--HEADER ON LIST
+1 SET HEAD="- - E N C O U N T E R D I A G N O S I S (ICD9 CODES) - -"
+2 WRITE !,IOCUU,?(IOM-$LENGTH(HEAD))\2,IOINHI,HEAD
+3 WRITE IOINLOW,IOELEOL
KILL HEAD
+4 ;
+5 IF $DATA(CLINIC)
DO POV^PXBUTL2(CLINIC)
+6 IF PXBCNT<11
DO DPOV1
+7 IF PXBCNT>10&($DATA(PXBNPOV))
DO DPOV4("SAME")
+8 IF PXBCNT>10&('$DATA(PXBNPOV))
DO DPOV4("BEGIN")
+9 QUIT
+10 ;
+11 ;
DPOV1 ;--Display the POV Data
+1 NEW ENTRY
+2 DO UNDON^PXBCC
+3 WRITE !,"No.",?5,"ICD",?13,"DESCRIPTION",?64,"PROBLEM LIST"
+4 WRITE IOEDEOP
+5 DO UNDOFF^PXBCC
+6 ;
+7 ;
+8 SET J=0
FOR
SET J=$ORDER(PXBSAM(J))
IF J=""
QUIT
Begin DoDot:1
+9 SET ENTRY=$GET(PXBSAM(J))
IF $DATA(PXBNPOV($PIECE(ENTRY,"^",1)))
SET $PIECE(ENTRY,"^",1)=$PIECE(ENTRY,"^",1)_"*"
+10 WRITE !,J,?4,$JUSTIFY($PIECE($PIECE(ENTRY,"^",1),".",1),4),".",$PIECE($PIECE(ENTRY,"^",1),".",2),?13,$EXTRACT($PIECE(ENTRY,"^",3),1,30),?44
IF $PIECE(ENTRY,"^",4)["PRI"
WRITE $PIECE(ENTRY,"^",4)
+11 IF $PIECE(ENTRY,"^",4)["PRI"
WRITE ?71,$PIECE(ENTRY,"^",5)
+12 IF '$TEST
WRITE ?74,$PIECE(ENTRY,"^",5)
+13 DO DIS
End DoDot:1
+14 ;---Write no entries if none exsist
+15 IF '$DATA(PXBSAM)
DO NONE^PXBUTL(3)
+16 ;-------------UNCOMMENT TO LIST CLINIC POV TO SCREEN-----
+17 ;D DEF^PXBDPOV("A")
+18 ;----------------------------------------------------
+19 DO DEF^PXBDPOV("D")
IF '$DATA(FIRST)
KILL PXBDPOV
+20 QUIT
+21 ;
+22 ;
+23 ;
DPOV4(SIGN) ;--Display the PROVIDER Data
+1 ;
+2 ;SIGN=
+3 ; '+' add 10 to the starting point in ^TMP("PXBDPOV",$J)
+4 ; '-' subtract 10 from the starting point but not less that 0
+5 ; 'BEGIN' start at the beginning
+6 ; 'SAME' start stays where it's at
+7 ; '3'--any number set start to that number
+8 ;
+9 NEW PXBSTART
+10 IF SIGN="BEGIN"
SET ^TMP("PXBDPOV",$JOB,"START")=0
SET PXBSTART=0
+11 IF SIGN="SAME"
SET PXBSTART=^TMP("PXBDPOV",$JOB,"START")
+12 IF SIGN="+"
SET PXBSTART=($GET(^TMP("PXBDPOV",$JOB,"START"))+(10))
IF PXBSTART'<PXBCNT
SET PXBSTART=(PXBCNT-(10))
SET ^TMP("PXBDPOV",$JOB,"START")=PXBSTART
+13 IF SIGN="-"
SET PXBSTART=$GET(^TMP("PXBDPOV",$JOB,"START"))-10
SET ^TMP("PXBDPOV",$JOB,"START")=PXBSTART
IF PXBSTART<0
SET PXBSTART=0
SET ^TMP("PXBDPOV",$JOB,"START")=0
+14 IF +SIGN>0&(SIGN#10)
SET PXBSTART=$PIECE((SIGN/10),".")*10
IF PXBSTART<10
SET PXBSTART=0
IF ^TMP("PXBDPOV",$JOB,"START")=PXBSTART
QUIT
SET ^TMP("PXBDPOV",$JOB,"START")=PXBSTART
+15 IF +SIGN>0&'(SIGN#10)
SET PXBSTART=(($PIECE((SIGN/10),".")*10)-10)
IF PXBSTART<10
SET PXBSTART=0
IF ^TMP("PXBDPOV",$JOB,"START")=PXBSTART
QUIT
SET ^TMP("PXBDPOV",$JOB,"START")=PXBSTART
+16 ;
+17 ;
+18 IF SIGN'="BEGIN"
DO LOC^PXBCC(3,0)
WRITE IOEDEOP
+19 ;
HEAD4 ;--HEADER ON LIST
+1 SET HEAD="- - E N C O U N T E R D I A G N O S I S (ICD9 CODES) - -"
+2 ;----F W $C(32) Q:$X=(IOM-(1))
WRITE !,IOCUU,?(IOM-$LENGTH(HEAD))\2,IOINHI,HEAD
+3 WRITE IOINLOW,IOELEOL
KILL HEAD
+4 ;
+5 ;
+6 NEW ENTRY,J
+7 DO UNDON^PXBCC
+8 WRITE !,"No.",?5,"ICD",?13,"DESCRIPTION",?64,"PROBLEM LIST"
+9 WRITE IOEDEOP
+10 DO UNDOFF^PXBCC
+11 ;
+12 ;
+13 SET J=PXBSTART
FOR
SET J=$ORDER(PXBSAM(J))
IF J=""
QUIT
IF J=(PXBSTART+(11))
QUIT
Begin DoDot:1
+14 SET ENTRY=$GET(PXBSAM(J))
IF $DATA(PXBNCPT($PIECE(ENTRY,"^",1)))
SET $PIECE(ENTRY,"^",1)=$PIECE(ENTRY,"^",1)_"*"
+15 WRITE !,J,?4,$JUSTIFY($PIECE($PIECE(ENTRY,"^",1),".",1),4),".",$PIECE($PIECE(ENTRY,"^",1),".",2),?13,$EXTRACT($PIECE(ENTRY,"^",3),1,30),?44
IF $PIECE(ENTRY,"^",4)["PRI"
WRITE IOINHI,$PIECE(ENTRY,"^",4),IOINLOW
+16 IF $PIECE(ENTRY,"^",4)["PRI"
WRITE ?81,$PIECE(ENTRY,"^",5)
+17 IF '$TEST
WRITE ?74,$PIECE(ENTRY,"^",5)
+18 DO DIS
End DoDot:1
+19 IF SIGN'="BEGIN"
WRITE !!
+20 ;------------UNCOMMENT TO LIST PORVIDERS TO SCREEN--------
+21 ;D DEF^PXBDPOV("A")
+22 ;---------------------------------------------------------
+23 DO DEF^PXBDPOV("D")
IF '$DATA(FIRST)
KILL PXBDPOV
+24 QUIT
+25 ;
+26 ;
DEF(CODE) ;---PROCESS DEFAULT LIST OF DIAGNOSIS
+1 ; I CODE="D" JUST SEND DEFAULT
+2 ; I CODE="A" JUST SEND THE ARRAY OF PROVIDERS
+3 DO POV^PXBUTL2(CLINIC,3)
+4 NEW POV,X,CLNAME,STOP,LIST,NAME,NUMBER
+5 IF '$DATA(IORC)
DO TERM^PXBCC
+6 IF '$DATA(CODE)
WRITE !,"SEND PARAMETER = TO 'D'efault OR 'A'rray"
QUIT
+7 IF $GET(CODE)="D"
IF $DATA(PXBPMT("DEF"))
SET NAME=$ORDER(PXBPMT("DEF",0))
SET PXBDPOV=NAME
+8 IF $GET(CODE)="A"
KILL PXBPMT("DEF")
Begin DoDot:1
+9 SET (POV,STOP)=""
FOR
SET POV=$ORDER(PXBPMT("POV",POV))
IF POV=""
QUIT
IF STOP=0
QUIT
Begin DoDot:2
+10 IF '$DATA(PXBKY(POV))
SET STOP=0
End DoDot:2
+11 IF STOP=""
QUIT
+12 SET CLNAME=$PIECE(^SC(CLINIC,0),"^",1)
+13 SET X="Other ICD CODES associated with "_CLNAME_" clinic."
+14 IF PXBCNT<7
WRITE !
WRITE !,?(IOM-$LENGTH(X))/2,IOINHI,X,IOINLOW
KILL X
+15 SET (POV,LIST)=""
FOR
SET POV=$ORDER(PXBPMT("POV",POV))
IF POV=""
QUIT
Begin DoDot:2
+16 IF $DATA(PXBKY(+POV))
QUIT
+17 SET LIST=LIST_POV_" "
IF $LENGTH(LIST," ")>2
WRITE !,?(IOM-$LENGTH(LIST))/2,LIST
SET LIST=""
End DoDot:2
End DoDot:1
+18 IF $GET(LIST)]""
WRITE !,?(IOM-$LENGTH(LIST))/2,LIST
+19 QUIT
+20 ;
DIS ;----DISPLAY
+1 QUIT
+2 IF $DATA(PXBPMT("POV",$PIECE($PIECE(ENTRY,"^",1),"*")))
IF PXBCNT>11
WRITE IORVON
WRITE ?37," --Clinic Associated--",IORVOFF
+3 QUIT
+4 ;