GMRGTGI1 ;HIRMFO/RM-PRIME DOCUMENT EDIT (cont.) ;9/1/95
;;3.0;Text Generator;;Jan 24, 1996
DISP ; DISPLAY CHARACTERISTICS OF THIS TERM
W !!,$P(GMRGINFO("TEXT"),"^")
I $P(GMRGINFO("CLAS"),"^",2)'="" W !?3,"Classification: "_$P(GMRGINFO("CLAS"),"^",2)_" "
E W:GMRGINFO("FORM")'="" !?3
I GMRGINFO("FORM")'="" W "Output Format: "_$S(GMRGINFO("FORM")="B":"BRIEF TABULAR",GMRGINFO("FORM")="T":"TABULAR",1:"SENTENCE")
W !?3,"Type of Term: ",$S(GMRGINFO("TYPE")=2:"FRAME",1:"TERM")
I GMRGINFO("ADD")'="" W ?25,"Ask Additional Text: ",$S(GMRGINFO("ADD"):"YES",1:"NO")
I GMRGINFO("MAX")'=""!(GMRGINFO("MIN")'="") W !?3,$S(GMRGINFO("MIN")'="":"Minimum number of selections: "_+GMRGINFO("MIN")_" ",1:""),$S(GMRGINFO("MAX")'="":"Maximum number of selections: "_+GMRGINFO("MAX"),1:"")
I GMRGINFO("SMES")'="" W !?3,"Supress min/max message: ",$S('GMRGINFO("SMES"):"NO SUPRESSION",1:"SUPRESS "_$S(GMRGINFO("SMES")=1:"MIN MESSAGE",GMRGINFO("SMES")=2:"MAX MESSAGE",1:"BOTH MESSAGES"))
I GMRGINFO("SPLIT")'=""!(GMRGINFO("TTOP")'="") W !?3,$S(GMRGINFO("SPLIT")'="":"Split Screen: "_$S(GMRGINFO("SPLIT"):"YES",1:"NO")_" ",1:""),$S(GMRGINFO("TTOP")'="":"Text on top: "_$S(GMRGINFO("TTOP"):"YES",1:"NO"),1:"")
I GMRGINFO("LEAD")'="" W !?3,"Lead Text: " S GMRGL=IOM-14,GMRGPLN=GMRGINFO("LEAD") F GMRG1=1:1 Q:GMRGPLN="" S GMRGLEN=GMRGL D FITLINE^GMRGRUT1 W ?14,GMRGPLN(0) W:GMRGPLN(1)'="" ! S GMRGPLN=GMRGPLN(1)
I GMRGINFO("TRAIL")'="" W !?3,"Trail Text: " S GMRGL=IOM-15,GMRGPLN=GMRGINFO("TRAIL") F GMRG1=1:1 Q:GMRGPLN="" S GMRGLEN=GMRGL D FITLINE^GMRGRUT1 W ?15,GMRGPLN(0) W:GMRGPLN(1)'="" ! S GMRGPLN=GMRGPLN(1)
F GMRGW=0:0 S GMRGW=$O(GMRGINFO("SEL",GMRGW)) Q:GMRGW'>0 D PRTCHC Q:GMRGOUT
S:GMRGOUT GMRGOUT=$S(GMRGOUT=1:0,1:1) Q:GMRGOUT
Q
PRTCHC ; LIST SELECTION AND ADD TO THE GMRGSEL ARRAY
I '(GMRGW#10),GMRGW\10,'GMRGOUT W !?9,"""^"" TO STOP " R Y:DTIME S:'$T!(Y="^")!(Y="^^") GMRGOUT=$S(Y="^":1,1:2)
I 'GMRGOUT W !?(6-$L(GMRGW)),GMRGW,". ",$P(GMRGINFO("SEL",GMRGW),"^",3),?$X+6,$S($P(GMRGINFO("SEL",GMRGW),"^",4)'="":"("_$P(GMRGINFO("SEL",GMRGW),"^",4)_")",1:"")
Q
DOWN ; GO DOWN A LEVEL INTO THE CARE PLAN
S GMRGLEVL=GMRGLEVL+1,^TMP($J,"GMRGINFO",GMRGLEVL)=GMRGINFO
S GMRGNOL=0 L +^GMRD(124.2,GMRGSEL,0):1 G:$T CNTD
LKDQ W !,$C(7),"ANOTHER TERMINAL IS EDITING THIS ENTRY",!,"Do you wish to wait for this entry" S %=0 D YN^DICN
I '% W !?3,"If you think that the person editing this entry is only doing so",!?3,"temporarily, and you will be able to continue answer Yes, else answer No." G LKDQ
S:%=2 GMRGNOL=1 S:%=-1 GMRGOUT=1 Q:GMRGOUT!GMRGNOL I %=1 L +^GMRD(124.2,GMRGSEL,0):600 G:'$T LKDQ
CNTD L -^GMRD(124.2,+GMRGINFO,0) K GMRGINFO S GMRGINFO=GMRGSEL D INFOSET^GMRGTGI0
Q
UP ; GO UP A LEVEL IN THE CARE PLAN
S GMRGNOL=0 L +^GMRD(124.2,^TMP($J,"GMRGINFO",GMRGLEVL),0):1 G:$T CNTU
LKUQ W !,$C(7),"ANOTHER TERMINAL IS EDITING THIS ENTRY",!,"Do you wish to wait for this entry" S %=0 D YN^DICN
I '% W !?3,"If you think that the person editing this entry is only doing so",!?3,"temporarily, and you will be able to continue answer Yes, else answer No." G LKUQ
S:%=2 GMRGNOL=1 S:%=-1 GMRGOUT=1 Q:GMRGOUT!GMRGNOL I %=1 L +^GMRD(124.2,^TMP($J,"GMRGINFO",GMRGLEVL),0):600 G:'$T LKUQ
CNTU L -^GMRD(124.2,+GMRGINFO,0) K GMRGINFO S GMRGINFO=^TMP($J,"GMRGINFO",GMRGLEVL)
D INFOSET^GMRGTGI0
K ^TMP($J,"GMRGINFO",GMRGLEVL) S GMRGLEVL=GMRGLEVL-1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRGTGI1 3398 printed Dec 13, 2024@01:55:38 Page 2
GMRGTGI1 ;HIRMFO/RM-PRIME DOCUMENT EDIT (cont.) ;9/1/95
+1 ;;3.0;Text Generator;;Jan 24, 1996
DISP ; DISPLAY CHARACTERISTICS OF THIS TERM
+1 WRITE !!,$PIECE(GMRGINFO("TEXT"),"^")
+2 IF $PIECE(GMRGINFO("CLAS"),"^",2)'=""
WRITE !?3,"Classification: "_$PIECE(GMRGINFO("CLAS"),"^",2)_" "
+3 IF '$TEST
if GMRGINFO("FORM")'=""
WRITE !?3
+4 IF GMRGINFO("FORM")'=""
WRITE "Output Format: "_$SELECT(GMRGINFO("FORM")="B":"BRIEF TABULAR",GMRGINFO("FORM")="T":"TABULAR",1:"SENTENCE")
+5 WRITE !?3,"Type of Term: ",$SELECT(GMRGINFO("TYPE")=2:"FRAME",1:"TERM")
+6 IF GMRGINFO("ADD")'=""
WRITE ?25,"Ask Additional Text: ",$SELECT(GMRGINFO("ADD"):"YES",1:"NO")
+7 IF GMRGINFO("MAX")'=""!(GMRGINFO("MIN")'="")
WRITE !?3,$SELECT(GMRGINFO("MIN")'="":"Minimum number of selections: "_+GMRGINFO("MIN")_" ",1:""),$SELECT(GMRGINFO("MAX")'="":"Maximum number of selections: "_+GMRGINFO("MAX"),1:"")
+8 IF GMRGINFO("SMES")'=""
WRITE !?3,"Supress min/max message: ",$SELECT('GMRGINFO("SMES"):"NO SUPRESSION",1:"SUPRESS "_$SELECT(GMRGINFO("SMES")=1:"MIN MESSAGE",GMRGINFO("SMES")=2:"MAX MESSAGE",1:"BOTH MESSAGES"))
+9 IF GMRGINFO("SPLIT")'=""!(GMRGINFO("TTOP")'="")
WRITE !?3,$SELECT(GMRGINFO("SPLIT")'="":"Split Screen: "_$SELECT(GMRGINFO("SPLIT"):"YES",1:"NO")_" ",1:""),$SELECT(GMRGINFO("TTOP")'="":"Text on top: "_$SELECT(GMRGINFO("TTOP"):"YES",1:"NO"),1:"")
+10 IF GMRGINFO("LEAD")'=""
WRITE !?3,"Lead Text: "
SET GMRGL=IOM-14
SET GMRGPLN=GMRGINFO("LEAD")
FOR GMRG1=1:1
if GMRGPLN=""
QUIT
SET GMRGLEN=GMRGL
DO FITLINE^GMRGRUT1
WRITE ?14,GMRGPLN(0)
if GMRGPLN(1)'=""
WRITE !
SET GMRGPLN=GMRGPLN(1)
+11 IF GMRGINFO("TRAIL")'=""
WRITE !?3,"Trail Text: "
SET GMRGL=IOM-15
SET GMRGPLN=GMRGINFO("TRAIL")
FOR GMRG1=1:1
if GMRGPLN=""
QUIT
SET GMRGLEN=GMRGL
DO FITLINE^GMRGRUT1
WRITE ?15,GMRGPLN(0)
if GMRGPLN(1)'=""
WRITE !
SET GMRGPLN=GMRGPLN(1)
+12 FOR GMRGW=0:0
SET GMRGW=$ORDER(GMRGINFO("SEL",GMRGW))
if GMRGW'>0
QUIT
DO PRTCHC
if GMRGOUT
QUIT
+13 if GMRGOUT
SET GMRGOUT=$SELECT(GMRGOUT=1:0,1:1)
if GMRGOUT
QUIT
+14 QUIT
PRTCHC ; LIST SELECTION AND ADD TO THE GMRGSEL ARRAY
+1 IF '(GMRGW#10)
IF GMRGW\10
IF 'GMRGOUT
WRITE !?9,"""^"" TO STOP "
READ Y:DTIME
if '$TEST!(Y="^")!(Y="^^")
SET GMRGOUT=$SELECT(Y="^":1,1:2)
+2 IF 'GMRGOUT
WRITE !?(6-$LENGTH(GMRGW)),GMRGW,". ",$PIECE(GMRGINFO("SEL",GMRGW),"^",3),?$X+6,$SELECT($PIECE(GMRGINFO("SEL",GMRGW),"^",4)'="":"("_$PIECE(GMRGINFO("SEL",GMRGW),"^",4)_")",1:"")
+3 QUIT
DOWN ; GO DOWN A LEVEL INTO THE CARE PLAN
+1 SET GMRGLEVL=GMRGLEVL+1
SET ^TMP($JOB,"GMRGINFO",GMRGLEVL)=GMRGINFO
+2 SET GMRGNOL=0
LOCK +^GMRD(124.2,GMRGSEL,0):1
if $TEST
GOTO CNTD
LKDQ WRITE !,$CHAR(7),"ANOTHER TERMINAL IS EDITING THIS ENTRY",!,"Do you wish to wait for this entry"
SET %=0
DO YN^DICN
+1 IF '%
WRITE !?3,"If you think that the person editing this entry is only doing so",!?3,"temporarily, and you will be able to continue answer Yes, else answer No."
GOTO LKDQ
+2 if %=2
SET GMRGNOL=1
if %=-1
SET GMRGOUT=1
if GMRGOUT!GMRGNOL
QUIT
IF %=1
LOCK +^GMRD(124.2,GMRGSEL,0):600
if '$TEST
GOTO LKDQ
CNTD LOCK -^GMRD(124.2,+GMRGINFO,0)
KILL GMRGINFO
SET GMRGINFO=GMRGSEL
DO INFOSET^GMRGTGI0
+1 QUIT
UP ; GO UP A LEVEL IN THE CARE PLAN
+1 SET GMRGNOL=0
LOCK +^GMRD(124.2,^TMP($JOB,"GMRGINFO",GMRGLEVL),0):1
if $TEST
GOTO CNTU
LKUQ WRITE !,$CHAR(7),"ANOTHER TERMINAL IS EDITING THIS ENTRY",!,"Do you wish to wait for this entry"
SET %=0
DO YN^DICN
+1 IF '%
WRITE !?3,"If you think that the person editing this entry is only doing so",!?3,"temporarily, and you will be able to continue answer Yes, else answer No."
GOTO LKUQ
+2 if %=2
SET GMRGNOL=1
if %=-1
SET GMRGOUT=1
if GMRGOUT!GMRGNOL
QUIT
IF %=1
LOCK +^GMRD(124.2,^TMP($JOB,"GMRGINFO",GMRGLEVL),0):600
if '$TEST
GOTO LKUQ
CNTU LOCK -^GMRD(124.2,+GMRGINFO,0)
KILL GMRGINFO
SET GMRGINFO=^TMP($JOB,"GMRGINFO",GMRGLEVL)
+1 DO INFOSET^GMRGTGI0
+2 KILL ^TMP($JOB,"GMRGINFO",GMRGLEVL)
SET GMRGLEVL=GMRGLEVL-1
+3 QUIT