BARRQ1 ; IHS/SD/TPF - RE-QUEU A/R TRANSACTIONS SEARCH UTILITIES
;;1.8;IHS ACCOUNTS RECEIVABLE;*22,23**;OCT 26, 2005
;OCT 2012 P.OTT ADDED REVERSE SEARCH
Q
;
OPENSESS(REJECT,ESC) ;EP - ENTER NEW OPEN SESSION FOR RE-QUEUING
ASKSESS ;EP -
;AUTO CREATE NEW OPEN SESSION FOR CASHIER CHOSEN
;DO NOT ALLOW ADDING AN OPEN ONE FOR THE CURRENT DUZ
;OR FOR SOMEONE WITHOUT ACCESS TO AR MENU
S (NEWDUZ,NEWSESS,NEWUSRNM)=""
S REJECT=0
K DIC,DIR,DIE,DA,DR
S DIC("A")="OPEN A NEW CASHIERING SESSION FOR REQUEUING: "
S DIC="^BARSESS("_DUZ(2)_","
S DIC(0)="AEQML"
;S DIC("S")="I ^(0)'=DUZ"
D ^DIC
I Y<0 S ESC=X Q
;I +Y=DUZ!('$D(^XUSEC("BARZMENU",+Y))) D Q
;.S REJECT=1
;.K DIC,DIR,DIE,DA,DR
;.S DIE="^BARSESS(DUZ(2),"
;.S DA=+Y
;.S DR=".01////@"
;.D ^DIE
;.W !!,"CAN NOT OPEN A SESSION FOR YOURSELF OR USER WITHOUT BAR ACCESS!!" H 2
S NEWDUZ=+Y
K DIC,DIE,DR,DA,DIR
D NOW^%DTC
S SESSID=%
S DA(1)=NEWDUZ
S X=SESSID
S DIC(0)="L"
S DIC("P")=$P(^DD(90057,1101,0),U,2)
S DIC="^BARSESS(DUZ(2),"_DA(1)_",11,"
D ^DIC
I Y<0 W !!,"SESSION COULD NOT BE CREATED!!" H 2 G ASKSESS
S NEWSESS=+Y
S X=$$SETSESS^BARUFUT(NEWDUZ,$P(Y,U,2),"O") ;SET OPEN STATUS
I X=0 W !!,"STATUS COULD NOT BE SET!!" H 2 G ASKSESS
S NEWUSRNM=$P($G(^VA(200,NEWDUZ,0)),U)
W !!!,"A NEW SESSION HAS BEEN OPENED FOR "_NEWUSRNM_" TO BE USED FOR RE-QUEUING"
W !!,"SESSION: ",NEWSESS,?30,"STATUS: ",$$CURSTAT^BARUFUT(NEWDUZ,NEWSESS,"E")
W !
K DIR
S DIR(0)="E"
D ^DIR
Q
;
FNSEARCH(FN) ;EP - SEARCH FOR FILENAME IN NODE 6 OF BARTR
;SCENARIO: TX HAS A FILNAME IN NODE 6 BUT SITE AND HUB CLAIM THIS FILE IS
; NOT TO BE FOUND IN LOCAL DIRECTORY AND NOT FOUND AT HUB.
; IF FILE NOT AT HUB BUT IS IN LOCAL DIR JUST FTP FILE
N FILENAME,TXCNT
S TXCNT=0
K DIR
S DIR(0)="FO^3:80"
S DIR("A")="ENTER FILENAME TO SEARCH FOR IN A/R TRANSACTION FILE"
S DIR("?")=5
S DIR("?",1)="USE THIS SEARCH OPTION TO FIND TX THAT APPARENTLY WERE SENT IN A FILE"
S DIR("?",2)="BUT THE SITE AND HUB CLAIM THE FILE IS NO WHERE TO BE FOUND"
D ^DIR
Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)!(Y="")
S TARGFILE=Y ;TARGET FILE STRING
S GLO="^BARTR(0)"
;B "S+"
F S GLO=$Q(@GLO,-1) Q:GLO=""!($P(GLO,",",2)["AC") D ;P.OTT REVERSE SEARCH
.Q:$P(GLO,",",3)'="6)"
.I @GLO'[TARGFILE Q
.W !,GLO_"="_@GLO
.S NODE6=@GLO
.S TRANTYPE=$P($G(^(1)),U)
.Q:TRANTYPE=49!(TRANTYPE=115)!(TRANTYPE=117) ;DON'T PROCESS BILL NEW, COL BAT TO ACC POST, OR COL BAT TO FACILITY
.S TX=$P(GLO,",",2)
.I $D(^BARSESS(DUZ(2),"NS",TX)) D Q
..W !!,"TRANSACTION IN THE 'NOT SEND' STATUS"
..W !,"TX NOT ALLOWED!"
.S NODE6=@GLO
.S BILL=$P($G(^(0)),U,4)
.S COLBAT=$P($G(^(0)),U,14)
.S FNAME=$P($G(^(6)),U)
.S SESSID=$P($G(^(6)),U,2)
.S BYUSER=$P($G(^(6)),U,3)
.S UNIQID=$P($G(^(6)),U,4)
.W !!,"TX: ",TX
.W !,"WAS TRANSMITTED IN FILE: ",FNAME
.W !,"BY: " W:BYUSER $P($G(^VA(200,BYUSER,0)),U)
.W !,"IN SESSION: ",SESSID
.W !,"TPB BILL: " W:BILL $P($G(^BARBL(DUZ(2),BILL,0)),U)
.W !,"COL BAT: " W:COLBAT $P($G(^BARCOL(DUZ(2),COLBAT,0)),U)
.I $D(^TMP($J,BARRNAM,$J,TX)) D Q
..W !,TX_" TRANSACTION FOUND IN PREVIOUS SEARCH"
.S ^TMP($J,BARRNAM,$J,TX)="",FN="*",^TMP($J,BARRNAM,$J)=$G(^TMP($J,BARRNAM,$J))+1
;PLACE SOME TYPE OF REVIEW/REJECTION STEP HERE.
Q
;
CBSEARCH(CB) ;EP - SEARCH FOR A GIVEN COL BATCH WHERE THE TX IS IN A SESSION BUT HAS NO NODE 6
;SCENARIO: SITE SUPPLIES A COL BATCH AND THEY CLAIM OR HUB CLAIMS
;THE TX IS NOT TO BE FOUND. SO LOOK AT COL BATCH THEN NODE 6 IF NO NODE 6, IS IT
;IN A SESSION? IF SESSION HAS A STATUS OF TRANSIMITED SOMETHING HAPPENED.
N CBATTAR,INSESS,FNFILE,SESSFOUN
K DIR,DIC,DIE,DR,DA
W !!,"USE THIS SEARCH OPTION TO FIND TX THAT APPARENTLY WERE IN A SESSION"
W !,"THE SESSION WAS TRANSMITTED BUT THE SITE AND HUB CLAIM"
W !,"THE TX IS NO WHERE TO BE FOUND"
S DIC(0)="AEMQ"
S DIC="^BARCOL(DUZ(2),"
D ^DIC
Q:Y<0
S COLBAT=+Y
S COLBATTAR=$P(Y,U,2)
;GO THROUGH BARTR "AD" X-REF
S TX=""
F S TX=$O(^BARTR(DUZ(2),"AD",COLBAT,TX)) Q:TX="" D
.S FNFILE=$P($G(^BARTR(DUZ(2),TX,6)),U)
.;FOUND TX BY COL BATCH. NOW LETS SEE IF ITS IN A SESSION
.; DUZ(2) TX DUZ SESSION DATE/TIME TX
.;^BARSESS(1564,"G",3070522.125652,805,3070522.125538,3070522.125652)
.K SESSFOUN
.S SESSFOUN=0
.;B:TX=3110210.132038 "S+"
.I $D(^BARSESS(DUZ(2),"G",TX)),(FNFILE="") D ;ITS IN THE COL BATCH AND HAS NO UFMS FILE
..;WHAT DOES THIS MEAN?
..;"G" SIMPLY MEANS ITS IN A SESSION.
..I $D(^BARSESS(DUZ(2),"NS",TX)) D Q
...W !!,"TRANSACTION IN THE 'NOT SEND' STATUS"
...W !,"TX NOT ALLOWED!"
..S UDUZ=""
..F S UDUZ=$O(^BARSESS(DUZ(2),"G",TX,UDUZ)) Q:UDUZ="" D
...S SESSION=""
...F SESSION=$O(^BARSESS(DUZ(2),"G",TX,UDUZ,SESSION)) Q:SESSION="" D
....S SESSFOUN=1
....S SESSFOUN(SESSION)=SESSION
....W !,"TX WAS FOUND IN SESSION: ",SESSION
....;WAS SESSION TRANSMITTED?
....I $O(^BARSESS(DUZ(2),UDUZ,11,SESSION,21,0)) D
.....W !,"AND WAS TRANSMITTED ON: "
.....S TRDT=0
.....F I=1:1 S TRDT=$O(^BARSESS(DUZ(2),UDUZ,11,SESSION,21,TRDT)) Q:'TRDT D
......S TXDATA=$G(^BARSESS(DUZ(2),UDUZ,11,SESSION,21,TRDT,0))
......S TXDT=$P(TXDATA,U)
......S TXFILE=$P(TXDATA,U,2)
......S TXBY=$P(TXDATA,U,3)
......I I=1 W ?25,TXDT,?35,TXFILE,!?25,"BY: ",$P($G(^VA(200,TXBY,0)),U)
......E W !,25,TXDT,?35,TXFILE,!?25,"BY: ",$P($G(^VA(200,TXBY,0)),U)
.;B "S+"
.Q:'SESSFOUN
.S TRANTYPE=$P($G(^BARTR(DUZ(2),TX,1)),U)
.Q:TRANTYPE=49!(TRANTYPE=115)!(TRANTYPE=117) ;DON'T PROCESS BILL NEW, COL BAT TO ACC POST, OR COL BAT TO FACILITY
.W !,"TRANTYPE= ",TRANTYPE
.W !,"TX: ",TX
.I $D(^TMP($J,BARRNAM,$J,TX)) D Q
..W !,TX_" TRANSACTION FOUND IN PREVIOUS SEARCH"
.S ^TMP($J,BARRNAM,$J,TX)="",CB="*",^TMP($J,BARRNAM,$J)=$G(^TMP($J,BARRNAM,$J))+1
Q
;
SSEARCH(SS) ;EP - SEARCH FOR A TX IN A SESSION WHERE THE SESSION HAS
;BEEN TRANSMITTED BUT THE TX DOESN'T HAVE NODE 6
SESS ;EP - ASK FOR A SESSION
N UDUZ,SESSID,TRANS,FOUND6,RQLIST,NODE6,UNIQID,UFMSFN,TRCNT
K DIC,DIE,DR,DA,DIR
S DIC="^BARSESS(DUZ(2),"
S DIC(0)="AEMQ"
D ^DIC
Q:Y<0
S UDUZ=+Y
K DIC,DIE,DR,DA,DIR
S DA(1)=UDUZ
S DIC="^BARSESS(DUZ(2),"_DA(1)_",11,"
S DIC(0)="AEMQ"
D ^DIC
G:Y<0 SESS
S SESSID=+Y
W !!,"SESSION ",SESSID," OF CASHIER ",$P($G(^VA(200,UDUZ,0)),U)
W !,"WILL BE SEARCHED FOR TRANSACTIONS"
;W !,"THAT DO NOT HAVE ^BARTR NODE 6.
W !,"THIS WILL ONLY BE DONE IF THE SESSION HAS BEEN TRANSMITTED."
S (TRCNT,FOUND6,NO6)=0
;I '$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,0)) D Q
;.W !,"SESSION HAS NOT BEEN TRANSMITTED!!"
;.W !,"SESSION WILL NOT BE SEARCHED"
W !!,"SESSION CASHIER ",$P($G(^VA(200,UDUZ,0)),U)
W !,"SESSION ",SESSID," HAS BEEN TRANSMITTED..."
S TX=0
F S TX=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TX)) Q:'TX D
.W !,TX
.I $D(^BARSESS(DUZ(2),"NS",TX)) D Q
..W !!,"TRANSACTION IN THE 'NOT SEND' STATUS"
..W !,"TX NOT ALLOWED!"
.S TRCNT=TRCNT+1
.I $D(^BARTR(DUZ(2),TX,6)) D
..S FOUND6=FOUND6+1 W ?17,"HAS NODE 6"
..S NODE6=$G(^BARTR(DUZ(2),TX,6)) ;MIGHT WANT TO MAKE FIELD 602 IN A/R TRANSACTION AS X-REF
..S UFMSFN=$P(NODE6,U)
..S SID=$P(NODE6,U,2)
..S BY=$P(NODE6,U,3)
..S:BY'="" BY=$P($G(^VA(200,BY,0)),U)
..S UNIQID=$P(NODE6,U,4)
..W !?10,"UFMS FN: ",UFMSFN
..W !?10,"SESSION ID: ",SID
..W !?10,"EXPORTED BY: ",BY
..W !?10,"UNIQUE ID: ",UNIQID
.E D
..S NO6=NO6+1 W ?17,TX_" MISSING NODE 6"
.;I NO6 D
.;.I $D(^TMP($J,BARRNAM,$J,TX)) D Q
.;..W !,TX_" TRANSACTION FOUND IN PREVIOUS SEARCH"
.S ^TMP($J,BARRNAM,$J,TX)="",SS="*",^TMP($J,BARRNAM,$J)=$G(^TMP($J,BARRNAM,$J))+1
W !,"A TOTAL OF ",TRCNT," TRANSACTIONS WERE PROCESSED"
W !,"THERE WERE "_$S(NO6=0:"NO",1:NO6)_" TRANSACTION"_$S(NO6=0!(NO6>1):"S",1:"")_" FOUND WITHOUT NODE 6"
W !,"THERE WERE "_$S(FOUND6=0:"NO",1:FOUND6)_" TRANSACTION"_$S(FOUND6=0!(FOUND6>1):"S",1:"")_" FOUND WITH NODE 6"
Q
;
PROCESS ;EP - PROCESS DATA FOUND FROM SEARCHES
I '$O(^TMP($J,BARRNAM,$J,"")) D Q
.W !!,"NO DATA IN ^TMP SEARCH GLOBAL"
.W !,"PLEASE PERFORM AT LEAST ONE SEARCH FIRST."
.K DIR
.S DIR(0)="E"
.D ^DIR
W !!,"THERE ARE "_$G(^TMP($J,BARRNAM,$J))_" TRANSACTIONS TO PROCESS."
S BARTRIEN=0
F S BARTRIEN=$O(^TMP($J,BARRNAM,$J,BARTRIEN)) Q:'BARTRIEN D
.K DIR
.S DIR(0)="E"
.S DIR("A")="CONTINUE PROCESSING TX: "_BARTRIEN
.D ^DIR
.Q:$D(DUOUT)
.S BARCNT=$G(BARCNT)+1
.D EN1^BARRQ
.K FLAG
Q
;
MSG1(BARMSG1,BARERR) ;EP - MESSAGE
I $G(BARTRIEN)="" S BARTRIEN=0
S BARTMP=+$G(^TMP($J,BARRNAM,BARRQDT,10,BARTRIEN))+1
S ^TMP($J,BARRNAM,BARRQDT,10,BARTRIEN)=BARTMP
S ^TMP($J,BARRNAM,BARRQDT,10,BARTRIEN,BARTMP,0)=$G(BARMSG1)
S ^TMP($J,BARRNAM,BARRQDT,10,BARTRIEN,BARTMP,2)=$G(BARBILL)_U_$G(SESSID)_U_$G(UDUZ)_U_$G(TPBILL)
S ^TMP($J,BARRNAM,BARRQDT,10,BARTRIEN,BARTMP,3)=$G(NEWSESS)_U_$G(NEWUSR)_U_$G(NEWUSRNM)
I BARERR="F" D
.W !,BARCNTS,?5,"<<< A/R TRANSACTION WAS NOT RE-QUEUED >>> REASON: ",$G(BARMSG1)
.S BARCNTS=BARCNTS+1 ;COUNT TX ADDED TO SESSION
.S BARCNTE=BARCNTE+1
.W !,DASHLINE
.W !,$G(BARCNTS),?6,$G(BARMSG1)
.W !,?5,"A/R TRANS:",?25,$G(BARTRIEN),?45,"ORIGINAL SESSION:",?65,$G(SESSID)
.W !,?5,"A/R BILL:",?25,$G(BARBILL),?45,"ORIG EXPORT USER:"
.W:$G(UDUZ)'="" ?65,$P($G(^VA(200,UDUZ,0)),U)
.W !,?5,"3P BILL:",?25,$G(TPBILL)
.I $G(BAR3PB)=1 W !,?6,"# OF A/R TX'S PROCESSED FOR ",$G(TPBILL),":",?37,BARCNT3X
.W !,?5,"*** TOTAL TRANS NOT PROCESSED:",?35,$G(BARCNTE)," ***"
.S BARSAVE=""
Q
;
SAVE ; - EP SAVE ORIGINAL DATA
D NOW^%DTC
S ^TMP($J,BARRNAM,BARRQDT,20,BARTRIEN,"TPB",0,0)="N/A"
S ^TMP($J,BARRNAM,BARRQDT,20,BARTRIEN,"BARTR",0,0)=%
S ^TMP($J,BARRNAM,BARRQDT,20,BARTRIEN,"BARTR",0,1)=$G(^BARTR(DUZ(2),BARTRIEN,0)) ;ORIGINAL TX BEFORE UPDATE
S ^TMP($J,BARRNAM,BARRQDT,20,BARTRIEN,"BARTR",1,1)=$G(^BARTR(DUZ(2),BARTRIEN,1))
S ^TMP($J,BARRNAM,BARRQDT,20,BARTRIEN,"BARTR",6,1)=$G(^BARTR(DUZ(2),BARTRIEN,6))
I UDUZ'="",SESSID'="" D
.S ^TMP($J,BARRNAM,BARRQDT,20,BARTRIEN,"BARSESS",SESSID,0)=UDUZ_U_SESSID_U_BARTRIEN_U_NEWSESS_"^No Action^"_%
.S ^TMP($J,BARRNAM,BARRQDT,20,BARTRIEN,"BARSESS",SESSID,11,0)=$G(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,BARTRIEN,0))
.S ^TMP($J,BARRNAM,BARRQDT,20,BARTRIEN,"BARSESS",SESSID,21,0)=$G(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,1,0))
.S BARSAVE=1
Q
;
SETRQTYP(DIR) ;EP - SET REQTYP HELP IN BARRQ
S DIR("?",1)="THE FIRST FOUR CHOICES ARE STRAIGHT FORWARD. YOU CAN ENTER"
S DIR("?",2)="ONE OR MANY INDIVIDUAL TXS OR BILLS. OR PROCESS A FILE OF TXS OR BILLS."
S DIR("?",3)="IF YOU DO ONE OF THE FIRST FOUR OPTIONS YOU MUST TRANSMIT THESE BEFORE"
S DIR("?",4)="USING THE 'BATCH' SEARCHES. AFTER USING ONE OF THE FIRST FOUR"
S DIR("?",5)="OPTIONS SIMPLY PRESS RETURN AT THE PROMPT TO ENTER THE DISPLAY SESSION SCREEN"
S DIR("?",6)="WHERE YOU CAN RECONCILE, REVIEW AND TRANSMIT YOUR RE-QUEUE SESSION."
S DIR("?",7)=" "
S DIR("?",8)="THE LAST THREE OPTIONS ARE SEARCHES DONE WITH A PARTICULAR LOGIC INVOLVED:"
S DIR("?",9)="SCENARIO 1:"
S DIR("?",10)="THE FN SEARCH ALLOWS THE USER TO ENTER A UFMS FILENAME. IT THEN"
S DIR("?",11)="SEARCHES THE A/R TRANSACTION FILE NODE 6 FOR THE FILENAME."
S DIR("?",12)="USE THIS SEARCH TO FIND TX THAT APPARENTLY WERE SENT IN A FILE"
S DIR("?",13)="BUT THE SITE AND HUB CLAIM THE FILE IS NO WHERE TO BE FOUND"
S DIR("?",14)=" "
S DIR("?",15)="SCENARIO 2:"
S DIR("?",16)="THE CB SEARCH ALLOWS THE USER TO ENTER A COLLECTION BATCH. IT THEN"
S DIR("?",17)="LOOKS FOR TX IN THE COL BATCH THAT ARE IN A TRANSMITTED SESSION BUT THERE IS NO"
S DIR("?",18)="NODE 6 IN THE A/R TRANSACTION FILE AND THE TX WAS TRANSMITTED (X-REF G)."
S DIR("?",19)=" "
S DIR("?",20)="SCENARIO 3:"
S DIR("?",21)="THE SS SEARCH ALLOWS THE USER TO ENTER A SESSION. IT THEN"
S DIR("?",22)="CHECKS TO SEE IF THE SESSION WAS TRANSMITTED. IF IT WAS"
S DIR("?",23)="THEN IT LOOKS FOR TX THAT HAVE NO NODE 6 IN THE SESSION."
S DIR("?",24)="THIS COULD BE THE 'CASHIER WENT TO LUNCH' SCENARIO"
S DIR("?",25)="KEEP IN MIND THESE SCENARIOS SEEM TO OVERLAP"
S DIR("?",26)="AND YOU MAY GET A HIT FOR THE SAME TX IN EACH SEARCH."
S DIR("?",27)=" "
S DIR("?",28)="AFTER DOING SEARCHES USING FN,CB AND SS A TEMPORARY GLOBAL WILL HOLD THE"
S DIR("?")="TRANSACTIONS FOUND. TO RE-Q THOSE TRANSACTIONS USE OPTION RQ."
Q
BARRQ1 ; IHS/SD/TPF - RE-QUEU A/R TRANSACTIONS SEARCH UTILITIES
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;*22,23**;OCT 26, 2005
+2 ;OCT 2012 P.OTT ADDED REVERSE SEARCH
+3 QUIT
+4 ;
OPENSESS(REJECT,ESC) ;EP - ENTER NEW OPEN SESSION FOR RE-QUEUING
ASKSESS ;EP -
+1 ;AUTO CREATE NEW OPEN SESSION FOR CASHIER CHOSEN
+2 ;DO NOT ALLOW ADDING AN OPEN ONE FOR THE CURRENT DUZ
+3 ;OR FOR SOMEONE WITHOUT ACCESS TO AR MENU
+4 SET (NEWDUZ,NEWSESS,NEWUSRNM)=""
+5 SET REJECT=0
+6 KILL DIC,DIR,DIE,DA,DR
+7 SET DIC("A")="OPEN A NEW CASHIERING SESSION FOR REQUEUING: "
+8 SET DIC="^BARSESS("_DUZ(2)_","
+9 SET DIC(0)="AEQML"
+10 ;S DIC("S")="I ^(0)'=DUZ"
+11 DO ^DIC
+12 IF Y<0
SET ESC=X
QUIT
+13 ;I +Y=DUZ!('$D(^XUSEC("BARZMENU",+Y))) D Q
+14 ;.S REJECT=1
+15 ;.K DIC,DIR,DIE,DA,DR
+16 ;.S DIE="^BARSESS(DUZ(2),"
+17 ;.S DA=+Y
+18 ;.S DR=".01////@"
+19 ;.D ^DIE
+20 ;.W !!,"CAN NOT OPEN A SESSION FOR YOURSELF OR USER WITHOUT BAR ACCESS!!" H 2
+21 SET NEWDUZ=+Y
+22 KILL DIC,DIE,DR,DA,DIR
+23 DO NOW^%DTC
+24 SET SESSID=%
+25 SET DA(1)=NEWDUZ
+26 SET X=SESSID
+27 SET DIC(0)="L"
+28 SET DIC("P")=$PIECE(^DD(90057,1101,0),U,2)
+29 SET DIC="^BARSESS(DUZ(2),"_DA(1)_",11,"
+30 DO ^DIC
+31 IF Y<0
WRITE !!,"SESSION COULD NOT BE CREATED!!"
HANG 2
GOTO ASKSESS
+32 SET NEWSESS=+Y
+33 ;SET OPEN STATUS
SET X=$$SETSESS^BARUFUT(NEWDUZ,$PIECE(Y,U,2),"O")
+34 IF X=0
WRITE !!,"STATUS COULD NOT BE SET!!"
HANG 2
GOTO ASKSESS
+35 SET NEWUSRNM=$PIECE($GET(^VA(200,NEWDUZ,0)),U)
+36 WRITE !!!,"A NEW SESSION HAS BEEN OPENED FOR "_NEWUSRNM_" TO BE USED FOR RE-QUEUING"
+37 WRITE !!,"SESSION: ",NEWSESS,?30,"STATUS: ",$$CURSTAT^BARUFUT(NEWDUZ,NEWSESS,"E")
+38 WRITE !
+39 KILL DIR
+40 SET DIR(0)="E"
+41 DO ^DIR
+42 QUIT
+43 ;
FNSEARCH(FN) ;EP - SEARCH FOR FILENAME IN NODE 6 OF BARTR
+1 ;SCENARIO: TX HAS A FILNAME IN NODE 6 BUT SITE AND HUB CLAIM THIS FILE IS
+2 ; NOT TO BE FOUND IN LOCAL DIRECTORY AND NOT FOUND AT HUB.
+3 ; IF FILE NOT AT HUB BUT IS IN LOCAL DIR JUST FTP FILE
+4 NEW FILENAME,TXCNT
+5 SET TXCNT=0
+6 KILL DIR
+7 SET DIR(0)="FO^3:80"
+8 SET DIR("A")="ENTER FILENAME TO SEARCH FOR IN A/R TRANSACTION FILE"
+9 SET DIR("?")=5
+10 SET DIR("?",1)="USE THIS SEARCH OPTION TO FIND TX THAT APPARENTLY WERE SENT IN A FILE"
+11 SET DIR("?",2)="BUT THE SITE AND HUB CLAIM THE FILE IS NO WHERE TO BE FOUND"
+12 DO ^DIR
+13 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)!(Y="")
QUIT
+14 ;TARGET FILE STRING
SET TARGFILE=Y
+15 SET GLO="^BARTR(0)"
+16 ;B "S+"
+17 ;P.OTT REVERSE SEARCH
FOR
SET GLO=$QUERY(@GLO,-1)
IF GLO=""!($PIECE(GLO,",",2)["AC")
QUIT
Begin DoDot:1
+18 IF $PIECE(GLO,",",3)'="6)"
QUIT
+19 IF @GLO'[TARGFILE
QUIT
+20 WRITE !,GLO_"="_@GLO
+21 SET NODE6=@GLO
+22 SET TRANTYPE=$PIECE($GET(^(1)),U)
+23 ;DON'T PROCESS BILL NEW, COL BAT TO ACC POST, OR COL BAT TO FACILITY
IF TRANTYPE=49!(TRANTYPE=115)!(TRANTYPE=117)
QUIT
+24 SET TX=$PIECE(GLO,",",2)
+25 IF $DATA(^BARSESS(DUZ(2),"NS",TX))
Begin DoDot:2
+26 WRITE !!,"TRANSACTION IN THE 'NOT SEND' STATUS"
+27 WRITE !,"TX NOT ALLOWED!"
End DoDot:2
QUIT
+28 SET NODE6=@GLO
+29 SET BILL=$PIECE($GET(^(0)),U,4)
+30 SET COLBAT=$PIECE($GET(^(0)),U,14)
+31 SET FNAME=$PIECE($GET(^(6)),U)
+32 SET SESSID=$PIECE($GET(^(6)),U,2)
+33 SET BYUSER=$PIECE($GET(^(6)),U,3)
+34 SET UNIQID=$PIECE($GET(^(6)),U,4)
+35 WRITE !!,"TX: ",TX
+36 WRITE !,"WAS TRANSMITTED IN FILE: ",FNAME
+37 WRITE !,"BY: "
IF BYUSER
WRITE $PIECE($GET(^VA(200,BYUSER,0)),U)
+38 WRITE !,"IN SESSION: ",SESSID
+39 WRITE !,"TPB BILL: "
IF BILL
WRITE $PIECE($GET(^BARBL(DUZ(2),BILL,0)),U)
+40 WRITE !,"COL BAT: "
IF COLBAT
WRITE $PIECE($GET(^BARCOL(DUZ(2),COLBAT,0)),U)
+41 IF $DATA(^TMP($JOB,BARRNAM,$JOB,TX))
Begin DoDot:2
+42 WRITE !,TX_" TRANSACTION FOUND IN PREVIOUS SEARCH"
End DoDot:2
QUIT
+43 SET ^TMP($JOB,BARRNAM,$JOB,TX)=""
SET FN="*"
SET ^TMP($JOB,BARRNAM,$JOB)=$GET(^TMP($JOB,BARRNAM,$JOB))+1
End DoDot:1
+44 ;PLACE SOME TYPE OF REVIEW/REJECTION STEP HERE.
+45 QUIT
+46 ;
CBSEARCH(CB) ;EP - SEARCH FOR A GIVEN COL BATCH WHERE THE TX IS IN A SESSION BUT HAS NO NODE 6
+1 ;SCENARIO: SITE SUPPLIES A COL BATCH AND THEY CLAIM OR HUB CLAIMS
+2 ;THE TX IS NOT TO BE FOUND. SO LOOK AT COL BATCH THEN NODE 6 IF NO NODE 6, IS IT
+3 ;IN A SESSION? IF SESSION HAS A STATUS OF TRANSIMITED SOMETHING HAPPENED.
+4 NEW CBATTAR,INSESS,FNFILE,SESSFOUN
+5 KILL DIR,DIC,DIE,DR,DA
+6 WRITE !!,"USE THIS SEARCH OPTION TO FIND TX THAT APPARENTLY WERE IN A SESSION"
+7 WRITE !,"THE SESSION WAS TRANSMITTED BUT THE SITE AND HUB CLAIM"
+8 WRITE !,"THE TX IS NO WHERE TO BE FOUND"
+9 SET DIC(0)="AEMQ"
+10 SET DIC="^BARCOL(DUZ(2),"
+11 DO ^DIC
+12 IF Y<0
QUIT
+13 SET COLBAT=+Y
+14 SET COLBATTAR=$PIECE(Y,U,2)
+15 ;GO THROUGH BARTR "AD" X-REF
+16 SET TX=""
+17 FOR
SET TX=$ORDER(^BARTR(DUZ(2),"AD",COLBAT,TX))
IF TX=""
QUIT
Begin DoDot:1
+18 SET FNFILE=$PIECE($GET(^BARTR(DUZ(2),TX,6)),U)
+19 ;FOUND TX BY COL BATCH. NOW LETS SEE IF ITS IN A SESSION
+20 ; DUZ(2) TX DUZ SESSION DATE/TIME TX
+21 ;^BARSESS(1564,"G",3070522.125652,805,3070522.125538,3070522.125652)
+22 KILL SESSFOUN
+23 SET SESSFOUN=0
+24 ;B:TX=3110210.132038 "S+"
+25 ;ITS IN THE COL BATCH AND HAS NO UFMS FILE
IF $DATA(^BARSESS(DUZ(2),"G",TX))
IF (FNFILE="")
Begin DoDot:2
+26 ;WHAT DOES THIS MEAN?
+27 ;"G" SIMPLY MEANS ITS IN A SESSION.
+28 IF $DATA(^BARSESS(DUZ(2),"NS",TX))
Begin DoDot:3
+29 WRITE !!,"TRANSACTION IN THE 'NOT SEND' STATUS"
+30 WRITE !,"TX NOT ALLOWED!"
End DoDot:3
QUIT
+31 SET UDUZ=""
+32 FOR
SET UDUZ=$ORDER(^BARSESS(DUZ(2),"G",TX,UDUZ))
IF UDUZ=""
QUIT
Begin DoDot:3
+33 SET SESSION=""
+34 FOR SESSION=$ORDER(^BARSESS(DUZ(2),"G",TX,UDUZ,SESSION))
IF SESSION=""
QUIT
Begin DoDot:4
+35 SET SESSFOUN=1
+36 SET SESSFOUN(SESSION)=SESSION
+37 WRITE !,"TX WAS FOUND IN SESSION: ",SESSION
+38 ;WAS SESSION TRANSMITTED?
+39 IF $ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSION,21,0))
Begin DoDot:5
+40 WRITE !,"AND WAS TRANSMITTED ON: "
+41 SET TRDT=0
+42 FOR I=1:1
SET TRDT=$ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSION,21,TRDT))
IF 'TRDT
QUIT
Begin DoDot:6
+43 SET TXDATA=$GET(^BARSESS(DUZ(2),UDUZ,11,SESSION,21,TRDT,0))
+44 SET TXDT=$PIECE(TXDATA,U)
+45 SET TXFILE=$PIECE(TXDATA,U,2)
+46 SET TXBY=$PIECE(TXDATA,U,3)
+47 IF I=1
WRITE ?25,TXDT,?35,TXFILE,!?25,"BY: ",$PIECE($GET(^VA(200,TXBY,0)),U)
+48 IF '$TEST
WRITE !,25,TXDT,?35,TXFILE,!?25,"BY: ",$PIECE($GET(^VA(200,TXBY,0)),U)
End DoDot:6
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
+49 ;B "S+"
+50 IF 'SESSFOUN
QUIT
+51 SET TRANTYPE=$PIECE($GET(^BARTR(DUZ(2),TX,1)),U)
+52 ;DON'T PROCESS BILL NEW, COL BAT TO ACC POST, OR COL BAT TO FACILITY
IF TRANTYPE=49!(TRANTYPE=115)!(TRANTYPE=117)
QUIT
+53 WRITE !,"TRANTYPE= ",TRANTYPE
+54 WRITE !,"TX: ",TX
+55 IF $DATA(^TMP($JOB,BARRNAM,$JOB,TX))
Begin DoDot:2
+56 WRITE !,TX_" TRANSACTION FOUND IN PREVIOUS SEARCH"
End DoDot:2
QUIT
+57 SET ^TMP($JOB,BARRNAM,$JOB,TX)=""
SET CB="*"
SET ^TMP($JOB,BARRNAM,$JOB)=$GET(^TMP($JOB,BARRNAM,$JOB))+1
End DoDot:1
+58 QUIT
+59 ;
SSEARCH(SS) ;EP - SEARCH FOR A TX IN A SESSION WHERE THE SESSION HAS
+1 ;BEEN TRANSMITTED BUT THE TX DOESN'T HAVE NODE 6
SESS ;EP - ASK FOR A SESSION
+1 NEW UDUZ,SESSID,TRANS,FOUND6,RQLIST,NODE6,UNIQID,UFMSFN,TRCNT
+2 KILL DIC,DIE,DR,DA,DIR
+3 SET DIC="^BARSESS(DUZ(2),"
+4 SET DIC(0)="AEMQ"
+5 DO ^DIC
+6 IF Y<0
QUIT
+7 SET UDUZ=+Y
+8 KILL DIC,DIE,DR,DA,DIR
+9 SET DA(1)=UDUZ
+10 SET DIC="^BARSESS(DUZ(2),"_DA(1)_",11,"
+11 SET DIC(0)="AEMQ"
+12 DO ^DIC
+13 IF Y<0
GOTO SESS
+14 SET SESSID=+Y
+15 WRITE !!,"SESSION ",SESSID," OF CASHIER ",$PIECE($GET(^VA(200,UDUZ,0)),U)
+16 WRITE !,"WILL BE SEARCHED FOR TRANSACTIONS"
+17 ;W !,"THAT DO NOT HAVE ^BARTR NODE 6.
+18 WRITE !,"THIS WILL ONLY BE DONE IF THE SESSION HAS BEEN TRANSMITTED."
+19 SET (TRCNT,FOUND6,NO6)=0
+20 ;I '$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,0)) D Q
+21 ;.W !,"SESSION HAS NOT BEEN TRANSMITTED!!"
+22 ;.W !,"SESSION WILL NOT BE SEARCHED"
+23 WRITE !!,"SESSION CASHIER ",$PIECE($GET(^VA(200,UDUZ,0)),U)
+24 WRITE !,"SESSION ",SESSID," HAS BEEN TRANSMITTED..."
+25 SET TX=0
+26 FOR
SET TX=$ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TX))
IF 'TX
QUIT
Begin DoDot:1
+27 WRITE !,TX
+28 IF $DATA(^BARSESS(DUZ(2),"NS",TX))
Begin DoDot:2
+29 WRITE !!,"TRANSACTION IN THE 'NOT SEND' STATUS"
+30 WRITE !,"TX NOT ALLOWED!"
End DoDot:2
QUIT
+31 SET TRCNT=TRCNT+1
+32 IF $DATA(^BARTR(DUZ(2),TX,6))
Begin DoDot:2
+33 SET FOUND6=FOUND6+1
WRITE ?17,"HAS NODE 6"
+34 ;MIGHT WANT TO MAKE FIELD 602 IN A/R TRANSACTION AS X-REF
SET NODE6=$GET(^BARTR(DUZ(2),TX,6))
+35 SET UFMSFN=$PIECE(NODE6,U)
+36 SET SID=$PIECE(NODE6,U,2)
+37 SET BY=$PIECE(NODE6,U,3)
+38 IF BY'=""
SET BY=$PIECE($GET(^VA(200,BY,0)),U)
+39 SET UNIQID=$PIECE(NODE6,U,4)
+40 WRITE !?10,"UFMS FN: ",UFMSFN
+41 WRITE !?10,"SESSION ID: ",SID
+42 WRITE !?10,"EXPORTED BY: ",BY
+43 WRITE !?10,"UNIQUE ID: ",UNIQID
End DoDot:2
+44 IF '$TEST
Begin DoDot:2
+45 SET NO6=NO6+1
WRITE ?17,TX_" MISSING NODE 6"
End DoDot:2
+46 ;I NO6 D
+47 ;.I $D(^TMP($J,BARRNAM,$J,TX)) D Q
+48 ;..W !,TX_" TRANSACTION FOUND IN PREVIOUS SEARCH"
+49 SET ^TMP($JOB,BARRNAM,$JOB,TX)=""
SET SS="*"
SET ^TMP($JOB,BARRNAM,$JOB)=$GET(^TMP($JOB,BARRNAM,$JOB))+1
End DoDot:1
+50 WRITE !,"A TOTAL OF ",TRCNT," TRANSACTIONS WERE PROCESSED"
+51 WRITE !,"THERE WERE "_$SELECT(NO6=0:"NO",1:NO6)_" TRANSACTION"_$SELECT(NO6=0!(NO6>1):"S",1:"")_" FOUND WITHOUT NODE 6"
+52 WRITE !,"THERE WERE "_$SELECT(FOUND6=0:"NO",1:FOUND6)_" TRANSACTION"_$SELECT(FOUND6=0!(FOUND6>1):"S",1:"")_" FOUND WITH NODE 6"
+53 QUIT
+54 ;
PROCESS ;EP - PROCESS DATA FOUND FROM SEARCHES
+1 IF '$ORDER(^TMP($JOB,BARRNAM,$JOB,""))
Begin DoDot:1
+2 WRITE !!,"NO DATA IN ^TMP SEARCH GLOBAL"
+3 WRITE !,"PLEASE PERFORM AT LEAST ONE SEARCH FIRST."
+4 KILL DIR
+5 SET DIR(0)="E"
+6 DO ^DIR
End DoDot:1
QUIT
+7 WRITE !!,"THERE ARE "_$GET(^TMP($JOB,BARRNAM,$JOB))_" TRANSACTIONS TO PROCESS."
+8 SET BARTRIEN=0
+9 FOR
SET BARTRIEN=$ORDER(^TMP($JOB,BARRNAM,$JOB,BARTRIEN))
IF 'BARTRIEN
QUIT
Begin DoDot:1
+10 KILL DIR
+11 SET DIR(0)="E"
+12 SET DIR("A")="CONTINUE PROCESSING TX: "_BARTRIEN
+13 DO ^DIR
+14 IF $DATA(DUOUT)
QUIT
+15 SET BARCNT=$GET(BARCNT)+1
+16 DO EN1^BARRQ
+17 KILL FLAG
End DoDot:1
+18 QUIT
+19 ;
MSG1(BARMSG1,BARERR) ;EP - MESSAGE
+1 IF $GET(BARTRIEN)=""
SET BARTRIEN=0
+2 SET BARTMP=+$GET(^TMP($JOB,BARRNAM,BARRQDT,10,BARTRIEN))+1
+3 SET ^TMP($JOB,BARRNAM,BARRQDT,10,BARTRIEN)=BARTMP
+4 SET ^TMP($JOB,BARRNAM,BARRQDT,10,BARTRIEN,BARTMP,0)=$GET(BARMSG1)
+5 SET ^TMP($JOB,BARRNAM,BARRQDT,10,BARTRIEN,BARTMP,2)=$GET(BARBILL)_U_$GET(SESSID)_U_$GET(UDUZ)_U_$GET(TPBILL)
+6 SET ^TMP($JOB,BARRNAM,BARRQDT,10,BARTRIEN,BARTMP,3)=$GET(NEWSESS)_U_$GET(NEWUSR)_U_$GET(NEWUSRNM)
+7 IF BARERR="F"
Begin DoDot:1
+8 WRITE !,BARCNTS,?5,"<<< A/R TRANSACTION WAS NOT RE-QUEUED >>> REASON: ",$GET(BARMSG1)
+9 ;COUNT TX ADDED TO SESSION
SET BARCNTS=BARCNTS+1
+10 SET BARCNTE=BARCNTE+1
+11 WRITE !,DASHLINE
+12 WRITE !,$GET(BARCNTS),?6,$GET(BARMSG1)
+13 WRITE !,?5,"A/R TRANS:",?25,$GET(BARTRIEN),?45,"ORIGINAL SESSION:",?65,$GET(SESSID)
+14 WRITE !,?5,"A/R BILL:",?25,$GET(BARBILL),?45,"ORIG EXPORT USER:"
+15 IF $GET(UDUZ)'=""
WRITE ?65,$PIECE($GET(^VA(200,UDUZ,0)),U)
+16 WRITE !,?5,"3P BILL:",?25,$GET(TPBILL)
+17 IF $GET(BAR3PB)=1
WRITE !,?6,"# OF A/R TX'S PROCESSED FOR ",$GET(TPBILL),":",?37,BARCNT3X
+18 WRITE !,?5,"*** TOTAL TRANS NOT PROCESSED:",?35,$GET(BARCNTE)," ***"
+19 SET BARSAVE=""
End DoDot:1
+20 QUIT
+21 ;
SAVE ; - EP SAVE ORIGINAL DATA
+1 DO NOW^%DTC
+2 SET ^TMP($JOB,BARRNAM,BARRQDT,20,BARTRIEN,"TPB",0,0)="N/A"
+3 SET ^TMP($JOB,BARRNAM,BARRQDT,20,BARTRIEN,"BARTR",0,0)=%
+4 ;ORIGINAL TX BEFORE UPDATE
SET ^TMP($JOB,BARRNAM,BARRQDT,20,BARTRIEN,"BARTR",0,1)=$GET(^BARTR(DUZ(2),BARTRIEN,0))
+5 SET ^TMP($JOB,BARRNAM,BARRQDT,20,BARTRIEN,"BARTR",1,1)=$GET(^BARTR(DUZ(2),BARTRIEN,1))
+6 SET ^TMP($JOB,BARRNAM,BARRQDT,20,BARTRIEN,"BARTR",6,1)=$GET(^BARTR(DUZ(2),BARTRIEN,6))
+7 IF UDUZ'=""
IF SESSID'=""
Begin DoDot:1
+8 SET ^TMP($JOB,BARRNAM,BARRQDT,20,BARTRIEN,"BARSESS",SESSID,0)=UDUZ_U_SESSID_U_BARTRIEN_U_NEWSESS_"^No Action^"_%
+9 SET ^TMP($JOB,BARRNAM,BARRQDT,20,BARTRIEN,"BARSESS",SESSID,11,0)=$GET(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,BARTRIEN,0))
+10 SET ^TMP($JOB,BARRNAM,BARRQDT,20,BARTRIEN,"BARSESS",SESSID,21,0)=$GET(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,1,0))
+11 SET BARSAVE=1
End DoDot:1
+12 QUIT
+13 ;
SETRQTYP(DIR) ;EP - SET REQTYP HELP IN BARRQ
+1 SET DIR("?",1)="THE FIRST FOUR CHOICES ARE STRAIGHT FORWARD. YOU CAN ENTER"
+2 SET DIR("?",2)="ONE OR MANY INDIVIDUAL TXS OR BILLS. OR PROCESS A FILE OF TXS OR BILLS."
+3 SET DIR("?",3)="IF YOU DO ONE OF THE FIRST FOUR OPTIONS YOU MUST TRANSMIT THESE BEFORE"
+4 SET DIR("?",4)="USING THE 'BATCH' SEARCHES. AFTER USING ONE OF THE FIRST FOUR"
+5 SET DIR("?",5)="OPTIONS SIMPLY PRESS RETURN AT THE PROMPT TO ENTER THE DISPLAY SESSION SCREEN"
+6 SET DIR("?",6)="WHERE YOU CAN RECONCILE, REVIEW AND TRANSMIT YOUR RE-QUEUE SESSION."
+7 SET DIR("?",7)=" "
+8 SET DIR("?",8)="THE LAST THREE OPTIONS ARE SEARCHES DONE WITH A PARTICULAR LOGIC INVOLVED:"
+9 SET DIR("?",9)="SCENARIO 1:"
+10 SET DIR("?",10)="THE FN SEARCH ALLOWS THE USER TO ENTER A UFMS FILENAME. IT THEN"
+11 SET DIR("?",11)="SEARCHES THE A/R TRANSACTION FILE NODE 6 FOR THE FILENAME."
+12 SET DIR("?",12)="USE THIS SEARCH TO FIND TX THAT APPARENTLY WERE SENT IN A FILE"
+13 SET DIR("?",13)="BUT THE SITE AND HUB CLAIM THE FILE IS NO WHERE TO BE FOUND"
+14 SET DIR("?",14)=" "
+15 SET DIR("?",15)="SCENARIO 2:"
+16 SET DIR("?",16)="THE CB SEARCH ALLOWS THE USER TO ENTER A COLLECTION BATCH. IT THEN"
+17 SET DIR("?",17)="LOOKS FOR TX IN THE COL BATCH THAT ARE IN A TRANSMITTED SESSION BUT THERE IS NO"
+18 SET DIR("?",18)="NODE 6 IN THE A/R TRANSACTION FILE AND THE TX WAS TRANSMITTED (X-REF G)."
+19 SET DIR("?",19)=" "
+20 SET DIR("?",20)="SCENARIO 3:"
+21 SET DIR("?",21)="THE SS SEARCH ALLOWS THE USER TO ENTER A SESSION. IT THEN"
+22 SET DIR("?",22)="CHECKS TO SEE IF THE SESSION WAS TRANSMITTED. IF IT WAS"
+23 SET DIR("?",23)="THEN IT LOOKS FOR TX THAT HAVE NO NODE 6 IN THE SESSION."
+24 SET DIR("?",24)="THIS COULD BE THE 'CASHIER WENT TO LUNCH' SCENARIO"
+25 SET DIR("?",25)="KEEP IN MIND THESE SCENARIOS SEEM TO OVERLAP"
+26 SET DIR("?",26)="AND YOU MAY GET A HIT FOR THE SAME TX IN EACH SEARCH."
+27 SET DIR("?",27)=" "
+28 SET DIR("?",28)="AFTER DOING SEARCHES USING FN,CB AND SS A TEMPORARY GLOBAL WILL HOLD THE"
+29 SET DIR("?")="TRANSACTIONS FOUND. TO RE-Q THOSE TRANSACTIONS USE OPTION RQ."
+30 QUIT