GMRCP5B ;SLC/DCM,RJS,WAT - Print Consult form 513 (Gather Data - Footers, Provisional Diagnosis and Reason For Request) ;09/10/08
;;3.0;CONSULT/REQUEST TRACKING;**4,13,12,15,24,23,22,29,65**;Dec 27, 1997;Build 7
;
; Patch #23 add "SERVICE RENDERED AS:" to SF513
; This routine invokes IA #1252 (SDUTL3),#10112 (VASITE)
; DBIA 10035 ;PATIENT FILE
; DBIA 2849 ;PROTOCOL
; DBIA 10060 ;NEW PERSON
; DBIA 10061 ;VADPT
; 10103 ;FMTE^XLFDT
; 10003 ;%DT
; 2056 ;$$GET1^DIQ
; ICR 4156 ;REGISTRATION, COMBAT VETERAN STATUS
Q
;
INIT(GMRCSG) ; Initialize the form
;
D HDR^GMRCP5D,FTR(.GMRCSG),REQUEST,PDIAG Q
;
REQUEST ;
N GMRCX
;
I $L($T(OUTPTPR^SDUTL3)) D
.S GMRCX=$P($$OUTPTPR^SDUTL3(DFN),U,2)
.D:$L(GMRCX) BLD("REQ",1,1,0,"Current Primary Care Provider: "_GMRCX)
I $L($T(OUTPTTM^SDUTL3)) D
.S GMRCX=$P($$OUTPTTM^SDUTL3(DFN),U,2)
.D:$L(GMRCX) BLD("REQ",1,1,0," Current Primary Care Team: "_GMRCX)
;
I $O(^TMP("GMRC",$J,"OUTPUT","REQ",0)) D BLD("REQ",1,1,0,"")
;
D SUB("H","REQ",1,"Reason For Request continued.")
D SUB("H","REQ",1," ")
;
D BLD("REQ",1,1,0,"REASON FOR REQUEST: (Complaints and findings)")
I '$O(^GMR(123,GMRCIFN,20,0)) D BLD("REQ",1,1,0,"") I 1
E D
.N LN S LN=0 F S LN=$O(^GMR(123,GMRCIFN,20,LN)) Q:LN="" D
..D BLD("REQ",1,1,0,^GMR(123,GMRCIFN,20,LN,0))
;
Q
PDIAG ;
;
D BLD("PDIAG",1,1,0,"PROVISIONAL DIAG: "_$G(^GMR(123,GMRCIFN,30)))
D BLD("PDIAG",1,1,0,GMRCDVL)
;
S (GMRCQSTR,GMRCPGR,GMRCIPH,GMRCQSTT)=""
;
I $S('$P(GMRCRD,U,23):1,$P(GMRCRD(12),U,5)="P":1,1:0) D
.S GMRCQSTR=$P(GMRCRD,U,14)
.S:'GMRCQSTR GMRCQSTR=$$GET1^DIQ(100,+$P(GMRCRD,U,3),1)
.S GMRCPGR=$$GET1^DIQ(200,+$G(GMRCQSTR),.137) S:'$L(GMRCPGR) GMRCPGR=$$GET1^DIQ(200,+$G(GMRCQSTR),.138)
.S GMRCIPH=$$GET1^DIQ(200,+$G(GMRCQSTR),.132)
.;
.S GMRCQSTT=$$GET1^DIQ(200,+$G(GMRCQSTR),20.3)
.S:'$L(GMRCQSTT) GMRCQSTT=$$GET1^DIQ(200,+$G(GMRCQSTR),8)
.S GMRCQSTR=$$GET1^DIQ(200,+$G(GMRCQSTR),.01)
;
I $P(GMRCRD,U,23),$P(GMRCRD(12),U,5)="F" D
.S GMRCQSTR=$P(GMRCRD(12),U,6)
.S GMRCIPH=$P(GMRCRD(13),U,2)
.S GMRCPGR=$P(GMRCRD(13),U,3)
;
S GMRCIPH="(Phone: "_GMRCIPH_")"
S GMRCPGR="(Pager: "_GMRCPGR_")"
;
D BLD("PDIAG",1,1,0,"REQUESTED BY: ")
D BLD("PDIAG",1,0,35,"|PLACE:")
D BLD("PDIAG",1,0,59,"|URGENCY:")
;
D BLD("PDIAG",1,1,0,$E(GMRCQSTR,1,37))
D BLD("PDIAG",1,0,35,"|"_$E($P($G(^ORD(101,+$P(GMRCRD,U,10),0)),U,2),1,20))
D BLD("PDIAG",1,0,59,"|"_$E($P($G(^ORD(101,+$P(GMRCRD,U,9),0)),U,2),1,18))
;
I $L(GMRCQSTT) D
.D BLD("PDIAG",1,1,0,GMRCQSTT)
.D BLD("PDIAG",1,0,35,"|")
.D BLD("PDIAG",1,0,59,"|")
D BLD("PDIAG",1,1,0,GMRCPGR)
D BLD("PDIAG",1,0,35,"|SERVICE RENDERED AS:")
D BLD("PDIAG",1,0,59,"|")
S GMRCINOU=$S($P(GMRCRD,U,18)="O":"Outpatient",1:"Inpatient")
I $D(GMRCIPH)>0 D
.D BLD("PDIAG",1,1,0,GMRCIPH)
.D BLD("PDIAG",1,0,35,"|"_GMRCINOU)
E D
.D BLD("PDIAG",1,1,35,"|"_GMRCINOU)
D BLD("PDIAG",1,0,59,"|")
K GMRCINOU
;***************************************************************
D BLD("PDIAG",1,1,0,GMRCDVL)
;
Q
;
FTR(GMRCSG) ;Footer of form 513
;
N GMRCRMBD,GMRCFAC1,GMRCLOC,GMRCX,SUB,VAIN,VAPA,VAERR
;
D ADD^VADPT,INP^VADPT
;
S (GMRCLOC,GMRCRMBD)=""
S GMRCLOC=$P($G(VAIN(4)),U,2)
S GMRCRMBD=$G(VAIN(5))
S:'$L(GMRCLOC) GMRCLOC=$P($G(^SC(+$P($G(^GMR(123,+GMRCIFN,0)),U,4),0)),U,1)
;No location, IFC - consulting site
I '$L(GMRCLOC),$P(GMRCRD,U,23),$P($G(GMRCRD(12)),U,5)="F" D
.I $P(GMRCRD,U,21) S GMRCLOC=$$GET1^DIQ(4,$P(GMRCRD,U,21),.01)
.E S GMRCLOC=$$GET1^DIQ(4,$P(GMRCRD,U,23),.01)
S:'$L(GMRCLOC) GMRCLOC=GMRCUL
;
D BLD("FTR",0,1,0,GMRCEQL)
D BLD("FTR",1,1,0,GMRCEQL)
;
I ($G(GMRCSG("GMRCSIGM"))="electronic") D I 1
.D BLD("FTR",0,1,0,"SIGNATURE & TITLE: ")
.D BLD("FTR",0,0,20,$G(GMRCSG("GMRCSIG"))_" /es/")
.D BLD("FTR",0,0,54,"|")
.D BLD("FTR",0,1,20,$G(GMRCSG("GMRCSIGT")))
.D BLD("FTR",0,0,54,"|DATE: "_$$EXDT($G(GMRCSG("GMRCSDT"))))
E D
.D BLD("FTR",0,1,0,"AUTHOR & TITLE: ")
.D BLD("FTR",0,0,20,$G(GMRCSG("GMRCSIG")))
.D BLD("FTR",0,0,54,"|")
.D BLD("FTR",0,1,20,$G(GMRCSG("GMRCSIGT")))
.D BLD("FTR",0,0,54,"|DATE: "_$$EXDT($G(GMRCSG("GMRCSDT"))))
;
S GMRCFAC1=+$G(DUZ(2))
S:'GMRCFAC1 GMRCFAC1=+$$SITE^VASITE()
S GMRCFAC1=$$GET1^DIQ(4,+GMRCFAC1,.01)
;
D BLD("FTR",0,1,0,GMRCDVL)
D BLD("FTR",0,1,0,"ID #:"_$E(GMRCUL,1,8))
D BLD("FTR",0,0,12,"|ORGANIZATION:"_$J($E(GMRCFAC1,1,17),17))
D BLD("FTR",0,0,45,"|REG #:"_$E(GMRCUL,1,4))
D BLD("FTR",0,0,58,"|LOC: "_$E($G(GMRCLOC),1,11))
;
I $L(GMRCRMBD) D I 1
.D BLD("FTR",0,1,12,"|")
.D BLD("FTR",0,0,45,"|")
.D BLD("FTR",0,0,58,"|RM/BD: "_GMRCRMBD)
;
D BLD("FTR",0,1,0,GMRCDVL)
;
F SUB=0,1 D
.I SUB D BLD("FTR",SUB,1,33,"Page ","GMRCPG,38"_" FIRST ONE") I 1
.E I '$G(GMRCGUI) D BLD("FTR",SUB,1,33,"Page ","GMRCPG,38"_" SECOND ONE")
I $G(GMRCPG)=0 D BLD("FTR",0,1,51,"Standard Form 513 (Rev 9-77)")
Q
;
CONSRQ(GMRCRQ) ;
;
N ORND,ORFL,REF
I '$L(GMRCRQ) Q "Consult"
S ORND=$P(GMRCRQ,";",1),ORFL=$P(GMRCRQ,";",2),REF=U_ORFL_ORND_",0)"
S GMRCRQ=$P($G(@(REF)),U,2)
Q:$L(GMRCRQ) GMRCRQ Q "Consult"
;
EXDT(X) ;EXTERNAL DATE FORMAT
;
N DATE,TIME,HR,MN,PD,Y,%DT
Q:'$L(X) ""
I '(X?7N.1".".6N) S %DT="PTS" D ^%DT S X=Y
Q $$FMTE^XLFDT(X,"5PMZ")
;
PRCMT(CMT) ;
;
Q $P($G(^GMR(123.1,+CMT,0)),U,8)
;
;
BLD(SUB,NDX,LINE,TAB,TEXT,RUNTIME) ;
;
Q:'$L($G(SUB))
N LINECNT
;
F LINECNT=1:1:+LINE S ^TMP("GMRC",$J,"OUTPUT",SUB,NDX,$$LASTLN(SUB,NDX)+1,0)=""
;
S $E(^TMP("GMRC",$J,"OUTPUT",SUB,NDX,$$LASTLN(SUB,NDX),0),TAB+1)=TEXT
I $L($G(RUNTIME)) S ^TMP("GMRC",$J,"OUTPUT",SUB,NDX,$$LASTLN(SUB,NDX),1)=RUNTIME
;
S GMRCLAST=SUB
Q
;
SUB(ZONE,SUB,NDX,TEXT) ;
;
N NEXT
S NEXT=$O(^TMP("GMRC",$J,"OUTPUT",SUB,NDX,ZONE," "),-1)+1
S ^TMP("GMRC",$J,"OUTPUT",SUB,NDX,ZONE,NEXT,0)=TEXT
Q
;
LASTLN(SUB,NDX) ;
Q +$O(^TMP("GMRC",$J,"OUTPUT",SUB,NDX," "),-1)
;
GMRCP5B ;SLC/DCM,RJS,WAT - Print Consult form 513 (Gather Data - Footers, Provisional Diagnosis and Reason For Request) ;09/10/08
+1 ;;3.0;CONSULT/REQUEST TRACKING;**4,13,12,15,24,23,22,29,65**;Dec 27, 1997;Build 7
+2 ;
+3 ; Patch #23 add "SERVICE RENDERED AS:" to SF513
+4 ; This routine invokes IA #1252 (SDUTL3),#10112 (VASITE)
+5 ; DBIA 10035 ;PATIENT FILE
+6 ; DBIA 2849 ;PROTOCOL
+7 ; DBIA 10060 ;NEW PERSON
+8 ; DBIA 10061 ;VADPT
+9 ; 10103 ;FMTE^XLFDT
+10 ; 10003 ;%DT
+11 ; 2056 ;$$GET1^DIQ
+12 ; ICR 4156 ;REGISTRATION, COMBAT VETERAN STATUS
+13 QUIT
+14 ;
INIT(GMRCSG) ; Initialize the form
+1 ;
+2 DO HDR^GMRCP5D
DO FTR(.GMRCSG)
DO REQUEST
DO PDIAG
QUIT
+3 ;
REQUEST ;
+1 NEW GMRCX
+2 ;
+3 IF $LENGTH($TEXT(OUTPTPR^SDUTL3))
Begin DoDot:1
+4 SET GMRCX=$PIECE($$OUTPTPR^SDUTL3(DFN),U,2)
+5 IF $LENGTH(GMRCX)
DO BLD("REQ",1,1,0,"Current Primary Care Provider: "_GMRCX)
End DoDot:1
+6 IF $LENGTH($TEXT(OUTPTTM^SDUTL3))
Begin DoDot:1
+7 SET GMRCX=$PIECE($$OUTPTTM^SDUTL3(DFN),U,2)
+8 IF $LENGTH(GMRCX)
DO BLD("REQ",1,1,0," Current Primary Care Team: "_GMRCX)
End DoDot:1
+9 ;
+10 IF $ORDER(^TMP("GMRC",$JOB,"OUTPUT","REQ",0))
DO BLD("REQ",1,1,0,"")
+11 ;
+12 DO SUB("H","REQ",1,"Reason For Request continued.")
+13 DO SUB("H","REQ",1," ")
+14 ;
+15 DO BLD("REQ",1,1,0,"REASON FOR REQUEST: (Complaints and findings)")
+16 IF '$ORDER(^GMR(123,GMRCIFN,20,0))
DO BLD("REQ",1,1,0,"")
IF 1
+17 IF '$TEST
Begin DoDot:1
+18 NEW LN
SET LN=0
FOR
SET LN=$ORDER(^GMR(123,GMRCIFN,20,LN))
IF LN=""
QUIT
Begin DoDot:2
+19 DO BLD("REQ",1,1,0,^GMR(123,GMRCIFN,20,LN,0))
End DoDot:2
End DoDot:1
+20 ;
+21 QUIT
PDIAG ;
+1 ;
+2 DO BLD("PDIAG",1,1,0,"PROVISIONAL DIAG: "_$GET(^GMR(123,GMRCIFN,30)))
+3 DO BLD("PDIAG",1,1,0,GMRCDVL)
+4 ;
+5 SET (GMRCQSTR,GMRCPGR,GMRCIPH,GMRCQSTT)=""
+6 ;
+7 IF $SELECT('$PIECE(GMRCRD,U,23):1,$PIECE(GMRCRD(12),U,5)="P":1,1:0)
Begin DoDot:1
+8 SET GMRCQSTR=$PIECE(GMRCRD,U,14)
+9 IF 'GMRCQSTR
SET GMRCQSTR=$$GET1^DIQ(100,+$PIECE(GMRCRD,U,3),1)
+10 SET GMRCPGR=$$GET1^DIQ(200,+$GET(GMRCQSTR),.137)
IF '$LENGTH(GMRCPGR)
SET GMRCPGR=$$GET1^DIQ(200,+$GET(GMRCQSTR),.138)
+11 SET GMRCIPH=$$GET1^DIQ(200,+$GET(GMRCQSTR),.132)
+12 ;
+13 SET GMRCQSTT=$$GET1^DIQ(200,+$GET(GMRCQSTR),20.3)
+14 IF '$LENGTH(GMRCQSTT)
SET GMRCQSTT=$$GET1^DIQ(200,+$GET(GMRCQSTR),8)
+15 SET GMRCQSTR=$$GET1^DIQ(200,+$GET(GMRCQSTR),.01)
End DoDot:1
+16 ;
+17 IF $PIECE(GMRCRD,U,23)
IF $PIECE(GMRCRD(12),U,5)="F"
Begin DoDot:1
+18 SET GMRCQSTR=$PIECE(GMRCRD(12),U,6)
+19 SET GMRCIPH=$PIECE(GMRCRD(13),U,2)
+20 SET GMRCPGR=$PIECE(GMRCRD(13),U,3)
End DoDot:1
+21 ;
+22 SET GMRCIPH="(Phone: "_GMRCIPH_")"
+23 SET GMRCPGR="(Pager: "_GMRCPGR_")"
+24 ;
+25 DO BLD("PDIAG",1,1,0,"REQUESTED BY: ")
+26 DO BLD("PDIAG",1,0,35,"|PLACE:")
+27 DO BLD("PDIAG",1,0,59,"|URGENCY:")
+28 ;
+29 DO BLD("PDIAG",1,1,0,$EXTRACT(GMRCQSTR,1,37))
+30 DO BLD("PDIAG",1,0,35,"|"_$EXTRACT($PIECE($GET(^ORD(101,+$PIECE(GMRCRD,U,10),0)),U,2),1,20))
+31 DO BLD("PDIAG",1,0,59,"|"_$EXTRACT($PIECE($GET(^ORD(101,+$PIECE(GMRCRD,U,9),0)),U,2),1,18))
+32 ;
+33 IF $LENGTH(GMRCQSTT)
Begin DoDot:1
+34 DO BLD("PDIAG",1,1,0,GMRCQSTT)
+35 DO BLD("PDIAG",1,0,35,"|")
+36 DO BLD("PDIAG",1,0,59,"|")
End DoDot:1
+37 DO BLD("PDIAG",1,1,0,GMRCPGR)
+38 DO BLD("PDIAG",1,0,35,"|SERVICE RENDERED AS:")
+39 DO BLD("PDIAG",1,0,59,"|")
+40 SET GMRCINOU=$SELECT($PIECE(GMRCRD,U,18)="O":"Outpatient",1:"Inpatient")
+41 IF $DATA(GMRCIPH)>0
Begin DoDot:1
+42 DO BLD("PDIAG",1,1,0,GMRCIPH)
+43 DO BLD("PDIAG",1,0,35,"|"_GMRCINOU)
End DoDot:1
+44 IF '$TEST
Begin DoDot:1
+45 DO BLD("PDIAG",1,1,35,"|"_GMRCINOU)
End DoDot:1
+46 DO BLD("PDIAG",1,0,59,"|")
+47 KILL GMRCINOU
+48 ;***************************************************************
+49 DO BLD("PDIAG",1,1,0,GMRCDVL)
+50 ;
+51 QUIT
+52 ;
FTR(GMRCSG) ;Footer of form 513
+1 ;
+2 NEW GMRCRMBD,GMRCFAC1,GMRCLOC,GMRCX,SUB,VAIN,VAPA,VAERR
+3 ;
+4 DO ADD^VADPT
DO INP^VADPT
+5 ;
+6 SET (GMRCLOC,GMRCRMBD)=""
+7 SET GMRCLOC=$PIECE($GET(VAIN(4)),U,2)
+8 SET GMRCRMBD=$GET(VAIN(5))
+9 IF '$LENGTH(GMRCLOC)
SET GMRCLOC=$PIECE($GET(^SC(+$PIECE($GET(^GMR(123,+GMRCIFN,0)),U,4),0)),U,1)
+10 ;No location, IFC - consulting site
+11 IF '$LENGTH(GMRCLOC)
IF $PIECE(GMRCRD,U,23)
IF $PIECE($GET(GMRCRD(12)),U,5)="F"
Begin DoDot:1
+12 IF $PIECE(GMRCRD,U,21)
SET GMRCLOC=$$GET1^DIQ(4,$PIECE(GMRCRD,U,21),.01)
+13 IF '$TEST
SET GMRCLOC=$$GET1^DIQ(4,$PIECE(GMRCRD,U,23),.01)
End DoDot:1
+14 IF '$LENGTH(GMRCLOC)
SET GMRCLOC=GMRCUL
+15 ;
+16 DO BLD("FTR",0,1,0,GMRCEQL)
+17 DO BLD("FTR",1,1,0,GMRCEQL)
+18 ;
+19 IF ($GET(GMRCSG("GMRCSIGM"))="electronic")
Begin DoDot:1
+20 DO BLD("FTR",0,1,0,"SIGNATURE & TITLE: ")
+21 DO BLD("FTR",0,0,20,$GET(GMRCSG("GMRCSIG"))_" /es/")
+22 DO BLD("FTR",0,0,54,"|")
+23 DO BLD("FTR",0,1,20,$GET(GMRCSG("GMRCSIGT")))
+24 DO BLD("FTR",0,0,54,"|DATE: "_$$EXDT($GET(GMRCSG("GMRCSDT"))))
End DoDot:1
IF 1
+25 IF '$TEST
Begin DoDot:1
+26 DO BLD("FTR",0,1,0,"AUTHOR & TITLE: ")
+27 DO BLD("FTR",0,0,20,$GET(GMRCSG("GMRCSIG")))
+28 DO BLD("FTR",0,0,54,"|")
+29 DO BLD("FTR",0,1,20,$GET(GMRCSG("GMRCSIGT")))
+30 DO BLD("FTR",0,0,54,"|DATE: "_$$EXDT($GET(GMRCSG("GMRCSDT"))))
End DoDot:1
+31 ;
+32 SET GMRCFAC1=+$GET(DUZ(2))
+33 IF 'GMRCFAC1
SET GMRCFAC1=+$$SITE^VASITE()
+34 SET GMRCFAC1=$$GET1^DIQ(4,+GMRCFAC1,.01)
+35 ;
+36 DO BLD("FTR",0,1,0,GMRCDVL)
+37 DO BLD("FTR",0,1,0,"ID #:"_$EXTRACT(GMRCUL,1,8))
+38 DO BLD("FTR",0,0,12,"|ORGANIZATION:"_$JUSTIFY($EXTRACT(GMRCFAC1,1,17),17))
+39 DO BLD("FTR",0,0,45,"|REG #:"_$EXTRACT(GMRCUL,1,4))
+40 DO BLD("FTR",0,0,58,"|LOC: "_$EXTRACT($GET(GMRCLOC),1,11))
+41 ;
+42 IF $LENGTH(GMRCRMBD)
Begin DoDot:1
+43 DO BLD("FTR",0,1,12,"|")
+44 DO BLD("FTR",0,0,45,"|")
+45 DO BLD("FTR",0,0,58,"|RM/BD: "_GMRCRMBD)
End DoDot:1
IF 1
+46 ;
+47 DO BLD("FTR",0,1,0,GMRCDVL)
+48 ;
+49 FOR SUB=0,1
Begin DoDot:1
+50 IF SUB
DO BLD("FTR",SUB,1,33,"Page ","GMRCPG,38"_" FIRST ONE")
IF 1
+51 IF '$TEST
IF '$GET(GMRCGUI)
DO BLD("FTR",SUB,1,33,"Page ","GMRCPG,38"_" SECOND ONE")
End DoDot:1
+52 IF $GET(GMRCPG)=0
DO BLD("FTR",0,1,51,"Standard Form 513 (Rev 9-77)")
+53 QUIT
+54 ;
CONSRQ(GMRCRQ) ;
+1 ;
+2 NEW ORND,ORFL,REF
+3 IF '$LENGTH(GMRCRQ)
QUIT "Consult"
+4 SET ORND=$PIECE(GMRCRQ,";",1)
SET ORFL=$PIECE(GMRCRQ,";",2)
SET REF=U_ORFL_ORND_",0)"
+5 SET GMRCRQ=$PIECE($GET(@(REF)),U,2)
+6 IF $LENGTH(GMRCRQ)
QUIT GMRCRQ
QUIT "Consult"
+7 ;
EXDT(X) ;EXTERNAL DATE FORMAT
+1 ;
+2 NEW DATE,TIME,HR,MN,PD,Y,%DT
+3 IF '$LENGTH(X)
QUIT ""
+4 IF '(X?7N.1".".6N)
SET %DT="PTS"
DO ^%DT
SET X=Y
+5 QUIT $$FMTE^XLFDT(X,"5PMZ")
+6 ;
PRCMT(CMT) ;
+1 ;
+2 QUIT $PIECE($GET(^GMR(123.1,+CMT,0)),U,8)
+3 ;
+4 ;
BLD(SUB,NDX,LINE,TAB,TEXT,RUNTIME) ;
+1 ;
+2 IF '$LENGTH($GET(SUB))
QUIT
+3 NEW LINECNT
+4 ;
+5 FOR LINECNT=1:1:+LINE
SET ^TMP("GMRC",$JOB,"OUTPUT",SUB,NDX,$$LASTLN(SUB,NDX)+1,0)=""
+6 ;
+7 SET $EXTRACT(^TMP("GMRC",$JOB,"OUTPUT",SUB,NDX,$$LASTLN(SUB,NDX),0),TAB+1)=TEXT
+8 IF $LENGTH($GET(RUNTIME))
SET ^TMP("GMRC",$JOB,"OUTPUT",SUB,NDX,$$LASTLN(SUB,NDX),1)=RUNTIME
+9 ;
+10 SET GMRCLAST=SUB
+11 QUIT
+12 ;
SUB(ZONE,SUB,NDX,TEXT) ;
+1 ;
+2 NEW NEXT
+3 SET NEXT=$ORDER(^TMP("GMRC",$JOB,"OUTPUT",SUB,NDX,ZONE," "),-1)+1
+4 SET ^TMP("GMRC",$JOB,"OUTPUT",SUB,NDX,ZONE,NEXT,0)=TEXT
+5 QUIT
+6 ;
LASTLN(SUB,NDX) ;
+1 QUIT +$ORDER(^TMP("GMRC",$JOB,"OUTPUT",SUB,NDX," "),-1)
+2 ;