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

BPCBHRP9.m

Go to the documentation of this file.
BPCBHRP9 ; IHS/OIT/MJL - behavioral health display for GUI ;
 ;;1.5;BPC;;MAY 26, 2005
 ;
 ;
 ;
TEST ;
 D NOSHOW(.RETVAL,87,"01/01/1995","01/20/2003")
 Q
NOSHOW(BGUARRAY,BPCPAT,BPCBD,BPCED,BPCPROG) ;EP - BPCBH RPT LIST NO SHOWS 1 PAT
 NEW AMHR
 S JOB=$J,BPCGUI=1,XWBWRAP=1
 S ZTIO="",ZTQUEUED=1
 S BGUARRAY="^XTMP(""BPCRPT"","_$J_")"
 K ^XTMP("BPCRPT",$J)
 I $G(BPCPROG)="" S BPCPROG="A"
 S AMHPROG=BPCPROG
 I $G(BPCPAT)="" S ^XTMP("BPCRPT",JOB,.5)=2,^XTMP("BPCRPT",JOB,1)="Invalid DFN of patient passed" D KILL Q
 I $G(BPCBD)="" S ^XTMP("BPCRPT",JOB,.5)=2,^XTMP("BPCRPT",JOB,1)="Invalid beginning date passed" D KILL Q
 I BPCBD]"" D DT^DILF("X",BPCBD,.AMHBD) I $G(AMHBD)=-1 S ^XTMP("BPCRPT",JOB,.5)=2,^XTMP("BPCRPT",JOB,1)="Invalid beginning date passed" D KILL Q
 I $G(BPCED)="" S ^XTMP("BPCRPT",JOB,.5)=2,^XTMP("BPCRPT",JOB,1)="Invalid ending date passed" D KILL Q
 I BPCED]"" D DT^DILF("X",BPCED,.AMHED) I $G(AMHED)=-1 S ^XTMP("BPCRPT",JOB,.5)=2,^XTMP("BPCRPT",JOB,1)="Invalid ending date passed" D KILL Q
 S (DFN,AMHPAT,AUPNPAT)=BPCPAT
 S AMHBDD=$$FMTE^XLFDT(AMHBD)
 S AMHEDD=$$FMTE^XLFDT(AMHED)
 D PROC^AMHRNS
 K ^XTMP("BPCRPT",JOB)
 S ^XTMP("BPCRPTRUN",JOB)=""
 D ^XBKSET
 S ZTRTN="TSK^BPCBHRP9",ZTIO="",ZTDESC="BPC LIST NO SHOW",ZTSAVE("DFN")="",ZTSAVE("AMH*")="",ZTSAVE("JOB")="",ZTDTH=$H D ^%ZTLOAD
 F I=1:1:120 Q:$G(^XTMP("BPCRPTRUN",$J))="DONE"  H 1
 D KILL
 Q
 ;
TSK ;
 D ^XBKSET
 S ^XTMP("BPCRPTRUN",JOB)="START"
 D GUIR^XBLM("PRINT^AMHRNS","^XTMP(""BPCRPT"",JOB)")
 S ^XTMP("BPCRPT",JOB,.5)=$O(^XTMP("BPCRPT",JOB,""),-1)+1
 S ^XTMP("BPCRPTRUN",JOB)="DONE"
 Q
 ;
KILL ;
 K DFN,AMHPAT,AUPNPAT
 K AMHOA,AMHBT,AMHTOT
 K BPCCTR,BPCGUI,AMHSF,DIC,JOB,X,Y,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
 D EN^XBVK("AMH")
 Q
L ;get patients last visit
 ;AMHV array
 I '$D(^AMHREC("AE",DFN)) Q
 S D=$O(^AMHREC("AE",DFN,"")),R=$O(^AMHREC("AE",DFN,D,""))
 I R S AMHV(D,R)=""
 Q
S ;san only
 S D=0,V=0
 F  S D=$O(^AMHREC("AE",DFN,D)) Q:D'=+D  S V=0 F  S V=$O(^AMHREC("AE",DFN,D,V)) Q:V'=+V  I $P(^AMHREC(V,0),U,33)="S" S AMHV(D,V)=""
 Q