BDGICS4 ; IHS/ANMC/LJF - WORKLOAD-COMPLETION TIMES ;
;;5.3;PIMS;**1005**;MAY 28, 2004
;IHS/OIT/LJF 04/14/2006 PATCH 1005 added observations to display
;
NEW BDGTYP,BDGBD,BDGED,TYPE,BDGSRT
;
;IHS/OIT/LJF 04/14/2006 PATCH 1005 added observations
;S BDGTYP=$$READ^BDGF("SO^1:Inpatients;2:Day Surgeries","Select Visit Type to Include") Q:BDGTYP<1
S BDGTYP=$$READ^BDGF("SO^1:Inpatients Only;2:Day Surgeries & Observations","Select Visit Type to Include") Q:BDGTYP<1
;
S TYPE=$S(BDGTYP=1:"Discharge",1:"Surgery")
S BDGBD=$$READ^BDGF("DO^::EP","Select Beginning "_TYPE_" Date")
Q:BDGBD<1
S BDGED=$$READ^BDGF("DO^::EP","Select Ending "_TYPE_" Date") Q:BDGED<1
;
S BDGSRT=$$READ^BDGF("SO^1:Sort Alphabetically by Name;2:Sort by Terminal Digit","Select Patient Sort") Q:BDGSRT<1
;
W !!,"If printing to paper, please use wide paper or condensed print"
D ZIS^BDGF("PQ","EN^BDGICS4","IC WORKLOAD STATS","BDGTYP;BDGBD;BDGED;BDGSRT")
Q
;
EN ; -- main entry point for BDG IC WORKLOAD STATS
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 WORKLOAD STATS")
D CLEAR^VALM1
Q
;
HDR ; -- header code
NEW X
;
;IHS/OIT/LJF 04/14/2006 PATCH 1005 added observations
;S X=$S(BDGTYP=1:"Inpatients",1:"Day Surgeries")
S X=$S(BDGTYP=1:"Inpatients Only",1:"Day Surgeries & Observations")
;
S VALMHDR(1)=$$SP(79-$L(X)\2)_X
S X=$$RANGE^BDGF(BDGBD,BDGED)
S VALMHDR(2)=$$SP(79-$L(X)\2)_X
S VALMHDR(3)=$$SP(50)_$G(IOUON)_"# of Days until ..."_$G(IOUOFF)
Q
;
INIT ; -- init variables and list array
I '$G(BDGPRT) D MSG^BDGF("Please wait while I compile the list...",2,0)
K ^TMP("BDGICS4",$J),^TMP("BDGICS4A",$J)
S VALMCNT=0
NEW BDGCNT,BDGTOT,BDGNUM ;totals
;
; first find all by date range & sort by patient
NEW DATE,END,BDGCNT,BDGTBP
S BDGTBP=$$GET1^DIQ(9009020.1,+$$DIV^BSDU,.13,"I") ;track bill prep?
S DATE=BDGBD-.0001,END=BDGED+.24
;
;IHS/OIT/LJF 04/14/2006 PATCH 1005 group observations with day surgeries
;I BDGTYP=1 D FIND("AD") ;gather inpatients & observation
;I BDGTYP=2 D FIND("AS") ;gather day surgeries
I BDGTYP=1 D FIND("AD",0) ;gather inpatients
I BDGTYP=2 D FIND("AS"),FIND("AD",1) ;gather day surgeries & observations
;
; now take sorted list and put into display array
NEW SORT,IEN,LINE,PRV,NAME,STATUS,BDGI
S SORT=0
F S SORT=$O(^TMP("BDGICS4A",$J,SORT)) Q:SORT="" D
. S IEN=0 F S IEN=$O(^TMP("BDGICS4A",$J,SORT,IEN)) Q:'IEN D
.. ;
.. S STATUS=^TMP("BDGICS4A",$J,SORT,IEN)
.. ;
.. ; build display line
.. S LINE=$$PAD($$GET1^DIQ(9009016.1,IEN,.01),20) ;patient
.. S LINE=LINE_$J($$GET1^DIQ(9009016.1,IEN,.011),8) ;chart #
.. S LINE=$$PAD(LINE,30)_$$DATES(IEN) ;admit/surg date
.. S LINE=$$PAD(LINE,45)
.. ;
.. ; find # of days until each stage was completed
.. ; and increment counts for reporting averages
.. S BDG1=$$IDATES(IEN,2) ;internal format for begin date
.. F BDGI=2:1:8 D
... S X=$$DAYS(BDGI,IEN,BDG1) ;# of days
... S LINE=LINE_$J(X,3)_$$SP(5)
... I X S BDGTOT(BDGI)=$G(BDGTOT(BDGI))+X,BDGNUM(BDGI)=$G(BDGNUM(BDGI))+1
.. ;
.. D SET(LINE,.VALMCNT)
;
D TOTALS
;
I '$D(^TMP("BDGICS4",$J)) D SET("NO DATA FOUND",.VALMCNT)
K ^TMP("BDGICS4A",$J)
Q
;
FIND(SUB,OBS) ; find all entries for date range;IHS/OIT/LJF 04/14/2006 PATCH 1005 added OBS
; SUB=subscript depending on visit type
; OBS=1 if SUB ="AD" but only observations are needed;IHS/OIT/LJF 04/14/2006 PATCH 1005
NEW DATE,END,IEN,STATUS
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
.. Q:$$GET1^DIQ(9009016.1,IEN,.17)]"" ;deleted entry
.. ;
.. ;IHS/OIT/LJF 04/14/2006 PATCH 1005 separate H and O visits
.. I SUB="AD",OBS=0 Q:$$GET1^DIQ(9009016.1,IEN,.0392)'="HOSPITALIZATION"
.. I SUB="AD",OBS=1 Q:$$GET1^DIQ(9009016.1,IEN,.0392)'="OBSERVATION"
.. ;
.. ; calculate entry's status (one of 8 categories)
.. D STATUS(IEN) ;sets STATUS variable
.. ;
.. ; set sort value to patient name or chart #
.. S SORT=$$GET1^DIQ(9009016.1,IEN,$S(BDGSRT=1:.01,1:.011))
.. I BDGSRT=2 S SORT=$$HRCNT^BDGF2(SORT) ;convert to terminal digit
.. ;
.. S ^TMP("BDGICS4A",$J,SORT,IEN)=STATUS
.. S BDGCNT=$G(BDGCNT)+1,BDGCNT(STATUS)=$G(BDGCNT(STATUS))+1
Q
;
STATUS(IEN) ; calculate entry's completion status
; Status: 1=newly incomplete, 2=chart recvd, 3=chart tagged
; 4=insurance identified, 5=ready to code, 6=coded, 7=completed
; 8=bill prepped (only used if track bill prep turned on
;
NEW DATA
D ENP^XBDIQ1(9009016.1,IEN,".11:.21","DATA(")
S STATUS=1 ;initialize as newly incomplete
I DATA(.14)]"" D Q ;if completed
. S STATUS=$S(BDGTBP'=1:7,DATA(.15)]"":8,1:7) Q
;
I DATA(.13)]"" S STATUS=6 Q ;coded
I DATA(.12)]"" S STATUS=5 Q ;ready to code
I DATA(.21)]"" S STATUS=4 Q ;insurance identified
I DATA(.19)]"" S STATUS=3 Q ;tagged
I DATA(.11)]"" S STATUS=2 Q ;chart received
Q
;
DATES(IEN) ; return dates for entry
Q $P($$GET1^DIQ(9009016.1,IEN,.0211),"@")
;
IDATES(IEN,NUM) ; return dates for entry in internal format
; NUM=1 for visit date, =2 for discharge date
NEW X
I NUM=2 S X=$$NUMDATE^BDGF($$GET1^DIQ(9009016.1,IEN,.02,"I")\1,1)
I $G(X) Q X
S X=$$GET1^DIQ(9009016.1,IEN,.03,"I") I 'X Q "??" ;visit ien
Q $$NUMDATE^BDGF($$GET1^DIQ(9000010,X,.01,"I")\1,1) ;visit date
;
DAYS(NUM,IEN,BEGIN) ; return # days for this stage of completion
NEW DAYS,X,FIELD
S FIELD=$P($T(FIELDS+NUM),";;",2) ;time field
S X=$$GET1^DIQ(9009016.1,IEN,FIELD)
Q $S(X="":"---",1:X) ;leave dashes if date not entered
;
TOTALS ; display totals and averages
NEW LINE,I,J,X
D SET($$REPEAT^XLFSTR("=",80),.VALMCNT)
;
; display time averages
S LINE=$$PAD($$SP(22)_"Averages:",40)
F I=2:1:8 D
. I '$G(BDGTOT(I)) S LINE=LINE_$$SP(8) Q
. S X=BDGTOT(I)\BDGNUM(I),LINE=$$PAD(LINE,$L(LINE)+5)_$J(X,3)
D SET(LINE,.VALMCNT),SET("",.VALMCNT)
;
; display total incomplete and completed charts
F I=1:1:8 D
. I I=7 D ;total incomplete charts
.. S X=0 F J=1:1:6 S X=X+$G(BDGCNT(J))
.. S LINE=$$PAD($$SP(10)_"TOTAL INCOMPLETE CHARTS:",40)_$J(X,6)
.. D SET(LINE,.VALMCNT),SET("",.VALMCNT)
. ;
. Q:'$G(BDGCNT(I))
. S LINE=$$PAD($$SP(10)_$P($T(STATNM+I),";;",2),40)_$J(BDGCNT(I),6)
. D SET(LINE,.VALMCNT)
;
S X=$G(BDGCNT(7))+$G(BDGCNT(8))
S LINE=$$PAD($$SP(10)_"TOTAL COMPLETED CHARTS:",40)_$J(X,6)
D SET(LINE,.VALMCNT)
;
Q
;
SET(DATA,NUM) ; puts display line into list template array
S NUM=NUM+1
S ^TMP("BDGICS4",$J,NUM,0)=DATA
Q
;
HELP ; -- help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ; -- exit code
K ^TMP("BDGICS4",$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("BDGICS4",$J,BDGX)) Q:'BDGX D
. I $Y>(IOSL-4) D HDG
. S BDGLN=^TMP("BDGICS4",$J,BDGX,0)
. W !,BDGLN
D ^%ZISC,PRTKL^BDGF,EXIT
Q
;
HDG ; heading for paper report
S BDGPG=$G(BDGPG)+1 I BDGPG>1 W @IOF
W !,BDGUSR,?11,"*****",$$CONF^BDGF,"*****"
W !,BDGDATE,?25,"Incomplete Charts Workload Report",?70,"Page: ",BDGPG
;
;IHS/OIT/LJF 04/14/2006 PATCH 1005
;NEW X S X=$S(BDGTYP=1:"Inpatient Charts",1:"Day Surgery Charts")
NEW X S X=$S(BDGTYP=1:"Inpatient Charts Only",1:"Day Surgery & Observation Charts")
;
W !,BDGTIME,?(80-$L(X)\2),X
W !,$$REPEAT^XLFSTR("-",80)
W !,?50,"# of Days Until ..."
W !?2,"Patient",?23,"HRCN",?30,"Dsch/Surg",?44,"Rcvd",?51,"Taggd"
W ?59,"Insur",?67,"Ready",?75,"Coded",?82,"Complt",?90,"Bill Prep"
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)
;
FIELDS ;;
;;
;;.1191;;chart pickup time;;
;;.1991;;time to tag;;
;;.2191;;time to identify insurance;;
;;.1291;;prepare to code time;;
;;.1391;;coding time;;
;;.1491;;chart procesing time;;
;;.1591;;time in bill prep;;
;
STATNM ;;
;;New Incomplete Charts;;
;;Incomplete-Received;;
;;Incomplete-Tagged;;
;;Incomplete-Insurance Identified;;
;;Incomplete-Ready to Code;;
;;Incomplete-In Code;;
;;Completed-In Bill Prep;;
;;Completed-Bill Prep Done;;
BDGICS4 ; IHS/ANMC/LJF - WORKLOAD-COMPLETION TIMES ;
+1 ;;5.3;PIMS;**1005**;MAY 28, 2004
+2 ;IHS/OIT/LJF 04/14/2006 PATCH 1005 added observations to display
+3 ;
+4 NEW BDGTYP,BDGBD,BDGED,TYPE,BDGSRT
+5 ;
+6 ;IHS/OIT/LJF 04/14/2006 PATCH 1005 added observations
+7 ;S BDGTYP=$$READ^BDGF("SO^1:Inpatients;2:Day Surgeries","Select Visit Type to Include") Q:BDGTYP<1
+8 SET BDGTYP=$$READ^BDGF("SO^1:Inpatients Only;2:Day Surgeries & Observations","Select Visit Type to Include")
IF BDGTYP<1
QUIT
+9 ;
+10 SET TYPE=$SELECT(BDGTYP=1:"Discharge",1:"Surgery")
+11 SET BDGBD=$$READ^BDGF("DO^::EP","Select Beginning "_TYPE_" Date")
+12 IF BDGBD<1
QUIT
+13 SET BDGED=$$READ^BDGF("DO^::EP","Select Ending "_TYPE_" Date")
IF BDGED<1
QUIT
+14 ;
+15 SET BDGSRT=$$READ^BDGF("SO^1:Sort Alphabetically by Name;2:Sort by Terminal Digit","Select Patient Sort")
IF BDGSRT<1
QUIT
+16 ;
+17 WRITE !!,"If printing to paper, please use wide paper or condensed print"
+18 DO ZIS^BDGF("PQ","EN^BDGICS4","IC WORKLOAD STATS","BDGTYP;BDGBD;BDGED;BDGSRT")
+19 QUIT
+20 ;
EN ; -- main entry point for BDG IC WORKLOAD STATS
+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 WORKLOAD STATS")
+4 DO CLEAR^VALM1
+5 QUIT
+6 ;
HDR ; -- header code
+1 NEW X
+2 ;
+3 ;IHS/OIT/LJF 04/14/2006 PATCH 1005 added observations
+4 ;S X=$S(BDGTYP=1:"Inpatients",1:"Day Surgeries")
+5 SET X=$SELECT(BDGTYP=1:"Inpatients Only",1:"Day Surgeries & Observations")
+6 ;
+7 SET VALMHDR(1)=$$SP(79-$LENGTH(X)\2)_X
+8 SET X=$$RANGE^BDGF(BDGBD,BDGED)
+9 SET VALMHDR(2)=$$SP(79-$LENGTH(X)\2)_X
+10 SET VALMHDR(3)=$$SP(50)_$GET(IOUON)_"# of Days until ..."_$GET(IOUOFF)
+11 QUIT
+12 ;
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("BDGICS4",$JOB),^TMP("BDGICS4A",$JOB)
+3 SET VALMCNT=0
+4 ;totals
NEW BDGCNT,BDGTOT,BDGNUM
+5 ;
+6 ; first find all by date range & sort by patient
+7 NEW DATE,END,BDGCNT,BDGTBP
+8 ;track bill prep?
SET BDGTBP=$$GET1^DIQ(9009020.1,+$$DIV^BSDU,.13,"I")
+9 SET DATE=BDGBD-.0001
SET END=BDGED+.24
+10 ;
+11 ;IHS/OIT/LJF 04/14/2006 PATCH 1005 group observations with day surgeries
+12 ;I BDGTYP=1 D FIND("AD") ;gather inpatients & observation
+13 ;I BDGTYP=2 D FIND("AS") ;gather day surgeries
+14 ;gather inpatients
IF BDGTYP=1
DO FIND("AD",0)
+15 ;gather day surgeries & observations
IF BDGTYP=2
DO FIND("AS")
DO FIND("AD",1)
+16 ;
+17 ; now take sorted list and put into display array
+18 NEW SORT,IEN,LINE,PRV,NAME,STATUS,BDGI
+19 SET SORT=0
+20 FOR
SET SORT=$ORDER(^TMP("BDGICS4A",$JOB,SORT))
IF SORT=""
QUIT
Begin DoDot:1
+21 SET IEN=0
FOR
SET IEN=$ORDER(^TMP("BDGICS4A",$JOB,SORT,IEN))
IF 'IEN
QUIT
Begin DoDot:2
+22 ;
+23 SET STATUS=^TMP("BDGICS4A",$JOB,SORT,IEN)
+24 ;
+25 ; build display line
+26 ;patient
SET LINE=$$PAD($$GET1^DIQ(9009016.1,IEN,.01),20)
+27 ;chart #
SET LINE=LINE_$JUSTIFY($$GET1^DIQ(9009016.1,IEN,.011),8)
+28 ;admit/surg date
SET LINE=$$PAD(LINE,30)_$$DATES(IEN)
+29 SET LINE=$$PAD(LINE,45)
+30 ;
+31 ; find # of days until each stage was completed
+32 ; and increment counts for reporting averages
+33 ;internal format for begin date
SET BDG1=$$IDATES(IEN,2)
+34 FOR BDGI=2:1:8
Begin DoDot:3
+35 ;# of days
SET X=$$DAYS(BDGI,IEN,BDG1)
+36 SET LINE=LINE_$JUSTIFY(X,3)_$$SP(5)
+37 IF X
SET BDGTOT(BDGI)=$GET(BDGTOT(BDGI))+X
SET BDGNUM(BDGI)=$GET(BDGNUM(BDGI))+1
End DoDot:3
+38 ;
+39 DO SET(LINE,.VALMCNT)
End DoDot:2
End DoDot:1
+40 ;
+41 DO TOTALS
+42 ;
+43 IF '$DATA(^TMP("BDGICS4",$JOB))
DO SET("NO DATA FOUND",.VALMCNT)
+44 KILL ^TMP("BDGICS4A",$JOB)
+45 QUIT
+46 ;
FIND(SUB,OBS) ; find all entries for date range;IHS/OIT/LJF 04/14/2006 PATCH 1005 added OBS
+1 ; SUB=subscript depending on visit type
+2 ; OBS=1 if SUB ="AD" but only observations are needed;IHS/OIT/LJF 04/14/2006 PATCH 1005
+3 NEW DATE,END,IEN,STATUS
+4 SET DATE=BDGBD-.0001
SET END=BDGED+.24
+5 FOR
SET DATE=$ORDER(^BDGIC(SUB,DATE))
IF 'DATE
QUIT
IF (DATE>END)
QUIT
Begin DoDot:1
+6 SET IEN=0
FOR
SET IEN=$ORDER(^BDGIC(SUB,DATE,IEN))
IF 'IEN
QUIT
Begin DoDot:2
+7 ;deleted entry
IF $$GET1^DIQ(9009016.1,IEN,.17)]""
QUIT
+8 ;
+9 ;IHS/OIT/LJF 04/14/2006 PATCH 1005 separate H and O visits
+10 IF SUB="AD"
IF OBS=0
IF $$GET1^DIQ(9009016.1,IEN,.0392)'="HOSPITALIZATION"
QUIT
+11 IF SUB="AD"
IF OBS=1
IF $$GET1^DIQ(9009016.1,IEN,.0392)'="OBSERVATION"
QUIT
+12 ;
+13 ; calculate entry's status (one of 8 categories)
+14 ;sets STATUS variable
DO STATUS(IEN)
+15 ;
+16 ; set sort value to patient name or chart #
+17 SET SORT=$$GET1^DIQ(9009016.1,IEN,$SELECT(BDGSRT=1:.01,1:.011))
+18 ;convert to terminal digit
IF BDGSRT=2
SET SORT=$$HRCNT^BDGF2(SORT)
+19 ;
+20 SET ^TMP("BDGICS4A",$JOB,SORT,IEN)=STATUS
+21 SET BDGCNT=$GET(BDGCNT)+1
SET BDGCNT(STATUS)=$GET(BDGCNT(STATUS))+1
End DoDot:2
End DoDot:1
+22 QUIT
+23 ;
STATUS(IEN) ; calculate entry's completion status
+1 ; Status: 1=newly incomplete, 2=chart recvd, 3=chart tagged
+2 ; 4=insurance identified, 5=ready to code, 6=coded, 7=completed
+3 ; 8=bill prepped (only used if track bill prep turned on
+4 ;
+5 NEW DATA
+6 DO ENP^XBDIQ1(9009016.1,IEN,".11:.21","DATA(")
+7 ;initialize as newly incomplete
SET STATUS=1
+8 ;if completed
IF DATA(.14)]""
Begin DoDot:1
+9 SET STATUS=$SELECT(BDGTBP'=1:7,DATA(.15)]"":8,1:7)
QUIT
End DoDot:1
QUIT
+10 ;
+11 ;coded
IF DATA(.13)]""
SET STATUS=6
QUIT
+12 ;ready to code
IF DATA(.12)]""
SET STATUS=5
QUIT
+13 ;insurance identified
IF DATA(.21)]""
SET STATUS=4
QUIT
+14 ;tagged
IF DATA(.19)]""
SET STATUS=3
QUIT
+15 ;chart received
IF DATA(.11)]""
SET STATUS=2
QUIT
+16 QUIT
+17 ;
DATES(IEN) ; return dates for entry
+1 QUIT $PIECE($$GET1^DIQ(9009016.1,IEN,.0211),"@")
+2 ;
IDATES(IEN,NUM) ; return dates for entry in internal format
+1 ; NUM=1 for visit date, =2 for discharge date
+2 NEW X
+3 IF NUM=2
SET X=$$NUMDATE^BDGF($$GET1^DIQ(9009016.1,IEN,.02,"I")\1,1)
+4 IF $GET(X)
QUIT X
+5 ;visit ien
SET X=$$GET1^DIQ(9009016.1,IEN,.03,"I")
IF 'X
QUIT "??"
+6 ;visit date
QUIT $$NUMDATE^BDGF($$GET1^DIQ(9000010,X,.01,"I")\1,1)
+7 ;
DAYS(NUM,IEN,BEGIN) ; return # days for this stage of completion
+1 NEW DAYS,X,FIELD
+2 ;time field
SET FIELD=$PIECE($TEXT(FIELDS+NUM),";;",2)
+3 SET X=$$GET1^DIQ(9009016.1,IEN,FIELD)
+4 ;leave dashes if date not entered
QUIT $SELECT(X="":"---",1:X)
+5 ;
TOTALS ; display totals and averages
+1 NEW LINE,I,J,X
+2 DO SET($$REPEAT^XLFSTR("=",80),.VALMCNT)
+3 ;
+4 ; display time averages
+5 SET LINE=$$PAD($$SP(22)_"Averages:",40)
+6 FOR I=2:1:8
Begin DoDot:1
+7 IF '$GET(BDGTOT(I))
SET LINE=LINE_$$SP(8)
QUIT
+8 SET X=BDGTOT(I)\BDGNUM(I)
SET LINE=$$PAD(LINE,$LENGTH(LINE)+5)_$JUSTIFY(X,3)
End DoDot:1
+9 DO SET(LINE,.VALMCNT)
DO SET("",.VALMCNT)
+10 ;
+11 ; display total incomplete and completed charts
+12 FOR I=1:1:8
Begin DoDot:1
+13 ;total incomplete charts
IF I=7
Begin DoDot:2
+14 SET X=0
FOR J=1:1:6
SET X=X+$GET(BDGCNT(J))
+15 SET LINE=$$PAD($$SP(10)_"TOTAL INCOMPLETE CHARTS:",40)_$JUSTIFY(X,6)
+16 DO SET(LINE,.VALMCNT)
DO SET("",.VALMCNT)
End DoDot:2
+17 ;
+18 IF '$GET(BDGCNT(I))
QUIT
+19 SET LINE=$$PAD($$SP(10)_$PIECE($TEXT(STATNM+I),";;",2),40)_$JUSTIFY(BDGCNT(I),6)
+20 DO SET(LINE,.VALMCNT)
End DoDot:1
+21 ;
+22 SET X=$GET(BDGCNT(7))+$GET(BDGCNT(8))
+23 SET LINE=$$PAD($$SP(10)_"TOTAL COMPLETED CHARTS:",40)_$JUSTIFY(X,6)
+24 DO SET(LINE,.VALMCNT)
+25 ;
+26 QUIT
+27 ;
SET(DATA,NUM) ; puts display line into list template array
+1 SET NUM=NUM+1
+2 SET ^TMP("BDGICS4",$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("BDGICS4",$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("BDGICS4",$JOB,BDGX))
IF 'BDGX
QUIT
Begin DoDot:1
+7 IF $Y>(IOSL-4)
DO HDG
+8 SET BDGLN=^TMP("BDGICS4",$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 SET BDGPG=$GET(BDGPG)+1
IF BDGPG>1
WRITE @IOF
+2 WRITE !,BDGUSR,?11,"*****",$$CONF^BDGF,"*****"
+3 WRITE !,BDGDATE,?25,"Incomplete Charts Workload Report",?70,"Page: ",BDGPG
+4 ;
+5 ;IHS/OIT/LJF 04/14/2006 PATCH 1005
+6 ;NEW X S X=$S(BDGTYP=1:"Inpatient Charts",1:"Day Surgery Charts")
+7 NEW X
SET X=$SELECT(BDGTYP=1:"Inpatient Charts Only",1:"Day Surgery & Observation Charts")
+8 ;
+9 WRITE !,BDGTIME,?(80-$LENGTH(X)\2),X
+10 WRITE !,$$REPEAT^XLFSTR("-",80)
+11 WRITE !,?50,"# of Days Until ..."
+12 WRITE !?2,"Patient",?23,"HRCN",?30,"Dsch/Surg",?44,"Rcvd",?51,"Taggd"
+13 WRITE ?59,"Insur",?67,"Ready",?75,"Coded",?82,"Complt",?90,"Bill Prep"
+14 WRITE !,$$REPEAT^XLFSTR("=",80)
+15 QUIT
+16 ;
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 ;
FIELDS ;;
+1 ;;
+2 ;;.1191;;chart pickup time;;
+3 ;;.1991;;time to tag;;
+4 ;;.2191;;time to identify insurance;;
+5 ;;.1291;;prepare to code time;;
+6 ;;.1391;;coding time;;
+7 ;;.1491;;chart procesing time;;
+8 ;;.1591;;time in bill prep;;
+9 ;
STATNM ;;
+1 ;;New Incomplete Charts;;
+2 ;;Incomplete-Received;;
+3 ;;Incomplete-Tagged;;
+4 ;;Incomplete-Insurance Identified;;
+5 ;;Incomplete-Ready to Code;;
+6 ;;Incomplete-In Code;;
+7 ;;Completed-In Bill Prep;;
+8 ;;Completed-Bill Prep Done;;