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

FBUCLET.m

Go to the documentation of this file.
  1. FBUCLET ;ALBISC/TET - UNAUTHORIZED CLAIMS LETTER ;6/26/01
  1. ;;3.5;FEE BASIS;**32**;JAN 30, 1995
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. AUTO(FBDA,FBORDER,FBUCA,FBUC) ;auto print - called by update routine, tasked job
  1. ;INPUT: FBDA = ien of unauthorized claim, file 162.7
  1. ; FBORDER = (optional) order number of status
  1. ; FBUCA = current (after) zero node of unauthorized claim (162.7)
  1. ; FBUC = unauthorized claim node in parameter file
  1. ;OUTPUT: none - task q'd to print letter and update fields upon completion
  1. N ZTIO,ZTRTN,ZTDESC,ZTDTH,ZTSAVE
  1. I $$PARAM(FBUC) S ZTIO=$P(FBUC,U,2) I ZTIO]"" D
  1. .S ZTRTN="AUTODQ^FBUCLET0",ZTDESC="AUTO PRINT UNAUTH CLAIM LETTER",ZTDTH=$H
  1. .S ZTSAVE("FBDA")="",ZTSAVE("FBORDER")="",ZTSAVE("FBUCA")="",ZTSAVE("FBUC")=""
  1. .D ^%ZTLOAD
  1. K IOP,ZTIO,ZTRTN,ZTDESC,ZTDTH,ZTSAVE,ZTSK Q
  1. ;
  1. PARAM(FBUC) ;check if letter should be printed
  1. ;check if parameter is set to print automatically, if so,
  1. ;check if printer is defined, if so ok to print
  1. ;INPUT: FBUC = UC node (unauthorized claim node) of parameter file
  1. ;OUTPUT: 1 if ok to print letter, 0 if not ok
  1. Q $S($P(FBUC,U,3)'="A":0,$P(FBUC,U,2)']"":0,1:1)
  1. ;
  1. PRFLD(FBDA) ;check if print field is still set
  1. ;INPUT: FBDA = internal entry number of unauthorized claim (162.7)
  1. ;OUTPUT: 1 for ok to print, 0 to not print
  1. Q $S('$D(^FB583("AL",1,FBDA)):0,1:1)
  1. ;
  1. REPRINT ;reprint
  1. N %ZIS,BEGDATE,ENDDATE,DIR,DIRUT,DTOUT,DUOUT,DISP,FBDT,FBI,FBJ,FBFR,FBNOUP,FBO,FBORDER,FBOUT,FBPL,FBPOP,FBRANGE,FBTO,FBUC,FBW,IOP,X,Y,ZTDESC,ZTIO,ZTRTN,ZTSAVE
  1. S FBOUT=0,FBUC=$$FBUC^FBUCUTL2(1)
  1. S DIR("A")="Do you wish to reprint letters for a date range",DIR(0)="Y",DIR("?")="Select Yes to reprint letters for a date range; No to reprint a specific letter."
  1. D ^DIR K DIR G END:$D(DIRUT),REPRINT:Y<0 S FBRANGE=Y I FBRANGE D DATE^FBAAUTL G:FBPOP END
  1. S FBFR=$S(FBRANGE:BEGDATE-.1,1:0),FBTO=$S(FBRANGE:ENDDATE,1:DT)
  1. I 'FBRANGE D LOOKUP^FBUCUTL3(0) G:FBOUT!('+$G(FBARY)) END I +$G(FBARY) S DISP=1 D PARSE^FBUCUTL4(FBARY),DISPY^FBUCUTL1 G:FBOUT!('+$G(FBARY(0))) END I $G(FBARY(0))]"" D STRING(FBARY(0))
  1. S DIR(0)="Y",DIR("A")="Should the expiration date be updated",DIR("B")="No",DIR("?")="Answer Yes to update the expiration date based upon today's printout, No to only reprint the letter but not change the date when the information is due."
  1. D ^DIR K DIR G END:$D(DIRUT),ASK:Y<0 S FBNOUP=$S('Y:1,1:0)
  1. D COPY G:FBOUT END S FBCOPIES=$S($P(FBUC,U,4):$P(FBUC,U,4),1:1)
  1. W ! S %ZIS("A")="Queue to print on: ",%ZIS("B")=$P(FBUC,U,2),%ZIS="NQ0",IOP="Q"_$S($P(FBUC,U,2):";"_$P(FBUC,U,2),1:"") D ^%ZIS G:POP END S $P(FBUC,U,2)=ION,ZTIO=ION,ZTDTH=$H
  1. S ZTRTN="REPRNTDQ^FBUCLET0",ZTDESC="REPRINT UNAUTH CLAIM LETTERS"
  1. S ZTSAVE("FBUC")="",ZTSAVE("FBFR")="",ZTSAVE("FBTO")="",ZTSAVE("FBNOUP")="",ZTSAVE("FBRANGE")="",ZTSAVE("FBARY(")="" I +$G(FBIEN) S ZTSAVE("FBIEN")="",ZTSAVE("FBIX")=""
  1. S:'$D(ZTDTH) ZTDTH=$H D ^%ZTLOAD
  1. K FBARY,^TMP("FBARY",$J),^TMP("FBARY",$J) G END
  1. BATCH ;to batch print letters & update date letter printed, interactive
  1. N %ZIS,DIR,DIRUT,DTOUT,DUOUT,X,Y,FBOUT,FBUC,FBZ,IOP
  1. S FBOUT=0,FBUC=$$FBUC^FBUCUTL2(1)
  1. ASK D COPY G:FBOUT END
  1. D LTRTYP G:FBOUT END
  1. W ! S %ZIS("A")="Queue to print on: ",%ZIS("B")=$P(FBUC,U,2),%ZIS="NQ0",IOP="Q"_$S($P(FBUC,U,2):";"_$P(FBUC,U,2),1:"") D ^%ZIS G:POP END S $P(FBUC,U,2)=ION,ZTIO=ION,ZTDTH=$H
  1. S FBCOPIES=$S($P(FBUC,U,4):$P(FBUC,U,4),1:1)
  1. ;call taskman queue
  1. S ZTRTN="BATCHDQ^FBUCLET0",ZTDESC="BATCH UNAUTH CLAIM LETTERS",ZTSAVE("FBUC")=FBUC,ZTSAVE("FBCOPIES")="",ZTSAVE("FBLTRTYP")="" S:'$D(ZTDTH) ZTDTH=$H D ^%ZTLOAD
  1. ;G END
  1. END D HOME^%ZIS K DA,DIE,DIRUT,DR,DTOUT,DUOUT,FBAR,FBARY,FBEXP,FBI,FBIEN,FBLET,FBLETDT,FBOUT,FBORDER,FBP,FBP,FBUC,FBCOPIES,FBDEVICE,POP,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTREQ,ZTSAVE,ZTSK,FBLTRTYP Q
  1. COPY ;
  1. S DIR(0)="161.4,35O",DIR("A")="Enter NUMBER OF COPIES for each letter",DIR("B")=$P(FBUC,U,4) D ^DIR K DIR S:$D(DIRUT) FBOUT=1 G:+Y<0 COPY S $P(FBUC,U,4)=$S(+Y=0:1,1:+Y)
  1. Q
  1. LTRTYP ; ask if user just want to print a specific letter type
  1. ;input - none
  1. ;output - FBLTRTYP - false if a specific letter type was not selected OR
  1. ; ien of the selected letter type (file #161.3)
  1. N DIR,DIC,Y
  1. S FBLTRTYP=""
  1. S DIR(0)="Y",DIR("A")="Print all types of letters",DIR("B")="YES"
  1. S DIR("?",1)="Enter YES to print all types of letters. Enter NO to"
  1. S DIR("?",2)="just print letters of one specific type."
  1. S DIR("?",3)=" "
  1. S DIR("?")="Enter either 'Y' or 'N'."
  1. D ^DIR K DIR I $D(DIRUT) S FBOUT=1 Q
  1. I +Y S FBLTRTYP="A" Q
  1. S DIC=161.3,DIC(0)="AQEM",DIC("S")="I $P(^(0),U,2)=1"
  1. D ^DIC K DIC I $D(DTOUT)!$D(DUOUT) S FBOUT=1 Q
  1. I Y<0 G LTRTYP
  1. S FBLTRTYP=+Y
  1. Q
  1. STRING(FBY) ;set variable to string of IEN's which user selected
  1. ;INPUT: FBY = fbary(0) or what user selected
  1. ;OUTPUT: FBARY = count of what was selected
  1. ; FBARY( = string array of selected IEN's of unauthorized claims,
  1. ; delimited by ','
  1. N FBCT,FBDCT,FBIEN,I
  1. S FBDCT=($L(FBY,","))-1,FBARY=FBDCT,FBCT=0 D CT
  1. F I=1:1:FBDCT I '($P(FBY,",",I)#1) S FBIEN=+$G(^TMP("FBARY",$J,$P(FBY,",",I))) D:($L(FBARY(FBCT)+FBIEN+1))>245 STRIP,CT S FBARY(FBCT)=FBARY(FBCT)_","_+$G(^TMP("FBARY",$J,$P(FBY,",",I)))
  1. D:$E(FBARY(FBCT),1)="," STRIP
  1. Q
  1. CT ;counter
  1. ;INPUT: FBCT = counter
  1. ;OUTPUT: FBCT incremented by one
  1. S FBCT=FBCT+1,FBARY(FBCT)=""
  1. Q
  1. STRIP ;strip comma
  1. ;INPUT: FBARY(FBCT array string
  1. ;OUTPUT: same array string with leading comma stripped
  1. S FBARY(FBCT)=$P(FBARY(FBCT),",",2,($L(FBARY(FBCT),",")))
  1. Q