WVBRPCD1 ;HCIOFO/FT,JR IHS/ANMC/MWR - BROWSE PROCEDURES; ;8/10/98 16:37
;;1.0;WOMEN'S HEALTH;;Sep 30, 1998
;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
;; DISPLAY CODE FOR BROWSING PROCEDURES. CALLED BY BRBRPCD.
;
DISPLAY(WVTITLE,WVHEADER,WVCODE) ;EP
;---> WVCONF=DISPLAY "CONFIDENTIAL PT INFO" BANNER.
;---> WVTITLE=TITLE AT TOP OF DISPLAY HEADER.
;---> WVHEADER=HEADER CALL TO ^WVUTL7
;---> WVCODE=CODE TO EXECUTE AS 3RD PIECE OF DIR(0) (AFTER DIR READ).
;---> WVSUBH=CODE TO EXECUTE FOR SUBHEADER (COLUMN TITLES).
;---> WVCRT=1 IF OUTPUT IS TO SCREEN (ALLOWS SELECTIONS TO EDIT).
;---> WVTAB=6 IF OUTPUT IS TO SCREEN, =3 IF OUTPUT IS TO PRINTER.
;---> WVPRMT(1,Q)=PROMPTS FOR DIR.
;
U IO
S WVCONF=1,WVHEADER=WVHEADER_"^WVUTL7"
D CENTERT^WVUTL5(.WVTITLE)
S WVSUBH="SUBHEAD^WVBRPCD1"
S (WVPOP,N,Z)=0
D TOPHEAD^WVUTL7
S WVTAB=$S(WVCRT:5,1:3)
;
NOMATCH ;EP
;---> QUIT IF NO RECORDS MATCH.
I '$D(^TMP("WV",$J,1)) D Q
.D @(WVHEADER)
.K WVPRMT,WVPRMT1,WVPRMTQ,DIR
.W !!?5,"No records match the selected criteria.",!
.I WVCRT&('$D(IO("S"))) D DIRZ^WVUTL3 W @IOF
.D ^%ZISC S WVPOP=1
;
DISPLAY1 ;EP
;---> IF A PROCEDURE IS EDITED ON THE LAST PAGE, GOTO HERE
;---> FROM LINELABEL "END" BELOW.
D @(WVHEADER)
F S N=$O(^TMP("WV",$J,2,N)) Q:'N!(WVPOP) D
.I $Y+6>IOSL D:WVCRT DIRZ^WVUTL3 Q:WVPOP D
..S WVPAGE=WVPAGE+1
..D @(WVHEADER) S Z=0
.S Y=^TMP("WV",$J,2,N),M=N
.W !
.;---> DON'T WRITE SSN# AND NAME IF IT MATCHES THE PREVIOUS RECORD.
.;---> DON'T WRITE BROWSE SELECTION#'S IF IO IS NOT A CRT (BRCRT).
.I $P(Y,U)'=Z D
..W ! W:WVCRT $J(N,3),")" ;BROWSE SELECTION#
..W ?WVTAB,$P(Y,U) ;SSN#
..W ?WVTAB+10,$E($P(Y,U,2),1,16)," " ;NAME
..W $$REPEAT^XLFSTR(".",16-$L($P(Y,U,2))) ;CONNECTING DOTS
..W:'WVCRT "..." ;ADD DOTS IF NOT A CRT
.I $P(Y,U)=Z D ;IF NEW SSN#...
..W:WVCRT $J(N,3),")" ;BROWSE SELECTION#
..W ?WVTAB,". . . . . . . . . . . . . ." ;CONNECTING DOTS
.S Z=$P(Y,U) ;STORE AS PREVIOUS SSN#
.;
.W ?34,$$SLDT2^WVUTL5($P(Y,U,3)) ;DATE OF PROCEDURE
.W ?44,$P(Y,U,4) ;ACCESSION#
.W ?57,$S($P(Y,U,7)="D":"*",1:" ") ;STATUS (* IF DELINQ)
.W ?58,$P(Y,U,7) ;STATUS
.W ?62,$E($P(Y,U,5),1,14)_" ("_$P(Y,U,6)_")" ;RESULTS/DIAGNOSIS (PRIORITY)
;
END ;EP
;---> IF A PROCEDURE HAS BEEN EDITED, SET N=N-5 AND START (GOTO)
;---> DISPLAY1 OVER AGAIN FROM 5 RECORDS PREVIOUS.
I WVCRT&('$D(IO("S")))&('WVPOP) D DIRZ^WVUTL3 I N S N=N-1 G NOMATCH
D ^%ZISC
K N,Z
Q
;
SUBHEAD ;EP
;---> SUB HEADER FOR PROCEDURE BROWSE OUTPUT.
W !?WVTAB,$$PNLB^WVUTL5()
W ?WVTAB+12,"PATIENT",?34,"DATE",?44,"ACC#"
W ?57,"STA",?62,"RESULTS/DIAGNOSIS"
W !?62,"(PRIORITY)",!
W $$REPEAT^XLFSTR("-",80)
Q
;
EDIT ;EP
;---> FROM BROWSE, WVPOP IN TO EDIT A SINGLE PROCEDURE.
D SETVARS^WVUTL5
S X=+X,DA=$P(^TMP("WV",$J,2,X),U,8)
S WVN=X N X
D EDIT2^WVPROC1(DA,.WVPOP)
;---> BACK UP 5 RECORDS AFTER EDIT.
S N=$S(WVN<6:1,1:WVN-5),Z=0 K WVN
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HWVBRPCD1 3202 printed Dec 13, 2024@02:46:49 Page 2
WVBRPCD1 ;HCIOFO/FT,JR IHS/ANMC/MWR - BROWSE PROCEDURES; ;8/10/98 16:37
+1 ;;1.0;WOMEN'S HEALTH;;Sep 30, 1998
+2 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
+3 ;; DISPLAY CODE FOR BROWSING PROCEDURES. CALLED BY BRBRPCD.
+4 ;
DISPLAY(WVTITLE,WVHEADER,WVCODE) ;EP
+1 ;---> WVCONF=DISPLAY "CONFIDENTIAL PT INFO" BANNER.
+2 ;---> WVTITLE=TITLE AT TOP OF DISPLAY HEADER.
+3 ;---> WVHEADER=HEADER CALL TO ^WVUTL7
+4 ;---> WVCODE=CODE TO EXECUTE AS 3RD PIECE OF DIR(0) (AFTER DIR READ).
+5 ;---> WVSUBH=CODE TO EXECUTE FOR SUBHEADER (COLUMN TITLES).
+6 ;---> WVCRT=1 IF OUTPUT IS TO SCREEN (ALLOWS SELECTIONS TO EDIT).
+7 ;---> WVTAB=6 IF OUTPUT IS TO SCREEN, =3 IF OUTPUT IS TO PRINTER.
+8 ;---> WVPRMT(1,Q)=PROMPTS FOR DIR.
+9 ;
+10 USE IO
+11 SET WVCONF=1
SET WVHEADER=WVHEADER_"^WVUTL7"
+12 DO CENTERT^WVUTL5(.WVTITLE)
+13 SET WVSUBH="SUBHEAD^WVBRPCD1"
+14 SET (WVPOP,N,Z)=0
+15 DO TOPHEAD^WVUTL7
+16 SET WVTAB=$SELECT(WVCRT:5,1:3)
+17 ;
NOMATCH ;EP
+1 ;---> QUIT IF NO RECORDS MATCH.
+2 IF '$DATA(^TMP("WV",$JOB,1))
Begin DoDot:1
+3 DO @(WVHEADER)
+4 KILL WVPRMT,WVPRMT1,WVPRMTQ,DIR
+5 WRITE !!?5,"No records match the selected criteria.",!
+6 IF WVCRT&('$DATA(IO("S")))
DO DIRZ^WVUTL3
WRITE @IOF
+7 DO ^%ZISC
SET WVPOP=1
End DoDot:1
QUIT
+8 ;
DISPLAY1 ;EP
+1 ;---> IF A PROCEDURE IS EDITED ON THE LAST PAGE, GOTO HERE
+2 ;---> FROM LINELABEL "END" BELOW.
+3 DO @(WVHEADER)
+4 FOR
SET N=$ORDER(^TMP("WV",$JOB,2,N))
if 'N!(WVPOP)
QUIT
Begin DoDot:1
+5 IF $Y+6>IOSL
if WVCRT
DO DIRZ^WVUTL3
if WVPOP
QUIT
Begin DoDot:2
+6 SET WVPAGE=WVPAGE+1
+7 DO @(WVHEADER)
SET Z=0
End DoDot:2
+8 SET Y=^TMP("WV",$JOB,2,N)
SET M=N
+9 WRITE !
+10 ;---> DON'T WRITE SSN# AND NAME IF IT MATCHES THE PREVIOUS RECORD.
+11 ;---> DON'T WRITE BROWSE SELECTION#'S IF IO IS NOT A CRT (BRCRT).
+12 IF $PIECE(Y,U)'=Z
Begin DoDot:2
+13 ;BROWSE SELECTION#
WRITE !
if WVCRT
WRITE $JUSTIFY(N,3),")"
+14 ;SSN#
WRITE ?WVTAB,$PIECE(Y,U)
+15 ;NAME
WRITE ?WVTAB+10,$EXTRACT($PIECE(Y,U,2),1,16)," "
+16 ;CONNECTING DOTS
WRITE $$REPEAT^XLFSTR(".",16-$LENGTH($PIECE(Y,U,2)))
+17 ;ADD DOTS IF NOT A CRT
if 'WVCRT
WRITE "..."
End DoDot:2
+18 ;IF NEW SSN#...
IF $PIECE(Y,U)=Z
Begin DoDot:2
+19 ;BROWSE SELECTION#
if WVCRT
WRITE $JUSTIFY(N,3),")"
+20 ;CONNECTING DOTS
WRITE ?WVTAB,". . . . . . . . . . . . . ."
End DoDot:2
+21 ;STORE AS PREVIOUS SSN#
SET Z=$PIECE(Y,U)
+22 ;
+23 ;DATE OF PROCEDURE
WRITE ?34,$$SLDT2^WVUTL5($PIECE(Y,U,3))
+24 ;ACCESSION#
WRITE ?44,$PIECE(Y,U,4)
+25 ;STATUS (* IF DELINQ)
WRITE ?57,$SELECT($PIECE(Y,U,7)="D":"*",1:" ")
+26 ;STATUS
WRITE ?58,$PIECE(Y,U,7)
+27 ;RESULTS/DIAGNOSIS (PRIORITY)
WRITE ?62,$EXTRACT($PIECE(Y,U,5),1,14)_" ("_$PIECE(Y,U,6)_")"
End DoDot:1
+28 ;
END ;EP
+1 ;---> IF A PROCEDURE HAS BEEN EDITED, SET N=N-5 AND START (GOTO)
+2 ;---> DISPLAY1 OVER AGAIN FROM 5 RECORDS PREVIOUS.
+3 IF WVCRT&('$DATA(IO("S")))&('WVPOP)
DO DIRZ^WVUTL3
IF N
SET N=N-1
GOTO NOMATCH
+4 DO ^%ZISC
+5 KILL N,Z
+6 QUIT
+7 ;
SUBHEAD ;EP
+1 ;---> SUB HEADER FOR PROCEDURE BROWSE OUTPUT.
+2 WRITE !?WVTAB,$$PNLB^WVUTL5()
+3 WRITE ?WVTAB+12,"PATIENT",?34,"DATE",?44,"ACC#"
+4 WRITE ?57,"STA",?62,"RESULTS/DIAGNOSIS"
+5 WRITE !?62,"(PRIORITY)",!
+6 WRITE $$REPEAT^XLFSTR("-",80)
+7 QUIT
+8 ;
EDIT ;EP
+1 ;---> FROM BROWSE, WVPOP IN TO EDIT A SINGLE PROCEDURE.
+2 DO SETVARS^WVUTL5
+3 SET X=+X
SET DA=$PIECE(^TMP("WV",$JOB,2,X),U,8)
+4 SET WVN=X
NEW X
+5 DO EDIT2^WVPROC1(DA,.WVPOP)
+6 ;---> BACK UP 5 RECORDS AFTER EDIT.
+7 SET N=$SELECT(WVN<6:1,1:WVN-5)
SET Z=0
KILL WVN
+8 QUIT