Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BWBRPCD1

BWBRPCD1.m

Go to the documentation of this file.
BWBRPCD1 ;IHS/ANMC/MWR - BROWSE PROCEDURES;15-Feb-2003 21:48;PLS
 ;;2.0;WOMEN'S HEALTH;**8**;MAY 16, 1996
 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
 ;;  DISPLAY CODE FOR BROWSING PROCEDURES.  CALLED BY BRBRPCD.
 ;
DISPLAY(BWTITLE,BWHEADER,BWCODE) ;EP
 ;---> BWCONF=DISPLAY "CONFIDENTIAL PT INFO" BANNER.
 ;---> BWTITLE=TITLE AT TOP OF DISPLAY HEADER.
 ;---> BWHEADER=HEADER CALL TO ^BWUTL7
 ;---> BWCODE=CODE TO EXECUTE AS 3RD PIECE OF DIR(0) (AFTER DIR READ).
 ;---> BWSUBH=CODE TO EXECUTE FOR SUBHEADER (COLUMN TITLES).
 ;---> BWCRT=1 IF OUTPUT IS TO SCREEN (ALLOWS SELECTIONS TO EDIT).
 ;---> BWTAB=6 IF OUTPUT IS TO SCREEN, =3 IF OUTPUT IS TO PRINTER.
 ;---> BWPRMT(1,Q)=PROMPTS FOR DIR.
 ;
 U IO
 S BWCONF=1,BWHEADER=BWHEADER_"^BWUTL7"
 D CENTERT^BWUTL5(.BWTITLE)
 S BWSUBH="SUBHEAD^BWBRPCD1"
 S BWPRMT1="   Press RETURN to continue or '^'to exit, or"
 S BWPRMT="   Select a left column number to edit"
 S BWPRMTQ="     To edit a Procedure, choose a number from the "
 S BWPRMTQ=BWPRMTQ_"left column"
 S (BWPOP,N,Z)=0
 D TOPHEAD^BWUTL7
 S BWTAB=$S(BWCRT:6,1:3)
 ;
NOMATCH ;EP
 ;---> QUIT IF NO RECORDS MATCH.
 I '$D(^TMP("BW",$J,1)) D  Q
 .D @(BWHEADER)
 .K BWPRMT,BWPRMT1,BWPRMTQ,DIR
 .W !!?5,"No records match the selected criteria.",!
 .D:BWCRT DIRZ^BWUTL3 W @IOF D ^%ZISC S BWPOP=1
 ;
DISPLAY1 ;EP
 ;---> IF A PROCEDURE IS EDITED ON THE LAST PAGE, GOTO HERE
 ;---> FROM LINELABEL "END" BELOW.
 D @(BWHEADER)
 F  S N=$O(^TMP("BW",$J,2,N)) Q:'N!(BWPOP)  D
 .I $Y+6>IOSL D:BWCRT DIRPRMT^BWUTL3 Q:BWPOP  D
 ..S BWPAGE=BWPAGE+1
 ..D @(BWHEADER) S Z=0
 .S Y=^TMP("BW",$J,2,N),M=N
 .W !
 .;---> DON'T WRITE CHART# 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:BWCRT $J(N,3),")"                  ;BROWSE SELECTION#
 ..W ?BWTAB,$P(Y,U)                         ;CHART#
 ..W ?BWTAB+10,$E($P(Y,U,2),1,16)," "       ;NAME
 ..F I=1:1:16-$L($P(Y,U,2)) W "."           ;CONNECTING DOTS
 ..W:'BWCRT "..."                           ;ADD DOTS IF NOT A CRT
 .I $P(Y,U)=Z D                             ;IF NEW CHART#...
 ..W:BWCRT $J(N,3),")"                      ;BROWSE SELECTION#
 ..W ?BWTAB,". . . .   . . . . . . . . ."   ;CONNECTING DOTS
 .S Z=$P(Y,U)                               ;STORE AS PREVIOUS CHART#
 .;
 .W ?35,$$SLDT2^BWUTL5($P(Y,U,3))           ;DATE OF PROCEDURE
 .W ?45,$P(Y,U,4)                           ;ACCESSION#
 .W ?55,$S($P(Y,U,7)="D":"*",1:" ")         ;STATUS (* IF DELINQ)
 .W ?56,$P(Y,U,7)                           ;STATUS
 .W ?60,$E($P(Y,U,5),1,20)                  ;RESULTS/DIAGNOSIS
 ;
END ;EP
 W:'BWCRT @IOF
 ;---> IF A PROCEDURE HAS BEEN EDITED, SET N=N-5 AND START (GOTO)
 ;---> DISPLAY1 OVER AGAIN FROM 5 RECORDS PREVIOUS.
 I BWCRT&('$D(IO("S")))&('BWPOP) D DIRPRMT^BWUTL3 I N S N=N-1 G NOMATCH
 D ^%ZISC
 K N,Z
 Q
 ;
SUBHEAD ;EP
 ;---> SUB HEADER FOR PROCEDURE BROWSE OUTPUT.
 W !?BWTAB,$$PNLB^BWUTL5(DUZ(2))
 W ?BWTAB+10,"PATIENT",?35,"DATE",?45,"ACC#"
 W ?55,"STA",?60,"RESULTS/DIAGNOSIS",!
 F I=1:1:80 W "-"
 Q
 ;
EDIT ;EP
 ;---> FROM BROWSE, BWPOP IN TO EDIT A SINGLE PROCEDURE.
 N (DT,DTIME,DUZ,M,N,U,X,Z) D SETVARS^BWUTL5
 S X=+X,DA=$P(^TMP("BW",$J,2,X),U,8)
 S BWN=X N X
 D EDIT2^BWPROC1(DA,.BWPOP)
 D:'BWPOP FOLLOWUP^BWPROC1(DA)
 ;---> BACK UP 5 RECORDS AFTER EDIT.
 S N=$S(BWN<6:1,1:BWN-5),Z=0 K BWN
 Q