Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMRGPNB2

GMRGPNB2.m

Go to the documentation of this file.
GMRGPNB2 ;CISC/RM-SENTENCE BUILDER (cont.) ;2/15/91
 ;;3.0;Text Generator;;Jan 24, 1996
SNTP ;
 S GMRGC0=+GMRGSNT(GMRGSNT) Q:GMRGC0'>0  S GMRGE0=""
 S GMRGB0=$O(^GMR(124.3,GMRGPDA,1,"B",GMRGC0,0)) I GMRGB0>0 S GMRGST=GMRGB0,GMRGST(1)=GMRGPDA,GMRGST(2)=$S(GMRGCSW=1:%,1:GMRGPDT) D STAT^GMRGRUT0 S GMRGF0=GMRGSTAT,GMRGST=GMRGB0,GMRGST(1)=GMRGPDA,GMRGST(2)=GMRGPDT D STAT^GMRGRUT0
 I GMRGB0>0 S GMRGE0=$S($P(GMRGSTAT,"^",3)=1:"",$P(GMRGSTAT,"^")=$P(GMRGF0,"^"):$P(^GMR(124.3,GMRGPDA,1,GMRGB0,0),"^",2),1:$P(^GMR(124.3,GMRGPDA,1,GMRGB0,2,$P(GMRGSTAT,"^"),0),"^",4))
 I  S GMRGADD=$S($P(GMRGSTAT,"^",3)=1:"",$P(GMRGSTAT,"^")=$P(GMRGF0,"^"):$S($D(^GMR(124.3,GMRGPDA,1,GMRGB0,"ADD")):"1;"_GMRGB0_";0",1:""),1:$S($D(^GMR(124.3,GMRGPDA,1,GMRGB0,2,$P(GMRGSTAT,"^"),"ADD")):"1;"_GMRGB0_";2;"_$P(GMRGSTAT,"^"),1:""))
 S GMRGE0(0)=$S($D(^GMRD(124.2,GMRGC0,0)):^(0),1:"")
 S GMRGNAR=GMRGPAR_"^S^"_GMRGSPC_"^^"_GMRGRM,GMRGNAR(0)=$P(GMRGE0(0),"^")_"^"_GMRGE0,GMRGNAR("LEAD")=GMRGSNT(GMRGSNT,"LEAD"),GMRGNAR("TRAIL")=GMRGSNT(GMRGSNT,"TRAIL")_$S($P(GMRGSNT(GMRGSNT,0),"^",2)'=3:"",1:".") D STORETXT^GMRGRUT1
 S GMRGJ0=0 F GMRGC0=0:0 S GMRGC0=$O(GMRGSNT(GMRGSNT,GMRGC0)) Q:GMRGC0'>0  D CHILD S GMRGJ0=1
 S GMRGSSW=1
 Q:'GMRGADD
 S GMRGNAR=GMRGPAR_"^T^"_GMRGSPC_"^^"_GMRGRM,GMRGNAR("LEAD")="Additional Text: ",GMRGNAR("TRAIL")=""
 S GMRGNAR(0)=$S('$P(GMRGADD,";",3):^GMR(124.3,GMRGPDA,1,$P(GMRGADD,";",2),"ADD"),1:^GMR(124.3,GMRGPDA,1,$P(GMRGADD,";",2),2,$P(GMRGADD,";",4),"ADD")) D STORETXT^GMRGRUT1
 Q
CHILD ;
 S GMRGH0=+GMRGSNT(GMRGSNT,GMRGC0) Q:GMRGH0'>0  S GMRGE0=""
 S GMRGB0=$O(^GMR(124.3,GMRGPDA,1,"B",GMRGH0,0)) I GMRGB0>0 S GMRGST=GMRGB0,GMRGST(1)=GMRGPDA,GMRGST(2)=$S(GMRGCSW=1:%,1:GMRGPDT) D STAT^GMRGRUT0 S GMRGF0=GMRGSTAT,GMRGST=GMRGB0,GMRGST(1)=GMRGPDA,GMRGST(2)=GMRGPDT D STAT^GMRGRUT0
 I GMRGB0>0 S GMRGE0=$S($P(GMRGSTAT,"^",3)=1:"",$P(GMRGSTAT,"^")=$P(GMRGF0,"^"):$P(^GMR(124.3,GMRGPDA,1,GMRGB0,0),"^",2),1:$P(^GMR(124.3,GMRGPDA,1,GMRGB0,2,$P(GMRGSTAT,"^"),0),"^",4))
 S GMRGE0(0)=$S($D(^GMRD(124.2,GMRGH0,0)):^(0),1:"")
 S GMRGNAR=GMRGPAR_"^S^"_GMRGSPC_"^"_$S($O(GMRGSNT(GMRGSNT,GMRGC0)):1,GMRGJ0:2,1:3)_"^"_GMRGRM,GMRGNAR(0)=$P(GMRGE0(0),"^")_"^"_GMRGE0,GMRGNAR("LEAD")="",GMRGNAR("TRAIL")="" D STORETXT^GMRGRUT1
 Q