Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BPSOSL1

BPSOSL1.m

Go to the documentation of this file.
  1. 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
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. Q
  1. ;
  1. ; Two entry points:
  1. ; PRINTLOG to print the log file, given the LOG
  1. ; PRINTDAT(type,start,end) prints all log files of the given
  1. ; type in the given date range. It prompts for missing parameters.
  1. ;
  1. ; PRINTDAT - Display Communication Log
  1. ; Input
  1. ; TYPE - Type of Communication Log. If not specified, prompt
  1. ; START - Start Date. If not specified, prompt
  1. ; END - End Date. If not specified, use START
  1. PRINTDAT(TYPE,START,END) ;
  1. I '$D(TYPE) S TYPE=$$GETTYPE Q:'TYPE
  1. W !
  1. I $D(START) D
  1. . I '$D(END) S END=START
  1. E D Q:'START
  1. . S START=$$GETDATES,END=$P(START,U,2),START=$P(START,U)
  1. N POP D ^%ZIS Q:$G(POP)
  1. N FORDATE,STOP
  1. S FORDATE=START,STOP=0
  1. F D Q:FORDATE>END!STOP
  1. . N SLOT,EXISTS
  1. . S SLOT=FORDATE+(TYPE/10),EXISTS=$$EXISTS(SLOT)
  1. . I EXISTS D PRINTLOG(SLOT,.STOP)
  1. . I 'EXISTS W "There is no log file ",SLOT,! H .25
  1. . S FORDATE=$$TADD^BPSOSUD(FORDATE,1) ; add one day
  1. D ^%ZISC
  1. Q
  1. ;
  1. GETDATES() ; Return start^end
  1. N PROMPT1 S PROMPT1="Starting date: "
  1. N PROMPT2 S PROMPT2=" Ending date: "
  1. N DEF1,DEF2 S (DEF1,DEF2)=DT
  1. Q $$DTR^BPSOSU1(PROMPT1,PROMPT2,DEF1,DEF2,"")
  1. ;
  1. ; Currently, we only have one communication log, which is .5=winnowing
  1. ; so we will return that. Kept old code that allowed a selection in
  1. ; case we add other logs again
  1. GETTYPE() ; Return log type
  1. Q 5
  1. N PROMPT S PROMPT="Which log file? "
  1. N DEF S DEF=5
  1. N MODE S MODE="V"
  1. N MENU S MENU="5:Winnowing;"
  1. Q $$SET^BPSOSU3(PROMPT,DEF,1,MODE,MENU)
  1. ;
  1. ; PRINTLOG - Print a log
  1. ; Input
  1. ; SLOT - Log to display
  1. ; STOP - If user quit from the display
  1. PRINTLOG(SLOT,STOP) ; EP - Above and BPSOS6M
  1. ;
  1. ; Validate parameters
  1. I '$G(SLOT) Q
  1. ;
  1. ; Initialize variables
  1. N IEN,LEN,UPDT,SEQ,UPDT,TEXT
  1. N PREVDATE,PREVTIME,EXDTTM
  1. ;
  1. ; Set IEN for the slot. If it does not exist, display message and quit
  1. S IEN=$$EXISTS(SLOT)
  1. I 'IEN W "Nothing in SLOT=",SLOT,! Q
  1. ;
  1. ; Do the Header
  1. I $Y D HDR
  1. ;
  1. ; Loop through text and display
  1. S (PREVDATE,PREVTIME)="",STOP=0,LEN=$S($G(IOM):IOM,1:80)-10-1
  1. S UPDT="" F S UPDT=$O(^BPS(9002313.12,IEN,10,"B",UPDT)) Q:UPDT="" D Q:STOP
  1. . S SEQ="" F S SEQ=$O(^BPS(9002313.12,IEN,10,"B",UPDT,SEQ)) Q:SEQ="" D Q:STOP
  1. .. S TEXT=$P($G(^BPS(9002313.12,IEN,10,SEQ,1)),U,1)
  1. .. S EXDTTM=$$FMTE^XLFDT(UPDT,1)
  1. .. I PREVDATE'=$P(UPDT,".",1) D
  1. ... S PREVDATE=$P(UPDT,".",1)
  1. ... W !,$P(EXDTTM,"@",1),!
  1. .. I $P(UPDT,".",2)'=PREVTIME D
  1. ... S PREVTIME=$P(UPDT,".",2)
  1. ... W $P(EXDTTM,"@",2)
  1. .. N I F I=1:LEN:$L(TEXT) D Q:STOP
  1. ... I I>1 W ?6,"..."
  1. ... W ?10,$E(TEXT,I,I+LEN-1),!
  1. ... D EOP
  1. Q
  1. ;
  1. EOP ; end of page handling
  1. ; set STOP if the user wants to get out
  1. S STOP=$$EOPQ^BPSOSU8(2,,"D HDR^"_$T(+0))
  1. Q
  1. ;
  1. HDR W @IOF,"Log file #",SLOT,!
  1. Q
  1. ;
  1. ; Get internal number for the slot
  1. EXISTS(SLOT) ; EP - Above and BPSOS6M
  1. I $G(SLOT)="" Q ""
  1. Q $O(^BPS(9002313.12,"B",SLOT,""))
  1. ;