ABSPOSL1 ; IHS/FCS/DRS - log file printing ;
;;1.0;PHARMACY POINT OF SALE;;JUN 21, 2001
Q
; D CLAIMLOG^ABSPOS6M - individual claims, as called from user screen
; D PRINTLOG^ABSPOSBD - DT+.2 - background posting to A/R
; D label^ABSPOSBL - billing log file - ILC interface - n+.2
; ABSPOSC2, ABSPOSC3 - testing and certification
; D LOGFILE^ABSPOSR1 - DT+.3 - background scanner of ^PSRX(indexes)
; D LASTLOG^ABSPOSRB - same as in ABSPOSRX, below
; D LASTLOG^ABSPOSRX - DT+.4 - background claims submission
; D LOGFILE^ABSPOSR4 - DT+.6 - back billing
; D COMMSLOG^ABSPOSU6 - dial out's log files - offset .1
; (no entry point) - DT+.5 - winnowing old data
; D PRINT^ABSPOSUT - the programmer-mode modem tests
;
; Two entry points: PRINTLOG to print the log file, given the #
; And PRINTDAT(type,start,end) prints all log files of the given
; type in the given date range. It prompts for missing parameters.
; (if start is given and end is missing, it just does start)
;
PRINTDAT(TYPE,START,END) ;EP
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 S FORDATE=START F D Q:FORDATE>END
. N SLOT S SLOT=FORDATE+(TYPE/10)
. I $$EXISTS^ABSPOSL(SLOT) D
. . D PRINTLOG(SLOT)
. E D
. . W "There is no log file ",SLOT,! H 1
. S FORDATE=$$TADD^ABSPOSUD(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^ABSPOSU1(PROMPT1,PROMPT2,DEF1,DEF2,"")
GETTYPE() ; return 2 = billing, 3 = background scanner, etc.
N PROMPT S PROMPT="Which log file? "
N DEF S DEF=2
N MODE S MODE="V"
N MENU S MENU="2:Billing;3:Background scan;4:Claims submitter;5:Winnowing;6:Back billing"
Q $$SET^ABSPOSU3(PROMPT,DEF,1,MODE,MENU)
PRINTLOG(SLOT,START,END) ; EP
I $Y D HDR
I '$$EXISTS^ABSPOSL(SLOT) W "Nothing in SLOT=",SLOT,! Q
I '$G(START) N START S START=1
I '$G(END) N END S END=$$PRINTEND^ABSPOSL(SLOT)
N PREVTIME S PREVTIME=""
N MISS S MISS=0 ; count of missing lines
N LEN S LEN=$S($G(IOM):IOM,1:80)-10-1
N STOP S STOP=0
N LINE F LINE=START:1:END D Q:STOP
.I '$D(^ABSPECP("LOG",SLOT,LINE)) D Q
..I MISS>3 Q ; don't bother saying any more
..S MISS=MISS+1 W "Missing line ",LINE
..I MISS=3 W "; no more missing lines will be reported."
..W !
.N X S X=^ABSPECP("LOG",SLOT,LINE) ; =$H seconds^text
.N % S %=$P(X,U)
.I %'=PREVTIME S PREVTIME=% D
..S %=PREVTIME W $J(%\3600,2),":" S %=%#3600
..W $TR($J(%\60,2)," ","0"),":" S %=$J(%#60,2) W $TR(%," ",0)
.S X=$P(X,U,2,$L(X,U))
.N I F I=1:LEN:$L(X) D Q:STOP
..I I>1 W ?6,"..."
..W ?10,$E(X,I,I+LEN-1),!
..D EOP
Q
EOP ; end of page handling
; set STOP if the user wants to get out
S STOP=$$EOPQ^ABSPOSU8(2,,"D HDR^"_$T(+0))
Q
HDR W @IOF,"Log file #",SLOT,! Q
ABSPOSL1 ; IHS/FCS/DRS - log file printing ;
+1 ;;1.0;PHARMACY POINT OF SALE;;JUN 21, 2001
+2 QUIT
+3 ; D CLAIMLOG^ABSPOS6M - individual claims, as called from user screen
+4 ; D PRINTLOG^ABSPOSBD - DT+.2 - background posting to A/R
+5 ; D label^ABSPOSBL - billing log file - ILC interface - n+.2
+6 ; ABSPOSC2, ABSPOSC3 - testing and certification
+7 ; D LOGFILE^ABSPOSR1 - DT+.3 - background scanner of ^PSRX(indexes)
+8 ; D LASTLOG^ABSPOSRB - same as in ABSPOSRX, below
+9 ; D LASTLOG^ABSPOSRX - DT+.4 - background claims submission
+10 ; D LOGFILE^ABSPOSR4 - DT+.6 - back billing
+11 ; D COMMSLOG^ABSPOSU6 - dial out's log files - offset .1
+12 ; (no entry point) - DT+.5 - winnowing old data
+13 ; D PRINT^ABSPOSUT - the programmer-mode modem tests
+14 ;
+15 ; Two entry points: PRINTLOG to print the log file, given the #
+16 ; And PRINTDAT(type,start,end) prints all log files of the given
+17 ; type in the given date range. It prompts for missing parameters.
+18 ; (if start is given and end is missing, it just does start)
+19 ;
PRINTDAT(TYPE,START,END) ;EP
+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
SET FORDATE=START
FOR
Begin DoDot:1
+9 NEW SLOT
SET SLOT=FORDATE+(TYPE/10)
+10 IF $$EXISTS^ABSPOSL(SLOT)
Begin DoDot:2
+11 DO PRINTLOG(SLOT)
End DoDot:2
+12 IF '$TEST
Begin DoDot:2
+13 WRITE "There is no log file ",SLOT,!
HANG 1
End DoDot:2
+14 ; add one day
SET FORDATE=$$TADD^ABSPOSUD(FORDATE,1)
End DoDot:1
IF FORDATE>END
QUIT
+15 DO ^%ZISC
+16 QUIT
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^ABSPOSU1(PROMPT1,PROMPT2,DEF1,DEF2,"")
GETTYPE() ; return 2 = billing, 3 = background scanner, etc.
+1 NEW PROMPT
SET PROMPT="Which log file? "
+2 NEW DEF
SET DEF=2
+3 NEW MODE
SET MODE="V"
+4 NEW MENU
SET MENU="2:Billing;3:Background scan;4:Claims submitter;5:Winnowing;6:Back billing"
+5 QUIT $$SET^ABSPOSU3(PROMPT,DEF,1,MODE,MENU)
PRINTLOG(SLOT,START,END) ; EP
+1 IF $Y
DO HDR
+2 IF '$$EXISTS^ABSPOSL(SLOT)
WRITE "Nothing in SLOT=",SLOT,!
QUIT
+3 IF '$GET(START)
NEW START
SET START=1
+4 IF '$GET(END)
NEW END
SET END=$$PRINTEND^ABSPOSL(SLOT)
+5 NEW PREVTIME
SET PREVTIME=""
+6 ; count of missing lines
NEW MISS
SET MISS=0
+7 NEW LEN
SET LEN=$SELECT($GET(IOM):IOM,1:80)-10-1
+8 NEW STOP
SET STOP=0
+9 NEW LINE
FOR LINE=START:1:END
Begin DoDot:1
+10 IF '$DATA(^ABSPECP("LOG",SLOT,LINE))
Begin DoDot:2
+11 ; don't bother saying any more
IF MISS>3
QUIT
+12 SET MISS=MISS+1
WRITE "Missing line ",LINE
+13 IF MISS=3
WRITE "; no more missing lines will be reported."
+14 WRITE !
End DoDot:2
QUIT
+15 ; =$H seconds^text
NEW X
SET X=^ABSPECP("LOG",SLOT,LINE)
+16 NEW %
SET %=$PIECE(X,U)
+17 IF %'=PREVTIME
SET PREVTIME=%
Begin DoDot:2
+18 SET %=PREVTIME
WRITE $JUSTIFY(%\3600,2),":"
SET %=%#3600
+19 WRITE $TRANSLATE($JUSTIFY(%\60,2)," ","0"),":"
SET %=$JUSTIFY(%#60,2)
WRITE $TRANSLATE(%," ",0)
End DoDot:2
+20 SET X=$PIECE(X,U,2,$LENGTH(X,U))
+21 NEW I
FOR I=1:LEN:$LENGTH(X)
Begin DoDot:2
+22 IF I>1
WRITE ?6,"..."
+23 WRITE ?10,$EXTRACT(X,I,I+LEN-1),!
+24 DO EOP
End DoDot:2
IF STOP
QUIT
End DoDot:1
IF STOP
QUIT
+25 QUIT
EOP ; end of page handling
+1 ; set STOP if the user wants to get out
+2 SET STOP=$$EOPQ^ABSPOSU8(2,,"D HDR^"_$TEXT(+0))
+3 QUIT
HDR WRITE @IOF,"Log file #",SLOT,!
QUIT