WVBRNOT1 ;HCIOFO/FT,JR IHS/ANMC/MWR - BROWSE NOTIFICATIONS; ;7/30/98 11:05
;;1.0;WOMEN'S HEALTH;;Sep 30, 1998
;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
;; DISPLAY CODE FOR BROWSING NOTIFICATIONS. CALLED BY WVBRNOT.
;
DISPLAY ;EP
;---> WVCONF=DISPLAY "CONFIDENTIAL PT INFO" BANNER.
;---> WVTITLE=TITLE AT TOP OF DISPLAY HEADER.
;---> WVSUBH=CODE TO EXECUTE FOR SUBHEADER (COLUMN TITLES).
;---> WVCODE=CODE TO EXECUTE AS 3RD PIECE OF DIR(0) (AFTER DIR READ).
;---> 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.
;---> WVD=0, TELLS DIRPRMT^WVUTL3 TO DISPLAY SELECTION NUMBERS.
;
U IO
S WVCONF=1
S WVTITLE1=$S(WVC=1:"DATE",WVC=2:"PATIENT",WVC=3:"PRIORITY",1:"?")
S WVTITLE="* * * NOTIFICATIONS LISTED BY "_WVTITLE1_" * * *"
D CENTERT^WVUTL5(.WVTITLE)
S WVSUBH="SUBHEAD^WVBRNOT1"
S WVCODE="D EDIT^WVBRNOT1,SORT^WVBRNOT,COPYGBL^WVBRNOT"
S (WVD,WVPOP,N,Z)=0
D TOPHEAD^WVUTL7
S WVTAB=$S(WVCRT:6,1:3)
;
NOMATCH ;EP
;---> QUIT IF NO RECORDS MATCH.
I '$D(^TMP("WV",$J,3)) D Q
.D HEADER1^WVUTL7
.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 NOTIFICATION IS EDITED ON THE LAST PAGE, GOTO HERE
;---> FROM LINELABEL "END" BELOW.
D HEADER1^WVUTL7
F S N=$O(^TMP("WV",$J,4,N)) Q:'N!(WVPOP) D
.I $Y+6>IOSL D:WVCRT DIRZ^WVUTL3 Q:WVPOP D
..S WVPAGE=WVPAGE+1
..D HEADER1^WVUTL7 S Z=0
.S Y=^TMP("WV",$J,4,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,22)," " ;NAME
..W $$REPEAT^XLFSTR(".",22-$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 CHRT#
.;
.W ?40,$$SLDT2^WVUTL5($P(Y,U,3)) ;DATE OF NOTIFICATION
.W ?51,$P(Y,U,4) ;ACCESSION#
.;W ?64,$E($P(Y,U,5),1,6)
.W ?65,$E($P(Y,U,5)) ;STATUS
.S X=$P(Y,U,6) ;PRIORITY
.W ?70,$S(X=1:"*",1:" ")
.W $E($P($P(^DD(790.404,.02,0),X_":",2),";"),1,8) K X
I $D(^TMP("WV",$J,3)) I WVCRT&('$D(IO("S"))) D:'WVPOP DIRZ^WVUTL3 W @IOF
END ;EP
D ^%ZISC
Q
;
SUBHEAD ;EP
;---> SUB HEADER FOR NOTIFICATION BROWSE OUTPUT.
W !?WVTAB,$$PNLB^WVUTL5()
W ?WVTAB+12,"PATIENT",?41,"DATE",?51,"ACC#"
W ?63,"STATUS",?71,"PRIORITY",!
W $$REPEAT^XLFSTR("-",80)
Q
;
EDIT ;EP
;---> FROM BROWSE, POP IN TO EDIT A SINGLE NOTIFICATION.
D SETVARS^WVUTL5
S X=+X,DA=$P(^TMP("WV",$J,4,X),U,7)
S WVNN=X N X
D EDIT2^WVNOTIF(DA)
;---> BACK UP 5 RECORDS AFTER EDIT.
S N=$S(WVNN<6:1,1:WVNN-5),Z=0 K WVNN
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HWVBRNOT1 3324 printed Nov 22, 2024@17:56:37 Page 2
WVBRNOT1 ;HCIOFO/FT,JR IHS/ANMC/MWR - BROWSE NOTIFICATIONS; ;7/30/98 11:05
+1 ;;1.0;WOMEN'S HEALTH;;Sep 30, 1998
+2 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
+3 ;; DISPLAY CODE FOR BROWSING NOTIFICATIONS. CALLED BY WVBRNOT.
+4 ;
DISPLAY ;EP
+1 ;---> WVCONF=DISPLAY "CONFIDENTIAL PT INFO" BANNER.
+2 ;---> WVTITLE=TITLE AT TOP OF DISPLAY HEADER.
+3 ;---> WVSUBH=CODE TO EXECUTE FOR SUBHEADER (COLUMN TITLES).
+4 ;---> WVCODE=CODE TO EXECUTE AS 3RD PIECE OF DIR(0) (AFTER DIR READ).
+5 ;---> WVCRT=1 IF OUTPUT IS TO SCREEN (ALLOWS SELECTIONS TO EDIT).
+6 ;---> WVTAB=6 IF OUTPUT IS TO SCREEN, =3 IF OUTPUT IS TO PRINTER.
+7 ;---> WVPRMT(1,Q)=PROMPTS FOR DIR.
+8 ;---> WVD=0, TELLS DIRPRMT^WVUTL3 TO DISPLAY SELECTION NUMBERS.
+9 ;
+10 USE IO
+11 SET WVCONF=1
+12 SET WVTITLE1=$SELECT(WVC=1:"DATE",WVC=2:"PATIENT",WVC=3:"PRIORITY",1:"?")
+13 SET WVTITLE="* * * NOTIFICATIONS LISTED BY "_WVTITLE1_" * * *"
+14 DO CENTERT^WVUTL5(.WVTITLE)
+15 SET WVSUBH="SUBHEAD^WVBRNOT1"
+16 SET WVCODE="D EDIT^WVBRNOT1,SORT^WVBRNOT,COPYGBL^WVBRNOT"
+17 SET (WVD,WVPOP,N,Z)=0
+18 DO TOPHEAD^WVUTL7
+19 SET WVTAB=$SELECT(WVCRT:6,1:3)
+20 ;
NOMATCH ;EP
+1 ;---> QUIT IF NO RECORDS MATCH.
+2 IF '$DATA(^TMP("WV",$JOB,3))
Begin DoDot:1
+3 DO HEADER1^WVUTL7
+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 NOTIFICATION IS EDITED ON THE LAST PAGE, GOTO HERE
+2 ;---> FROM LINELABEL "END" BELOW.
+3 DO HEADER1^WVUTL7
+4 FOR
SET N=$ORDER(^TMP("WV",$JOB,4,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 HEADER1^WVUTL7
SET Z=0
End DoDot:2
+8 SET Y=^TMP("WV",$JOB,4,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,22)," "
+16 ;CONNECTING DOTS
WRITE $$REPEAT^XLFSTR(".",22-$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 CHRT#
SET Z=$PIECE(Y,U)
+22 ;
+23 ;DATE OF NOTIFICATION
WRITE ?40,$$SLDT2^WVUTL5($PIECE(Y,U,3))
+24 ;ACCESSION#
WRITE ?51,$PIECE(Y,U,4)
+25 ;W ?64,$E($P(Y,U,5),1,6)
+26 ;STATUS
WRITE ?65,$EXTRACT($PIECE(Y,U,5))
+27 ;PRIORITY
SET X=$PIECE(Y,U,6)
+28 WRITE ?70,$SELECT(X=1:"*",1:" ")
+29 WRITE $EXTRACT($PIECE($PIECE(^DD(790.404,.02,0),X_":",2),";"),1,8)
KILL X
End DoDot:1
+30 IF $DATA(^TMP("WV",$JOB,3))
IF WVCRT&('$DATA(IO("S")))
if 'WVPOP
DO DIRZ^WVUTL3
WRITE @IOF
END ;EP
+1 DO ^%ZISC
+2 QUIT
+3 ;
SUBHEAD ;EP
+1 ;---> SUB HEADER FOR NOTIFICATION BROWSE OUTPUT.
+2 WRITE !?WVTAB,$$PNLB^WVUTL5()
+3 WRITE ?WVTAB+12,"PATIENT",?41,"DATE",?51,"ACC#"
+4 WRITE ?63,"STATUS",?71,"PRIORITY",!
+5 WRITE $$REPEAT^XLFSTR("-",80)
+6 QUIT
+7 ;
EDIT ;EP
+1 ;---> FROM BROWSE, POP IN TO EDIT A SINGLE NOTIFICATION.
+2 DO SETVARS^WVUTL5
+3 SET X=+X
SET DA=$PIECE(^TMP("WV",$JOB,4,X),U,7)
+4 SET WVNN=X
NEW X
+5 DO EDIT2^WVNOTIF(DA)
+6 ;---> BACK UP 5 RECORDS AFTER EDIT.
+7 SET N=$SELECT(WVNN<6:1,1:WVNN-5)
SET Z=0
KILL WVNN
+8 QUIT