ABMDTXPT ; IHS/ASDST/DMJ - REPRINT TRANSMITTAL LIST ;
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
START ;START HERE
S DIC="^ABMDAOTX(DUZ(2),",DIC(0)="AEMQ" D ^DIC Q:Y<0 S ABM("Y")=+Y
S %ZIS="NQ" D ^%ZIS
I IO'=IO(0) D QUE,HOME^%ZIS K ABM Q
I $D(IO("S")) S IOP=ION D ^%ZIS
L1 ;TASKMAN COMES HERE - FIRST LOOP
S DA=0 F S DA=$O(^ABMDBILL(DUZ(2),"AZ",ABM("Y"),DA)) Q:'DA D
F I=1:1:8 S ABM(I)=$P(^ABMDBILL(DUZ(2),DA,0),"^",I)
S ABM(9)=$S($P($G(^AUTNINS(ABM(8),2)),U)="R":1,$P($G(^(2)),U)="D":2,1:3)
S ^TMP("ABMDTX",$J,ABM(9),ABM(5),DA)=""
L2 ;SECOND LOOP
S I=0 F S I=$O(^TMP("ABMDTX",$J,I)) Q:'I D
.S J=0 F S J=$O(^TMP("ABMDTX",$J,I,J)) Q:'J D
..S DA=0 F S DA=$O(^TMP("ABMDTX",$J,I,J,DA)) Q:'DA D
...F K=1:1:8 S ABM(K)=$P(^ABMDBILL(DUZ(2),DA,0),"^",I)
...W !
Q
QUE ;QUE TO TASKMAN
S ZTRTN="L1^ABMDTXPT",ZTDESC="TRANSMITTAL LIST REPRINT"
S ZTSAVE("ABM(""Y"")")=""
K ZTSK D ^%ZTLOAD W:$G(ZTSK) !,"Task # ",ZTSK," queued.",!
Q
ABMDTXPT ; IHS/ASDST/DMJ - REPRINT TRANSMITTAL LIST ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
START ;START HERE
+1 SET DIC="^ABMDAOTX(DUZ(2),"
SET DIC(0)="AEMQ"
DO ^DIC
IF Y<0
QUIT
SET ABM("Y")=+Y
+2 SET %ZIS="NQ"
DO ^%ZIS
+3 IF IO'=IO(0)
DO QUE
DO HOME^%ZIS
KILL ABM
QUIT
+4 IF $DATA(IO("S"))
SET IOP=ION
DO ^%ZIS
L1 ;TASKMAN COMES HERE - FIRST LOOP
+1 SET DA=0
FOR
SET DA=$ORDER(^ABMDBILL(DUZ(2),"AZ",ABM("Y"),DA))
IF 'DA
QUIT
Begin DoDot:1
End DoDot:1
+2 FOR I=1:1:8
SET ABM(I)=$PIECE(^ABMDBILL(DUZ(2),DA,0),"^",I)
+3 SET ABM(9)=$SELECT($PIECE($GET(^AUTNINS(ABM(8),2)),U)="R":1,$PIECE($GET(^(2)),U)="D":2,1:3)
+4 SET ^TMP("ABMDTX",$JOB,ABM(9),ABM(5),DA)=""
L2 ;SECOND LOOP
+1 SET I=0
FOR
SET I=$ORDER(^TMP("ABMDTX",$JOB,I))
IF 'I
QUIT
Begin DoDot:1
+2 SET J=0
FOR
SET J=$ORDER(^TMP("ABMDTX",$JOB,I,J))
IF 'J
QUIT
Begin DoDot:2
+3 SET DA=0
FOR
SET DA=$ORDER(^TMP("ABMDTX",$JOB,I,J,DA))
IF 'DA
QUIT
Begin DoDot:3
+4 FOR K=1:1:8
SET ABM(K)=$PIECE(^ABMDBILL(DUZ(2),DA,0),"^",I)
+5 WRITE !
End DoDot:3
End DoDot:2
End DoDot:1
+6 QUIT
QUE ;QUE TO TASKMAN
+1 SET ZTRTN="L1^ABMDTXPT"
SET ZTDESC="TRANSMITTAL LIST REPRINT"
+2 SET ZTSAVE("ABM(""Y"")")=""
+3 KILL ZTSK
DO ^%ZTLOAD
IF $GET(ZTSK)
WRITE !,"Task # ",ZTSK," queued.",!
+4 QUIT