source: WorldVistAEHR/trunk/r/GEN_MED_REC_GENERATOR-GMRG/GMRGPNB2.m@ 1211

Last change on this file since 1211 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1GMRGPNB2 ;CISC/RM-SENTENCE BUILDER (cont.) ;2/15/91
2 ;;3.0;Text Generator;;Jan 24, 1996
3SNTP ;
4 S GMRGC0=+GMRGSNT(GMRGSNT) Q:GMRGC0'>0 S GMRGE0=""
5 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
6 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))
7 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:""))
8 S GMRGE0(0)=$S($D(^GMRD(124.2,GMRGC0,0)):^(0),1:"")
9 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
10 S GMRGJ0=0 F GMRGC0=0:0 S GMRGC0=$O(GMRGSNT(GMRGSNT,GMRGC0)) Q:GMRGC0'>0 D CHILD S GMRGJ0=1
11 S GMRGSSW=1
12 Q:'GMRGADD
13 S GMRGNAR=GMRGPAR_"^T^"_GMRGSPC_"^^"_GMRGRM,GMRGNAR("LEAD")="Additional Text: ",GMRGNAR("TRAIL")=""
14 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
15 Q
16CHILD ;
17 S GMRGH0=+GMRGSNT(GMRGSNT,GMRGC0) Q:GMRGH0'>0 S GMRGE0=""
18 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
19 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))
20 S GMRGE0(0)=$S($D(^GMRD(124.2,GMRGH0,0)):^(0),1:"")
21 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
22 Q
Note: See TracBrowser for help on using the repository browser.