source: WorldVistAEHR/trunk/r/GEN_MED_REC_GENERATOR-GMRG/GMRGPNB0.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: 2.2 KB
Line 
1GMRGPNB0 ;CISC/JH/RM-NARRATIVE BUILDER FOR TEXT GENERATOR (cont.) ;6/20/91
2 ;;3.0;Text Generator;;Jan 24, 1996
3TEXT ; ENTRY WITH GMRGA SET TO POINT AT WHICH WANT TO START BUILDING TEXT
4 S (GMRGE0,GMRGADD)=""
5 Q:'$D(^GMR(124.3,GMRGPDA,1,"ALIST",GMRGA0))&GMRGCSW Q:('$D(^GMR(124.3,"B",GMRGA0,GMRGPDA))&'$D(^GMR(124.3,GMRGPDA,1,"B",GMRGA0)))&'GMRGCSW D NOW^%DTC
6 S GMRGB0=$O(^GMR(124.3,GMRGPDA,1,"B",GMRGA0,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
7 I GMRGB0>0 S GMRGE0=$S($P(GMRGSTAT,"^",3)=1:"",$P(GMRGSTAT,"^")=$P(GMRGF0,"^"):$S($D(^GMR(124.3,GMRGPDA,1,GMRGB0,0)):$P(^(0),"^",2),1:""),1:$S($D(^GMR(124.3,GMRGPDA,1,GMRGB0,2,+$P(GMRGSTAT,"^"),0)):$P(^(0),"^",4),1:""))
8 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:""))
9 S GMRGE0(0)=$S($D(^GMRD(124.2,GMRGA0,0)):^(0),1:""),GMRGE0(4)=$S($D(^GMRD(124.2,GMRGA0,4)):^(4),1:""),GMRGE0(5)=$S($D(^GMRD(124.2,GMRGA0,5)):^(5),1:"") Q:$P(GMRGE0(0),"^",2)=3&GMRGSSW
10 I "S"[$P(GMRGE0(0),"^",8)!GMRGSSW D SNT^GMRGPNB1 Q
11 S GMRGNAR=GMRGPAR_"^"_$P(GMRGE0(0),"^",8)_"^"_GMRGSPC_"^^"_GMRGRM,GMRGNAR(0)=$P(GMRGE0(0),"^")_"^"_GMRGE0,GMRGNAR("LEAD")=GMRGE0(4),GMRGNAR("TRAIL")=GMRGE0(5) D STORETXT^GMRGRUT1
12 S GMRGSPC=GMRGSPC+3
13 F GMRGD0=0:0 S GMRGD0=$O(^GMRD(124.2,GMRGA0,1,GMRGD0)) Q:GMRGD0'>0 D RECUR
14 Q:'GMRGADD
15 S GMRGNAR=GMRGPAR_"^T^"_GMRGSPC_"^^"_GMRGRM,GMRGNAR("LEAD")="Additional Text: ",GMRGNAR("TRAIL")=""
16 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
17 Q
18RECUR ;
19 Q:'$$ALIST^GMRGRUT0(GMRGPDA,GMRGA0,+$G(^GMRD(124.2,+GMRGA0,1,+GMRGD0,0)))
20 S ^TMP($J,"GMRGPLVL",GMRGPLVL)=GMRGA0_"^"_GMRGD0_"^"_GMRGSPC_"^"_GMRGSSW_"^"_GMRGADD,GMRGPLVL=GMRGPLVL+1,GMRGA0=$S($D(^GMRD(124.2,GMRGA0,1,GMRGD0,0)):$P(^(0),"^"),1:"")
21 D TEXT
22 S GMRGPLVL=GMRGPLVL-1,GMRGI0=^TMP($J,"GMRGPLVL",GMRGPLVL),GMRGA0=$P(GMRGI0,"^"),GMRGD0=$P(GMRGI0,"^",2),GMRGSPC=$P(GMRGI0,"^",3),GMRGSSW=$P(GMRGI0,"^",4),GMRGADD=$P(GMRGI0,"^",5)
23 Q
Note: See TracBrowser for help on using the repository browser.