1 | FSCRPCSF ;SLC/STAFF-NOIS RPC Static File ;2/21/97 17:31
|
---|
2 | ;;1.1;NOIS;;Sep 06, 1998
|
---|
3 | ;
|
---|
4 | FILE(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 | ;
|
---|
15 | SPEC ;
|
---|
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 | ;
|
---|
23 | SORT ;
|
---|
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 | ;
|
---|
34 | DISPLAY ;
|
---|
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
|
---|