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

BWPROF.m

Go to the documentation of this file.
BWPROF ;IHS/ANMC/MWR - DISPLAY PATIENT PROFILE; [ 09/17/2001  7:55 AM ]
 ;;2.0;WOMEN'S HEALTH;**1,6,8**;MAY 16, 1996
 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
 ;;  CALL ED BY OPTION: "BW PATIENT PROFILE" TO DISPLAY PROFILE.
 ;;  PATCHED AT LINELABEL PROFCALL.  IHS/ANMC/MWR 11/20/96
 ;
 ;---> *NOTE: TO ASK DATE RANGE, UNCOMMENT ALL LINES WITH "XDATES",
 ;--->        AND IN HEADER2^BWUTL7.
 ;
 ;---> VARIABLES:
 ;---> BWDFN: DFN OF SELECTED PATIENT
 ;---> DATES: BWBEGDT=BEGINNING DATE, BWENDDT=ENDING DATE
 ;---> USE NODES 1 & 2 IN ^TMP GLOBAL.
 ;
 D SETVARS^BWUTL5
 S:'$D(BWERRORS) BWERRORS=1
 F  D RUN Q:BWPOP
 D EXIT
 Q
 ;
RUN ;EP
 D TITLE^BWUTL5("PATIENT PROFILE")
 D PATIENT Q:BWPOP
 ;D DATES  Q:BWPOP
 D BRIEF   Q:BWPOP
 D DEVICE  Q:BWPOP
 D SORT^BWPROF2
 D COPYGBL
 D ^BWPROF1 S BWPOP=0
 K BWD,BWSUBH
 Q
 ;
EXIT ;EP
 D KILLALL^BWUTL8
 Q
 ;
 ;
PATIENT ;EP
 ;---> SELECT PATIENT (RETURN BWDFN).
 W !!,"   Select the patient whose Profile you wish to display."
 D PATLKUP^BWUTL8(.Y) S:Y<0 BWPOP=1
 ;---> USE NEXT LINE IF I WANT TO ADD CAPABILITY OF ADDING NEW PATIENT.
 ;D PATLKUP^BWUTL8(.Y,$S($G(BWPUSER):"",1:"ADD")) S:Y<0 BWPOP=1
 S BWDFN=+Y
 Q
 ;
DATES ;EP
 ;---> ASK DATE RANGE.  RETURN DATES IN BWBEGDT AND BWENDDT.
 ;---> IF LOOKING AT ONLY ONE PATIENT, SET DEFAULT BEGIN DATE=T-5YEARS.
 ;S BWBEGDT=2500101,BWENDDT=DT     ;---> XDATES-CAN USE THIS INSTEAD.
 ;S BWBEGDF="T-60M",BWENDDF="T"    ;---> XDATES
 ;D ASKDATES^BWUTL3(.BWBEGDT,.BWENDDT,.BWPOP,"T-365","T")  ;---> XDATES
 Q
 ;
BRIEF ;EP
 ;---> BRIEF OR DETAILED LISTING OF PROCEDURES (BRIEF DOES NOT LIST
 ;---> NOTIFICATIONS AND PROVIDERS).
 N DIR,DIRUT,Y
 W !!?3,"List Patient Profile in BRIEF or DETAILED format?"
 S DIR("A")="   Select BRIEF or DETAILED: ",DIR("B")="BRIEF"
 S DIR(0)="SAM^b:BRIEF;d:DETAILED" D HELP1
 D ^DIR
 I Y=-1!($D(DIRUT)) S BWPOP=1 Q
 ;---> IF ALL DETAILED, S BWD=1; FOR BRIEF BWD=0
 S BWD=$S(Y="d":1,1:0)
 Q
 ;
DEVICE ;EP
 ;---> GET DEVICE AND POSSIBLY QUEUE TO TASKMAN.
 S ZTRTN="DEQUEUE^BWPROF"
 F BWSV="D","DFN","BEGDT","ENDDT","ERRORS" D
 .I $D(@("BW"_BWSV)) S ZTSAVE("BW"_BWSV)=""
 D ZIS^BWUTL2(.BWPOP,1,"HOME")
 Q
 ;
COPYGBL ;EP
 ;---> COPY ^TMP("BW",$J,1 TO ^TMP("BW",$J,2 TO MAKE IT FLAT.
 N I,M,N,P,Q
 S N=0,I=0
 F  S N=$O(^TMP("BW",$J,1,N)) Q:N=""  D
 .S M=0
 .F  S M=$O(^TMP("BW",$J,1,N,M)) Q:M=""  D
 ..S P=0
 ..F  S P=$O(^TMP("BW",$J,1,N,M,P)) Q:P=""  D
 ...S Q=0
 ...F  S Q=$O(^TMP("BW",$J,1,N,M,P,Q)) Q:Q=""  D
 ....S I=I+1,^TMP("BW",$J,2,I)=^TMP("BW",$J,1,N,M,P,Q)
 Q
 ;
 ;
DEQUEUE ;EP
 ;---> EP FOR TASKMAN QUEUE OF PRINTOUT.
 D SETVARS^BWUTL5,SORT^BWPROF2,COPYGBL,^BWPROF1,EXIT
 Q
 ;
HELP1 ;EP
 ;;Enter "D" for a "Detailed" listing of the patient's Procedures,
 ;;Notifications, PAP Regimen and Pregnancy changes.
 ;;Enter "B" for a "Brief" listing of the patient's Procedures only.
 S BWTAB=5,BWLINL="HELP1" D HELPTX
 Q
 ;
HELPTX ;EP
 ;---> CREATES DIR ARRAY FOR DIR.  REQUIRED VARIABLES: BWTAB,BWLINL.
 N I,T,X S T="" F I=1:1:BWTAB S T=T_" "
 F I=1:1 S X=$T(@BWLINL+I) Q:X'[";;"  S DIR("?",I)=T_$P(X,";;",2)
 S DIR("?")=DIR("?",I-1) K DIR("?",I-1)
 Q
 ;
 ;
USER ;EP
 ;---> CALLED BY OPTION: "BW PATIENT PROFILE USER"
 ;---> FOR USER TO VIEW PROFILE AND PRINT PROCEDURES, BUT NO EDIT.
 S BWPUSER=1
 D BWPROF K BWPUSER
 Q
 ;
PROFCALL(BWDFN) ;EP
 ;---> PATCHED: EARLIER METHODS FOR OTHER PACKAGES TO PRODUCE A
 ;---> WOMEN'S HEALTH PROFILE WERE TO CUMBERSOME AND ERROR PRONE.
 ;---> USED TO CALL A PATIENT PROFILE (DISPLAY ONLY) WITH PATIENT
 ;---> ALREADY SELECTED.  DFN PASSED AS FIRST PARAMETER.
 ;---> THIS ENTIRE CALL HAS BEEN ADDED AS A PATCH. IHS/ANMC/MWR 11/20/96
 I '$G(BWDFN) D  Q
 .W !?5,"Patient DFN was not passed.  Please contact your site manager."
 .D DIRZ^BWUTL3
 I '$D(^BWP(BWDFN,0)) D  Q
 .W !?5,"This patient is not currently in the Women's Health Database."
 .D DIRZ^BWUTL3
 N (BWDFN)
 D SETVARS^BWUTL5 S BWERRORS=1,BWPUSER=1
 D BRIEF  Q:BWPOP
 D DEVICE Q:BWPOP
 D SORT^BWPROF2
 D COPYGBL
 D ^BWPROF1
 Q
 ;
ERRORS ;EP
 ;---> CALLED BY OPTION: "BW PATIENT PROFILE W/ERRORS"
 ;---> ENTER HERE TO INCLUDE ERRONEOUS ENTRIES.
 S BWERRORS=0 G BWPROF
 Q
 ;
EP(BWDFN,BWD,BWEXT) ;PEP called without user interaction to display profile
 ;IHS/CMI/LAB - patch 6 added this subroutine this is
 ;called from the health summary.
 ;---> PATCHED: EARLIER METHODS FOR OTHER PACKAGES TO PRODUCE A
 ;---> WOMEN'S HEALTH PROFILE WERE TO CUMBERSOME AND ERROR PRONE.
 ;---> USED TO CALL A PATIENT PROFILE (DISPLAY ONLY) WITH PATIENT
 ;---> ALREADY SELECTED.  DFN PASSED AS FIRST PARAMETER.
 ;---> THIS ENTIRE CALL HAS BEEN ADDED AS A PATCH. IHS/ANMC/MWR 11/20/96
 ;IHS/CMI/THL PATCH 8 BWEXT SET FOR EXTERNAL CALL SO DEVICE ISN'T CLOSED
 Q:'$G(BWDFN)
 Q:$G(BWD)=""  ;did not pass brief/detailed
 Q:'$D(^BWP(BWDFN,0))
 D EN^XBNEW("EP1^BWPROF","BWDFN;BWD")
 Q
EP1 ;EP called by xbnew
 D SETVARS^BWUTL5 S BWERRORS=1,BWPUSER=1
 D SORT^BWPROF2
 D COPYGBL
 D ^BWPROF1
 Q