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

BWPROF1.m

Go to the documentation of this file.
BWPROF1 ;IHS/ANMC/MWR - DISPLAY PATIENT PROFILE;15-Feb-2003 22:08;PLS
 ;;2.0;WOMEN'S HEALTH;**8**;MAY 16, 1996
 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
 ;;  SETUP AND EDIT CODE FOR DISPLAYING PATIENT PROFILE.
 ;;  CALLED BY BWPROF.
 ;
 D DISPLAY Q:BWPOP
 D ^BWPROF3
 Q
 ;
 ;
DISPLAY ;EP
 ;---> BWCONF=DISPLAY "CONFIDENTIAL PATIENT INFO" BANNER.
 ;---> BWTITLE=TITLE AT TOP OF DISPLAY HEADER.
 ;---> BWCHAGE=DISPLAY CHART AND AGE IN 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
 I '$D(BWDFN)!('$D(BWNAME))!('$D(BWCHRT)) D  Q
 .W !!,"INSUFFICIENT PATIENT INFORMATION.",!!
 .D DIRZ^BWUTL3 S BWPOP=1
 ;
 S BWCONF=1,BWCHAGE=1
 S BWTITLE="* * *  Patient Profile  * * *" D CENTERT^BWUTL5(.BWTITLE)
 S BWCODE="Q:'$D(^TMP(""BW"",$J,2,+X))  "
 S BWCODE=BWCODE_"D EDIT^BWPROF1 N X D SORT^BWPROF2,COPYGBL^BWPROF"
 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 or Notification, choose "
 S BWPRMTQ=BWPRMTQ_"a number from the             left-most column."
 ;---> IF PROFILE IS BEING ACCESSED BY A USER FROM OUTSIDE OF THE
 ;---> PACKAGE (NOT WOMEN'S HEALTH STAFF), THEN OFFER DISPLAY/PRINT
 ;---> OF PROCEDURE; DO NOT OFFER EDIT OF PROCEDURE.
 D:$G(BWPUSER)
 .S BWCODE="D PRINTPCD^BWPROF1"
 .S BWPRMT="   Select a left column number to display/print"
 .S BWPRMTQ="     To display or print a Procedure in detail, choose "
 .S BWPRMTQ=BWPRMTQ_"a number from the             left-most column."
 S (BWACCP,N,BWPOP,Z)=0
 D TOPHEAD^BWUTL7
 S BWTAB=$S(BWCRT:6,1:3)
 Q
 ;
 ;
EDIT ;EP
 ;---> FROM BROWSE, BWPOP IN TO EDIT A SINGLE PROCEDURE.
 ;---> NOTE: PIECE 10 OF EACH TMP NODE IS THE IEN FOR THAT ENTRY
 ;---> IN ITS RESPECTIVE FILE (PROCDURE FILE OR NOTIFICATION FILE).
 N (DT,DTIME,DUZ,IOF,M,N,U,X,Z) D SETVARS^BWUTL5
 S X=+X,DA=$P(^TMP("BW",$J,2,X),U,10)
 S BWNN=X N X D
 .I $P(^TMP("BW",$J,2,BWNN),U)=1 D  Q
 ..D EDIT2^BWPROC1(DA,.BWPOP) Q:BWPOP  D FOLLOWUP^BWPROC1(DA)
 .I $P(^TMP("BW",$J,2,BWNN),U)=2 D EDIT2^BWNOTIF(DA) Q
 .W !!?3,*7,"This is neither a PROCEDURE nor a NOTIFICATION.  "
 .W "It cannot be edited here."
 .D DIRZ^BWUTL3 Q
 ;---> BACK UP 5 RECORDS AFTER EDIT.
 S N=$S(BWNN<6:1,1:BWNN-5),Z=0 K BWNN
 Q
 ;
 ;
PRINTPCD ;EP
 ;---> FROM BROWSE, PRINT THIS PROCEDURE.
 ;---> NOTE: PIECE 10 OF EACH TMP NODE IS THE IEN FOR THAT ENTRY
 ;---> IN ITS RESPECTIVE FILE (PROCDURE FILE OR NOTIFICATION FILE).
 N (DT,DTIME,DUZ,M,N,U,X,Z) D SETVARS^BWUTL5
 S X=+X,DA=$P(^TMP("BW",$J,2,X),U,10)
 S BWN=X N X D
 .I $P(^TMP("BW",$J,2,BWN),U)=1 D TOP^BWPRPCD(DA) Q
 .W !!?3,*7,"This is not a PROCEDURE.  "
 .D DIRZ^BWUTL3 Q
 ;---> BACK UP 5 RECORDS AFTER EDIT.
 S N=$S(BWN<6:1,1:BWN-5),Z=0 K BWN
 Q
 ;
 ;
SUBHEAD ;EP
 ;---> SUB HEADER FOR BRIEF DISPLAY OF PROCEDURES ONLY.
 W !?BWTAB,"DATE",?16,"PROCEDURE",?27,"RESULTS/DIAGNOSIS",?71,"STATUS",!
 W ?BWTAB,"--------",?16,"---------",?27,"----------------------------"
 W ?71,"------"
 Q