46 lines
3.4 KiB
Mathematica
46 lines
3.4 KiB
Mathematica
GMRGUT1 ;HIRMFO/DDA,RM-UTILITIES ROUTINE FOR GMRG FILES (CONT.) ;9/1/95
|
|
;;3.0;Text Generator;;Jan 24, 1996
|
|
EN3 ; ENTRY TO UPDATE NODE ID FIELD
|
|
S GMRG=$S($D(^GMRD(124.2,DA,0)):^(0),1:""),GMRG(1)=$P(GMRG,"^"),GMRG(2)=$P(GMRG,"^",2),GMRG(3)=$P(GMRG,"^",3),GMRG(5)=$P(GMRG,"^",5) G Q3:GMRG(1)=""!(GMRG(2)="")!(GMRG(3)="") S GMRG("X")=X
|
|
I GMRG(5)'="" S GMRG("QT")=0 F GMRG("DA")=0:0 S GMRG("DA")=$O(^GMRD(124.2,"AA",GMRG(3),GMRG(2),GMRG(1),GMRG(5),GMRG("DA"))) Q:GMRG("DA")'>0 I GMRG("DA")'=DA S GMRG("QT")=1 Q
|
|
I GMRG(5)'="",'GMRG("QT") S GMRG("NODE")=GMRG(5) G S3
|
|
S GMRG("QT")=0 F GMRG("NODE")=1:1 Q:$D(^GMRD(124.2,"AA",GMRG(3),GMRG(2),GMRG(1),GMRG("NODE"),DA)) I '$D(^GMRD(124.2,"AA",GMRG(3),GMRG(2),GMRG(1),GMRG("NODE"))) D:GMRG(5)'="" CLND Q:GMRG(5)=""!(GMRG(5)'=""&GMRG("QT"))
|
|
I GMRG(5)'="" S X=GMRG(5) F GMRG("L")=0:0 S GMRG("L")=$O(^DD(124.2,.05,1,GMRG("L"))) Q:GMRG("L")'>0 X:$D(^DD(124.2,.05,1,GMRG("L"),2)) ^(2)
|
|
S3 S X=GMRG("NODE"),$P(^GMRD(124.2,DA,0),"^",5)=X F GMRG("L")=0:0 S GMRG("L")=$O(^DD(124.2,.05,1,GMRG("L"))) Q:GMRG("L")'>0 X:$D(^DD(124.2,.05,1,GMRG("L"),1)) ^(1)
|
|
S X=GMRG("X")
|
|
Q3 K GMRG
|
|
Q
|
|
CLND ;
|
|
S GMRG("QT")=1 F GMRG("DA")=0:0 S GMRG("DA")=$O(^GMRD(124.2,"AA",GMRG(3),GMRG(2),GMRG(1),GMRG("NODE"),GMRG("DA"))) Q:GMRG("DA")'>0 I GMRG("DA")'=DA S GMRG("QT")=0 Q
|
|
Q
|
|
EN4 ; SCREEN FROM THE TYPE OF TERM (#.02) FIELD FROM AGGREGRATE TERM FILE
|
|
S GMRG("L")=2,GMRG("H")=4
|
|
S GMRG=$O(^GMRD(124.2,DA,1,"AC",0)) S:GMRG'="" GMRG("H")=2
|
|
I Y'<GMRG("L"),Y'>GMRG("H")
|
|
K GMRG
|
|
Q
|
|
EN5 ; ENTRY TO SET LIST XREF OF THE SELECTION SUBFIELD (#.01) OF THE
|
|
; SELECTION FIELD (#1) OF THE GMR TEXT (#124.3) FILE
|
|
S GMRG(1)=$S($D(^GMR(124.3,DA(2),1,DA(1),0)):$P(^(0),U),1:"") Q:GMRG(1)'>0 S:'$D(^GMR(124.3,DA(2),1,"ALIST",GMRG(1),1)) ^(1)="^0"
|
|
S GMRGND=DA(2),GMRGND(0)=GMRG(1) D STLST^GMRGRUT0
|
|
Q
|
|
EN6 ; ENTRY TO KILL LIST XREF OF THE SELECTION SUBFIELD (#.01) OF THE
|
|
; SELECTION FIELD (#1) OF THE GMR TEXT (#124.3) FILE
|
|
S GMRG(1)=$S($D(^GMR(124.3,DA(2),1,DA(1),0)):$P(^(0),U),1:"") Q:GMRG(1)'>0 F GMRG=0:0 S GMRG=$O(^GMR(124.3,DA(2),1,"ALIST",GMRG(1),GMRG)) Q:GMRG'>0 K ^GMR(124.3,DA(2),1,"ALIST",GMRG(1),GMRG)
|
|
S GMRGND=DA(2),GMRGND(0)=GMRG(1) D DLLST^GMRGRUT0
|
|
Q
|
|
EN7 ; ENTRY TO UPDATE ALIST XREF
|
|
I '$D(GMRGRT) F GMRG(1)=0:0 S GMRG(1)=$O(^GMR(124.3,DA(2),1,DA(1),2,GMRG(1))) Q:GMRG(1)'>0 I $D(^GMR(124.3,DA(2),1,DA(1),2,GMRG(1),0)),$P(^(0),"^"),$S(GMRG:1,GMRG(1)=DA:0,1:1) S GMRG(1,(9999999-$P(^(0),"^")))=$P(^(0),"^",2)
|
|
S GMRG(1)=$S($D(GMRGRT):$O(^GMR(124.3,DA(2),1,DA(1),2,"AA",0)),1:$O(GMRG(1,0))),GMRG(2)=$S($D(GMRGRT):$O(^GMR(124.3,DA(2),1,DA(1),2,"AA",+GMRG(1),0)),$D(GMRG(1,+GMRG(1))):GMRG(1,GMRG(1)),1:0)
|
|
K GMRG(1) I '$D(GMRGRT),GMRG(2) D STPAR
|
|
D EN5:GMRG(2),EN6:'GMRG(2) K GMRG
|
|
Q
|
|
STPAR ;
|
|
S GMRG(1,0)=$S($D(^GMR(124.3,DA(2),1,DA(1),0)):+$P(^(0),"^"),1:0) Q:'GMRG(1,0) S:$S('$D(^GMR(124.3,DA(2),0)):0,'$D(^GMRD(124.2,"AKID",GMRG(1,0),+^GMR(124.3,DA(2),0))):0,1:1) GMRG(0,+^GMR(124.3,DA(2),0))=""
|
|
F GMRG(1)=0:0 S GMRG(1)=$O(^GMR(124.3,DA(2),1,GMRG(1))) Q:GMRG(1)'>0 I $D(^GMR(124.3,DA(2),1,GMRG(1),0)),$D(^GMRD(124.2,"AKID",GMRG(1,0),+^GMR(124.3,DA(2),1,GMRG(1),0))) D STPAR1
|
|
Q
|
|
STPAR1 ;
|
|
K GMRG("A") F GMRG(0)=0:0 S GMRG(0)=$O(^GMR(124.3,DA(2),1,GMRG(1),2,GMRG(0))) Q:GMRG(0)'>0 S GMRG(3)=$S($D(^GMR(124.3,DA(2),1,GMRG(1),2,GMRG(0),0)):^(0),1:"") I +GMRG(3) S GMRG("A",9999999-GMRG(3))=GMRG(3)
|
|
S GMRG(0)=$O(GMRG("A",0)) S:$S('$D(GMRG("A",+GMRG(0))):0,$P(GMRG("A",+GMRG(0)),"^",2):1,1:0) GMRG(0,+^GMR(124.3,DA(2),1,GMRG(1),0))=""
|
|
Q
|