source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCRPCSF.m@ 1724

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

initial load of WorldVistAEHR

File size: 1.4 KB
Line 
1FSCRPCSF ;SLC/STAFF-NOIS RPC Static File ;2/21/97 17:31
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4FILE(IN,OUT) ; from FSCRPX (RPCStaticFile)
5 N FILE,NUM
6 S FILE=$P($G(^TMP("FSCRPC",$J,"INPUT",1)),U,1)
7 I '$L(FILE) Q
8 I FILE="SPEC" D SPEC Q
9 I FILE="FORMAT_SORT" D SORT Q
10 I FILE="FORMAT_DISPLAY" D DISPLAY Q
11 I '$D(^FSC(FILE,0)) Q
12 S NUM=0 F S NUM=$O(^FSC(FILE,NUM)) Q:NUM<1 S ^TMP("FSCRPC",$J,"OUTPUT",NUM)=NUM_U_^(NUM,0)
13 Q
14 ;
15SPEC ;
16 N DATA,NUM,UNUM
17 S NUM=0
18 S UNUM=0 F S UNUM=$O(^FSC("SPEC",UNUM)) Q:UNUM<1 S DATA=$G(^(UNUM,0)) I $L(DATA) D
19 .S NUM=NUM+1
20 .S ^TMP("FSCRPC",$J,"OUTPUT",NUM)=UNUM_U_$P($G(^VA(200,UNUM,0)),U)_$P(DATA,U,2,99)
21 Q
22 ;
23SORT ;
24 N DESCEND,FIELD,LINE,LINE1,NUM,SUBNUM
25 S NUM=0 F S NUM=$O(^FSC("FORMAT",NUM)) Q:NUM<1 S LINE=$G(^(NUM,0)) I $P(LINE,U,2)="S" D
26 .S FIELD="",DESCEND=""
27 .S SUBNUM=0 F S SUBNUM=$O(^FSC("FORMAT",NUM,2,SUBNUM)) Q:SUBNUM<1 S LINE1=$G(^(SUBNUM,0)) D
28 ..I +LINE1<1 Q
29 ..S DESCEND=$P(LINE1,U,8) I 'DESCEND S DESCEND=0
30 ..S FIELD=FIELD_$P(LINE1,U)_":"_DESCEND_";"
31 .S ^TMP("FSCRPC",$J,"OUTPUT",NUM)=NUM_U_LINE S $P(^(NUM),U,7)=FIELD
32 Q
33 ;
34DISPLAY ;
35 N FIELD,LINE,LINE1,NUM,SUBNUM
36 S NUM=0 F S NUM=$O(^FSC("FORMAT",NUM)) Q:NUM<1 S LINE=$G(^(NUM,0)) I $P(LINE,U,2)="F" D
37 .S FIELD=""
38 .S SUBNUM=0 F S SUBNUM=$O(^FSC("FORMAT",NUM,2,SUBNUM)) Q:SUBNUM<1 S LINE1=$G(^(SUBNUM,0)) D
39 ..I +LINE1<1 Q
40 ..S FIELD=FIELD_$P(LINE1,U)_";"
41 .S ^TMP("FSCRPC",$J,"OUTPUT",NUM)=NUM_U_LINE S $P(^(NUM),U,7)=FIELD
42 Q
Note: See TracBrowser for help on using the repository browser.