BPCHSDSP ; IHS/OIT/MJL - HEALTH SUMMARY DISP GUI RPC ROUTINE ;
;;1.5;BPC;;MAY 26, 2005
;
GETHSDSP(BGUARRAY,BPCPIEN,BPCTIEN) ;EP CALL FROM REMOTE PROC: BPC GETHSDATA
;
EN ;
S JOB=$J,BPCGUI=1,XWBWRAP=1
S BGUARRAY="^XTMP(""BPCHS"","_$J_")"
TYPE I BPCTIEN G PAT
S X="" I DUZ(2),$D(^APCCCTRL(DUZ(2),0))#2 S X=$P(^(0),U,3)
I $D(^DISV(DUZ,"^APCHSCTL(")) S Y=^("^APCHSCTL(") I $D(^APCHSCTL(Y,0)) S X=$P(^(0),U,1)
I X="" S X="ADULT REGULAR",DIC(0)="XM",DIC="^APCHSCTL(" D ^DIC I Y>0 K DIC S BPCTIEN=+Y
PAT ;
I 'BPCTIEN S ^XTMP("BPCHS",JOB,1)=-1,^XTMP("BPCHS",JOB,2)="HEALTH SUMMARY TYPE IEN NOT SENT!" D KILL Q
I BPCPIEN="" S ^XTMP("BPCHS",JOB,1)=-1,^XTMP("BPCHS",JOB,2)="PATIENT IEN NOT SENT!" D KILL Q
I '$D(^AUPNPAT(BPCPIEN,0)) S ^XTMP("BPCHS",JOB,1)=-1,^XTMP("BPCHS",JOB,2)="PATIENT IEN IS NOT DEFINED!" D KILL Q
I '$D(^APCHSCTL(BPCTIEN,0)) S ^XTMP("BPCHS",JOB,1)=-1,^XTMP("BPCHS",JOB,2)="HEALTH SUMMARY TYPE IEN IS NOT DEFINED!" D KILL Q
S APCHSPAT=BPCPIEN
S APCHSTYP=BPCTIEN
K ^XTMP("BPCHS",JOB)
S ^XTMP("BPCHSRUN",JOB)=""
S ZTRTN="TSK^BPCHSDSP",ZTIO="",ZTDESC="BPC HS REPORT",ZTSAVE("APCHSPAT")="",ZTSAVE("APCHSTYP")="",ZTSAVE("JOB")="",ZTDTH=$H D ^%ZTLOAD
F I=1:1:60 Q:$G(^XTMP("BPCHSRUN",$J))="DONE" H 1
I $G(^XTMP("BPCHSRUN",JOB))'="DONE" S ^XTMP("BPCHS",JOB,1)=-1,^(2)="HEALTH SUMMARY RUN FAILURE-CHECK SYSTEM TASKMAN" D KILL Q
S X=0,BPCCTR=0 F S X=$O(^XTMP("BPCHS",JOB,X)) Q:+X=0 S:^(X)["****************************************" ^(X)=$E(^(X),76,255) S:^(X)["----------------------------------------" ^(X)=$E(^(X),76,255) S BPCCTR=BPCCTR+1
S ^XTMP("BPCHS",JOB,.5)=BPCCTR+1
D KILL
Q
TSK ;
D ^XBKSET
S ^XTMP("BPCHSRUN",JOB)="START"
D GUIR^XBLM("EN^APCHS","^XTMP(""BPCHS"",JOB)")
S ^XTMP("BPCHSRUN",JOB)="DONE"
Q
;
KILL ;
K BPCCTR,BPCGUI,APCHSPAT,APCHSTYP,BPCTIEN,DIC,JOB,X,Y,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
Q
Q
BPCHSDSP ; IHS/OIT/MJL - HEALTH SUMMARY DISP GUI RPC ROUTINE ;
+1 ;;1.5;BPC;;MAY 26, 2005
+2 ;
GETHSDSP(BGUARRAY,BPCPIEN,BPCTIEN) ;EP CALL FROM REMOTE PROC: BPC GETHSDATA
+1 ;
EN ;
+1 SET JOB=$JOB
SET BPCGUI=1
SET XWBWRAP=1
+2 SET BGUARRAY="^XTMP(""BPCHS"","_$JOB_")"
TYPE IF BPCTIEN
GOTO PAT
+1 SET X=""
IF DUZ(2)
IF $DATA(^APCCCTRL(DUZ(2),0))#2
SET X=$PIECE(^(0),U,3)
+2 IF $DATA(^DISV(DUZ,"^APCHSCTL("))
SET Y=^("^APCHSCTL(")
IF $DATA(^APCHSCTL(Y,0))
SET X=$PIECE(^(0),U,1)
+3 IF X=""
SET X="ADULT REGULAR"
SET DIC(0)="XM"
SET DIC="^APCHSCTL("
DO ^DIC
IF Y>0
KILL DIC
SET BPCTIEN=+Y
PAT ;
+1 IF 'BPCTIEN
SET ^XTMP("BPCHS",JOB,1)=-1
SET ^XTMP("BPCHS",JOB,2)="HEALTH SUMMARY TYPE IEN NOT SENT!"
DO KILL
QUIT
+2 IF BPCPIEN=""
SET ^XTMP("BPCHS",JOB,1)=-1
SET ^XTMP("BPCHS",JOB,2)="PATIENT IEN NOT SENT!"
DO KILL
QUIT
+3 IF '$DATA(^AUPNPAT(BPCPIEN,0))
SET ^XTMP("BPCHS",JOB,1)=-1
SET ^XTMP("BPCHS",JOB,2)="PATIENT IEN IS NOT DEFINED!"
DO KILL
QUIT
+4 IF '$DATA(^APCHSCTL(BPCTIEN,0))
SET ^XTMP("BPCHS",JOB,1)=-1
SET ^XTMP("BPCHS",JOB,2)="HEALTH SUMMARY TYPE IEN IS NOT DEFINED!"
DO KILL
QUIT
+5 SET APCHSPAT=BPCPIEN
+6 SET APCHSTYP=BPCTIEN
+7 KILL ^XTMP("BPCHS",JOB)
+8 SET ^XTMP("BPCHSRUN",JOB)=""
+9 SET ZTRTN="TSK^BPCHSDSP"
SET ZTIO=""
SET ZTDESC="BPC HS REPORT"
SET ZTSAVE("APCHSPAT")=""
SET ZTSAVE("APCHSTYP")=""
SET ZTSAVE("JOB")=""
SET ZTDTH=$HOROLOG
DO ^%ZTLOAD
+10 FOR I=1:1:60
IF $GET(^XTMP("BPCHSRUN",$JOB))="DONE"
QUIT
HANG 1
+11 IF $GET(^XTMP("BPCHSRUN",JOB))'="DONE"
SET ^XTMP("BPCHS",JOB,1)=-1
SET ^(2)="HEALTH SUMMARY RUN FAILURE-CHECK SYSTEM TASKMAN"
DO KILL
QUIT
+12 SET X=0
SET BPCCTR=0
FOR
SET X=$ORDER(^XTMP("BPCHS",JOB,X))
IF +X=0
QUIT
IF ^(X)["****************************************"
SET ^(X)=$EXTRACT(^(X),76,255)
IF ^(X)["----------------------------------------"
SET ^(X)=$EXTRACT(^(X),76,255)
SET BPCCTR=BPCCTR+1
+13 SET ^XTMP("BPCHS",JOB,.5)=BPCCTR+1
+14 DO KILL
+15 QUIT
TSK ;
+1 DO ^XBKSET
+2 SET ^XTMP("BPCHSRUN",JOB)="START"
+3 DO GUIR^XBLM("EN^APCHS","^XTMP(""BPCHS"",JOB)")
+4 SET ^XTMP("BPCHSRUN",JOB)="DONE"
+5 QUIT
+6 ;
KILL ;
+1 KILL BPCCTR,BPCGUI,APCHSPAT,APCHSTYP,BPCTIEN,DIC,JOB,X,Y,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
+2 QUIT
+3 QUIT