| 1 | BPSOSL1 ;BHAM ISC/FCS/DRS/DLF - log file printing ;06/01/2004 | 
|---|
| 2 | ;;1.0;E CLAIMS MGMT ENGINE;**1,5**;JUN 2004;Build 45 | 
|---|
| 3 | ;;Per VHA Directive 2004-038, this routine should not be modified. | 
|---|
| 4 | Q | 
|---|
| 5 | ; | 
|---|
| 6 | ;  Two entry points: | 
|---|
| 7 | ;    PRINTLOG to print the log file, given the LOG | 
|---|
| 8 | ;    PRINTDAT(type,start,end) prints all log files of the given | 
|---|
| 9 | ;      type in the given date range.  It prompts for missing parameters. | 
|---|
| 10 | ; | 
|---|
| 11 | ; PRINTDAT - Display Communication Log | 
|---|
| 12 | ; Input | 
|---|
| 13 | ;   TYPE  - Type of Communication Log.  If not specified, prompt | 
|---|
| 14 | ;   START - Start Date.  If not specified, prompt | 
|---|
| 15 | ;   END   - End Date.  If not specified, use START | 
|---|
| 16 | PRINTDAT(TYPE,START,END) ; | 
|---|
| 17 | I '$D(TYPE) S TYPE=$$GETTYPE Q:'TYPE | 
|---|
| 18 | W ! | 
|---|
| 19 | I $D(START) D | 
|---|
| 20 | . I '$D(END) S END=START | 
|---|
| 21 | E  D  Q:'START | 
|---|
| 22 | . S START=$$GETDATES,END=$P(START,U,2),START=$P(START,U) | 
|---|
| 23 | N POP D ^%ZIS Q:$G(POP) | 
|---|
| 24 | N FORDATE,STOP | 
|---|
| 25 | S FORDATE=START,STOP=0 | 
|---|
| 26 | F  D  Q:FORDATE>END!STOP | 
|---|
| 27 | . N SLOT,EXISTS | 
|---|
| 28 | . S SLOT=FORDATE+(TYPE/10),EXISTS=$$EXISTS(SLOT) | 
|---|
| 29 | . I EXISTS D PRINTLOG(SLOT,.STOP) | 
|---|
| 30 | . I 'EXISTS  W "There is no log file ",SLOT,! H .25 | 
|---|
| 31 | . S FORDATE=$$TADD^BPSOSUD(FORDATE,1) ; add one day | 
|---|
| 32 | D ^%ZISC | 
|---|
| 33 | Q | 
|---|
| 34 | ; | 
|---|
| 35 | GETDATES() ; Return start^end | 
|---|
| 36 | N PROMPT1 S PROMPT1="Starting date: " | 
|---|
| 37 | N PROMPT2 S PROMPT2="  Ending date: " | 
|---|
| 38 | N DEF1,DEF2 S (DEF1,DEF2)=DT | 
|---|
| 39 | Q $$DTR^BPSOSU1(PROMPT1,PROMPT2,DEF1,DEF2,"") | 
|---|
| 40 | ; | 
|---|
| 41 | ; Currently, we only have one communication log, which is .5=winnowing | 
|---|
| 42 | ;   so we will return that.  Kept old code that allowed a selection in | 
|---|
| 43 | ;   case we add other logs again | 
|---|
| 44 | GETTYPE() ; Return log type | 
|---|
| 45 | Q 5 | 
|---|
| 46 | N PROMPT S PROMPT="Which log file? " | 
|---|
| 47 | N DEF S DEF=5 | 
|---|
| 48 | N MODE S MODE="V" | 
|---|
| 49 | N MENU S MENU="5:Winnowing;" | 
|---|
| 50 | Q $$SET^BPSOSU3(PROMPT,DEF,1,MODE,MENU) | 
|---|
| 51 | ; | 
|---|
| 52 | ; PRINTLOG - Print a log | 
|---|
| 53 | ; Input | 
|---|
| 54 | ;   SLOT - Log to display | 
|---|
| 55 | ;   STOP - If user quit from the display | 
|---|
| 56 | PRINTLOG(SLOT,STOP) ; EP - Above and BPSOS6M | 
|---|
| 57 | ; | 
|---|
| 58 | ; Validate parameters | 
|---|
| 59 | I '$G(SLOT) Q | 
|---|
| 60 | ; | 
|---|
| 61 | ; Initialize variables | 
|---|
| 62 | N IEN,LEN,UPDT,SEQ,UPDT,TEXT | 
|---|
| 63 | N PREVDATE,PREVTIME,EXDTTM | 
|---|
| 64 | ; | 
|---|
| 65 | ; Set IEN for the slot.  If it does not exist, display message and quit | 
|---|
| 66 | S IEN=$$EXISTS(SLOT) | 
|---|
| 67 | I 'IEN W "Nothing in SLOT=",SLOT,! Q | 
|---|
| 68 | ; | 
|---|
| 69 | ; Do the Header | 
|---|
| 70 | I $Y D HDR | 
|---|
| 71 | ; | 
|---|
| 72 | ; Loop through text and display | 
|---|
| 73 | S (PREVDATE,PREVTIME)="",STOP=0,LEN=$S($G(IOM):IOM,1:80)-10-1 | 
|---|
| 74 | S UPDT="" F  S UPDT=$O(^BPS(9002313.12,IEN,10,"B",UPDT)) Q:UPDT=""  D  Q:STOP | 
|---|
| 75 | . S SEQ="" F  S SEQ=$O(^BPS(9002313.12,IEN,10,"B",UPDT,SEQ)) Q:SEQ=""  D  Q:STOP | 
|---|
| 76 | .. S TEXT=$P($G(^BPS(9002313.12,IEN,10,SEQ,1)),U,1) | 
|---|
| 77 | .. S EXDTTM=$$FMTE^XLFDT(UPDT,1) | 
|---|
| 78 | .. I PREVDATE'=$P(UPDT,".",1) D | 
|---|
| 79 | ... S PREVDATE=$P(UPDT,".",1) | 
|---|
| 80 | ... W !,$P(EXDTTM,"@",1),! | 
|---|
| 81 | .. I $P(UPDT,".",2)'=PREVTIME D | 
|---|
| 82 | ... S PREVTIME=$P(UPDT,".",2) | 
|---|
| 83 | ... W $P(EXDTTM,"@",2) | 
|---|
| 84 | .. N I F I=1:LEN:$L(TEXT) D  Q:STOP | 
|---|
| 85 | ... I I>1 W ?6,"..." | 
|---|
| 86 | ... W ?10,$E(TEXT,I,I+LEN-1),! | 
|---|
| 87 | ... D EOP | 
|---|
| 88 | Q | 
|---|
| 89 | ; | 
|---|
| 90 | EOP ; end of page handling | 
|---|
| 91 | ; set STOP if the user wants to get out | 
|---|
| 92 | S STOP=$$EOPQ^BPSOSU8(2,,"D HDR^"_$T(+0)) | 
|---|
| 93 | Q | 
|---|
| 94 | ; | 
|---|
| 95 | HDR W @IOF,"Log file #",SLOT,! | 
|---|
| 96 | Q | 
|---|
| 97 | ; | 
|---|
| 98 | ; Get internal number for the slot | 
|---|
| 99 | EXISTS(SLOT) ; EP - Above and BPSOS6M | 
|---|
| 100 | I $G(SLOT)="" Q "" | 
|---|
| 101 | Q $O(^BPS(9002313.12,"B",SLOT,"")) | 
|---|
| 102 | ; | 
|---|