FSCRS ;SLC/STAFF-NOIS Report Special ;1/13/98 16:54
;;1.1;NOIS;;Sep 06, 1998
;
SUMMARY ; executed from NOIS FORMAT file
N FORMAT K FORMAT ; CALLNUM,LATLINE,LISTNUM,STYLE,TYPE available for use
S FORMAT(1)="",FORMAT(1,1)="",FORMAT(1,2)=" This is simply a test to show a format for call # "_CALLNUM
I TYPE["VIEW" D VIEW^FSCFORMU(LISTNUM,CALLNUM,.FORMAT,STYLE,.LASTLINE,TYPE) Q
D SETUP^FSCFORMU(LISTNUM,CALLNUM,.FORMAT,STYLE,.LASTLINE,TYPE)
Q
;
STATHIST ;
N CNT,DATETIME,DIFF,FORMAT,LINE,LINECNT,LINECNT1,SEQ,START,STATUS,STOP K FORMAT,SEQ
S FORMAT(1)=""
S (SEQ,LINECNT)=0 F S LINECNT=$O(^FSCD("CALL",CALLNUM,110,LINECNT)) Q:LINECNT<1 S LINE=^(LINECNT,0) D
.S SEQ=SEQ+1
.D INFO(LINE,.STATUS,.DATETIME)
.S SEQ(SEQ)=STATUS_U_DATETIME
.S LINECNT1=$O(^FSCD("CALL",CALLNUM,110,LINECNT)) I LINECNT1'<1 S LINE=$G(^(LINECNT1,0))
.I LINECNT1<1 D
..S SEQ(SEQ)=SEQ(SEQ)_U_$$FMTE^XLFDT($$NOW^XLFDT)
.E D
..D INFO(LINE,.STATUS,.DATETIME)
..S SEQ(SEQ)=SEQ(SEQ)_U_DATETIME
S (CNT,SEQ)=0 F S SEQ=$O(SEQ(SEQ)) Q:SEQ<1 D
.S LINE=SEQ(SEQ),STATUS=$P(LINE,U),START=$P(LINE,U,2),STOP=$P(LINE,U,3)
.S START=$$EXTFM(START),STOP=$$EXTFM(STOP),DIFF=$$FMDIFF^XLFDT(STOP,START,3)
.I '$L(DIFF) S DIFF="00:00:00"
.S CNT=CNT+1,FORMAT(1,CNT)=STATUS_": "_DIFF
I TYPE["VIEW" D VIEW^FSCFORMU(LISTNUM,CALLNUM,.FORMAT,STYLE,.LASTLINE,TYPE) Q
D SETUP^FSCFORMU(LISTNUM,CALLNUM,.FORMAT,STYLE,.LASTLINE,TYPE)
Q
;
INFO(LINE,STATUS,DATETIME) ;
S STATUS=$P(LINE," on ")
I STATUS["Changed from" S STATUS=$P(STATUS," to ",2)
I $E(STATUS,1,2)=" " S STATUS=$E(STATUS,3,99)
S DATETIME=$P(LINE," on ",2),DATETIME=$P(DATETIME," by ")
Q
;
EXTFM(DATETIME) ; $$(external date@time) -> fmdate.time
N DATE,MON,NEW,TIME
S DATE=$P(DATETIME,"@"),TIME=$P(DATETIME,"@",2)
S NEW=$P(DATE," ",3)-1700
S MON=$P(DATE," "),MON=$S(MON="Jan":"01",MON="Feb":"02",MON="Mar":"03",MON="Apr":"04",MON="May":"05",MON="Jun":"06",MON="Jul":"07",MON="Aug":"08",MON="Sep":"09",MON="Oct":"10",MON="Nov":"11",1:"12")
S NEW=NEW_MON_$P($P(DATE," ",2),",")
I $L(TIME) S NEW=NEW_"."_$TR(TIME,":","")
Q NEW
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCRS 2114 printed Nov 22, 2024@17:30:07 Page 2
FSCRS ;SLC/STAFF-NOIS Report Special ;1/13/98 16:54
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
SUMMARY ; executed from NOIS FORMAT file
+1 ; CALLNUM,LATLINE,LISTNUM,STYLE,TYPE available for use
NEW FORMAT
KILL FORMAT
+2 SET FORMAT(1)=""
SET FORMAT(1,1)=""
SET FORMAT(1,2)=" This is simply a test to show a format for call # "_CALLNUM
+3 IF TYPE["VIEW"
DO VIEW^FSCFORMU(LISTNUM,CALLNUM,.FORMAT,STYLE,.LASTLINE,TYPE)
QUIT
+4 DO SETUP^FSCFORMU(LISTNUM,CALLNUM,.FORMAT,STYLE,.LASTLINE,TYPE)
+5 QUIT
+6 ;
STATHIST ;
+1 NEW CNT,DATETIME,DIFF,FORMAT,LINE,LINECNT,LINECNT1,SEQ,START,STATUS,STOP
KILL FORMAT,SEQ
+2 SET FORMAT(1)=""
+3 SET (SEQ,LINECNT)=0
FOR
SET LINECNT=$ORDER(^FSCD("CALL",CALLNUM,110,LINECNT))
if LINECNT<1
QUIT
SET LINE=^(LINECNT,0)
Begin DoDot:1
+4 SET SEQ=SEQ+1
+5 DO INFO(LINE,.STATUS,.DATETIME)
+6 SET SEQ(SEQ)=STATUS_U_DATETIME
+7 SET LINECNT1=$ORDER(^FSCD("CALL",CALLNUM,110,LINECNT))
IF LINECNT1'<1
SET LINE=$GET(^(LINECNT1,0))
+8 IF LINECNT1<1
Begin DoDot:2
+9 SET SEQ(SEQ)=SEQ(SEQ)_U_$$FMTE^XLFDT($$NOW^XLFDT)
End DoDot:2
+10 IF '$TEST
Begin DoDot:2
+11 DO INFO(LINE,.STATUS,.DATETIME)
+12 SET SEQ(SEQ)=SEQ(SEQ)_U_DATETIME
End DoDot:2
End DoDot:1
+13 SET (CNT,SEQ)=0
FOR
SET SEQ=$ORDER(SEQ(SEQ))
if SEQ<1
QUIT
Begin DoDot:1
+14 SET LINE=SEQ(SEQ)
SET STATUS=$PIECE(LINE,U)
SET START=$PIECE(LINE,U,2)
SET STOP=$PIECE(LINE,U,3)
+15 SET START=$$EXTFM(START)
SET STOP=$$EXTFM(STOP)
SET DIFF=$$FMDIFF^XLFDT(STOP,START,3)
+16 IF '$LENGTH(DIFF)
SET DIFF="00:00:00"
+17 SET CNT=CNT+1
SET FORMAT(1,CNT)=STATUS_": "_DIFF
End DoDot:1
+18 IF TYPE["VIEW"
DO VIEW^FSCFORMU(LISTNUM,CALLNUM,.FORMAT,STYLE,.LASTLINE,TYPE)
QUIT
+19 DO SETUP^FSCFORMU(LISTNUM,CALLNUM,.FORMAT,STYLE,.LASTLINE,TYPE)
+20 QUIT
+21 ;
INFO(LINE,STATUS,DATETIME) ;
+1 SET STATUS=$PIECE(LINE," on ")
+2 IF STATUS["Changed from"
SET STATUS=$PIECE(STATUS," to ",2)
+3 IF $EXTRACT(STATUS,1,2)=" "
SET STATUS=$EXTRACT(STATUS,3,99)
+4 SET DATETIME=$PIECE(LINE," on ",2)
SET DATETIME=$PIECE(DATETIME," by ")
+5 QUIT
+6 ;
EXTFM(DATETIME) ; $$(external date@time) -> fmdate.time
+1 NEW DATE,MON,NEW,TIME
+2 SET DATE=$PIECE(DATETIME,"@")
SET TIME=$PIECE(DATETIME,"@",2)
+3 SET NEW=$PIECE(DATE," ",3)-1700
+4 SET MON=$PIECE(DATE," ")
SET MON=$SELECT(MON="Jan":"01",MON="Feb":"02",MON="Mar":"03",MON="Apr":"04",MON="May":"05",MON="Jun":"06",MON="Jul":"07",MON="Aug":"08",MON="Sep":"09",MON="Oct":"10",MON="Nov":"11",1:"12")
+5 SET NEW=NEW_MON_$PIECE($PIECE(DATE," ",2),",")
+6 IF $LENGTH(TIME)
SET NEW=NEW_"."_$TRANSLATE(TIME,":","")
+7 QUIT NEW