1 | RRCI18L ; Package File Loader
|
---|
2 | ;RRCI18L V0.0001;;MTZ/RCR/27MAY2004 29Aug2004
|
---|
3 | ;Donated by Chris Richardson
|
---|
4 | ;Initial database design by Marcus Werner
|
---|
5 | ;Copyright 2008 WorldVistA. Licensed under the terms of the GNU
|
---|
6 | ;General Public License See attached copy of the License.
|
---|
7 | ;
|
---|
8 | ;This program is free software; you can redistribute it and/or modify
|
---|
9 | ;it under the terms of the GNU General Public License as published by
|
---|
10 | ;the Free Software Foundation; either version 2 of the License, or
|
---|
11 | ;(at your option) any later version.
|
---|
12 | ;
|
---|
13 | ;This program is distributed in the hope that it will be useful,
|
---|
14 | ;but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | ;GNU General Public License for more details.
|
---|
17 | ;
|
---|
18 | ;You should have received a copy of the GNU General Public License along
|
---|
19 | ;with this program; if not, write to the Free Software Foundation, Inc.,
|
---|
20 | ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
---|
21 | V ; Note: Snapshot file .84 before this run so that
|
---|
22 | ; it might be restored completely.
|
---|
23 | N CODE,END,EXIT,I,J,K,LL,RRCODE,RRCFILE,RRCIEN,RRCNODE,MSK
|
---|
24 | S F="/root/VA-File-Custody.txt",U="^",V="`"
|
---|
25 | O F:READ
|
---|
26 | U F
|
---|
27 | F D Q:$L(R,"#")>5
|
---|
28 | . R R
|
---|
29 | . U 0 W R,!
|
---|
30 | . D PROC(R)
|
---|
31 | . U F
|
---|
32 | .QUIT
|
---|
33 | U 0
|
---|
34 | C F
|
---|
35 | QUIT
|
---|
36 | ; ============
|
---|
37 | PROC(X) ; Process the Row just read in
|
---|
38 | N I,T
|
---|
39 | S T=$C(9),P=$C(34)
|
---|
40 | F I=1:1:$L(X,T) S V(I)=$TR($P(X,T,I),P)
|
---|
41 | S FN=V(1),NS=V(4)
|
---|
42 | Q:NS=""
|
---|
43 | S Y=$G(SUM(NS))
|
---|
44 | S LV=$P(Y,U,2)
|
---|
45 | S:LV="" LV=9999999999999
|
---|
46 | I FN<LV S $P(Y,U,2)=FN
|
---|
47 | I FN>$P(Y,U,3) S $P(Y,U,3)=FN
|
---|
48 | S SUM(NS)=NS_U_$P(Y,U,2,3)
|
---|
49 | QUIT
|
---|
50 | ; ============
|
---|
51 | ; ============
|
---|