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

BWBRNED1.m

Go to the documentation of this file.
BWBRNED1 ;IHS/ANMC/MWR - BROWSE TX NEEDS PAST DUE;15-Feb-2003 21:47;PLS
 ;;2.0;WOMEN'S HEALTH;**5,8**;MAY 16, 1996
 ;IHS/CMI/LAB - Y2K
 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
 ;;  DISPLAY CODE FOR BROWSING TX NEEDS.  CALLED BY BWBRNED.
 ;
DISPLAY ;EP
 ;---> BWCONF=DISPLAY "CONFIDENTIAL PT INFO" BANNER.
 ;---> BWTITLE=TITLE AT TOP OF DISPLAY HEADER.
 ;---> BWSUBH=CODE TO EXECUTE FOR SUBHEADER (COLUMN TITLES).
 ;---> BWCODE=CODE TO EXECUTE AS 3RD PIECE OF DIR(0) (AFTER DIR READ).
 ;---> 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
 S BWTITLE1=$S(BWB=1:"BY NEED DATE",BWB=2:"ALPHABETICALLY",1:"?")
 S BWTITLE="*  PATIENTS LISTED "_BWTITLE1_"  *"
 D CENTERT^BWUTL5(.BWTITLE)
 S BWSUBH="SUBHEAD^BWBRNED1"
 S BWCODE="D EDIT^BWBRNED1 N N D SORT^BWBRNED,COPYGBL^BWBRNED"
 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
 ;---> *SET BWFAC FOR NOW; MAKE BWFAC SELECTABLE IN FUTURE VERSIONS.
 S BWFAC=DUZ(2)
 S BWTAB=$S(BWCRT:6,1:3)
 ;
NOMATCH ;EP
 ;---> QUIT IF NO RECORDS MATCH.
 I '$D(^TMP("BW",$J,1)) D  Q
 .D HEADER5^BWUTL7
 .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.
 N M,Y
 D HEADER5^BWUTL7
 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 HEADER5^BWUTL7
 .S Y=^TMP("BW",$J,2,N),M=N
 .;---> DON'T WRITE BROWSE SELECTION#'S IF IO IS NOT A CRT (BRCRT).
 .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
 .;begin Y2K
 .W ?34,$E($P($P(Y,U,3),","),1,9)           ;CASE MANAGER ;IHS/CMI/LAB Y2000
 .W ?44,$P(Y,U,4)                           ;CERVICAL TX NEED&DATE ;IHS/CMI/LAB Y2000
 .W !?44,$P(Y,U,5)                          ;BREAST TX NEED&DATE ;IHS/CMI/LAB Y2000
 .;end Y2K
 ;
 D:'N
 .N BWTITLE S BWTITLE="-----  End of Report  -----"
 .D CENTERT^BWUTL5(.BWTITLE) W !!,BWTITLE
 ;
END ;EP
 W:'BWCRT @IOF
 ;---> IF A PATIENT HAS BEEN EDITED, SET N=N-5 AND START (GOTO)
 I BWCRT&('$D(IO("S")))&('BWPOP) D DIRPRMT^BWUTL3 I N S N=N-1 G NOMATCH
 D ^%ZISC
 Q
 ;
SUBHEAD ;EP
 ;---> SUB HEADER FOR PATIENT BROWSE OUTPUT.
 ;begin Y2K
 W !?BWTAB,$$PNLB^BWUTL5(DUZ(2)),?BWTAB+10,"PATIENT",?34,"CASE MGR" ;IHS/CMI/LAB spacing for 4 digit date Y2000
 W ?44,"TREATMENT NEED DUE BY DATE",! ;IHS/CMI/LAB Y2000
 ;end Y2K
 F I=1:1:80 W "-"
 Q
 ;
EDIT ;EP
 ;---> FROM BROWSE, BWPOP IN TO EDIT AN INDIVIDUAL PATIENT.
 N (DT,DTIME,DUZ,M,N,U,X,Z) D SETVARS^BWUTL5
 S X=+X,BWDFN=$P(^TMP("BW",$J,2,X),U,6)
 S BWN=X N X
 D SCREEN^BWPATE(BWDFN)
 ;---> BACK UP 5 RECORDS AFTER EDIT.
 S N=$S(BWN<6:1,1:BWN-5) K BWN
 Q