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

BPCBWDSP.m

Go to the documentation of this file.
BPCBWDSP ; IHS/OIT/MJL - DISPLAY PATIENT PROFILE ; [ 12/31/2007  10:16 AM ]
 ;;1.5;BPC;**4**;FEB 16, 2005
 ;;MODIFIED FOR PATIENT CHART  FJE 6/19/00
 ;;* 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.
 ;
 ;
GETBWDSP(BGUARRAY,BPCPIEN) ;;EP REMOTE PROC: BPC GETBWDATA
 ;
EN ;
 S JOB=$J,BPCGUI=1,XWBWRAP=1
 S BGUARRAY="^XTMP(""BPCBW"","_$J_")"
 I BPCPIEN="" S ^XTMP("BPCBW",JOB,1)=-1,^XTMP("BPCBW",JOB,2)="PATIENT IEN NOT SENT!" Q
 I '$D(^BWP(BPCPIEN,0)) S ^XTMP("BPCBW",JOB,1)=-1,^XTMP("BPCBW",JOB,2)="PATIENT IS NOT DEFINED IN WOMEN'S HEALTH!" Q
 S X="WOMEN'S HEALTH",DIC="^DIC(9.4,",DIC(0)="XMZ" D ^DIC I +Y<1 S ^XTMP("BPCBW",JOB,1)=-1,^XTMP("BPCBW",JOB,2)="WOMEN'S HEALTH NOT INSTALLED!" Q
 I +$G(^DIC(9.4,+Y,"VERSION"))<2 S ^XTMP("BPCBW",JOB,1)=-1,^XTMP("BPCBW",JOB,2)="WOMEN'S HEALTH VERSION INCORRECT!" Q
 S BWDFN=BPCPIEN
 S BWD=1
 K ^XTMP("BPCBW",JOB)
 S ^XTMP("BPCBWRUN",JOB)=""
 S ZTRTN="TSK^BPCBWDSP",ZTIO="",ZTDESC="BPC BW REPORT",ZTSAVE("BWDFN")="",ZTSAVE("BWD")="",ZTSAVE("JOB")="",ZTDTH=$H D ^%ZTLOAD
 F I=1:1:60 Q:$G(^XTMP("BPCBWRUN",$J))="DONE"  H 1
 I $G(^XTMP("BPCBWRUN",JOB))'="DONE" S ^XTMP("BPCBW",JOB,1)=-1,^(2)="WOMEN'S HEALTH SUMMARY RUN FAILURE-CHECK SYSTEM TASKMAN" Q
 S X=0,BPCCTR=0 F  S X=$O(^XTMP("BPCBW",JOB,X)) Q:+X=0  S BPCCTR=BPCCTR+1
 S ^XTMP("BPCBW",JOB,.5)=BPCCTR+1
 Q
TSK ;
 D ^XBKSET
 S ^XTMP("BPCBWRUN",JOB)="START"
 ;S APCHSPAT=1,APCHSTYP=7 FOR TESTING
 D GUIR^XBLM("STRT^BPCBWDSP","^XTMP(""BPCBW"",JOB)")
 S ^XTMP("BPCBWRUN",JOB)="DONE"
 Q
STRT 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
 ;Q
 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
 ;S BWDFN=6878
 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)
 S BWD=1
 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