ABMDF4X ; IHS/ASDST/DMJ - ADA-90 FORM ;
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;Original;TMD;08/15/96 9:00 AM
;
MARG ;Set left and top margins
S U="^",(ABM("LM"),ABM("TM"),ABM("LN"))=0
I $D(^ABMDEXP(4,0)) S ABM("TM")=$P(^(0),U,3),ABM("LM")=$P(^(0),U,2)
W $$EN^ABMVDF("IOF")
I +ABM("TM") F ABM("I")=1:1:ABM("TM") W !
;
;Loop thru line number array
LOOP S ABM("LN")=$O(ABMF(ABM("LN"))) I +ABM("LN")=0!(ABM("LN")>62) G XIT
;
;Set to correct format line
S ABM("FL")=ABM("LN")
I ABM("LN")>34,ABM("LN")<49 S ABM("FL")=35 ;Lines 35 thru 48 are same
I ABM("LN")>49,ABM("LN")<55 S ABM("FL")=50 ;Lines 50 thru 54 are same
I ABM("LN")>58,ABM("LN")<63 S ABM("FL")=59 ;Lines 59 thru 62 are same
;
;Set tab & format variables
S ABM("TABS")=$P($T(@ABM("FL")),";;",2)
S ABM("FMAT")=$P($T(@ABM("FL")),";;",3)
;
;Skip to req'd line
F Q:$Y-ABM("TM")>(ABM("LN")+0) W !
;
; Test Modes for setting Data Fields
G LOOP2:'$D(ABMF("TEST"))
F ABM("I")=1:1:$L(ABM("FMAT"),U) I $P(ABM("TABS"),U,ABM("I"))]"" S ABM("FLD")="",$P(ABM("FLD"),"X",$P(ABM("FMAT"),U,ABM("I"))+1)="" I ABM("FLD")]"" W ?($P(ABM("TABS"),U,ABM("I"))+ABM("LM")) D FRMT
G LOOP
;
;Loop thru the pieces of the line array
LOOP2 F ABM("I")=1:1:$L(ABMF(ABM("LN")),U) I $P(ABM("TABS"),U,ABM("I"))]"" S ABM("FLD")=$P(ABMF(ABM("LN")),U,ABM("I")) I ABM("FLD")]"" W ?($P(ABM("TABS"),U,ABM("I"))+ABM("LM")) D FRMT
G LOOP
;
;Write the field in the designated format
FRMT S ABM("LTH")=$P(ABM("FMAT"),U,ABM("I")) I +ABM("LTH")=0 S ABM("LTH")=99
I ABM("LTH")["$" S ABM("LTH")=$P(ABM("LTH"),"$") W $J($FN(+ABM("FLD"),",",2),ABM("LTH")) Q
I ABM("LTH")["D" S ABM("LTH")=$P(ABM("LTH"),"D") W $E(ABM("FLD"),4,5),"-",$E(ABM("FLD"),6,7),"-",$E(ABM("FLD"),2,3) Q
I ABM("LTH")["L" S ABM("LTH")=$P(ABM("LTH"),"L") F Q:$L(ABM("FLD"))=ABM("LTH")!($L(ABM("FLD"))>ABM("LTH")) S ABM("FLD")="0"_ABM("FLD")
I ABM("LTH")["C" S ABM("LTH")=$P(ABM("LTH"),"C") S ABM("FLD")=$J("",ABM("LTH")-$L(ABM("FLD"))\2)_ABM("FLD")
I ABM("LTH")["R" S ABM("LTH")=$P(ABM("LTH"),"R") S ABM("RT")=ABM("LTH")-$L(ABM("FLD"))+1 I ABM("RT")>1 S ABM("BLNK")="",$P(ABM("BLNK")," ",ABM("RT"))="",ABM("FLD")=ABM("BLNK")_ABM("FLD")
W $E(ABM("FLD"),1,ABM("LTH"))
Q
;
TEST S ABMF("TEST")=1
F ABM=0:ABMF("TEST"):62 S ABMF(ABM)=""
G MARG
;
XIT I '$D(ABM("MORE")) K ABMF,ABM
E K ABM("MORE")
Q
TEXT ;;TABS;;FIELD LENGTH
; FORMAT ($-$ FORMAT,L-LNGTH REQ'D,C-CENTER,R-RIGHT,D-DATE)
1 ;;1^41;;1^37
2 ;;1^41;;1^37
3 ;;41;;37
5 ;;28^33^58;;1^1^20R
6 ;;2^28^33^37^43^45^47^50^53^58;;24^1^1^5^1^1^2^2^4^20R
8 ;;2^50^68;;24^17^11C
9 ;;2^27^50^68;;24^11^17^11C
10 ;;2^27^39^42^45^50^68;;24^12^2^2^4^17^12C
12 ;;6^10^17^41^57;;1^1^24^15^22
13 ;;17^41^57;;24^15C^22
14 ;;11^14^17^41^57;;1^1^24^15C^22
16 ;;2^59^64;;26^1^1
17 ;;2^29^43^48^52^59^64^68;;26^11^2^2^4^1^1^5
20 ;;2^31^43^70;;26^8D^26^8D
23 ;;2^52^54^56;;38^1^1^22
25 ;;2^52^54^56;;38^1^1^22
27 ;;2^52^54^56;;38^1^1^22
29 ;;2^17^28^52^54^56^71;;13^10^12^1^1^13^8D
31 ;;2^12^16^19^22^34^36^38^52^54^64^76;;8D^1^1^1^1^1^1^2^1^1^8D^2
35 ;;13^17^23^49^51^53^56^64;;3R^5^25^2^2^2^7R^6$
50 ;;1^64;;62^6$
57 ;;2^27^42^61;;23^11R^8D^9$
59 ;;64;;6
ABMDF4X ; IHS/ASDST/DMJ - ADA-90 FORM ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;Original;TMD;08/15/96 9:00 AM
+3 ;
MARG ;Set left and top margins
+1 SET U="^"
SET (ABM("LM"),ABM("TM"),ABM("LN"))=0
+2 IF $DATA(^ABMDEXP(4,0))
SET ABM("TM")=$PIECE(^(0),U,3)
SET ABM("LM")=$PIECE(^(0),U,2)
+3 WRITE $$EN^ABMVDF("IOF")
+4 IF +ABM("TM")
FOR ABM("I")=1:1:ABM("TM")
WRITE !
+5 ;
+6 ;Loop thru line number array
LOOP SET ABM("LN")=$ORDER(ABMF(ABM("LN")))
IF +ABM("LN")=0!(ABM("LN")>62)
GOTO XIT
+1 ;
+2 ;Set to correct format line
+3 SET ABM("FL")=ABM("LN")
+4 ;Lines 35 thru 48 are same
IF ABM("LN")>34
IF ABM("LN")<49
SET ABM("FL")=35
+5 ;Lines 50 thru 54 are same
IF ABM("LN")>49
IF ABM("LN")<55
SET ABM("FL")=50
+6 ;Lines 59 thru 62 are same
IF ABM("LN")>58
IF ABM("LN")<63
SET ABM("FL")=59
+7 ;
+8 ;Set tab & format variables
+9 SET ABM("TABS")=$PIECE($TEXT(@ABM("FL")),";;",2)
+10 SET ABM("FMAT")=$PIECE($TEXT(@ABM("FL")),";;",3)
+11 ;
+12 ;Skip to req'd line
+13 FOR
IF $Y-ABM("TM")>(ABM("LN")+0)
QUIT
WRITE !
+14 ;
+15 ; Test Modes for setting Data Fields
+16 IF '$DATA(ABMF("TEST"))
GOTO LOOP2
+17 FOR ABM("I")=1:1:$LENGTH(ABM("FMAT"),U)
IF $PIECE(ABM("TABS"),U,ABM("I"))]""
SET ABM("FLD")=""
SET $PIECE(ABM("FLD"),"X",$PIECE(ABM("FMAT"),U,ABM("I"))+1)=""
IF ABM("FLD")]""
WRITE ?($PIECE(ABM("TABS"),U,ABM("I"))+ABM("LM"))
DO FRMT
+18 GOTO LOOP
+19 ;
+20 ;Loop thru the pieces of the line array
LOOP2 FOR ABM("I")=1:1:$LENGTH(ABMF(ABM("LN")),U)
IF $PIECE(ABM("TABS"),U,ABM("I"))]""
SET ABM("FLD")=$PIECE(ABMF(ABM("LN")),U,ABM("I"))
IF ABM("FLD")]""
WRITE ?($PIECE(ABM("TABS"),U,ABM("I"))+ABM("LM"))
DO FRMT
+1 GOTO LOOP
+2 ;
+3 ;Write the field in the designated format
FRMT SET ABM("LTH")=$PIECE(ABM("FMAT"),U,ABM("I"))
IF +ABM("LTH")=0
SET ABM("LTH")=99
+1 IF ABM("LTH")["$"
SET ABM("LTH")=$PIECE(ABM("LTH"),"$")
WRITE $JUSTIFY($FNUMBER(+ABM("FLD"),",",2),ABM("LTH"))
QUIT
+2 IF ABM("LTH")["D"
SET ABM("LTH")=$PIECE(ABM("LTH"),"D")
WRITE $EXTRACT(ABM("FLD"),4,5),"-",$EXTRACT(ABM("FLD"),6,7),"-",$EXTRACT(ABM("FLD"),2,3)
QUIT
+3 IF ABM("LTH")["L"
SET ABM("LTH")=$PIECE(ABM("LTH"),"L")
FOR
IF $LENGTH(ABM("FLD"))=ABM("LTH")!($LENGTH(ABM("FLD"))>ABM("LTH"))
QUIT
SET ABM("FLD")="0"_ABM("FLD")
+4 IF ABM("LTH")["C"
SET ABM("LTH")=$PIECE(ABM("LTH"),"C")
SET ABM("FLD")=$JUSTIFY("",ABM("LTH")-$LENGTH(ABM("FLD"))\2)_ABM("FLD")
+5 IF ABM("LTH")["R"
SET ABM("LTH")=$PIECE(ABM("LTH"),"R")
SET ABM("RT")=ABM("LTH")-$LENGTH(ABM("FLD"))+1
IF ABM("RT")>1
SET ABM("BLNK")=""
SET $PIECE(ABM("BLNK")," ",ABM("RT"))=""
SET ABM("FLD")=ABM("BLNK")_ABM("FLD")
+6 WRITE $EXTRACT(ABM("FLD"),1,ABM("LTH"))
+7 QUIT
+8 ;
TEST SET ABMF("TEST")=1
+1 FOR ABM=0:ABMF("TEST"):62
SET ABMF(ABM)=""
+2 GOTO MARG
+3 ;
XIT IF '$DATA(ABM("MORE"))
KILL ABMF,ABM
+1 IF '$TEST
KILL ABM("MORE")
+2 QUIT
TEXT ;;TABS;;FIELD LENGTH
+1 ; FORMAT ($-$ FORMAT,L-LNGTH REQ'D,C-CENTER,R-RIGHT,D-DATE)
1 ;;1^41;;1^37
2 ;;1^41;;1^37
3 ;;41;;37
5 ;;28^33^58;;1^1^20R
6 ;;2^28^33^37^43^45^47^50^53^58;;24^1^1^5^1^1^2^2^4^20R
8 ;;2^50^68;;24^17^11C
9 ;;2^27^50^68;;24^11^17^11C
10 ;;2^27^39^42^45^50^68;;24^12^2^2^4^17^12C
12 ;;6^10^17^41^57;;1^1^24^15^22
13 ;;17^41^57;;24^15C^22
14 ;;11^14^17^41^57;;1^1^24^15C^22
16 ;;2^59^64;;26^1^1
17 ;;2^29^43^48^52^59^64^68;;26^11^2^2^4^1^1^5
20 ;;2^31^43^70;;26^8D^26^8D
23 ;;2^52^54^56;;38^1^1^22
25 ;;2^52^54^56;;38^1^1^22
27 ;;2^52^54^56;;38^1^1^22
29 ;;2^17^28^52^54^56^71;;13^10^12^1^1^13^8D
31 ;;2^12^16^19^22^34^36^38^52^54^64^76;;8D^1^1^1^1^1^1^2^1^1^8D^2
35 ;;13^17^23^49^51^53^56^64;;3R^5^25^2^2^2^7R^6$
50 ;;1^64;;62^6$
57 ;;2^27^42^61;;23^11R^8D^9$
59 ;;64;;6