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

BPCHSDSP.m

Go to the documentation of this file.
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