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

DGBTR123.m

Go to the documentation of this file.
DGBTR123 ;ALB/RFE - CLERK REPORT; 06/04/12
 ;;1.0;Beneficiary Travel;**20**;November 11, 2011;Build 185
 Q
EN ;Entry point
 N %,%Y,CCFEE,CLERK,CLERKALL,CLERKNAME,DATALINE,DFN,DGBTDIVN,DGBTEXC,DGBTQ,EQUAL,ENDDT,ENTRY,GRAND,I,LINEM,LINESP,LINEZERO,PAGE,PDT,PATZERO,POP
 N PROMPT,REPTYPE,SQ1,SQ2,STARTDT,SUBS,TYPE,X,X2,X3,Y,ZTQUEUED
 D CLEAN^DILF
 S X2="2$",DGBTEXC=0
 K DIR
 S DIR("A")="START DATE: ",DIR(0)="DA^2991231:NOW:EX" D ^DIR K DIR
 I ($D(DIRUT))!($D(DIROUT)) D CLEAN^DILF Q
 S STARTDT=Y
 S DIR("A")="END DATE: ",DIR(0)="DA^"_STARTDT_":NOW:EX" D ^DIR K DIR
 I ($D(DIRUT))!($D(DIROUT)) D CLEAN^DILF Q
 S ENDDT=Y
 D
 .I $$GET1^DIQ(43,1,11,"I") D  Q
 ..S DGBTDIVN=$$YESNO^DGBTUTL("Do you wish to run this report for all divisions")
 ..I DGBTDIVN S DGBTDIVN="ALL" Q
 ..I (($D(DIRUT))!($D(DTOUT))!($D(DUOUT))) Q
 ..K DIR S DIR(0)="P^40.8:EMZ" D ^DIR K DIR
 ..I (($D(DIRUT))!($D(DTOUT))!($D(DUOUT))) Q
 ..S DGBTDIVN=+Y
 .S DGBTDIVN=$O(^DG(40.8,0))
 I (($D(DIRUT))!($D(DTOUT))!($D(DUOUT))) D CLEAN^DILF Q
 K DIR
 S DIR(0)="S^M:MILEAGE;S:SPECIAL MODE",DIR("A")="Which claim type do you want to run?" D ^DIR K DIR
 I (($D(DIRUT))!($D(DTOUT))!($D(DUOUT))) D CLEAN^DILF Q
 S TYPE=Y
 S CLERKALL=$$YESNO^DGBTUTL("Do you wish to run this report for all clerks")
 I (($D(DIRUT))!($D(DTOUT))!($D(DUOUT))) D CLEAN^DILF Q
 S CLERK=""
 I 'CLERKALL D
 .K DIR S DIR(0)="P^200:EMZ",DIR("A")="Select CLERK" D ^DIR K DIR
 .I (($D(DIRUT))!($D(DTOUT))!($D(DUOUT))) Q
 .S CLERK=$P(Y,U)
 I (($D(DIRUT))!($D(DTOUT))!($D(DUOUT))) D CLEAN^DILF Q
 K DIR
 S DIR(0)="S^F:FULL;T:TOTAL",DIR("A")="Which claim type do you want to run?" D ^DIR K DIR
 I (($D(DIRUT))!($D(DTOUT))!($D(DUOUT))) D CLEAN^DILF Q
 S REPTYPE=Y
 D SETPRT,QUIT
 Q
SETPRT ;
 S DGBTEXC=$$SELEXCEL^DGBTUTL
 I DGBTEXC="^" Q
 S SUBS=DGBTEXC_U_STARTDT_U_ENDDT_U_DGBTDIVN_U_TYPE_U_REPTYPE_U_CLERKALL_U_CLERK
 I 'DGBTEXC N COLWID S COLWID=132 D PRINTMSG^DGBTUTL
 D DEVICE^DGBTUTL("Beneficiary Travel Clerk Report","MAIN^DGBTR123(SUBS)",DGBTEXC,132)
 I $G(DGBTQ) Q
 ;
 I $D(IO("Q")) D:'$D(ZTQUEUED) ^%ZISC Q
 D MAIN(SUBS)
 D:'$D(ZTQUEUED) ^%ZISC
 U IO
 Q
MAIN(SUBS) ;
 K ^TMP("DGBTRPTC",$J)
 S DGBTEXC=$P(SUBS,U)
 S STARTDT=$P(SUBS,U,2)
 S ENDDT=$P(SUBS,U,3)
 S DGBTDIVN=$P(SUBS,U,4)
 S TYPE=$P(SUBS,U,5)
 S REPTYPE=$P(SUBS,U,6)
 S CLERKALL=$P(SUBS,U,7)
 S CLERK=$P(SUBS,U,8)
 S CLERKNAME=$$GET1^DIQ(200,CLERK,.01)
 D GETRECS
 I '$D(^TMP("DGBTRPTC",$J)) W !,"No records found" D QUIT Q
 D PRINT
 Q
GETRECS ;
 I ((TYPE="M")&(REPTYPE="F")) F I="CLAIMS","TOT MILE","CC FEE","ECON","M&L","F&B","DED","PAY" S GRAND(I)=0
 I ((TYPE="M")&(REPTYPE="T")) F I="MILE","CC FEE","ECON","M&L","F&B","DED","PAY" S GRAND(I)=0
 I ((TYPE="S")&(REPTYPE="F")) F I="CLAIMS","MILE","BASE RATE","NSNL","WAIT TIME","EXTRA CREW","SPECIAL EQUIPMENT","INVOICE AMT" S GRAND(I)=0
 I ((TYPE="S")&(REPTYPE="T")) F I="CLAIMS","MILE","BASE RATE","NSNL","WAIT TIME","EXTRA CREW","SPECIAL EQUIPMENT","INVOICE AMT" S GRAND(I)=0
 S ENTRY=$O(^DGBT(392,"D",STARTDT),-1)
 F  S ENTRY=$O(^DGBT(392,"D",ENTRY)) Q:ENTRY=""  Q:ENTRY>ENDDT  D
 .S I=""
 .F  S I=$O(^DGBT(392,"D",ENTRY,I)) Q:I=""  D GETLINE
 Q
GETLINE ;
 S LINEZERO=$G(^DGBT(392,I,0)) Q:'$$CLERK
 I $$GET1^DIQ(392,I,45.2,"I") Q  ;'="NO" Q
 I '$$DIV Q
 S DATALINE=""
 S SQ1=$P(LINEZERO,"^",13)_"^"_$P(LINEZERO,"^",12)
 I TYPE="M" D GLMILE
 I TYPE="S" D GLSP
 I DATALINE'="" S ^TMP("DGBTRPTC",$J,SQ1,SQ2)=DATALINE
 Q
DIV() ;
 I DGBTDIVN="ALL" Q 1
 Q $P(LINEZERO,U,11)=DGBTDIVN
CLERK() ;
 I CLERKALL Q 1
 Q $P(LINEZERO,"^",12)=CLERK
GLMILE ;
 I $$GET1^DIQ(392,I,56,"I")'="M" Q
 S LINEM=$G(^DGBT(392,I,"M"))
 S CCFEE=$$GET1^DIQ(392,$P(LINEZERO,U),55)
 I REPTYPE="F" D GLMILEF
 I REPTYPE="T" D GLMILET
 Q
GLMILEF ; Mileage full
 S SQ2=$O(^TMP("DGBTRPTC",$J,SQ1,""),-1)+1
 S DFN=$P(LINEZERO,U,2) Q:DFN=""
 S PATZERO=$G(^DPT(DFN,0))
 S DATALINE=$P(PATZERO,U) ; Pat name
 S GRAND("CLAIMS")=GRAND("CLAIMS")+1
 S $P(DATALINE,U,2)=$P(PATZERO,U,9) ; Pat ID
 S $P(DATALINE,U,3)=$$FMTE^XLFDT($P($P(LINEZERO,U),".")) ; Claim date/time
 I DGBTEXC S $P(DATALINE,U,3)=$P($P(DATALINE,U,3),"@")
 S $P(DATALINE,U,4)=$$GET1^DIQ(40.8,$P(LINEZERO,U,11),.01) ; Division
 S $P(DATALINE,U,5)=$$GET1^DIQ(392.3,$P(LINEZERO,U,6),2) ; Account
 S $P(DATALINE,U,6)=$S($P(LINEM,U)=1:"O",1:"R")
 S $P(DATALINE,U,7)=$P(LINEM,U)*$P(LINEM,U,2) ; Total mileage
 S GRAND("TOT MILE")=GRAND("TOT MILE")+($P(LINEM,U)*$P(LINEM,U,2))
 S $P(DATALINE,U,8)=$$GET1^DIQ(392,$P(LINEZERO,U),44) ; Common carrier mode
 S $P(DATALINE,U,9)=$$DLRAMT(CCFEE) ; Common carrier fee
 S GRAND("CC FEE")=GRAND("CC FEE")+$$GET1^DIQ(392,$P(LINEZERO,U),55)
 S $P(DATALINE,U,10)=$$DLRAMT($P(LINEZERO,U,8)) ; Most economical cost
 S GRAND("ECON")=GRAND("ECON")+$P(LINEZERO,U,8)
 S $P(DATALINE,U,11)=$$DLRAMT($P(LINEM,U,4)) ; Meals & lodging
 S GRAND("M&L")=GRAND("M&L")+$P(LINEM,U,4)
 S $P(DATALINE,U,12)=$$DLRAMT($P(LINEM,U,5)) ; Ferries & bridges
 S GRAND("F&B")=GRAND("F&B")+$P(LINEM,U,5)
 S $P(DATALINE,U,13)=$$DLRAMT($P(LINEZERO,U,9)) ; Deductible
 S GRAND("DED")=GRAND("DED")+$P(LINEZERO,U,9)
 S $P(DATALINE,U,14)=$$DLRAMT($P(LINEZERO,U,10)) ; Payable
 S GRAND("PAY")=GRAND("PAY")+$P(LINEZERO,U,10)
 S $P(DATALINE,U,15)=$TR($$GET1^DIQ(392,$P(LINEZERO,U),51),"^","") ; Remarks
 Q
GLMILET ; Mileage total
 S $P(SQ1,"^",3)=$P(LINEZERO,U,11)
 S $P(SQ1,"^",4)=$P(LINEZERO,U,6)
 S SQ2=0
 S DATALINE=$G(^TMP("DGBTRPTC",$J,SQ1,SQ2))
 S $P(DATALINE,U)=($P(LINEM,U)*$P(LINEM,U,2))+$P(DATALINE,U) ; MILEAGE
 S $P(DATALINE,U,2)=$$GET1^DIQ(392,I,55)+$P(DATALINE,U,2) ;COMMON CARRIER FEE
 S GRAND("CC FEE")=GRAND("CC FEE")+CCFEE
 S $P(DATALINE,U,3)=$P(LINEZERO,U,8)+$P(DATALINE,U,3) ; MOST ECONOMICAL COST
 S GRAND("ECON")=GRAND("ECON")+$P(LINEZERO,U,8)
 S $P(DATALINE,U,4)=$P(LINEM,U,4)+$P(DATALINE,U,4) ; MEALS & LODGING
 S GRAND("M&L")=GRAND("M&L")+$P(LINEM,U,4)
 S $P(DATALINE,U,5)=$P(LINEM,U,5)+$P(DATALINE,U,5) ; FERRIES & BRIDGES
 S GRAND("F&B")=GRAND("F&B")+$P(LINEM,U,5)
 S $P(DATALINE,U,6)=$P(LINEZERO,U,9)+$P(DATALINE,U,6) ; DEDUCTIBLE
 S GRAND("DED")=GRAND("DED")+$P(LINEZERO,U,9)
 S $P(DATALINE,U,7)=$P(LINEZERO,U,10)+$P(DATALINE,U,7) ; PAYABLE
 S GRAND("PAY")=GRAND("PAY")+$P(LINEZERO,U,10)
 Q
GLSP ;
 I $$GET1^DIQ(392,I,56,"I")'="S" Q
 S LINESP=$G(^DGBT(392,I,"SP"))
 I REPTYPE="F" D GLSPF
 I REPTYPE="T" D GLSPT
 Q
GLSPF ; Special mode full
 S SQ2=$O(^TMP("DGBTRPTC",$J,SQ1,""),-1)+1
 S DFN=$P(LINEZERO,U,2) Q:DFN=""
 S PATZERO=$G(^DPT(DFN,0))
 S DATALINE=$P(PATZERO,U) ; Pat name
 S GRAND("CLAIMS")=GRAND("CLAIMS")+1
 S $P(DATALINE,U,2)=$P(PATZERO,U,9) ; Pat ID
 S $P(DATALINE,U,3)=$$FMTE^XLFDT($P($P(LINEZERO,U),".")) ; Claim date/time
 I DGBTEXC S $P(DATALINE,U,3)=$P($P(DATALINE,U,3),"@")
 S $P(DATALINE,U,4)=$$GET1^DIQ(40.8,$P(LINEZERO,U,11),.01) ; Division
 S $P(DATALINE,U,5)=$$GET1^DIQ(392.3,$P(LINEZERO,U,6),2) ; Account
 S $P(DATALINE,U,6)=$P(LINESP,U,12) ; Mileage
 S GRAND("MILE")=GRAND("MILE")+$P(LINESP,U,12)
 S $P(DATALINE,U,7)=$$DLRAMT($P(LINESP,U,5)) ; Base rate fee
 S GRAND("BASE RATE")=GRAND("BASE RATE")+$P(LINESP,U,5)
 S $P(DATALINE,U,8)=$$DLRAMT($P(LINESP,U,7)) ; No show/no load fee
 S GRAND("NSNL")=GRAND("NSNL")+$P(LINESP,U,7)
 S $P(DATALINE,U,9)=$$DLRAMT($P(LINESP,U,8)) ; Wait time fee
 S GRAND("WAIT TIME")=GRAND("WAIT TIME")+$P(LINESP,U,8)
 S $P(DATALINE,U,10)=$$DLRAMT($P(LINESP,U,9)) ; Extra crew fee
 S GRAND("EXTRA CREW")=GRAND("EXTRA CREW")+$P(LINESP,U,9)
 S $P(DATALINE,U,11)=$$DLRAMT($P(LINESP,U,10)) ; Special equipment fee
 S GRAND("SPECIAL EQUIPMENT")=GRAND("SPECIAL EQUIPMENT")+$P(LINESP,U,10)
 S $P(DATALINE,U,12)=$$DLRAMT($P(LINESP,U,4)) ; Invoice
 S GRAND("INVOICE AMT")=GRAND("INVOICE AMT")+$P(LINESP,U,4)
 S $P(DATALINE,U,13)=$TR($P(LINESP,U,26),"^","") ; Remarks
 Q
GLSPT ; Special mode total
 S $P(SQ1,"^",3)=$P(LINEZERO,U,11)
 S $P(SQ1,"^",4)=$P(LINEZERO,U,6)
 S SQ2=0
 S DATALINE=$G(^TMP("DGBTRPTC",$J,SQ1,SQ2))
 S $P(DATALINE,U)=1+$P(DATALINE,U) ; TOTAL CLAIMS
 S GRAND("CLAIMS")=GRAND("CLAIMS")+1
 S $P(DATALINE,U,2)=$P(LINESP,U,12)+$P(DATALINE,U,2) ; MILEAGE
 S GRAND("MILE")=GRAND("MILE")+$P(LINESP,U,12)
 S $P(DATALINE,U,3)=$P(LINESP,U,5)+$P(DATALINE,U,3) ; BASE RATE FEE
 S GRAND("BASE RATE")=GRAND("BASE RATE")+$P(LINESP,U,5)
 S $P(DATALINE,U,4)=$P(LINESP,U,7)+$P(DATALINE,U,4) ; NO LOAD/NO SHOW
 S GRAND("NSNL")=GRAND("NSNL")+$P(LINESP,U,7)
 S $P(DATALINE,U,5)=$P(LINESP,U,8)+$P(DATALINE,U,5) ; WAIT TIME
 S GRAND("WAIT TIME")=GRAND("WAIT TIME")+$P(LINESP,U,8)
 S $P(DATALINE,U,6)=$P(LINESP,U,9)+$P(DATALINE,U,6) ; EXTRA CREW
 S GRAND("EXTRA CREW")=GRAND("EXTRA CREW")+$P(LINESP,U,9)
 S $P(DATALINE,U,7)=$P(LINESP,U,10)+$P(DATALINE,U,7) ; SPECIAL EQUIPMENT
 S GRAND("SPECIAL EQUIPMENT")=GRAND("SPECIAL EQUIPMENT")+$P(LINESP,U,10)
 S $P(DATALINE,U,8)=$P(LINESP,U,4)+$P(DATALINE,U,8) ; TOTAL INVOICE AMOUNT
 S GRAND("INVOICE AMT")=GRAND("INVOICE AMT")+$P(LINESP,U,4)
 Q
PRINT ;
 U IO
 S PAGE=0,$P(EQUAL,"=",133)=""
 D NOW^%DTC S Y=% D DD^%DT S PDT=Y
 I DGBTEXC D
 .I (TYPE="M")&(REPTYPE="F") D
 ..W "DATE ENTERED^PATIENT^PATIENT ID^CLERK^CLAIM DATE^DIVISION^ACCT^R/O^MILEAGE^CC MODE^CC FEE^MOST ECONOMIC^M & L^FERRIES & BRIDGES^DEDUCTIBLE^AMOUNT PAYABLE^REMARK"
 .I (TYPE="M")&(REPTYPE="T") D
 ..W "DATE ENTERED^CLERK^DIVISION^ACCT^MILEAGE^CC FEE^MOST ECONOMIC^M & L^FERRIES &BRIDGES^DEDUCTIBLE^AMOUNT PAYABLE"
 .I (TYPE="S")&(REPTYPE="F") D
 ..W "DATE ENTERED^PATIENT^PATIENT ID^CLERK^CLAIM DATE^DIVISION^ACCT^MILEAGE^BASE RATE^NO SHOW NO LOAD^WAIT TIME^EXTRA CREW^SPECIAL EQUIPMENT^INVOICE AMOUNT^REMARK"
 .I (TYPE="S")&(REPTYPE="T") D
 ..W "DATE ENTERED^CLERK^DIVISION^ACCT^# CLAIMS^MILEAGE^BASE RATE^NO SHOW NO LOAD^WAIT TIME^EXTRA CREW^SPECIAL EQUIPMENT^INVOICE AMOUNT"
 I (TYPE="M")&(REPTYPE="F")&('DGBTEXC) D HDRMF^DGBTR3A
 I (TYPE="M")&(REPTYPE="T")&('DGBTEXC) D HDRMT
 I (TYPE="S")&(REPTYPE="F")&('DGBTEXC) D HDRSF
 I (TYPE="S")&(REPTYPE="T")&('DGBTEXC) D HDRST
 S (PROMPT,SQ1)=""
 F  S SQ1=$O(^TMP("DGBTRPTC",$J,SQ1)) Q:SQ1=""  D  Q:PROMPT="^"
 .S SQ2=""
 .F  S SQ2=$O(^TMP("DGBTRPTC",$J,SQ1,SQ2)) Q:SQ2=""  D  Q:PROMPT="^"
 ..S DATALINE=^TMP("DGBTRPTC",$J,SQ1,SQ2)
 ..I DGBTEXC D PRTXL Q
 ..I (TYPE="M")&(REPTYPE="F")&(($Y+4)>IOSL) D  Q:PROMPT="^"
 ...D HDRMF^DGBTR3A
 ..I (TYPE="M")&(REPTYPE="F") D
 ...W !,$P(DATALINE,U),?32,$P(DATALINE,U,2),?43,$$GET1^DIQ(200,$P(SQ1,U,2),.01),?78,$P(DATALINE,U,3),?92,$$FMTE^XLFDT($P(SQ1,U))
 ...W ?109,$P(DATALINE,U,5)
 ...W !,?5,$P(DATALINE,U,4),?42,$P(DATALINE,U,6),?48,$P(DATALINE,U,7),?54,$P(DATALINE,U,8),?92,$P(DATALINE,U,9),?107,$P(DATALINE,U,10)
 ...W ?119,$P(DATALINE,U,11)
 ...W !,?5,$P(DATALINE,U,12),?17,$P(DATALINE,U,13),?25,$P(DATALINE,U,14),?38,$P(DATALINE,U,15)
 ..I (TYPE="S")&(REPTYPE="F")&(($Y+4)>IOSL) D  Q:PROMPT="^"
 ...D HDRSF
 ..I (TYPE="S")&(REPTYPE="F") D
 ...W !,$P(DATALINE,U),?32,$P(DATALINE,U,2),?43,$$GET1^DIQ(200,$P(SQ1,U,2),.01),?78,$P(DATALINE,U,3),?92,$$FMTE^XLFDT($P(SQ1,U))
 ...W ?109,$P(DATALINE,U,5)
 ...W !,?5,$P(DATALINE,U,4),?42,$P(DATALINE,U,6),?50,$P(DATALINE,U,7),?65,$P(DATALINE,U,8),?79,$P(DATALINE,U,9),?90,$P(DATALINE,U,10)
 ...W ?102,$P(DATALINE,U,11),?116,$P(DATALINE,U,12)
 ...W !,?5,$P(DATALINE,U,13)
 ..I (TYPE="M")&(REPTYPE="T")&(($Y+3)>IOSL) D  Q:PROMPT="^"
 ...D HDRMT
 ..I (TYPE="M")&(REPTYPE="T") D
 ...W !,$$GET1^DIQ(40.8,$P(SQ1,U,3),.01),?37,$$FMTE^XLFDT($P(SQ1,U)),?50,$$GET1^DIQ(392.3,$P(SQ1,U,4),2),?55,$P(DATALINE,U)
 ...W ?63,$$DLRAMT($P(DATALINE,U,2)),?78,$$DLRAMT($P(DATALINE,U,3)),?90,$$DLRAMT($P(DATALINE,U,4)),?103,$$DLRAMT($P(DATALINE,U,5))
 ...W !,?5,$$DLRAMT($P(DATALINE,U,6)),?18,$$DLRAMT($P(DATALINE,U,7)),?29,$$GET1^DIQ(200,$P(SQ1,U,2),.01)
 ..I (TYPE="S")&(REPTYPE="T")&(($Y+3)>IOSL) D  Q:PROMPT="^"
 ...D HDRST
 ..I (TYPE="S")&(REPTYPE="T") D
 ...W !,$$GET1^DIQ(40.8,$P(SQ1,U,3),.01),?37,$$FMTE^XLFDT($P(SQ1,U)),?50,$$GET1^DIQ(392.3,$P(SQ1,U,4),2),?55,$P(DATALINE,U,2)
 ...W ?63,$P(DATALINE,U),?72,$$DLRAMT($P(DATALINE,U,3)),?87,$$DLRAMT($P(DATALINE,U,4)),?102,$$DLRAMT($P(DATALINE,U,5))
 ...W ?117,$$DLRAMT($P(DATALINE,U,6))
 ...W !,?5,$$DLRAMT($P(DATALINE,U,7)),?15,$$DLRAMT($P(DATALINE,U,8)),?25,$$GET1^DIQ(200,$P(SQ1,U,2),.01)
 ..Q
 I 'DGBTEXC D
 .I ($Y+4)<IOSL W !!!
 .I (REPTYPE="F"),(TYPE="M") D GRANDMF^DGBTR3A
 .I (REPTYPE="T"),(TYPE="M") D GRANDMT^DGBTR3A
 .I (REPTYPE="F"),(TYPE="S") D GRANDSF^DGBTR3A
 .I (REPTYPE="T"),(TYPE="S") D GRANDST^DGBTR3A
 I IOST["C-" S Y=$$PAUSE^DGBTUTL(DGBTEXC)
 I IOST'["C-" W !,"REPORT HAS FINISHED"
 Q
PRTXL ;
 I REPTYPE="F" D
 .W !,$$FMTE^XLFDT($P(SQ1,U)),U,$P(DATALINE,U),U,$P(DATALINE,U,2),U,$$GET1^DIQ(200,$P(SQ1,U,2),.01) F I=3:1:$L(DATALINE,U) W U,$P(DATALINE,U,I)
 I REPTYPE="T" D
 .W !,$$FMTE^XLFDT($P(SQ1,U)),U,$$GET1^DIQ(200,$P(SQ1,U,2),.01),U,$$GET1^DIQ(40.8,$P(SQ1,U,3),.01),U,$$GET1^DIQ(392.3,$P(SQ1,U,4),2)
 .I TYPE="M" D
 ..W U,$P(DATALINE,U,1)
 ..F I=2:1:$L(DATALINE,U) W U,$$DLRAMT($P(DATALINE,U,I))
 .I TYPE="S" D
 ..F I=1,2 W U,$P(DATALINE,U,I)
 ..F I=3:1:$L(DATALINE,U) W U,$$DLRAMT($P(DATALINE,U,I))
 Q
DLRAMT(X) ;
 D COMMA^%DTC I 'DGBTEXC Q $TR(X," ","")
 Q $TR(X," ,$","")
HDRMT ;
 S PAGE=PAGE+1
 W @IOF
 W "BT CLERK REPORT      PRINT DATE: ",PDT,?(126-$L(PAGE)),"PAGE ",PAGE
 W !,$$FMTE^XLFDT(STARTDT)," TO ",$$FMTE^XLFDT(ENDDT)
 W !,"VERSION: TOTAL"
 W !,"TYPE: MILEAGE"
 W !,"DIVISION: ",$S(DGBTDIVN="ALL":"ALL",1:$$GET1^DIQ(40.8,DGBTDIVN,.01))
 W !,"CLERK: ",$S(CLERKALL:"ALL",1:CLERKNAME)
 W !,$E(EQUAL,1,117)
 W !,"DIVISION",?37,"ENTERED",?50,"ACCT",?55,"MILEAGE",?63,"CC FEE",?78,"MOST ECON",?90,"M&L",?103,"F&B"
 W !,?5,"DED",?18,"PAYABLE",?29,"CLERK"
 W !,$E(EQUAL,1,117)
 Q
HDRSF ;
 S PAGE=PAGE+1
 W @IOF
 W "BT CLERK REPORT      PRINT DATE: ",PDT,?(126-$L(PAGE)),"PAGE ",PAGE
 W !,$$FMTE^XLFDT(STARTDT)," TO ",$$FMTE^XLFDT(ENDDT)
 W !,"VERSION: FULL"
 W !,"TYPE: SPECIAL MODE"
 W !,"DIVISION: ",$S(DGBTDIVN="ALL":"ALL",1:$$GET1^DIQ(40.8,DGBTDIVN,.01))
 W !,"CLERK: ",$S(CLERKALL:"ALL",1:CLERKNAME)
 W !,$E(EQUAL,1,124)
 W !,"PATIENT NAME",?32,"SSN",?43,"CLERK",?78,"CL DT",?92,"ENT DT",?109,"ACCT"
 W !,?5,"DIVISION",?42,"MILEAGE",?50,"BASE RATE",?65,"NSNL",?79,"WAIT TIME",?90,"EX CREW",?102,"SPEC EQ",?116,"INV AMT"
 W !,?5,"REMARKS"
 W !,$E(EQUAL,1,124)
 Q
HDRST ;
 S PAGE=PAGE+1
 W @IOF
 W "BT CLERK REPORT      PRINT DATE: ",PDT,?(126-$L(PAGE)),"PAGE ",PAGE
 W !,$$FMTE^XLFDT(STARTDT)," TO ",$$FMTE^XLFDT(ENDDT)
 W !,"VERSION: TOTAL"
 W !,"TYPE: SPECIAL MODE"
 W !,"DIVISION: ",$S(DGBTDIVN="ALL":"ALL",1:$$GET1^DIQ(40.8,DGBTDIVN,.01))
 W !,"CLERK: ",$S(CLERKALL:"ALL",1:CLERKNAME)
 W !,$E(EQUAL,1,127)
 W !,"DIVISION",?37,"ENTERED",?50,"ACCT",?55,"MILEAGE",?63,"CLAIMS",?72,"BASE RATE",?87,"NSNL",?102,"WAIT TIME",?117,"EXTRA CREW"
 W !,?5,"SPEC EQ",?15,"INV AMT",?25,"CLERK"
 W !,$E(EQUAL,1,127)
 Q
QUIT ;
 K ^TMP("DGBTRPTC",$J)
 D CLEAN^DILF
 Q