source: WorldVistAEHR/trunk/r/GEN_MED_REC_GENERATOR-GMRG/GMRGUT1.m@ 1259

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1GMRGUT1 ;HIRMFO/DDA,RM-UTILITIES ROUTINE FOR GMRG FILES (CONT.) ;9/1/95
2 ;;3.0;Text Generator;;Jan 24, 1996
3EN3 ; ENTRY TO UPDATE NODE ID FIELD
4 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
5 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
6 I GMRG(5)'="",'GMRG("QT") S GMRG("NODE")=GMRG(5) G S3
7 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"))
8 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)
9S3 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)
10 S X=GMRG("X")
11Q3 K GMRG
12 Q
13CLND ;
14 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
15 Q
16EN4 ; SCREEN FROM THE TYPE OF TERM (#.02) FIELD FROM AGGREGRATE TERM FILE
17 S GMRG("L")=2,GMRG("H")=4
18 S GMRG=$O(^GMRD(124.2,DA,1,"AC",0)) S:GMRG'="" GMRG("H")=2
19 I Y'<GMRG("L"),Y'>GMRG("H")
20 K GMRG
21 Q
22EN5 ; ENTRY TO SET LIST XREF OF THE SELECTION SUBFIELD (#.01) OF THE
23 ; SELECTION FIELD (#1) OF THE GMR TEXT (#124.3) FILE
24 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"
25 S GMRGND=DA(2),GMRGND(0)=GMRG(1) D STLST^GMRGRUT0
26 Q
27EN6 ; ENTRY TO KILL LIST XREF OF THE SELECTION SUBFIELD (#.01) OF THE
28 ; SELECTION FIELD (#1) OF THE GMR TEXT (#124.3) FILE
29 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)
30 S GMRGND=DA(2),GMRGND(0)=GMRG(1) D DLLST^GMRGRUT0
31 Q
32EN7 ; ENTRY TO UPDATE ALIST XREF
33 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)
34 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)
35 K GMRG(1) I '$D(GMRGRT),GMRG(2) D STPAR
36 D EN5:GMRG(2),EN6:'GMRG(2) K GMRG
37 Q
38STPAR ;
39 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))=""
40 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
41 Q
42STPAR1 ;
43 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)
44 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))=""
45 Q
Note: See TracBrowser for help on using the repository browser.