BDGICS5 ; IHS/ANMC/LJF - INCOMPLETE STATS BY PROVIDER ;
;;5.3;PIMS;**1005**;MAY 28, 2004
;IHS/OIT/LJF 04/06/2006 PATCH 1005 new routine
;
NEW BDGRPT,DEFAULT,BDGBD,BDGED,BDGSRT,BDGPRV
;
S BDGRPT=$$READ^BDGF("S0^1:Statistics Only;2:List Charts Only;3:Both Statistics & Listing","Select Report Format") Q:BDGRPT<1
;
S BDGBD=$$READ^BDGF("DO^::EX","Select Beginning Discharge/Surgery Date") Q:BDGBD<1
S BDGED=$$READ^BDGF("DO^::EX","Select Ending Discharge/Surgery Date") Q:BDGED<1
;
S BDGPRV=$$READ^BDGF("YO","Print Report for ALL Providers","NO")
Q:BDGPRV=U S:BDGPRV=1 BDGPRV="ALL"
I BDGPRV=0 S BDGPRV=$$PROVS^BDGICR2 I '$O(BDGPRV(0)) Q
;
S BDGSRT=$$READ^BDGF("SO^1:Chart Deficiency;2:Discharge/Surgery Date","Within Provider Sort By") Q:BDGSRT<1
;
I $$BROWSE^BDGF="B" D EN Q
D ZIS^BDGF("PQM","EN^BDGICS5","IC STATS BY PROVIDER","BDGRPT;BDGBD;BDGED;BDGSRT;BDGPRV*")
Q
;
;
EN ; -- main entry point for BDG IC CHARTS BY PATIENT
I $E(IOST,1,2)="P-" S BDGPRT=1 D INIT,PRINT Q ;printing to paper
NEW VALMCNT D TERM^VALM0,CLEAR^VALM1
D EN^VALM("BDG IC STATS BY PROVIDER")
D CLEAR^VALM1
Q
;
HDR ; -- header code
NEW X
S VALMHDR(1)=$$SP(15)_$$CONF^BDGF
S X="Sorted by "_$S(BDGSRT=1:"Chart Deficiency",1:"Discharge/Surgery Date")
S VALMHDR(2)=$$SP(75-$L(X)\2)_X
S X=$$RANGE^BDGF(BDGBD,BDGED),VALMHDR(3)=$$SP(75-$L(X)\2)_X
Q
;
INIT ; -- init variables and list array
I '$G(BDGPRT) D MSG^BDGF("Please wait while I compile the list...",2,0)
K ^TMP("BDGICS5",$J),^TMP("BDGICS5A",$J)
S VALMCNT=0
;
; first find incomplete entries by date range & sort by patient
NEW DATE,END
S DATE=BDGBD-.0001,END=BDGED+.24
D FIND ;gather visits by provider
;
; now take sorted list and put into display array
NEW SORT,IEN,LINE,PRV,NAME,IEN2,STR,BDGCNT,FIRST
S FIRST=1
S PRV=0 F S PRV=$O(^TMP("BDGICS5A",$J,PRV)) Q:PRV="" D
. I FIRST S FIRST=0
. E D SET("",.VALMCNT)
. D SET($$SP(15)_"**** "_PRV_" ****",.VALMCNT)
. K BDGCNT
. ;
. S SORT=0 F S SORT=$O(^TMP("BDGICS5A",$J,PRV,SORT)) Q:SORT="" D
.. S IEN=0 F S IEN=$O(^TMP("BDGICS5A",$J,PRV,SORT,IEN)) Q:'IEN D
... S IEN2=0 F S IEN2=$O(^TMP("BDGICS5A",$J,PRV,SORT,IEN,IEN2)) Q:'IEN2 D
.... S STR=^TMP("BDGICS5A",$J,PRV,SORT,IEN,IEN2)
.... ;
.... ; build display line if requested
.... I BDGRPT>1 D
..... S LINE=$$PAD($J($$GET1^DIQ(9009016.1,IEN,.011),7),10) ;chart #
..... S LINE=LINE_$E($$GET1^DIQ(9009016.1,IEN,.0392),1,3) ;service category
..... S LINE=$$PAD(LINE,18)_$$NUMDATE^BDGF(+STR\1) ;dsch/surg date
..... S LINE=$$PAD(LINE,31)_$E($P(STR,U,2),1,20) ;deficiency name
..... S LINE=$$PAD(LINE,53)_$$GET1^DIQ(9009016.11,IEN2_","_IEN,.0393) ;def status
..... S LINE=$$PAD(LINE,66)_$$GET1^DIQ(9009016.11,IEN2_","_IEN,.0392) ;days to complete
..... D SET(LINE,.VALMCNT)
.... ;
.... Q:BDGRPT=2 ;no stats if requested listing only
.... ;
.... ; build statistical counts
.... NEW DELQ,RESV,X
.... S BDGCNT("TOTAL")=$G(BDGCNT("TOTAL"))+1 ;add to incomplete count
.... S X=$$GET1^DIQ(9009016.1,IEN,.0392) ;visit's service category
.... S BDGCNT("TOTAL",X)=$G(BDGCNT("TOTAL",X))+1 ;IC count by service category
.... ;
.... I $$GET1^DIQ(9009016.4,$P(STR,U,3),.03)="ADMIN ONLY" Q ;quit if deficiency not to be counted
.... S DELQ=$$GET1^DIQ(9009016.11,IEN2_","_IEN,.0391) Q:DELQ="" ;date delinquent (computed)
.... S %DT="",X=DELQ D ^%DT S DELQ=Y ;convert to internal format
.... S RESV=$$GET1^DIQ(9009016.11,IEN2_","_IEN,.03,"I") S:'RESV RESV=DT ;date resolved
.... I (DELQ<RESV) D
..... S BDGCNT("DELQ")=$G(BDGCNT("DELQ"))+1 ;add to delinquent count
..... S BDGCNT("DELQ",$P(STR,U,2))=$G(BDGCNT("DELQ",$P(STR,U,2)))+1 ;DQ counts by deficiency
. ;
. Q:BDGRPT=2 ;don't display if requested listing only
. ; now display provider's statistics
. D SET("",.VALMCNT)
. D SET($$PAD("TOTAL INCOMPLETE CHARTS",30)_(+$G(BDGCNT("TOTAL"))),.VALMCNT)
. I $G(BDGCNT("TOTAL")) D
.. S X=0 F S X=$O(BDGCNT("TOTAL",X)) Q:X="" D SET($$PAD($$SP(7)_"Incomplete "_X_" Charts",45)_BDGCNT("TOTAL",X),.VALMCNT)
.. D SET("",.VALMCNT)
.. D SET($$PAD("# OF DELINQUENT CHARTS",30)_(+$G(BDGCNT("DELQ"))),.VALMCNT)
.. S X=0 F S X=$O(BDGCNT("DELQ",X)) Q:X="" D SET($$PAD($$SP(7)_"Delinquent for "_X,45)_BDGCNT("DELQ",X),.VALMCNT)
;
I '$D(^TMP("BDGICS5",$J)) D SET("NO DATA FOUND",.VALMCNT)
K ^TMP("BDGICS5A",$J)
Q
;
FIND ; find all entries for date range
NEW SUB,DATE,END,IEN,SORT,IEN2,PROV,DEF,DEF1
F SUB="AD","AS" D
. S DATE=BDGBD-.0001,END=BDGED+.24
. F S DATE=$O(^BDGIC(SUB,DATE)) Q:'DATE Q:(DATE>END) D
.. S IEN=0 F S IEN=$O(^BDGIC(SUB,DATE,IEN)) Q:'IEN D
... ;
... I $$GET1^DIQ(9009016.1,IEN,.14)]"" Q ;quit if deleted
... I BDGSRT=2 S X=$$GET1^DIQ(9009016.1,IEN,.02,"I"),SORT=$S(X]"":X,1:$$GET1^DIQ(9009016.1,IEN,.05,"I"))
... ;
... ; find all providers with deficiencies
... S IEN2=0 F S IEN2=$O(^BDGIC(IEN,1,IEN2)) Q:'IEN2 D
.... Q:$$GET1^DIQ(9009016.11,IEN2_","_IEN,.04)]"" ;don't count if deleted
.... ;
.... S PROV=$$GET1^DIQ(9009016.11,IEN2_","_IEN,.01,"I") ;provider pointer
.... I BDGPRV="SRV",'$D(BDGPRV(+$$GET1^DIQ(200,PROV,29,"I"))) Q ;skip if prov not in requested service
.... I BDGPRV="CLASS",'$D(BDGPRV(+$$GET1^DIQ(200,PROV,53.5,"I"))) Q ;skip if prov not in requested class
.... I BDGPRV="NAME",'$D(BDGPRV(PROV)) Q ;skip if provider not requested by name
.... ;
.... S PROV=$$GET1^DIQ(9009016.11,IEN2_","_IEN,.01) ;provider name
.... S DEF=$$GET1^DIQ(9009016.11,IEN2_","_IEN,.02) ;deficiency name
.... S DEFI=$$GET1^DIQ(9009016.11,IEN2_","_IEN,.02,"I") ;deficiency pointer
.... I BDGSRT=1 S SORT=DEF
.... S ^TMP("BDGICS5A",$J,PROV,SORT,IEN,IEN2)=DATE_U_DEF_U_DEFI ;put into sorted list
Q
;
SET(DATA,NUM) ; puts display line into list template array
S NUM=NUM+1
S ^TMP("BDGICS5",$J,NUM,0)=DATA
Q
;
HELP ; -- help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ; -- exit code
K ^TMP("BDGICS5",$J) K BDGPRT
Q
;
EXPND ; -- expand code
Q
;
PRINT ; print report to paper
NEW BDGX,BDGLN,BDGPG
U IO D INIT^BDGF ;initialize heading variables
D HDG
;
; loop thru display array
S BDGX=0 F S BDGX=$O(^TMP("BDGICS5",$J,BDGX)) Q:'BDGX D
. I $Y>(IOSL-4) D HDG
. S BDGLN=^TMP("BDGICS5",$J,BDGX,0)
. W !,BDGLN
D ^%ZISC,PRTKL^BDGF,EXIT
Q
;
HDG ; heading for paper report
NEW X
S BDGPG=$G(BDGPG)+1 I BDGPG>1 W @IOF
W !,BDGUSR,?11,"*****",$$CONF^BDGF,"*****"
W !,BDGDATE,?23,"Incomplete Statistics by Provider",?70,"Page: ",BDGPG
S X="Sorted by "_$S(BDGSRT=1:"Chart Deficiency",1:"Discharge/Surgery Date")
W !,BDGTIME,?(80-$L(X)\2),X
S X=$$RANGE^BDGF(BDGBD,BDGED) W !,?(80-$L(X)\2),X
W !,$$REPEAT^XLFSTR("-",80)
I BDGRPT>1 D
. W !?2,"Chart#",?10,"Type",?18,"Dsch/Surg",?31,"Deficiency",?53,"Status",?63,"Days to Complete"
W !,$$REPEAT^XLFSTR("=",80)
Q
;
PAD(D,L) ;EP -- SUBRTN to pad length of data
; -- D=data L=length
Q $E(D_$$REPEAT^XLFSTR(" ",L),1,L)
;
SP(N) ; -- SUBRTN to pad N number of spaces
Q $$PAD(" ",N)
;
BDGICS5 ; IHS/ANMC/LJF - INCOMPLETE STATS BY PROVIDER ;
+1 ;;5.3;PIMS;**1005**;MAY 28, 2004
+2 ;IHS/OIT/LJF 04/06/2006 PATCH 1005 new routine
+3 ;
+4 NEW BDGRPT,DEFAULT,BDGBD,BDGED,BDGSRT,BDGPRV
+5 ;
+6 SET BDGRPT=$$READ^BDGF("S0^1:Statistics Only;2:List Charts Only;3:Both Statistics & Listing","Select Report Format")
IF BDGRPT<1
QUIT
+7 ;
+8 SET BDGBD=$$READ^BDGF("DO^::EX","Select Beginning Discharge/Surgery Date")
IF BDGBD<1
QUIT
+9 SET BDGED=$$READ^BDGF("DO^::EX","Select Ending Discharge/Surgery Date")
IF BDGED<1
QUIT
+10 ;
+11 SET BDGPRV=$$READ^BDGF("YO","Print Report for ALL Providers","NO")
+12 IF BDGPRV=U
QUIT
IF BDGPRV=1
SET BDGPRV="ALL"
+13 IF BDGPRV=0
SET BDGPRV=$$PROVS^BDGICR2
IF '$ORDER(BDGPRV(0))
QUIT
+14 ;
+15 SET BDGSRT=$$READ^BDGF("SO^1:Chart Deficiency;2:Discharge/Surgery Date","Within Provider Sort By")
IF BDGSRT<1
QUIT
+16 ;
+17 IF $$BROWSE^BDGF="B"
DO EN
QUIT
+18 DO ZIS^BDGF("PQM","EN^BDGICS5","IC STATS BY PROVIDER","BDGRPT;BDGBD;BDGED;BDGSRT;BDGPRV*")
+19 QUIT
+20 ;
+21 ;
EN ; -- main entry point for BDG IC CHARTS BY PATIENT
+1 ;printing to paper
IF $EXTRACT(IOST,1,2)="P-"
SET BDGPRT=1
DO INIT
DO PRINT
QUIT
+2 NEW VALMCNT
DO TERM^VALM0
DO CLEAR^VALM1
+3 DO EN^VALM("BDG IC STATS BY PROVIDER")
+4 DO CLEAR^VALM1
+5 QUIT
+6 ;
HDR ; -- header code
+1 NEW X
+2 SET VALMHDR(1)=$$SP(15)_$$CONF^BDGF
+3 SET X="Sorted by "_$SELECT(BDGSRT=1:"Chart Deficiency",1:"Discharge/Surgery Date")
+4 SET VALMHDR(2)=$$SP(75-$LENGTH(X)\2)_X
+5 SET X=$$RANGE^BDGF(BDGBD,BDGED)
SET VALMHDR(3)=$$SP(75-$LENGTH(X)\2)_X
+6 QUIT
+7 ;
INIT ; -- init variables and list array
+1 IF '$GET(BDGPRT)
DO MSG^BDGF("Please wait while I compile the list...",2,0)
+2 KILL ^TMP("BDGICS5",$JOB),^TMP("BDGICS5A",$JOB)
+3 SET VALMCNT=0
+4 ;
+5 ; first find incomplete entries by date range & sort by patient
+6 NEW DATE,END
+7 SET DATE=BDGBD-.0001
SET END=BDGED+.24
+8 ;gather visits by provider
DO FIND
+9 ;
+10 ; now take sorted list and put into display array
+11 NEW SORT,IEN,LINE,PRV,NAME,IEN2,STR,BDGCNT,FIRST
+12 SET FIRST=1
+13 SET PRV=0
FOR
SET PRV=$ORDER(^TMP("BDGICS5A",$JOB,PRV))
IF PRV=""
QUIT
Begin DoDot:1
+14 IF FIRST
SET FIRST=0
+15 IF '$TEST
DO SET("",.VALMCNT)
+16 DO SET($$SP(15)_"**** "_PRV_" ****",.VALMCNT)
+17 KILL BDGCNT
+18 ;
+19 SET SORT=0
FOR
SET SORT=$ORDER(^TMP("BDGICS5A",$JOB,PRV,SORT))
IF SORT=""
QUIT
Begin DoDot:2
+20 SET IEN=0
FOR
SET IEN=$ORDER(^TMP("BDGICS5A",$JOB,PRV,SORT,IEN))
IF 'IEN
QUIT
Begin DoDot:3
+21 SET IEN2=0
FOR
SET IEN2=$ORDER(^TMP("BDGICS5A",$JOB,PRV,SORT,IEN,IEN2))
IF 'IEN2
QUIT
Begin DoDot:4
+22 SET STR=^TMP("BDGICS5A",$JOB,PRV,SORT,IEN,IEN2)
+23 ;
+24 ; build display line if requested
+25 IF BDGRPT>1
Begin DoDot:5
+26 ;chart #
SET LINE=$$PAD($JUSTIFY($$GET1^DIQ(9009016.1,IEN,.011),7),10)
+27 ;service category
SET LINE=LINE_$EXTRACT($$GET1^DIQ(9009016.1,IEN,.0392),1,3)
+28 ;dsch/surg date
SET LINE=$$PAD(LINE,18)_$$NUMDATE^BDGF(+STR\1)
+29 ;deficiency name
SET LINE=$$PAD(LINE,31)_$EXTRACT($PIECE(STR,U,2),1,20)
+30 ;def status
SET LINE=$$PAD(LINE,53)_$$GET1^DIQ(9009016.11,IEN2_","_IEN,.0393)
+31 ;days to complete
SET LINE=$$PAD(LINE,66)_$$GET1^DIQ(9009016.11,IEN2_","_IEN,.0392)
+32 DO SET(LINE,.VALMCNT)
End DoDot:5
+33 ;
+34 ;no stats if requested listing only
IF BDGRPT=2
QUIT
+35 ;
+36 ; build statistical counts
+37 NEW DELQ,RESV,X
+38 ;add to incomplete count
SET BDGCNT("TOTAL")=$GET(BDGCNT("TOTAL"))+1
+39 ;visit's service category
SET X=$$GET1^DIQ(9009016.1,IEN,.0392)
+40 ;IC count by service category
SET BDGCNT("TOTAL",X)=$GET(BDGCNT("TOTAL",X))+1
+41 ;
+42 ;quit if deficiency not to be counted
IF $$GET1^DIQ(9009016.4,$PIECE(STR,U,3),.03)="ADMIN ONLY"
QUIT
+43 ;date delinquent (computed)
SET DELQ=$$GET1^DIQ(9009016.11,IEN2_","_IEN,.0391)
IF DELQ=""
QUIT
+44 ;convert to internal format
SET %DT=""
SET X=DELQ
DO ^%DT
SET DELQ=Y
+45 ;date resolved
SET RESV=$$GET1^DIQ(9009016.11,IEN2_","_IEN,.03,"I")
IF 'RESV
SET RESV=DT
+46 IF (DELQ<RESV)
Begin DoDot:5
+47 ;add to delinquent count
SET BDGCNT("DELQ")=$GET(BDGCNT("DELQ"))+1
+48 ;DQ counts by deficiency
SET BDGCNT("DELQ",$PIECE(STR,U,2))=$GET(BDGCNT("DELQ",$PIECE(STR,U,2)))+1
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
+49 ;
+50 ;don't display if requested listing only
IF BDGRPT=2
QUIT
+51 ; now display provider's statistics
+52 DO SET("",.VALMCNT)
+53 DO SET($$PAD("TOTAL INCOMPLETE CHARTS",30)_(+$GET(BDGCNT("TOTAL"))),.VALMCNT)
+54 IF $GET(BDGCNT("TOTAL"))
Begin DoDot:2
+55 SET X=0
FOR
SET X=$ORDER(BDGCNT("TOTAL",X))
IF X=""
QUIT
DO SET($$PAD($$SP(7)_"Incomplete "_X_" Charts",45)_BDGCNT("TOTAL",X),.VALMCNT)
+56 DO SET("",.VALMCNT)
+57 DO SET($$PAD("# OF DELINQUENT CHARTS",30)_(+$GET(BDGCNT("DELQ"))),.VALMCNT)
+58 SET X=0
FOR
SET X=$ORDER(BDGCNT("DELQ",X))
IF X=""
QUIT
DO SET($$PAD($$SP(7)_"Delinquent for "_X,45)_BDGCNT("DELQ",X),.VALMCNT)
End DoDot:2
End DoDot:1
+59 ;
+60 IF '$DATA(^TMP("BDGICS5",$JOB))
DO SET("NO DATA FOUND",.VALMCNT)
+61 KILL ^TMP("BDGICS5A",$JOB)
+62 QUIT
+63 ;
FIND ; find all entries for date range
+1 NEW SUB,DATE,END,IEN,SORT,IEN2,PROV,DEF,DEF1
+2 FOR SUB="AD","AS"
Begin DoDot:1
+3 SET DATE=BDGBD-.0001
SET END=BDGED+.24
+4 FOR
SET DATE=$ORDER(^BDGIC(SUB,DATE))
IF 'DATE
QUIT
IF (DATE>END)
QUIT
Begin DoDot:2
+5 SET IEN=0
FOR
SET IEN=$ORDER(^BDGIC(SUB,DATE,IEN))
IF 'IEN
QUIT
Begin DoDot:3
+6 ;
+7 ;quit if deleted
IF $$GET1^DIQ(9009016.1,IEN,.14)]""
QUIT
+8 IF BDGSRT=2
SET X=$$GET1^DIQ(9009016.1,IEN,.02,"I")
SET SORT=$SELECT(X]"":X,1:$$GET1^DIQ(9009016.1,IEN,.05,"I"))
+9 ;
+10 ; find all providers with deficiencies
+11 SET IEN2=0
FOR
SET IEN2=$ORDER(^BDGIC(IEN,1,IEN2))
IF 'IEN2
QUIT
Begin DoDot:4
+12 ;don't count if deleted
IF $$GET1^DIQ(9009016.11,IEN2_","_IEN,.04)]""
QUIT
+13 ;
+14 ;provider pointer
SET PROV=$$GET1^DIQ(9009016.11,IEN2_","_IEN,.01,"I")
+15 ;skip if prov not in requested service
IF BDGPRV="SRV"
IF '$DATA(BDGPRV(+$$GET1^DIQ(200,PROV,29,"I")))
QUIT
+16 ;skip if prov not in requested class
IF BDGPRV="CLASS"
IF '$DATA(BDGPRV(+$$GET1^DIQ(200,PROV,53.5,"I")))
QUIT
+17 ;skip if provider not requested by name
IF BDGPRV="NAME"
IF '$DATA(BDGPRV(PROV))
QUIT
+18 ;
+19 ;provider name
SET PROV=$$GET1^DIQ(9009016.11,IEN2_","_IEN,.01)
+20 ;deficiency name
SET DEF=$$GET1^DIQ(9009016.11,IEN2_","_IEN,.02)
+21 ;deficiency pointer
SET DEFI=$$GET1^DIQ(9009016.11,IEN2_","_IEN,.02,"I")
+22 IF BDGSRT=1
SET SORT=DEF
+23 ;put into sorted list
SET ^TMP("BDGICS5A",$JOB,PROV,SORT,IEN,IEN2)=DATE_U_DEF_U_DEFI
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+24 QUIT
+25 ;
SET(DATA,NUM) ; puts display line into list template array
+1 SET NUM=NUM+1
+2 SET ^TMP("BDGICS5",$JOB,NUM,0)=DATA
+3 QUIT
+4 ;
HELP ; -- help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ; -- exit code
+1 KILL ^TMP("BDGICS5",$JOB)
KILL BDGPRT
+2 QUIT
+3 ;
EXPND ; -- expand code
+1 QUIT
+2 ;
PRINT ; print report to paper
+1 NEW BDGX,BDGLN,BDGPG
+2 ;initialize heading variables
USE IO
DO INIT^BDGF
+3 DO HDG
+4 ;
+5 ; loop thru display array
+6 SET BDGX=0
FOR
SET BDGX=$ORDER(^TMP("BDGICS5",$JOB,BDGX))
IF 'BDGX
QUIT
Begin DoDot:1
+7 IF $Y>(IOSL-4)
DO HDG
+8 SET BDGLN=^TMP("BDGICS5",$JOB,BDGX,0)
+9 WRITE !,BDGLN
End DoDot:1
+10 DO ^%ZISC
DO PRTKL^BDGF
DO EXIT
+11 QUIT
+12 ;
HDG ; heading for paper report
+1 NEW X
+2 SET BDGPG=$GET(BDGPG)+1
IF BDGPG>1
WRITE @IOF
+3 WRITE !,BDGUSR,?11,"*****",$$CONF^BDGF,"*****"
+4 WRITE !,BDGDATE,?23,"Incomplete Statistics by Provider",?70,"Page: ",BDGPG
+5 SET X="Sorted by "_$SELECT(BDGSRT=1:"Chart Deficiency",1:"Discharge/Surgery Date")
+6 WRITE !,BDGTIME,?(80-$LENGTH(X)\2),X
+7 SET X=$$RANGE^BDGF(BDGBD,BDGED)
WRITE !,?(80-$LENGTH(X)\2),X
+8 WRITE !,$$REPEAT^XLFSTR("-",80)
+9 IF BDGRPT>1
Begin DoDot:1
+10 WRITE !?2,"Chart#",?10,"Type",?18,"Dsch/Surg",?31,"Deficiency",?53,"Status",?63,"Days to Complete"
End DoDot:1
+11 WRITE !,$$REPEAT^XLFSTR("=",80)
+12 QUIT
+13 ;
PAD(D,L) ;EP -- SUBRTN to pad length of data
+1 ; -- D=data L=length
+2 QUIT $EXTRACT(D_$$REPEAT^XLFSTR(" ",L),1,L)
+3 ;
SP(N) ; -- SUBRTN to pad N number of spaces
+1 QUIT $$PAD(" ",N)
+2 ;