source: WorldVistAEHR/trunk/r/FEE_BASIS-FB/FBUCLET1.m@ 1096

Last change on this file since 1096 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 7.9 KB
Line 
1FBUCLET1 ;ALBISC/TET - UNAUTHORIZED CLAIM LETTER (continued) ;29/NOV/2006
2 ;;3.5;FEE BASIS;**12,23,32,38,101**;JAN 30, 1995;Build 2
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4PRINT ;print letter, don't update if variable fbnoup exists
5 ;INPUT: FBDA = ien of unauthorized claim, file 162.7
6 ; FBORDER = (optional) order number of status
7 ; FBUCA = current (after) zero node of unauthorized claim (162.7)
8 ; FBUC = unauthorized claim node in parameter file
9 ; FBNOUP = 1 if no update is to occur, optional, set in reprint
10 ; FBFF = counter flag, suppresses formfeed if = 0
11 ; FBCOPIES = # of copies to print, optional, not set from auto
12 ; FBSTANUM = station number
13 ; FBSADD( array = station address, if site parameter designates letterhead not used
14 ;VAR FBADD( = address array to where letter is mailed
15 ; FBADDCC( = address array for carbon copy
16 ; FBCC = flag, true if CC address should print at bottom of page
17 ; FBCCI = # used to determine where CC address prints
18 ; FBTAMT = $ amount calculated in routine FBUCLET2 for an
19 ; approved or approved to stabilization disposition
20 ; letter. Used to populate field #14 in file #162.7.
21 ;OUTPUT: none - print letter and update fields, if '$d(fbnoup), upon completion
22 N FBADD,FBADDCC,FBAUTH,FBC,FBEP,FBLETDT,FBLIEN,FBMCODE,FBNAM,FBNAM1
23 N FBPROG,FBRE,FBSUBMIT,FBTAMT,FBCC,FBCCI
24 S FBLETDT=0 S:FBORDER']"" FBORDER=$$ORDER^FBUCUTL(FBDA) S ZTSTOP=$$S^%ZTLOAD
25 D ADDRESS^FBUCUTL2(FBUCA)
26 S FBSUBMIT=$P(FBUCA,U,23),FBPROG=$$PROG^FBUCUTL(+$P(FBUCA,U,2))
27 S FBNAM=$S(FBSUBMIT["FBAAV("!(FBSUBMIT["VA(200,"):$$VET^FBUCUTL(+$P(FBUCA,U,4)),1:$$VEN^FBUCUTL(+$P(FBUCA,U,3))) I FBNAM["," S FBNAM=$P(FBNAM,",",2)_" "_$P(FBNAM,",")
28 I FBSUBMIT'["DPT(" S FBNAM1=$$VEN^FBUCUTL(+$P(FBUCA,U,3)) I FBNAM1["," S FBNAM1=$P(FBNAM1,",",2)_" "_$P(FBNAM1,",")
29 ;
30 ; Utilize new API for Name Standardization
31 ;
32 I FBNAM'="UNKNOWN",FBSUBMIT["FBAAV("!(FBSUBMIT["VA(200,") D
33 .S FBNAM=$$GETNAME(+$P(FBUCA,U,4),2,"G","")
34 .Q
35 ;
36 S FBRE=$S(FBSUBMIT']""!(FBSUBMIT["DPT("):"VENDOR:",1:"VETERAN:")
37 S FBEP=$$FMTE^XLFDT(+$P(FBUCA,U,5)) S:$P(FBUCA,U,6)'=$P(FBUCA,U,5) FBEP=FBEP_"^"_$$FMTE^XLFDT(+$P(FBUCA,U,6))
38 S FBAUTH=$$FMTE^XLFDT(+$P(FBUCA,U,13)) S:$P(FBUCA,U,14)'=$P(FBUCA,U,13) FBAUTH=FBAUTH_"^"_$$FMTE^XLFDT(+$P(FBUCA,U,14))
39 S FBLIEN=$$LETTER^FBUCUTL2(FBORDER,+$P(FBUCA,U,28))
40 S FBMCODE=$$GET1^DIQ(161.4,1,5.5) ; Load Mail Code
41 I '$D(FBCOPIES) S FBCOPIES=$S($P(FBUC,U,4):$P(FBUC,U,4),1:1)
42 I FBLIEN F FBC=1:1:FBCOPIES D
43 .N DIWF,DIWL,FBEXP,FBI,FBDL1
44 .;set flag true when disposition letter to indicate that a CC address
45 .;needs to be printed at the bottom of the first page
46 .S FBCC=$S(FBORDER>20:1,1:0)
47 .;set FBCCI = blank lines before address (2) + max address lines (5) +
48 .; # of lines after address from site parameters + a constant (2)
49 .;S FBCCI=2+5+$S($P(FBUC,U,10)]"":$P(FBUC,U,10),1:9)+2 ; default param
50 .S FBCCI=2+5+$P(FBUC,U,10)+2
51 .S FBFF=FBFF+1 W:FBFF&(FBFF>1) @IOF W !
52 .W:$P(FBUC,U,8) !!!!! D:'$P(FBUC,U,8)
53 ..N FBI,FBX,FBCT S (FBCT,FBI)=0 F S FBI=$O(FBSADD(FBI)) Q:'FBI S FBX=FBSADD(FBI) W !?(IOM-$L(FBX)/2),FBX S FBCT=FBCT+1
54 ..S FBCT=5-FBCT I FBCT>0 F FBI=1:1:FBCT W ! ;ensure length of header is consistant
55 .W !?4,$$PDATE^FBUCUTL2(DT),!
56 .W:'$P(FBUC,U,8) ?47,"In Reply Refer To: " W ?66,FBSTANUM,"/",FBMCODE
57 .W !?50,$$GETNAME(+$P(FBUCA,U,4),2,"F","C")
58 .S (FBCT,FBI)=0 F S FBI=$O(FBADD(FBI)) Q:'FBI W !?4,FBADD(FBI) S FBCT=FBCT+1 I FBI=1 W ?50,$$SSNL4^FBAAUTL($$SSN^FBAAUTL(+$P(FBUCA,U,4)))
59 .D HED
60 .S DIWF="WC79I4",DIWL=1 D:$Y+$S(FBCCI>10&FBCC:FBCCI,1:10)>IOSL PAGE D TXT^FBUCUTL2("^FBAA(161.3,",FBLIEN,1,DIWF,DIWL,1,.FBCC,FBCCI) W !
61 .S DIWF="WC72I8",DIWL=1
62 .I FBORDER>20 D:$Y+$S(FBCCI>10&FBCC:FBCCI,1:10)>IOSL PAGE D TXT^FBUCUTL2("^FB(162.91,",+$P(FBUCA,U,11),$S(+$P(FBUCA,U,28):2,1:1),DIWF,DIWL,1,.FBCC,FBCCI) D
63 ..; if approved (or approved to stabilization) then include details
64 ..I $P(FBUCA,U,11)=1!($P(FBUCA,U,11)=4) D AUTHPR^FBUCLET2
65 ..I +$P(FBUCA,U,11)'=1,+$O(^FB583(FBDA,"D",0)) D:$Y+$S(FBCCI>10&FBCC:FBCCI,1:10)>IOSL PAGE W !?8,"Reason(s) for not approving "_$S($P(FBUCA,U,11)=4:"entire ",1:"")_"claim:" D
66 ...N DIWF,FBI,FBZ S DIWF="WC69I8",FBI=0 F S FBI=$O(^FB583(FBDA,"D",FBI)) Q:'FBI S FBZ=^(FBI,0) D:$Y+$S(FBCCI>8&FBCC:FBCCI,1:8)>IOSL PAGE W ! D TXT^FBUCUTL2("^FB(162.94,",+FBZ,1,DIWF,DIWL,1,.FBCC,FBCCI)
67 ..;
68 ..;print optional disposition remarks for the claim
69 ..I FBORDER>20 D
70 ...N DIWF,DIWL,FBN
71 ...; select appropriate wp field based on status (appeal, cova, initial)
72 ...S FBN=$S(FBORDER=70:"""A1""",FBORDER=90:"""A2""",1:4)
73 ...Q:'$O(^FB583(FBDA,FBN,0)) ; no remarks on file
74 ...D:$Y+$S(FBCCI>7&FBCC:FBCCI,1:7)>IOSL PAGE
75 ...W !
76 ...S DIWF="WC72I8",DIWL=1
77 ...D TXT^FBUCUTL2("^FB583(",FBDA,FBN,DIWF,DIWL,1,.FBCC,FBCCI)
78 ..;
79 ..;print additional description text (if any) for disposition
80 ..I $O(^FB(162.91,+$P(FBUCA,U,11),3,0)) D
81 ...N DIWF,DIWL
82 ...D:$Y+$S(FBCCI>10&FBCC:FBCCI,1:10)>IOSL PAGE
83 ...W !
84 ...S DIWF="WC72I8",DIWL=1
85 ...D TXT^FBUCUTL2("^FB(162.91,",+$P(FBUCA,U,11),3,DIWF,DIWL,1,.FBCC,FBCCI)
86 .I FBORDER'>20 S FBI=0 F S FBI=$O(^FBAA(162.8,"AC",FBDA,FBI)) Q:'FBI S FBZ=$G(^FBAA(162.8,FBI,0)) I '$P(FBZ,U,5) D:$Y+$S(FBCCI>12&FBCC:FBCCI,1:12)>IOSL PAGE D
87 ..N FBX W ! S FBX=$P($G(^FB(162.93,+$P(FBZ,U,3),0)),U) I FBX="OTHER" S:$P(FBZ,U,4)]"" FBX=$P(FBZ,U,4) W ?8,FBX,! Q
88 ..D TXT^FBUCUTL2("^FB(162.93,",+$P(FBZ,U,3),1,DIWF,DIWL,1,.FBCC,FBCCI)
89 .S DIWF="WC79I4",DIWL=1 D:($Y+4+$S(FBCCI>$S(FBORDER>20:15,1:22)&FBCC:FBCCI,FBORDER>20:15,1:22))>IOSL PAGE W ! D TXT^FBUCUTL2("^FBAA(161.3,",FBLIEN,2,DIWF,DIWL,1,.FBCC,FBCCI)
90 .;print postscript (if any) on request info. letter
91 .I FBORDER'>20 S FBI=0 F S FBI=$O(^FBAA(162.8,"AC",FBDA,FBI)) Q:'FBI S FBZ=$G(^FBAA(162.8,FBI,0)) I '$P(FBZ,U,5) D
92 ..N FBX,FBPS
93 ..Q:'$O(^FB(162.93,+$P(FBZ,U,3),2,0)) ; no postscript to print
94 ..;start new page
95 ..S FBPS=1 D PAGE S FBPS=0
96 ..W !!
97 ..;print text
98 ..S FBX=$P($G(^FB(162.93,+$P(FBZ,U,3),0)),U)
99 ..I FBX="SIGNED STATEMENT FROM CLAIMANT",$P(FBZ,U,4)]"",$E($P(FBZ,U,4),1)=0 D
100 ...; just print statement since user specified that regulations should
101 ...; not be printed (stop after line 11 of postscript)
102 ...N FBI,FBTXT
103 ...S FBI=0 F S FBI=$O(^FB(162.93,+$P(FBZ,U,3),2,FBI)) Q:FBI>11!'FBI D
104 ....S FBTXT=^FB(162.93,+$P(FBZ,U,3),2,FBI,0),X=FBTXT
105 ....I $Y+$S(FBCCI>7&FBCC:FBCCI,1:7)>IOSL D PAGE
106 ....D ^DIWP
107 ...I $Y+$S(FBCCI>7&FBCC:FBCCI,1:7)>IOSL D PAGE
108 ...D:$D(FBTXT) ^DIWW
109 ..E D TXT^FBUCUTL2("^FB(162.93,",+$P(FBZ,U,3),2,DIWF,DIWL,1,.FBCC,FBCCI) ;entire ps
110 .;if still on 1st page of disposition letter then print the CC address
111 .I FBCC D CCADDR
112 ;
113 I '$D(FBNOUP) D
114 .D:$D(XRTL) T0^%ZOSV ;start monitor
115 .S FBEXP=$$EXPIRE^FBUCUTL8(FBDA,DT,FBUCA,FBORDER)
116 .D EDITL^FBUCED(FBDA,FBEXP,"@",DT,$G(FBTAMT))
117 .S:$D(XRT0) XRTN=$T(+0) D:$D(XRT0) T1^%ZOSV ;stop monitor
118 Q
119 ;
120GETNAME(FBIEN,FBFILE,FBFMT,FBFLAG) ;
121 N FBNAMES
122 I FBIEN=""!(FBFILE)="" Q "" ; Quit if there is no IEN or File number
123 S FBFMT=$G(FBFMT),FBFLAG=$G(FBFLAG)
124 S FBNAMES("FILE")=FBFILE,FBNAMES("IENS")=FBIEN,FBNAMES("FIELD")=.01
125 S FBNAMES=$$NAMEFMT^XLFNAME(.FBNAMES,FBFMT,FBFLAG)
126 Q FBNAMES
127 ;
128PAGE ;new page
129 ;print CC address at bottom of 1st page on disposition letters
130 I FBCC D CCADDR
131 W @IOF,!!!!!!!
132 ; if called from 1st page of postscript print then include more info
133 I $G(FBPS)=1 D
134 .W:'$P(FBUC,U,8) ?47,"In Reply Refer To: " W ?66,FBSTANUM,"/",FBMCODE
135 .W !?50,$$GETNAME(+$P(FBUCA,U,4),2,"F","C")
136 .W !?50,$$SSNL4^FBAAUTL($$SSN^FBAAUTL(+$P(FBUCA,U,4)))
137HED ;header to print after address and on each new page
138 W !!!!?8,"REGARDING:",?20,FBRE,?38,FBNAM I $D(FBNAM1) W !?20,"VENDOR:",?38,FBNAM1
139 W !?20,"FEE PROGRAM:",?38,FBPROG
140 W !?20,"EPISODE OF CARE:",?38,$P(FBEP,U) W:$P(FBEP,U,2)]"" " to ",$P(FBEP,U,2)
141 W !!
142 Q
143CCADDR ; print CC address at bottom of page
144 ; advance to bottom of page
145 N FBI
146 F FBI=$Y+FBCCI-1:1:$S(IOSL>120:$Y+FBCCI,1:IOSL) W !
147 ; print CC address lines
148 S FBI=0
149 F S FBI=$O(FBADDCC(FBI)) Q:'FBI W ! W:FBI=1 " CC:" W ?4,FBADDCC(FBI)
150 ;set flag to false since CC address has been printed
151 S FBCC=0
152 Q
Note: See TracBrowser for help on using the repository browser.