GMRGTGIF ;HIRMFO/DDA,RM-TEXT GENERATOR PRIME DOCUMENT EDIT ;1/23/96
;;3.0;Text Generator;;Jan 24, 1996
EN1 ; ENTRY TO ADD DATA TO AGGREGATE TERM FILE IF PACKAGE IS UNKNOWN
Q:'$D(GMRGPK)
W ! S DX=$X,DY=0 X ^%ZOSF("XY")
S DIC("S")="I $S($P(^(0),U,4)="""":0,'$D(^GMRD(124.25,$P(^GMRD(124.2,+Y,0),U,4),0)):0,$P(^(0),U)=""PRIME DOCUMENT"":1,1:0)",DIC("A")="Select Prime Document to be modified: ",DIC="^GMRD(124.2,",DIC(0)="AEQML",DLAYGO=124.2
S DIC("DR")=".03///^S X=GMRGPK;.02///^S X=2;.04///^S X=""PRIME DOCUMENT"""
D ^DIC K DIC,DLAYGO
G:+Y'>0 Q S GMRGRT=+Y D EN4 I GMRGOUT K GMRGOUT,GMRGRT Q
G EN1
EN4 ; ENTRY TO ADD DATA IF PACKAGE AND PRIME DOCUMENT ARE BOTH KNOWN
; GMRGPK=PACKAGE REFERENCE GMRGRT=PRIME DOCUMENT IN AGG. TERM FILE
Q:'$D(GMRGPK)!'$D(GMRGRT) S GMRGRT(0)=$S($D(^GMRD(124.2,GMRGRT,0)):^(0),1:""),IOP="HOME",(GMRGLEVL,GMRGUP,GMRGOUT)=0 D ^%ZIS S GMRGINFO=GMRGRT D INFOSET^GMRGTGI0
A D EN2 G Q:GMRGUP,A:'GMRGOUT
Q L -^GMRD(124.2,+GMRGINFO,0) K ^TMP($J),%,D0,DA,DIC,DIE,DIK,DINUM,DR,DTOUT,GMRGANW,GMRGDOL,GMRGDUP,GMRGINFO,GMRGL,GMRGLEVL,GMRGNOL,GMRGNUP,GMRGOK,GMRGR,GMRGS,GMRGSEL,GMRGT,GMRGU,GMRGUP,GMRGW,GMRGX,GMRGY,GMRGZ,I
Q
EN2 ; ENTRY TO MODIFY A PRIME DOCUMENT GMRGRT=PRIME DOC. (PTR TO 124.2),
; GMRGINFO AND GMRGINFO( WHICH CONTAINS THE FOLLOWING ELEMEMTS:
; GMRGINFO = AGGY ENTRY WHICH FOLLOWING INFO PERTAINS (PTR FILE 124.2)
; GMRGINFO("PACK")=PACKAGE (PTR TO FILE 9.4).
; GMRGINFO("TYPE")=$S(1:"DOCUMENT",2:"FRAME",3:"TERM"),
; GMRGINFO("LEAD"),GMRGINFO("TRAIL")= LEAD OR TRAIL TEXT 1-200 CHARS.
; GMRGINFO("TEXT")= TEXT OF TERM ^ NODE IDENTIFIER
; GMRGINFO("FORM")=$S("B":"BRIEF TABULAR","T":"TABULAR",S:"SENTENCE")
; GMRGINFO("CLAS")=CLASSIFICATION (PTR TO FILE 124.25) ^ CLASS. TEXT
; GMRGINFO("MAX"),GMRGINFO("MIN")= MIN OR MAX # OF SELECTABLE ITEMS
; GMRGINFO("ACTS"),GMRGINFO("ACTF") = SELECTION OR FILING ACTION
; GMRGINFO("SEL") = # OF CHILDREN FOR THIS ENTRY
; GMRGINFO("SEL",SELECTION #) = SELCTION IEN (ENTRY IN CHILD MULT) ^
; SELECTION PTR (PTR TO 124.2) ^ SELECTION TEXT
K GMRGXVER D DISP^GMRGTGI1 Q:GMRGOUT
CHADE ; CHOOSE DELETE/ADD/EDIT A SELECTION, OR EDIT THE ENTRY
W !!,"Enter appropriate action, or type a '?' to see what you can do: " R Y:DTIME
S:Y="^"!(Y="^^")!'$T GMRGOUT=1 Q:GMRGOUT I '$L(Y)!(Y?1N.N0.1"@")!(Y?1N.N1"D")!(Y?1N.N1"d")!($L(Y)=1) S:'$L(Y) GMRGUP=1 Q:GMRGUP I Y?1N.N0.1"@"!(Y?1N.N1"D")!(Y?1N.N1"d")!($L(Y)=1&("Tt"[Y!("Aa"[Y)!("Rr"[Y))) Q:"Rr"[Y D EN1^GMRGTGI2 Q
I Y'?1"?".E W !?3,$C(7),"Incorrect response, enter a '?' for more help."
I Y?1"?".E S XQH="GMRG-EDIT CHOICES" D EN^XQH K XQH
G CHADE
EN3 ; SELECT PACKAGE FOR WHICH ADDING TERMS
W !!,"PACKAGE REFERENCE: " R X:DTIME G Q3:"^^"[X!'$T
I $L(X)<2!($L(X)>5)!(X?1P.E) W !?5,$C(7),"This is a reference for which to identify which package an aggregate",!?5,"term entry belongs. Answer must be 2-5 characters in length.",!!?5,"References already used include: " D LP G EN3
S GMRGPK=X D EN1
Q3 K GMRGLP,GMRGPK
Q
LP ;
S X="" F GMRGLP=0:0 S X=$O(^GMRD(124.2,"AA",X)) Q:X="" W !?18,X
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRGTGIF 3085 printed Oct 16, 2024@17:56:22 Page 2
GMRGTGIF ;HIRMFO/DDA,RM-TEXT GENERATOR PRIME DOCUMENT EDIT ;1/23/96
+1 ;;3.0;Text Generator;;Jan 24, 1996
EN1 ; ENTRY TO ADD DATA TO AGGREGATE TERM FILE IF PACKAGE IS UNKNOWN
+1 if '$DATA(GMRGPK)
QUIT
+2 WRITE !
SET DX=$X
SET DY=0
XECUTE ^%ZOSF("XY")
+3 SET DIC("S")="I $S($P(^(0),U,4)="""":0,'$D(^GMRD(124.25,$P(^GMRD(124.2,+Y,0),U,4),0)):0,$P(^(0),U)=""PRIME DOCUMENT"":1,1:0)"
SET DIC("A")="Select Prime Document to be modified: "
SET DIC="^GMRD(124.2,"
SET DIC(0)="AEQML"
SET DLAYGO=124.2
+4 SET DIC("DR")=".03///^S X=GMRGPK;.02///^S X=2;.04///^S X=""PRIME DOCUMENT"""
+5 DO ^DIC
KILL DIC,DLAYGO
+6 if +Y'>0
GOTO Q
SET GMRGRT=+Y
DO EN4
IF GMRGOUT
KILL GMRGOUT,GMRGRT
QUIT
+7 GOTO EN1
EN4 ; ENTRY TO ADD DATA IF PACKAGE AND PRIME DOCUMENT ARE BOTH KNOWN
+1 ; GMRGPK=PACKAGE REFERENCE GMRGRT=PRIME DOCUMENT IN AGG. TERM FILE
+2 if '$DATA(GMRGPK)!'$DATA(GMRGRT)
QUIT
SET GMRGRT(0)=$SELECT($DATA(^GMRD(124.2,GMRGRT,0)):^(0),1:"")
SET IOP="HOME"
SET (GMRGLEVL,GMRGUP,GMRGOUT)=0
DO ^%ZIS
SET GMRGINFO=GMRGRT
DO INFOSET^GMRGTGI0
A DO EN2
if GMRGUP
GOTO Q
if 'GMRGOUT
GOTO A
Q LOCK -^GMRD(124.2,+GMRGINFO,0)
KILL ^TMP($JOB),%,D0,DA,DIC,DIE,DIK,DINUM,DR,DTOUT,GMRGANW,GMRGDOL,GMRGDUP,GMRGINFO,GMRGL,GMRGLEVL,GMRGNOL,GMRGNUP,GMRGOK,GMRGR,GMRGS,GMRGSEL,GMRGT,GMRGU,GMRGUP,GMRGW,GMRGX,GMRGY,GMRGZ,I
+1 QUIT
EN2 ; ENTRY TO MODIFY A PRIME DOCUMENT GMRGRT=PRIME DOC. (PTR TO 124.2),
+1 ; GMRGINFO AND GMRGINFO( WHICH CONTAINS THE FOLLOWING ELEMEMTS:
+2 ; GMRGINFO = AGGY ENTRY WHICH FOLLOWING INFO PERTAINS (PTR FILE 124.2)
+3 ; GMRGINFO("PACK")=PACKAGE (PTR TO FILE 9.4).
+4 ; GMRGINFO("TYPE")=$S(1:"DOCUMENT",2:"FRAME",3:"TERM"),
+5 ; GMRGINFO("LEAD"),GMRGINFO("TRAIL")= LEAD OR TRAIL TEXT 1-200 CHARS.
+6 ; GMRGINFO("TEXT")= TEXT OF TERM ^ NODE IDENTIFIER
+7 ; GMRGINFO("FORM")=$S("B":"BRIEF TABULAR","T":"TABULAR",S:"SENTENCE")
+8 ; GMRGINFO("CLAS")=CLASSIFICATION (PTR TO FILE 124.25) ^ CLASS. TEXT
+9 ; GMRGINFO("MAX"),GMRGINFO("MIN")= MIN OR MAX # OF SELECTABLE ITEMS
+10 ; GMRGINFO("ACTS"),GMRGINFO("ACTF") = SELECTION OR FILING ACTION
+11 ; GMRGINFO("SEL") = # OF CHILDREN FOR THIS ENTRY
+12 ; GMRGINFO("SEL",SELECTION #) = SELCTION IEN (ENTRY IN CHILD MULT) ^
+13 ; SELECTION PTR (PTR TO 124.2) ^ SELECTION TEXT
+14 KILL GMRGXVER
DO DISP^GMRGTGI1
if GMRGOUT
QUIT
CHADE ; CHOOSE DELETE/ADD/EDIT A SELECTION, OR EDIT THE ENTRY
+1 WRITE !!,"Enter appropriate action, or type a '?' to see what you can do: "
READ Y:DTIME
+2 if Y="^"!(Y="^^")!'$TEST
SET GMRGOUT=1
if GMRGOUT
QUIT
IF '$LENGTH(Y)!(Y?1N.N0.1"@")!(Y?1N.N1"D")!(Y?1N.N1"d")!($LENGTH(Y)=1)
if '$LENGTH(Y)
SET GMRGUP=1
if GMRGUP
QUIT
IF Y?1N.N0.1"@"!(Y?1N.N1"D")!(Y?1N.N1"d")!($LENGTH(Y)=1&("Tt"[Y!("Aa"[Y)!("Rr"[Y)))
if "Rr"[Y
QUIT
DO EN1^GMRGTGI2
QUIT
+3 IF Y'?1"?".E
WRITE !?3,$CHAR(7),"Incorrect response, enter a '?' for more help."
+4 IF Y?1"?".E
SET XQH="GMRG-EDIT CHOICES"
DO EN^XQH
KILL XQH
+5 GOTO CHADE
EN3 ; SELECT PACKAGE FOR WHICH ADDING TERMS
+1 WRITE !!,"PACKAGE REFERENCE: "
READ X:DTIME
if "^^"[X!'$TEST
GOTO Q3
+2 IF $LENGTH(X)<2!($LENGTH(X)>5)!(X?1P.E)
WRITE !?5,$CHAR(7),"This is a reference for which to identify which package an aggregate",!?5,"term entry belongs. Answer must be 2-5 characters in length.",!!?5,"References already used include: "
DO LP
GOTO EN3
+3 SET GMRGPK=X
DO EN1
Q3 KILL GMRGLP,GMRGPK
+1 QUIT
LP ;
+1 SET X=""
FOR GMRGLP=0:0
SET X=$ORDER(^GMRD(124.2,"AA",X))
if X=""
QUIT
WRITE !?18,X
+2 QUIT