PSBSAGG ;BIRMINGHAM/EFC-BCMA TEMPORARY SAGG TYPE REPORTING ;Mar 2004
;;3.0;BAR CODE MED ADMIN;;Mar 2004
;
; Reference/IA
; WIN^DGPMDDCF/1246
; OPER^DGPMDDCF/1246
; ^XMB(1,1,"XUS")/10091
; File 4/10090
; ^DIC(42/10039
EN ;
N XMDUZ,XMY,XMSUB,XMTEXT,PSBEDS,PSBDT,PSB,PSBCNT,PSBWRD,D0,PSBSITE,PSBNUM
S X1=DT,X2=-1*(+$E(DT,6,7)) D C^%DTC
S PSBDT=$E(X,1,5),Y=PSBDT_"00" X ^DD("DD") S PSBDT(0)=Y
S PSBNUM=$P(^XMB(1,1,"XUS"),U,17)
S PSBSITE=$$GET1^DIQ(4,PSBNUM_",",.01)
S PSBNUM=$$GET1^DIQ(4,PSBNUM_",",99)
K ^TMP("PSBO",$J)
S ^TMP("PSBO",$J,1)=PSBSITE_U_PSBNUM_U_PSBDT(0)
F D0=0:0 S D0=$O(^DIC(42,D0)) Q:'D0 D
.D WIN^DGPMDDCF Q:X ; Inactive Ward
.D OPER^DGPMDDCF S PSBEDS=X
.Q:'PSBEDS ; No operating beds
.; Tally the med passes
.S PSBWRD=$P(^DIC(42,D0,0),U)
.S PSBCNT=0,PSB=PSBDT_"00"
.F S PSB=$O(^PSB("SAGG",PSBWRD,PSB)) Q:PSB=""!($P(PSB,PSBDT)]"") D
..S PSBCNT=PSBCNT+^PSB("SAGG",PSBWRD,PSB)
.; Add to the message
.S Y=$O(^TMP("PSBO",$J,""),-1)+1
.S ^TMP("PSBO",$J,Y)=PSBWRD_U_PSBEDS_U_PSBCNT
S ^TMP("PSBO",$J,0)=+$O(^TMP("PSBO",$J,""),-1)
S XMDUZ="BCMA"
S XMSUB=PSBSITE_" ("_PSBDT(0)_") BCMA Med Pass Tally"
;
; Begin Patch PSB*1*2
; DP/Topeka 7-SEP-1999 12:12:49
; Changed server name per request of SAGG Team
S XMY("S.KMP90-BCMA-SERVER@DOMAIN.NAME")=""
; End Patch PSB*1*2
;
S XMTEXT="^TMP(""PSBO"",$J,"
D ^XMD
Q
;
PSBSAGG ;BIRMINGHAM/EFC-BCMA TEMPORARY SAGG TYPE REPORTING ;Mar 2004
+1 ;;3.0;BAR CODE MED ADMIN;;Mar 2004
+2 ;
+3 ; Reference/IA
+4 ; WIN^DGPMDDCF/1246
+5 ; OPER^DGPMDDCF/1246
+6 ; ^XMB(1,1,"XUS")/10091
+7 ; File 4/10090
+8 ; ^DIC(42/10039
EN ;
+1 NEW XMDUZ,XMY,XMSUB,XMTEXT,PSBEDS,PSBDT,PSB,PSBCNT,PSBWRD,D0,PSBSITE,PSBNUM
+2 SET X1=DT
SET X2=-1*(+$EXTRACT(DT,6,7))
DO C^%DTC
+3 SET PSBDT=$EXTRACT(X,1,5)
SET Y=PSBDT_"00"
XECUTE ^DD("DD")
SET PSBDT(0)=Y
+4 SET PSBNUM=$PIECE(^XMB(1,1,"XUS"),U,17)
+5 SET PSBSITE=$$GET1^DIQ(4,PSBNUM_",",.01)
+6 SET PSBNUM=$$GET1^DIQ(4,PSBNUM_",",99)
+7 KILL ^TMP("PSBO",$JOB)
+8 SET ^TMP("PSBO",$JOB,1)=PSBSITE_U_PSBNUM_U_PSBDT(0)
+9 FOR D0=0:0
SET D0=$ORDER(^DIC(42,D0))
IF 'D0
QUIT
Begin DoDot:1
+10 ; Inactive Ward
DO WIN^DGPMDDCF
IF X
QUIT
+11 DO OPER^DGPMDDCF
SET PSBEDS=X
+12 ; No operating beds
IF 'PSBEDS
QUIT
+13 ; Tally the med passes
+14 SET PSBWRD=$PIECE(^DIC(42,D0,0),U)
+15 SET PSBCNT=0
SET PSB=PSBDT_"00"
+16 FOR
SET PSB=$ORDER(^PSB("SAGG",PSBWRD,PSB))
IF PSB=""!($PIECE(PSB,PSBDT)]"")
QUIT
Begin DoDot:2
+17 SET PSBCNT=PSBCNT+^PSB("SAGG",PSBWRD,PSB)
End DoDot:2
+18 ; Add to the message
+19 SET Y=$ORDER(^TMP("PSBO",$JOB,""),-1)+1
+20 SET ^TMP("PSBO",$JOB,Y)=PSBWRD_U_PSBEDS_U_PSBCNT
End DoDot:1
+21 SET ^TMP("PSBO",$JOB,0)=+$ORDER(^TMP("PSBO",$JOB,""),-1)
+22 SET XMDUZ="BCMA"
+23 SET XMSUB=PSBSITE_" ("_PSBDT(0)_") BCMA Med Pass Tally"
+24 ;
+25 ; Begin Patch PSB*1*2
+26 ; DP/Topeka 7-SEP-1999 12:12:49
+27 ; Changed server name per request of SAGG Team
+28 SET XMY("S.KMP90-BCMA-SERVER@DOMAIN.NAME")=""
+29 ; End Patch PSB*1*2
+30 ;
+31 SET XMTEXT="^TMP(""PSBO"",$J,"
+32 DO ^XMD
+33 QUIT
+34 ;