source: FOIAVistA/trunk/r/NOIS-FSC/FSCRS.m@ 949

Last change on this file since 949 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1FSCRS ;SLC/STAFF-NOIS Report Special ;1/13/98 16:54
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4SUMMARY ; executed from NOIS FORMAT file
5 N FORMAT K FORMAT ; CALLNUM,LATLINE,LISTNUM,STYLE,TYPE available for use
6 S FORMAT(1)="",FORMAT(1,1)="",FORMAT(1,2)=" This is simply a test to show a format for call # "_CALLNUM
7 I TYPE["VIEW" D VIEW^FSCFORMU(LISTNUM,CALLNUM,.FORMAT,STYLE,.LASTLINE,TYPE) Q
8 D SETUP^FSCFORMU(LISTNUM,CALLNUM,.FORMAT,STYLE,.LASTLINE,TYPE)
9 Q
10 ;
11STATHIST ;
12 N CNT,DATETIME,DIFF,FORMAT,LINE,LINECNT,LINECNT1,SEQ,START,STATUS,STOP K FORMAT,SEQ
13 S FORMAT(1)=""
14 S (SEQ,LINECNT)=0 F S LINECNT=$O(^FSCD("CALL",CALLNUM,110,LINECNT)) Q:LINECNT<1 S LINE=^(LINECNT,0) D
15 .S SEQ=SEQ+1
16 .D INFO(LINE,.STATUS,.DATETIME)
17 .S SEQ(SEQ)=STATUS_U_DATETIME
18 .S LINECNT1=$O(^FSCD("CALL",CALLNUM,110,LINECNT)) I LINECNT1'<1 S LINE=$G(^(LINECNT1,0))
19 .I LINECNT1<1 D
20 ..S SEQ(SEQ)=SEQ(SEQ)_U_$$FMTE^XLFDT($$NOW^XLFDT)
21 .E D
22 ..D INFO(LINE,.STATUS,.DATETIME)
23 ..S SEQ(SEQ)=SEQ(SEQ)_U_DATETIME
24 S (CNT,SEQ)=0 F S SEQ=$O(SEQ(SEQ)) Q:SEQ<1 D
25 .S LINE=SEQ(SEQ),STATUS=$P(LINE,U),START=$P(LINE,U,2),STOP=$P(LINE,U,3)
26 .S START=$$EXTFM(START),STOP=$$EXTFM(STOP),DIFF=$$FMDIFF^XLFDT(STOP,START,3)
27 .I '$L(DIFF) S DIFF="00:00:00"
28 .S CNT=CNT+1,FORMAT(1,CNT)=STATUS_": "_DIFF
29 I TYPE["VIEW" D VIEW^FSCFORMU(LISTNUM,CALLNUM,.FORMAT,STYLE,.LASTLINE,TYPE) Q
30 D SETUP^FSCFORMU(LISTNUM,CALLNUM,.FORMAT,STYLE,.LASTLINE,TYPE)
31 Q
32 ;
33INFO(LINE,STATUS,DATETIME) ;
34 S STATUS=$P(LINE," on ")
35 I STATUS["Changed from" S STATUS=$P(STATUS," to ",2)
36 I $E(STATUS,1,2)=" " S STATUS=$E(STATUS,3,99)
37 S DATETIME=$P(LINE," on ",2),DATETIME=$P(DATETIME," by ")
38 Q
39 ;
40EXTFM(DATETIME) ; $$(external date@time) -> fmdate.time
41 N DATE,MON,NEW,TIME
42 S DATE=$P(DATETIME,"@"),TIME=$P(DATETIME,"@",2)
43 S NEW=$P(DATE," ",3)-1700
44 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")
45 S NEW=NEW_MON_$P($P(DATE," ",2),",")
46 I $L(TIME) S NEW=NEW_"."_$TR(TIME,":","")
47 Q NEW
Note: See TracBrowser for help on using the repository browser.