BPCDBS ; IHS/OIT/MJL - DIABETIC SUMMARY UTILITY FOR GUI PAT CHART ;
;;1.5;BPC;;MAY 26, 2005
;
DBSUM(BPCRES,BPCIEN,BPCPARAM) ;EP CALL FROM REMOTE PROC: BPC GETDBS
S U="^",XWBWRAP=1,BPCIEN=$G(BPCIEN),BPCPARAM=$G(BPCPARAM),BPCCTR=0
S BPCRES="^XTMP(""BPC"","_$J_")" K ^XTMP("BPC",$J)
I BPCIEN="" S ^XTMP("BPC",$J,0)=-1,^XTMP("BPC",$J,1)="NO IEN SENT!" K BPCCTR,BPCD,BPCIEN,BPCPARAM,BPCX Q
S (DFN,APCHSPAT)=BPCIEN
S X="APCHS9B1" X ^%ZOSF("TEST") I $T D
.D EP2^APCHS9B1(BPCIEN)
.D:$D(^TMP("APCHS",$J,"DCS")) SETDATA
.I BPCCTR=0 S ^XTMP("BPC",$J,0)=-1,^(1)="NO DATA RETURNED!"
.K BPCCTR,BPCD,BPCIEN,BPCPARAM,BPCX
Q:'$G(BPCIEN)
;
D EP2^BPCDBS1(BPCIEN) D:$D(^TMP("APCHS",$J,"DCS")) SETDATA
K BPCCTR,BPCD,BPCIEN,BPCPARAM,BPCX
Q
SETDATA ;
S BPCX=0 F S BPCX=$O(^TMP("APCHS",$J,"DCS",BPCX)) Q:BPCX="" D
.S BPCD=^TMP("APCHS",$J,"DCS",BPCX) S:BPCD="" BPCD=" "
.S BPCCTR=BPCCTR+1,^XTMP("BPC",$J,BPCCTR)=BPCD
S ^XTMP("BPC",$J,0)=BPCCTR
Q
BPCDBS ; IHS/OIT/MJL - DIABETIC SUMMARY UTILITY FOR GUI PAT CHART ;
+1 ;;1.5;BPC;;MAY 26, 2005
+2 ;
DBSUM(BPCRES,BPCIEN,BPCPARAM) ;EP CALL FROM REMOTE PROC: BPC GETDBS
+1 SET U="^"
SET XWBWRAP=1
SET BPCIEN=$GET(BPCIEN)
SET BPCPARAM=$GET(BPCPARAM)
SET BPCCTR=0
+2 SET BPCRES="^XTMP(""BPC"","_$JOB_")"
KILL ^XTMP("BPC",$JOB)
+3 IF BPCIEN=""
SET ^XTMP("BPC",$JOB,0)=-1
SET ^XTMP("BPC",$JOB,1)="NO IEN SENT!"
KILL BPCCTR,BPCD,BPCIEN,BPCPARAM,BPCX
QUIT
+4 SET (DFN,APCHSPAT)=BPCIEN
+5 SET X="APCHS9B1"
XECUTE ^%ZOSF("TEST")
IF $TEST
Begin DoDot:1
+6 DO EP2^APCHS9B1(BPCIEN)
+7 IF $DATA(^TMP("APCHS",$JOB,"DCS"))
DO SETDATA
+8 IF BPCCTR=0
SET ^XTMP("BPC",$JOB,0)=-1
SET ^(1)="NO DATA RETURNED!"
+9 KILL BPCCTR,BPCD,BPCIEN,BPCPARAM,BPCX
End DoDot:1
+10 IF '$GET(BPCIEN)
QUIT
+11 ;
+12 DO EP2^BPCDBS1(BPCIEN)
IF $DATA(^TMP("APCHS",$JOB,"DCS"))
DO SETDATA
+13 KILL BPCCTR,BPCD,BPCIEN,BPCPARAM,BPCX
+14 QUIT
SETDATA ;
+1 SET BPCX=0
FOR
SET BPCX=$ORDER(^TMP("APCHS",$JOB,"DCS",BPCX))
IF BPCX=""
QUIT
Begin DoDot:1
+2 SET BPCD=^TMP("APCHS",$JOB,"DCS",BPCX)
IF BPCD=""
SET BPCD=" "
+3 SET BPCCTR=BPCCTR+1
SET ^XTMP("BPC",$JOB,BPCCTR)=BPCD
End DoDot:1
+4 SET ^XTMP("BPC",$JOB,0)=BPCCTR
+5 QUIT