Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BARDMLP1

BARDMLP1.m

Go to the documentation of this file.
BARDMLP1 ;IHS/OIT/FCJ - 2 OF 2 ;DEBT MANAGEMENT PRINT LETTERS
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**22,23,24**;OCT 26, 2005;Build 69
 ;New routine 5-12-2011 for Debt Letter Management
 ;Routine to print letters
 ; IHS/SD/POTT JAN 2013 ADDED NEW PARAMETERS: BARPBDT and BARPDOB (SET IN BARDMU)- BAR*1.8*23
 ; IHS/SD/POTT SEP 2013 FIXED MISSING DATE- BAR*1.8*23
 ; IHS/SD/POTT HEAT143490 12/04/14 FIX ADDRESSE'THE GUARDIAN...' IF INS. - BAR*1.8*24
 ;
PRINT ;EP
 W $$EN^BARVDF("IOF")
 K ^UTILITY($J,"W")
 S DIWL=BARMRGL,DIWR=75
 S DIWF="W"
 D HDR
 S BARR=0 F  S BARR=$O(^BAR(90052.03,BARPCP(CY),1,BARR)) Q:BARR'?1N.N  D
 .S X=^BAR(90052.03,BARPCP(CY),1,BARR,0)
 .I X["TODAY" D DT Q
 .I X["BARINS" D LTOP Q
 .I X["BARFAC" D LFAC Q
 .I X["BARSTF" D LBOT Q
 .I X["BARSIG" D LSIG Q
 .D ^DIWP
 Q
HDR ;PRINT HEADER 
 F I1=1:1:BARMRGT S X="" D ^DIWP,^DIWW
 S X=$P(^BAR(90052.03,BARPCP(CY),0),U,2) D ^DIWP,^DIWW
 Q
DT  ;OLD CODE HEAT158596 BAR*1.8*24
 I BARRPT="R",BARDTP="",$G(BARBAT) D
 . N Y
 . S Y=+$G(^BARDMLG(DUZ(2),BARBAT,0))\1 I 'Y Q
 . X ^DD("DD") S BARDTP=Y
 I BARRPT="R" S X="Date: "_BARDTP
 D ^DIWP
 Q
 ;-------------------------------------------------
LTOP ;TOP OF LETTER
 S X=BARDM("INS_NM") D ^DIWP,^DIWW
 S X=BARDM("INS_STR") D ^DIWP,^DIWW
 S X=BARDM("INS_CTY")_", "_$S(BARDM("INS_ST")'="":$P(^DIC(5,BARDM("INS_ST"),0),U,2),1:"  ")_"  "_BARDM("INS_ZP") D ^DIWP,^DIWW
 I BARDACG="AUTNINS(" S X="TIN: "_BARDM("INS_TX") D ^DIWP
 E  S X="" D ^DIWP
 S X="" D ^DIWP
 I BARDACG="AUTNINS(" D
 . S X="Re: Policy Holder: "_BARDM("POL_HOLDER")_BARLEN
 . S X=$E(X,1,40)_" Policy #: "_BARDM("POL_NUM") D ^DIWP
 . S X="    Patient: "_BARPAT_BARLEN
 . S X=$E(X,1,40)_" Date of Service: "_BARDM("DOS") D ^DIWP
 E  S BARDACG="AUPNPAT(" S X="Re: Date of Service: "_BARDM("DOS") D ^DIWP
 S X="    Bill Number: "_BARBILN_BARLEN S X=$E(X,1,40)_" Bill Amount: "_BARAMTO D ^DIWP
 I BARPBDT S X="      Bill Date: "_$$SDT^BARDUTL($P($G(^BARBL(DUZ(2),BARBIEN,0)),U,18)) D ^DIWP  ;P.OTT
 S X=""
 I BARPDOB D  ;P.OTT - BAR*1.8*23
 . S X="    Patient DOB: "_BARDOB_BARLEN D ^DIWP,^DIWW
 S X=""
 I BARPNPI="FACILITY" D
 .S X="    Facility NPI: "_BARNPIF
 I BARPNPI="PROVIDER" D
 .S X="    Provider NPI: "_BARNPIP
 I BARPNPI["BOTH" D
 .S X=$S(BARNPIP>0:"    Provider NPI: "_BARNPIP_BARLEN,1:"          "_BARLEN)
 .S X=$S(BARNPIF>0:$E(X,1,40)_" Facility NPI: "_BARNPIF,1:"")
 I X'="" D ^DIWP
 F I1=1:1:2 S X="" D ^DIWP
 ;begin old code - BAR*1.8*24
 ;I $G(BARL)="CYCLE 4" S X="Dear Area Claims Collection Officer:" D ^DIWP
 ;E  I BARMIN=1 S X="Dear "_BARDM("INS_NM")_":" D ^DIWP
 ;E  I BARMIN=0 S X="To the Guardian of "_BARDM("INS_NM")_":" D ^DIWP
 I $G(BARL)="CYCLE 4" S X="Dear Area Claims Collection Officer:" D ^DIWP
 I $G(BARL)'="CYCLE 4" I BARMIN=1 S X="Dear "_BARDM("INS_NM")_":" D ^DIWP
 I $G(BARL)'="CYCLE 4" I BARMIN=0 S X="To the Guardian of "_BARDM("INS_NM")_":" D ^DIWP
 I $G(BARL)'="CYCLE 4" I BARMIN=2 S X="To "_BARDM("INS_NM")_":" D ^DIWP ;- BAR*1.8*24
 Q
LFAC ;FAC SET
 S X="     "_BARFAC D ^DIWP
 S X="     "_BARAD1 D ^DIWP
 I BARAD2 S X="     "_BARAD2 D ^DIWP
 S X="     "_BARCTY_", "_$P(^DIC(5,BARST,0),U,2)_" "_BARZP D ^DIWP
 Q
LBOT ;BOTTOM OF LETTER
 I $G(BARL)="CYCLE 4" S X=$P(X,"BARPH",1)_BARPH_"."
 E  S X=$P(X,"BARSTF",1)_BARSG_" at "_BARPH_"."
 D ^DIWP,^DIWW
 Q
LSIG ;SIGNATURE LINES
 S SG=$P(X,"BARSIG")
 S X=SG_BARSG D ^DIWP
 I $D(BARSG1) S X=SG_BARSG1 D ^DIWP
 I $D(BARSG2) S X=SG_BARSG2 D ^DIWP
 D ^DIWW
 Q  ;------EOR-------------