BPSOSL1 ;BHAM ISC/FCS/DRS/DLF - log file printing ;06/01/2004
;;1.0;E CLAIMS MGMT ENGINE;**1,5**;JUN 2004;Build 45
;;Per VHA Directive 2004-038, this routine should not be modified.
Q
;
; Two entry points:
; PRINTLOG to print the log file, given the LOG
; PRINTDAT(type,start,end) prints all log files of the given
; type in the given date range. It prompts for missing parameters.
;
; PRINTDAT - Display Communication Log
; Input
; TYPE - Type of Communication Log. If not specified, prompt
; START - Start Date. If not specified, prompt
; END - End Date. If not specified, use START
PRINTDAT(TYPE,START,END) ;
I '$D(TYPE) S TYPE=$$GETTYPE Q:'TYPE
W !
I $D(START) D
. I '$D(END) S END=START
E D Q:'START
. S START=$$GETDATES,END=$P(START,U,2),START=$P(START,U)
N POP D ^%ZIS Q:$G(POP)
N FORDATE,STOP
S FORDATE=START,STOP=0
F D Q:FORDATE>END!STOP
. N SLOT,EXISTS
. S SLOT=FORDATE+(TYPE/10),EXISTS=$$EXISTS(SLOT)
. I EXISTS D PRINTLOG(SLOT,.STOP)
. I 'EXISTS W "There is no log file ",SLOT,! H .25
. S FORDATE=$$TADD^BPSOSUD(FORDATE,1) ; add one day
D ^%ZISC
Q
;
GETDATES() ; Return start^end
N PROMPT1 S PROMPT1="Starting date: "
N PROMPT2 S PROMPT2=" Ending date: "
N DEF1,DEF2 S (DEF1,DEF2)=DT
Q $$DTR^BPSOSU1(PROMPT1,PROMPT2,DEF1,DEF2,"")
;
; Currently, we only have one communication log, which is .5=winnowing
; so we will return that. Kept old code that allowed a selection in
; case we add other logs again
GETTYPE() ; Return log type
Q 5
N PROMPT S PROMPT="Which log file? "
N DEF S DEF=5
N MODE S MODE="V"
N MENU S MENU="5:Winnowing;"
Q $$SET^BPSOSU3(PROMPT,DEF,1,MODE,MENU)
;
; PRINTLOG - Print a log
; Input
; SLOT - Log to display
; STOP - If user quit from the display
PRINTLOG(SLOT,STOP) ; EP - Above and BPSOS6M
;
; Validate parameters
I '$G(SLOT) Q
;
; Initialize variables
N IEN,LEN,UPDT,SEQ,UPDT,TEXT
N PREVDATE,PREVTIME,EXDTTM
;
; Set IEN for the slot. If it does not exist, display message and quit
S IEN=$$EXISTS(SLOT)
I 'IEN W "Nothing in SLOT=",SLOT,! Q
;
; Do the Header
I $Y D HDR
;
; Loop through text and display
S (PREVDATE,PREVTIME)="",STOP=0,LEN=$S($G(IOM):IOM,1:80)-10-1
S UPDT="" F S UPDT=$O(^BPS(9002313.12,IEN,10,"B",UPDT)) Q:UPDT="" D Q:STOP
. S SEQ="" F S SEQ=$O(^BPS(9002313.12,IEN,10,"B",UPDT,SEQ)) Q:SEQ="" D Q:STOP
.. S TEXT=$P($G(^BPS(9002313.12,IEN,10,SEQ,1)),U,1)
.. S EXDTTM=$$FMTE^XLFDT(UPDT,1)
.. I PREVDATE'=$P(UPDT,".",1) D
... S PREVDATE=$P(UPDT,".",1)
... W !,$P(EXDTTM,"@",1),!
.. I $P(UPDT,".",2)'=PREVTIME D
... S PREVTIME=$P(UPDT,".",2)
... W $P(EXDTTM,"@",2)
.. N I F I=1:LEN:$L(TEXT) D Q:STOP
... I I>1 W ?6,"..."
... W ?10,$E(TEXT,I,I+LEN-1),!
... D EOP
Q
;
EOP ; end of page handling
; set STOP if the user wants to get out
S STOP=$$EOPQ^BPSOSU8(2,,"D HDR^"_$T(+0))
Q
;
HDR W @IOF,"Log file #",SLOT,!
Q
;
; Get internal number for the slot
EXISTS(SLOT) ; EP - Above and BPSOS6M
I $G(SLOT)="" Q ""
Q $O(^BPS(9002313.12,"B",SLOT,""))
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HBPSOSL1 3136 printed Oct 16, 2024@17:52:36 Page 2
BPSOSL1 ;BHAM ISC/FCS/DRS/DLF - log file printing ;06/01/2004
+1 ;;1.0;E CLAIMS MGMT ENGINE;**1,5**;JUN 2004;Build 45
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 QUIT
+4 ;
+5 ; Two entry points:
+6 ; PRINTLOG to print the log file, given the LOG
+7 ; PRINTDAT(type,start,end) prints all log files of the given
+8 ; type in the given date range. It prompts for missing parameters.
+9 ;
+10 ; PRINTDAT - Display Communication Log
+11 ; Input
+12 ; TYPE - Type of Communication Log. If not specified, prompt
+13 ; START - Start Date. If not specified, prompt
+14 ; END - End Date. If not specified, use START
PRINTDAT(TYPE,START,END) ;
+1 IF '$DATA(TYPE)
SET TYPE=$$GETTYPE
if 'TYPE
QUIT
+2 WRITE !
+3 IF $DATA(START)
Begin DoDot:1
+4 IF '$DATA(END)
SET END=START
End DoDot:1
+5 IF '$TEST
Begin DoDot:1
+6 SET START=$$GETDATES
SET END=$PIECE(START,U,2)
SET START=$PIECE(START,U)
End DoDot:1
if 'START
QUIT
+7 NEW POP
DO ^%ZIS
if $GET(POP)
QUIT
+8 NEW FORDATE,STOP
+9 SET FORDATE=START
SET STOP=0
+10 FOR
Begin DoDot:1
+11 NEW SLOT,EXISTS
+12 SET SLOT=FORDATE+(TYPE/10)
SET EXISTS=$$EXISTS(SLOT)
+13 IF EXISTS
DO PRINTLOG(SLOT,.STOP)
+14 IF 'EXISTS
WRITE "There is no log file ",SLOT,!
HANG .25
+15 ; add one day
SET FORDATE=$$TADD^BPSOSUD(FORDATE,1)
End DoDot:1
if FORDATE>END!STOP
QUIT
+16 DO ^%ZISC
+17 QUIT
+18 ;
GETDATES() ; Return start^end
+1 NEW PROMPT1
SET PROMPT1="Starting date: "
+2 NEW PROMPT2
SET PROMPT2=" Ending date: "
+3 NEW DEF1,DEF2
SET (DEF1,DEF2)=DT
+4 QUIT $$DTR^BPSOSU1(PROMPT1,PROMPT2,DEF1,DEF2,"")
+5 ;
+6 ; Currently, we only have one communication log, which is .5=winnowing
+7 ; so we will return that. Kept old code that allowed a selection in
+8 ; case we add other logs again
GETTYPE() ; Return log type
+1 QUIT 5
+2 NEW PROMPT
SET PROMPT="Which log file? "
+3 NEW DEF
SET DEF=5
+4 NEW MODE
SET MODE="V"
+5 NEW MENU
SET MENU="5:Winnowing;"
+6 QUIT $$SET^BPSOSU3(PROMPT,DEF,1,MODE,MENU)
+7 ;
+8 ; PRINTLOG - Print a log
+9 ; Input
+10 ; SLOT - Log to display
+11 ; STOP - If user quit from the display
PRINTLOG(SLOT,STOP) ; EP - Above and BPSOS6M
+1 ;
+2 ; Validate parameters
+3 IF '$GET(SLOT)
QUIT
+4 ;
+5 ; Initialize variables
+6 NEW IEN,LEN,UPDT,SEQ,UPDT,TEXT
+7 NEW PREVDATE,PREVTIME,EXDTTM
+8 ;
+9 ; Set IEN for the slot. If it does not exist, display message and quit
+10 SET IEN=$$EXISTS(SLOT)
+11 IF 'IEN
WRITE "Nothing in SLOT=",SLOT,!
QUIT
+12 ;
+13 ; Do the Header
+14 IF $Y
DO HDR
+15 ;
+16 ; Loop through text and display
+17 SET (PREVDATE,PREVTIME)=""
SET STOP=0
SET LEN=$SELECT($GET(IOM):IOM,1:80)-10-1
+18 SET UPDT=""
FOR
SET UPDT=$ORDER(^BPS(9002313.12,IEN,10,"B",UPDT))
if UPDT=""
QUIT
Begin DoDot:1
+19 SET SEQ=""
FOR
SET SEQ=$ORDER(^BPS(9002313.12,IEN,10,"B",UPDT,SEQ))
if SEQ=""
QUIT
Begin DoDot:2
+20 SET TEXT=$PIECE($GET(^BPS(9002313.12,IEN,10,SEQ,1)),U,1)
+21 SET EXDTTM=$$FMTE^XLFDT(UPDT,1)
+22 IF PREVDATE'=$PIECE(UPDT,".",1)
Begin DoDot:3
+23 SET PREVDATE=$PIECE(UPDT,".",1)
+24 WRITE !,$PIECE(EXDTTM,"@",1),!
End DoDot:3
+25 IF $PIECE(UPDT,".",2)'=PREVTIME
Begin DoDot:3
+26 SET PREVTIME=$PIECE(UPDT,".",2)
+27 WRITE $PIECE(EXDTTM,"@",2)
End DoDot:3
+28 NEW I
FOR I=1:LEN:$LENGTH(TEXT)
Begin DoDot:3
+29 IF I>1
WRITE ?6,"..."
+30 WRITE ?10,$EXTRACT(TEXT,I,I+LEN-1),!
+31 DO EOP
End DoDot:3
if STOP
QUIT
End DoDot:2
if STOP
QUIT
End DoDot:1
if STOP
QUIT
+32 QUIT
+33 ;
EOP ; end of page handling
+1 ; set STOP if the user wants to get out
+2 SET STOP=$$EOPQ^BPSOSU8(2,,"D HDR^"_$TEXT(+0))
+3 QUIT
+4 ;
HDR WRITE @IOF,"Log file #",SLOT,!
+1 QUIT
+2 ;
+3 ; Get internal number for the slot
EXISTS(SLOT) ; EP - Above and BPSOS6M
+1 IF $GET(SLOT)=""
QUIT ""
+2 QUIT $ORDER(^BPS(9002313.12,"B",SLOT,""))
+3 ;