RCAMINS1 ;WASH-ISC@ALTOONA,PA/LDB-CHECK FOR INSURANCE COMPANY AS DEBTOR,SECONDARY OR TERTIARY CO ;11/22/95 2:08 PM
V ;;4.5;Accounts Receivable;**20,144**;Mar 20, 1995
MAIL ;Setup mail message after resetting insurance companies
N XMTEXT,XMY
K ^TMP($J,"MSG")
S XMTEXT="^TMP($J,""MSG"","
S XMY("G.PRCA ADJUSTMENT TRANS")=""
S ^TMP($J,"MSG",1)="The following insurance company: "
S ^TMP($J,"MSG",2)=" "
S ^TMP($J,"MSG",3)=" "_INSN1
I $G(ADD(1))]"" F P=1:1:7 D
.I $P(ADD(1),"^",P)]"",(P<4) S ^TMP($J,"MSG",3+P)=" "_$P(ADD(1),"^",P)
.I $P(ADD(1),"^",4)]"",(P=4) S ^TMP($J,"MSG",7)=" "_$P(ADD(1),"^",4)_", "
.I $P(ADD(1),"^",5)]"",(P=5) S ^TMP($J,"MSG",7)=$S($G(^TMP($J,"MSG",7))="":" ",1:$G(^TMP($J,"MSG",7)))_$P(ADD(1),"^",5)
.I $P(ADD(1),"^",6)]"",(P=6) D
..S $P(ADD(1),"^",7)=$E($P(ADD(1),"^",6),1,5)_$S($E($P(ADD(1),"^",6),6,9)]"":"-"_$E($P(ADD(1),"^",6),6,9),1:"")
..S ^TMP($J,"MSG",7)=$S($G(^TMP($J,"MSG",7))="":" ",1:$G(^TMP($J,"MSG",7)))_" "_$P(ADD(1),"^",7)
S ^TMP($J,"MSG",8)=" "
S ^TMP($J,"MSG",9)="has "_$S($G(INS1):"had bills merged to the following company: ",1:"been deleted.")
I $G(INS1) D
.S ^TMP($J,"MSG",10)=" "
.S ^TMP($J,"MSG",11)=" "_INSN2
.I $G(ADD(2))]"" F P=1:1:7 D
..I $P(ADD(2),"^",P)]"",(P<4) S ^TMP($J,"MSG",11+P)=" "_$P(ADD(2),"^",P)
..I $P(ADD(2),"^",4)]"",(P=4) S ^TMP($J,"MSG",15)=" "_$P(ADD(2),"^",4)_", "
..I $P(ADD(2),"^",5)]"",(P=5) S ^TMP($J,"MSG",15)=$S($G(^TMP($J,"MSG",15))="":" ",1:$G(^TMP($J,"MSG",15)))_$P(ADD(2),"^",5)
..I $P(ADD(2),"^",6)]"",(P=6) D
...S $P(ADD(2),"^",7)=$E($P(ADD(2),"^",6),1,5)_$S($E($P(ADD(2),"^",6),6,9)]"":"-"_$E($P(ADD(2),"^",6),6,9),1:"")
...S ^TMP($J,"MSG",15)=$S($G(^TMP($J,"MSG",15))="":" ",1:$G(^TMP($J,"MSG",15)))_" "_$P(ADD(2),"^",7)
S ^TMP($J,"MSG",16)=" "
S ^TMP($J,"MSG",18)=" "
S C=18,I="" F S I=$O(^TMP("RCAMINS",$J,I)) Q:I="" S C=C+1,^TMP($J,"MSG",C)=" "_I
D ^XMD
K ^TMP("RCAMINS",$J),^TMP($J,"MSG")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRCAMINS1 2048 printed Dec 13, 2024@01:42:29 Page 2
RCAMINS1 ;WASH-ISC@ALTOONA,PA/LDB-CHECK FOR INSURANCE COMPANY AS DEBTOR,SECONDARY OR TERTIARY CO ;11/22/95 2:08 PM
V ;;4.5;Accounts Receivable;**20,144**;Mar 20, 1995
MAIL ;Setup mail message after resetting insurance companies
+1 NEW XMTEXT,XMY
+2 KILL ^TMP($JOB,"MSG")
+3 SET XMTEXT="^TMP($J,""MSG"","
+4 SET XMY("G.PRCA ADJUSTMENT TRANS")=""
+5 SET ^TMP($JOB,"MSG",1)="The following insurance company: "
+6 SET ^TMP($JOB,"MSG",2)=" "
+7 SET ^TMP($JOB,"MSG",3)=" "_INSN1
+8 IF $GET(ADD(1))]""
FOR P=1:1:7
Begin DoDot:1
+9 IF $PIECE(ADD(1),"^",P)]""
IF (P<4)
SET ^TMP($JOB,"MSG",3+P)=" "_$PIECE(ADD(1),"^",P)
+10 IF $PIECE(ADD(1),"^",4)]""
IF (P=4)
SET ^TMP($JOB,"MSG",7)=" "_$PIECE(ADD(1),"^",4)_", "
+11 IF $PIECE(ADD(1),"^",5)]""
IF (P=5)
SET ^TMP($JOB,"MSG",7)=$SELECT($GET(^TMP($JOB,"MSG",7))="":" ",1:$GET(^TMP($JOB,"MSG",7)))_$PIECE(ADD(1),"^",5)
+12 IF $PIECE(ADD(1),"^",6)]""
IF (P=6)
Begin DoDot:2
+13 SET $PIECE(ADD(1),"^",7)=$EXTRACT($PIECE(ADD(1),"^",6),1,5)_$SELECT($EXTRACT($PIECE(ADD(1),"^",6),6,9)]"":"-"_$EXTRACT($PIECE(ADD(1),"^",6),6,9),1:"")
+14 SET ^TMP($JOB,"MSG",7)=$SELECT($GET(^TMP($JOB,"MSG",7))="":" ",1:$GET(^TMP($JOB,"MSG",7)))_" "_$PIECE(ADD(1),"^",7)
End DoDot:2
End DoDot:1
+15 SET ^TMP($JOB,"MSG",8)=" "
+16 SET ^TMP($JOB,"MSG",9)="has "_$SELECT($GET(INS1):"had bills merged to the following company: ",1:"been deleted.")
+17 IF $GET(INS1)
Begin DoDot:1
+18 SET ^TMP($JOB,"MSG",10)=" "
+19 SET ^TMP($JOB,"MSG",11)=" "_INSN2
+20 IF $GET(ADD(2))]""
FOR P=1:1:7
Begin DoDot:2
+21 IF $PIECE(ADD(2),"^",P)]""
IF (P<4)
SET ^TMP($JOB,"MSG",11+P)=" "_$PIECE(ADD(2),"^",P)
+22 IF $PIECE(ADD(2),"^",4)]""
IF (P=4)
SET ^TMP($JOB,"MSG",15)=" "_$PIECE(ADD(2),"^",4)_", "
+23 IF $PIECE(ADD(2),"^",5)]""
IF (P=5)
SET ^TMP($JOB,"MSG",15)=$SELECT($GET(^TMP($JOB,"MSG",15))="":" ",1:$GET(^TMP($JOB,"MSG",15)))_$PIECE(ADD(2),"^",5)
+24 IF $PIECE(ADD(2),"^",6)]""
IF (P=6)
Begin DoDot:3
+25 SET $PIECE(ADD(2),"^",7)=$EXTRACT($PIECE(ADD(2),"^",6),1,5)_$SELECT($EXTRACT($PIECE(ADD(2),"^",6),6,9)]"":"-"_$EXTRACT($PIECE(ADD(2),"^",6),6,9),1:"")
+26 SET ^TMP($JOB,"MSG",15)=$SELECT($GET(^TMP($JOB,"MSG",15))="":" ",1:$GET(^TMP($JOB,"MSG",15)))_" "_$PIECE(ADD(2),"^",7)
End DoDot:3
End DoDot:2
End DoDot:1
+27 SET ^TMP($JOB,"MSG",16)=" "
+28 SET ^TMP($JOB,"MSG",18)=" "
+29 SET C=18
SET I=""
FOR
SET I=$ORDER(^TMP("RCAMINS",$JOB,I))
if I=""
QUIT
SET C=C+1
SET ^TMP($JOB,"MSG",C)=" "_I
+30 DO ^XMD
+31 KILL ^TMP("RCAMINS",$JOB),^TMP($JOB,"MSG")
+32 QUIT