BDGICR5 ; IHS/ANMC/LJF - CHARTS COMPLETED BY DATE ;
;;5.3;PIMS;**1005**;MAY 28,2004
;IHS/OIT/LJF 04/14/2006 PATCH 1005 added display of observations
;
NEW BDGSTG,BDGBD,BDGED,DEFAULT,BDGTYP,BDGSRT
S BDGSTG=$$READ^BDGF("SO^1:Coded;2:Completed;3:Bill Prep Done","Select Completion Stage") Q:BDGSTG<1
;
S DEFAULT=$S(BDGSTG=1:"Coded",BDGSTG=2:"Completed",1:"Bill Prep Done")
S BDGBD=$$READ^BDGF("DO^::E","Enter Beginning Date "_DEFAULT)
Q:'BDGBD
S BDGED=$$READ^BDGF("DO^::E","Enter Ending Date "_DEFAULT)
Q:'BDGED
;
S BDGSRT=$$READ^BDGF("SO^1:Alphabetical;2:By Date "_DEFAULT,"Select Sorting Choice")
Q:BDGSRT<1
;
;IHS/OIT/LJF 04/14/2006 PATCH 1005 add observations
;S BDGTYP=$$READ^BDGF("SO^1:Inpatients Only;2:Day Surgeries Only;3:Both","Select Visit Types To Include") Q:'BDGTYP
S BDGTYP=$$READ^BDGF("SO^1:Inpatients Only;2:Day Surgeries & Observations;3:All Types","Select Visit Types To Include") Q:'BDGTYP
;
I $$BROWSE^BDGF="B" D EN Q
D ZIS^BDGF("PQ","EN^BDGICR5","DAILY/WEEKLY IC REPORT","BDGSTG;BDGBD;BDGED;BDGTYP;BDGSRT")
Q
;
EN ;EP; -- main entry point for BDG IC COMPLETED WEEKLY
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 COMPLETED WEEKLY")
D CLEAR^VALM1
Q
;
HDR ; -- header code
NEW X
S VALMHDR(1)=$$SP(15)_$$CONF^BDGF
;
;IHS/OIT/LJF 04/14/2006 PATCH 1005 added observations
;S X=$S(BDGTYP=1:"Inpatients Only",BDGTYP=2:"Day Surgeries Only",1:"Inpatients & Day Surgeries")
S X=$S(BDGTYP=1:"Inpatients Only",BDGTYP=2:"Day Surgeries & Observations",1:"Inpatients, Observations & Day Surgeries")
;
S X=X_$$SP(4)_"-"_$$SP(4)_$P($T(CHOICE+BDGSTG),";;",2)
S VALMHDR(2)=$$SP(75-$L(X)\2)_X
S X=$$RANGE^BDGF(BDGBD,BDGED) ;date range
S VALMHDR(3)=$$SP(75-$L(X)\2)_X
;
S X=$S(BDGSTG=1:" Coded",BDGSTG=2:" Complt",1:" BillPrep")
S X=$$PAD($$PAD($$PAD(X,13)_"HRCN",19)_"Patient Name",46)
S X=$$PAD($$PAD($$PAD(X_"Typ",51)_"Dsch/Sur",62)_"WHO",67)
S X=X_$S(BDGSTG=1:"Compl BPrep",BDGSTG=2:$$SP(6)_"BPrep",1:"")
S VALMCAP=$$PAD(X,79)
Q
;
INIT ; -- init variables and list array
I '$G(BDGPRT) D MSG^BDGF("Please wait; compiling list...",2,0)
NEW XREF,DATE,IEN,LINE,X,SORT1,SORT2,COUNT
S VALMCNT=0 K ^TMP("BDGICR5",$J),^TMP("BDGICR5A",$J)
;
; find charts at completion stage for date range & sort
S XREF=$S(BDGSTG=1:"AC",BDGSTG=2:"AE",1:"AF")
S DATE=BDGBD-.0001
F S DATE=$O(^BDGIC(XREF,DATE)) Q:'DATE Q:DATE>BDGED D
. S IEN=0 F S IEN=$O(^BDGIC(XREF,DATE,IEN)) Q:'IEN D
.. ; screen out entries
.. Q:$$GET1^DIQ(9009016.1,IEN,.17)]"" ;deleted
.. ;
.. ;IHS/OIT/LJF 04/14/2006 PATCH 1005 use different logic to screen for visit type
.. ;I BDGTYP=1 Q:$$GET1^DIQ(9009016.1,IEN,.02)="" ;ip needs disch date
.. ;I BDGTYP=2 Q:$$GET1^DIQ(9009016.1,IEN,.04)="" ;ds needs surg date
.. ;I BDGTYP=2 Q:$$GET1^DIQ(9009016.1,IEN,.02)]"" ;no sda for ds
.. NEW CAT S CAT=$$GET1^DIQ(9009016.1,IEN,.0392) ;visit service category
.. I (BDGTYP=1),(CAT'="HOSPITALIZATION") Q ;skip if asked for inpt and not H visit
.. I (BDGTYP=2),(CAT'="DAY SURGERY"),(CAT'="OBSERVATION") Q ;skip if not correct service category
.. ;
.. I BDGSRT=1 S (SORT1,SORT2)=$$GET1^DIQ(9009016.1,IEN,.01)
.. E D
... I BDGSTG=1 S SORT1=$$GET1^DIQ(9009016.1,IEN,.13,"I") Q:SORT1=""
... I BDGSTG=2 S SORT1=$$GET1^DIQ(9009016.1,IEN,.14,"I") Q:SORT1=""
... I BDGSTG=3 S SORT1=$$GET1^DIQ(9009016.1,IEN,.15,"I") Q:SORT1=""
... ;
... ; sort by completion date and then by disch/surg date
... S SORT2=$$GET1^DIQ(9009016.1,IEN,.02,"I")
... I SORT2="" S SORT2=$$GET1^DIQ(9009016.1,IEN,.05,"I")
... I SORT2="" S SORT2="??"
.. ;
.. ; store by primary & secondary sorts
.. S ^TMP("BDGICR5A",$J,SORT1,SORT2,IEN)=DATE
;
; now take sorted list and create display lines
S COUNT=0
S SORT1=0 F S SORT1=$O(^TMP("BDGICR5A",$J,SORT1)) Q:SORT1="" D
. S SORT2=0
. F S SORT2=$O(^TMP("BDGICR5A",$J,SORT1,SORT2)) Q:SORT2="" D
.. S IEN=0 F S IEN=$O(^TMP("BDGICR5A",$J,SORT1,SORT2,IEN)) Q:'IEN D
... S DATE=^TMP("BDGICR5A",$J,SORT1,SORT2,IEN)
... S LINE=$$NUMDATE^BDGF(DATE,1) ;date
... S LINE=$$PAD(LINE,10)_$J($$GET1^DIQ(9009016.1,IEN,.011),7) ;hrcn
... S LINE=$$PAD(LINE,19)_$E($$GET1^DIQ(9009016.1,IEN,.01),1,25)
... S X=$$GET1^DIQ(9009016.1,IEN,.0392) ;visit type
... ;S LINE=$$PAD(LINE,46)_$S(X["HOSP":"IP",X["OBSER":"DSO",1:"DS")
... S LINE=$$PAD(LINE,46)_$S(X["HOSP":"IP",X["OBSER":"OBS",1:"DS")
... S X=$$GET1^DIQ(9009016.1,IEN,.02,"I") ;disch date
... I X="" S X=$$GET1^DIQ(9009016.1,IEN,.05,"I") ;surg date
... I X="" S LINE=$$PAD(LINE,51)_"??"
... E S LINE=$$PAD(LINE,51)_$$NUMDATE^BDGF(X\1,1)
... I BDGSTG<3 S X=$$GET1^DIQ(9009016.1,IEN,.22,"I") ;coder
... I BDGSTG=3 S X=$$GET1^DIQ(9009016.1,IEN,.23,"I") ;bill prep
... I X S LINE=$$PAD(LINE,62)_$$GET1^DIQ(200,X,1) ;initials
... ;
... ; if listing coded charts, show any that are completed also
... I BDGSTG=1,$$GET1^DIQ(9009016.1,IEN,.14)]"" S LINE=$$PAD(LINE,69)_"X"
... ; if listing coded or completed charts, show any already bill prepd
... I BDGSTG<3,$$GET1^DIQ(9009016.1,IEN,.15)]"" S LINE=$$PAD(LINE,75)_"X"
... D SET(LINE,.VALMCNT)
... S COUNT=COUNT+1,COUNT(SORT1)=$G(COUNT(SORT1))+1
;
I COUNT D
. D SET("",.VALMCNT),SET("Total Charts:"_$J(COUNT,4),.VALMCNT)
. S X=0 F S X=$O(COUNT(X)) Q:'X D
.. S LINE=$$SP(3)_$$NUMDATE^BDGF(X\1)_":"_$J(COUNT(X),5)
.. D SET(LINE,.VALMCNT)
;
I '$D(^TMP("BDGICR5",$J)) S VALMCNT=1,^TMP("BDGICR5",$J,1,0)="NO DATA FOUND"
K ^TMP("BDGICR5A",$J)
Q
;
HELP ; -- help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ; -- exit code
K ^TMP("BDGICR5",$J) K BDGPRT
Q
;
EXPND ; -- expand code
Q
;
SET(DATA,NUM) ; put display line into array
S NUM=NUM+1
S ^TMP("BDGICR5",$J,NUM,0)=DATA
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("BDGICR5",$J,BDGX)) Q:'BDGX D
. I $Y>(IOSL-4) D HDG
. S BDGLN=^TMP("BDGICR5",$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,?25,"Completed Charts Report",?70,"Page: ",BDGPG
;
;IHS/OIT/LJF 04/14/2006 PATCH 1005 added observations
;NEW X S X=$S(BDGTYP=1:"Inpatient Charts Only",BDGTYP=2:"Day Surgery Charts Only",1:"Inpatient and Day Surgery Charts")
NEW X S X=$S(BDGTYP=1:"Inpatient Charts Only",BDGTYP=2:"Day Surgery & Observation Charts",1:"Inpatient, Observaiton and Day Surgery Charts")
;
S X=X_$$SP(4)_"-"_$$SP(4)_$P($T(CHOICE+BDGSTG),";;",2)
W !,BDGTIME,?(80-$L(X)\2),X
S X=$$RANGE^BDGF(BDGBD,BDGED) W !?(80-$L(X)\2),X ;date range
;
W !,$$REPEAT^XLFSTR("-",80)
S X=$S(BDGSTG=1:" Coded",BDGSTG=2:" Complt",1:" BillPrep")
W !,X,?13,"HRCN",?19,"Patient Name",?46,"Typ",?51,"Dsch/Surg"
S X=$S(BDGSTG=1:"Compl BPrep",BDGSTG=2:$$SP(6)_"BPrep",1:"")
W ?62,"WHO",?67,X
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)
;
CHOICE ;;
;;Coded Charts;;
;;Completed Charts;;
;;Bill Prep Done;;
BDGICR5 ; IHS/ANMC/LJF - CHARTS COMPLETED BY DATE ;
+1 ;;5.3;PIMS;**1005**;MAY 28,2004
+2 ;IHS/OIT/LJF 04/14/2006 PATCH 1005 added display of observations
+3 ;
+4 NEW BDGSTG,BDGBD,BDGED,DEFAULT,BDGTYP,BDGSRT
+5 SET BDGSTG=$$READ^BDGF("SO^1:Coded;2:Completed;3:Bill Prep Done","Select Completion Stage")
IF BDGSTG<1
QUIT
+6 ;
+7 SET DEFAULT=$SELECT(BDGSTG=1:"Coded",BDGSTG=2:"Completed",1:"Bill Prep Done")
+8 SET BDGBD=$$READ^BDGF("DO^::E","Enter Beginning Date "_DEFAULT)
+9 IF 'BDGBD
QUIT
+10 SET BDGED=$$READ^BDGF("DO^::E","Enter Ending Date "_DEFAULT)
+11 IF 'BDGED
QUIT
+12 ;
+13 SET BDGSRT=$$READ^BDGF("SO^1:Alphabetical;2:By Date "_DEFAULT,"Select Sorting Choice")
+14 IF BDGSRT<1
QUIT
+15 ;
+16 ;IHS/OIT/LJF 04/14/2006 PATCH 1005 add observations
+17 ;S BDGTYP=$$READ^BDGF("SO^1:Inpatients Only;2:Day Surgeries Only;3:Both","Select Visit Types To Include") Q:'BDGTYP
+18 SET BDGTYP=$$READ^BDGF("SO^1:Inpatients Only;2:Day Surgeries & Observations;3:All Types","Select Visit Types To Include")
IF 'BDGTYP
QUIT
+19 ;
+20 IF $$BROWSE^BDGF="B"
DO EN
QUIT
+21 DO ZIS^BDGF("PQ","EN^BDGICR5","DAILY/WEEKLY IC REPORT","BDGSTG;BDGBD;BDGED;BDGTYP;BDGSRT")
+22 QUIT
+23 ;
EN ;EP; -- main entry point for BDG IC COMPLETED WEEKLY
+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 COMPLETED WEEKLY")
+4 DO CLEAR^VALM1
+5 QUIT
+6 ;
HDR ; -- header code
+1 NEW X
+2 SET VALMHDR(1)=$$SP(15)_$$CONF^BDGF
+3 ;
+4 ;IHS/OIT/LJF 04/14/2006 PATCH 1005 added observations
+5 ;S X=$S(BDGTYP=1:"Inpatients Only",BDGTYP=2:"Day Surgeries Only",1:"Inpatients & Day Surgeries")
+6 SET X=$SELECT(BDGTYP=1:"Inpatients Only",BDGTYP=2:"Day Surgeries & Observations",1:"Inpatients, Observations & Day Surgeries")
+7 ;
+8 SET X=X_$$SP(4)_"-"_$$SP(4)_$PIECE($TEXT(CHOICE+BDGSTG),";;",2)
+9 SET VALMHDR(2)=$$SP(75-$LENGTH(X)\2)_X
+10 ;date range
SET X=$$RANGE^BDGF(BDGBD,BDGED)
+11 SET VALMHDR(3)=$$SP(75-$LENGTH(X)\2)_X
+12 ;
+13 SET X=$SELECT(BDGSTG=1:" Coded",BDGSTG=2:" Complt",1:" BillPrep")
+14 SET X=$$PAD($$PAD($$PAD(X,13)_"HRCN",19)_"Patient Name",46)
+15 SET X=$$PAD($$PAD($$PAD(X_"Typ",51)_"Dsch/Sur",62)_"WHO",67)
+16 SET X=X_$SELECT(BDGSTG=1:"Compl BPrep",BDGSTG=2:$$SP(6)_"BPrep",1:"")
+17 SET VALMCAP=$$PAD(X,79)
+18 QUIT
+19 ;
INIT ; -- init variables and list array
+1 IF '$GET(BDGPRT)
DO MSG^BDGF("Please wait; compiling list...",2,0)
+2 NEW XREF,DATE,IEN,LINE,X,SORT1,SORT2,COUNT
+3 SET VALMCNT=0
KILL ^TMP("BDGICR5",$JOB),^TMP("BDGICR5A",$JOB)
+4 ;
+5 ; find charts at completion stage for date range & sort
+6 SET XREF=$SELECT(BDGSTG=1:"AC",BDGSTG=2:"AE",1:"AF")
+7 SET DATE=BDGBD-.0001
+8 FOR
SET DATE=$ORDER(^BDGIC(XREF,DATE))
IF 'DATE
QUIT
IF DATE>BDGED
QUIT
Begin DoDot:1
+9 SET IEN=0
FOR
SET IEN=$ORDER(^BDGIC(XREF,DATE,IEN))
IF 'IEN
QUIT
Begin DoDot:2
+10 ; screen out entries
+11 ;deleted
IF $$GET1^DIQ(9009016.1,IEN,.17)]""
QUIT
+12 ;
+13 ;IHS/OIT/LJF 04/14/2006 PATCH 1005 use different logic to screen for visit type
+14 ;I BDGTYP=1 Q:$$GET1^DIQ(9009016.1,IEN,.02)="" ;ip needs disch date
+15 ;I BDGTYP=2 Q:$$GET1^DIQ(9009016.1,IEN,.04)="" ;ds needs surg date
+16 ;I BDGTYP=2 Q:$$GET1^DIQ(9009016.1,IEN,.02)]"" ;no sda for ds
+17 ;visit service category
NEW CAT
SET CAT=$$GET1^DIQ(9009016.1,IEN,.0392)
+18 ;skip if asked for inpt and not H visit
IF (BDGTYP=1)
IF (CAT'="HOSPITALIZATION")
QUIT
+19 ;skip if not correct service category
IF (BDGTYP=2)
IF (CAT'="DAY SURGERY")
IF (CAT'="OBSERVATION")
QUIT
+20 ;
+21 IF BDGSRT=1
SET (SORT1,SORT2)=$$GET1^DIQ(9009016.1,IEN,.01)
+22 IF '$TEST
Begin DoDot:3
+23 IF BDGSTG=1
SET SORT1=$$GET1^DIQ(9009016.1,IEN,.13,"I")
IF SORT1=""
QUIT
+24 IF BDGSTG=2
SET SORT1=$$GET1^DIQ(9009016.1,IEN,.14,"I")
IF SORT1=""
QUIT
+25 IF BDGSTG=3
SET SORT1=$$GET1^DIQ(9009016.1,IEN,.15,"I")
IF SORT1=""
QUIT
+26 ;
+27 ; sort by completion date and then by disch/surg date
+28 SET SORT2=$$GET1^DIQ(9009016.1,IEN,.02,"I")
+29 IF SORT2=""
SET SORT2=$$GET1^DIQ(9009016.1,IEN,.05,"I")
+30 IF SORT2=""
SET SORT2="??"
End DoDot:3
+31 ;
+32 ; store by primary & secondary sorts
+33 SET ^TMP("BDGICR5A",$JOB,SORT1,SORT2,IEN)=DATE
End DoDot:2
End DoDot:1
+34 ;
+35 ; now take sorted list and create display lines
+36 SET COUNT=0
+37 SET SORT1=0
FOR
SET SORT1=$ORDER(^TMP("BDGICR5A",$JOB,SORT1))
IF SORT1=""
QUIT
Begin DoDot:1
+38 SET SORT2=0
+39 FOR
SET SORT2=$ORDER(^TMP("BDGICR5A",$JOB,SORT1,SORT2))
IF SORT2=""
QUIT
Begin DoDot:2
+40 SET IEN=0
FOR
SET IEN=$ORDER(^TMP("BDGICR5A",$JOB,SORT1,SORT2,IEN))
IF 'IEN
QUIT
Begin DoDot:3
+41 SET DATE=^TMP("BDGICR5A",$JOB,SORT1,SORT2,IEN)
+42 ;date
SET LINE=$$NUMDATE^BDGF(DATE,1)
+43 ;hrcn
SET LINE=$$PAD(LINE,10)_$JUSTIFY($$GET1^DIQ(9009016.1,IEN,.011),7)
+44 SET LINE=$$PAD(LINE,19)_$EXTRACT($$GET1^DIQ(9009016.1,IEN,.01),1,25)
+45 ;visit type
SET X=$$GET1^DIQ(9009016.1,IEN,.0392)
+46 ;S LINE=$$PAD(LINE,46)_$S(X["HOSP":"IP",X["OBSER":"DSO",1:"DS")
+47 SET LINE=$$PAD(LINE,46)_$SELECT(X["HOSP":"IP",X["OBSER":"OBS",1:"DS")
+48 ;disch date
SET X=$$GET1^DIQ(9009016.1,IEN,.02,"I")
+49 ;surg date
IF X=""
SET X=$$GET1^DIQ(9009016.1,IEN,.05,"I")
+50 IF X=""
SET LINE=$$PAD(LINE,51)_"??"
+51 IF '$TEST
SET LINE=$$PAD(LINE,51)_$$NUMDATE^BDGF(X\1,1)
+52 ;coder
IF BDGSTG<3
SET X=$$GET1^DIQ(9009016.1,IEN,.22,"I")
+53 ;bill prep
IF BDGSTG=3
SET X=$$GET1^DIQ(9009016.1,IEN,.23,"I")
+54 ;initials
IF X
SET LINE=$$PAD(LINE,62)_$$GET1^DIQ(200,X,1)
+55 ;
+56 ; if listing coded charts, show any that are completed also
+57 IF BDGSTG=1
IF $$GET1^DIQ(9009016.1,IEN,.14)]""
SET LINE=$$PAD(LINE,69)_"X"
+58 ; if listing coded or completed charts, show any already bill prepd
+59 IF BDGSTG<3
IF $$GET1^DIQ(9009016.1,IEN,.15)]""
SET LINE=$$PAD(LINE,75)_"X"
+60 DO SET(LINE,.VALMCNT)
+61 SET COUNT=COUNT+1
SET COUNT(SORT1)=$GET(COUNT(SORT1))+1
End DoDot:3
End DoDot:2
End DoDot:1
+62 ;
+63 IF COUNT
Begin DoDot:1
+64 DO SET("",.VALMCNT)
DO SET("Total Charts:"_$JUSTIFY(COUNT,4),.VALMCNT)
+65 SET X=0
FOR
SET X=$ORDER(COUNT(X))
IF 'X
QUIT
Begin DoDot:2
+66 SET LINE=$$SP(3)_$$NUMDATE^BDGF(X\1)_":"_$JUSTIFY(COUNT(X),5)
+67 DO SET(LINE,.VALMCNT)
End DoDot:2
End DoDot:1
+68 ;
+69 IF '$DATA(^TMP("BDGICR5",$JOB))
SET VALMCNT=1
SET ^TMP("BDGICR5",$JOB,1,0)="NO DATA FOUND"
+70 KILL ^TMP("BDGICR5A",$JOB)
+71 QUIT
+72 ;
HELP ; -- help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ; -- exit code
+1 KILL ^TMP("BDGICR5",$JOB)
KILL BDGPRT
+2 QUIT
+3 ;
EXPND ; -- expand code
+1 QUIT
+2 ;
SET(DATA,NUM) ; put display line into array
+1 SET NUM=NUM+1
+2 SET ^TMP("BDGICR5",$JOB,NUM,0)=DATA
+3 QUIT
+4 ;
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("BDGICR5",$JOB,BDGX))
IF 'BDGX
QUIT
Begin DoDot:1
+7 IF $Y>(IOSL-4)
DO HDG
+8 SET BDGLN=^TMP("BDGICR5",$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,?25,"Completed Charts Report",?70,"Page: ",BDGPG
+5 ;
+6 ;IHS/OIT/LJF 04/14/2006 PATCH 1005 added observations
+7 ;NEW X S X=$S(BDGTYP=1:"Inpatient Charts Only",BDGTYP=2:"Day Surgery Charts Only",1:"Inpatient and Day Surgery Charts")
+8 NEW X
SET X=$SELECT(BDGTYP=1:"Inpatient Charts Only",BDGTYP=2:"Day Surgery & Observation Charts",1:"Inpatient, Observaiton and Day Surgery Charts")
+9 ;
+10 SET X=X_$$SP(4)_"-"_$$SP(4)_$PIECE($TEXT(CHOICE+BDGSTG),";;",2)
+11 WRITE !,BDGTIME,?(80-$LENGTH(X)\2),X
+12 ;date range
SET X=$$RANGE^BDGF(BDGBD,BDGED)
WRITE !?(80-$LENGTH(X)\2),X
+13 ;
+14 WRITE !,$$REPEAT^XLFSTR("-",80)
+15 SET X=$SELECT(BDGSTG=1:" Coded",BDGSTG=2:" Complt",1:" BillPrep")
+16 WRITE !,X,?13,"HRCN",?19,"Patient Name",?46,"Typ",?51,"Dsch/Surg"
+17 SET X=$SELECT(BDGSTG=1:"Compl BPrep",BDGSTG=2:$$SP(6)_"BPrep",1:"")
+18 WRITE ?62,"WHO",?67,X
+19 WRITE !,$$REPEAT^XLFSTR("=",80)
+20 QUIT
+21 ;
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 ;
CHOICE ;;
+1 ;;Coded Charts;;
+2 ;;Completed Charts;;
+3 ;;Bill Prep Done;;