source: FOIAVistA/trunk/r/GEN_MED_REC_GENERATOR-GMRG/GMRGED2.m@ 1683

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

initial load of FOIAVistA 6/30/08 version

File size: 4.6 KB
Line 
1GMRGED2 ;HIRMFO/RM-PATIENT DATA EDIT (cont.) ;1/23/96
2 ;;3.0;Text Generator;;Jan 24, 1996
3EN1 ; ENTRY TO PROCESS USER SELECTIONS IN GMRGUSL ARRAY
4 S GMRG0="",GMRGTLVL=$P(GMRGLVL($P(GMRGLVL,"^")),"^")+1,$P(GMRGLVL($P(GMRGLVL,"^")),"^")=GMRGTLVL K ^TMP($J,"GMRGLVL",$P(GMRGLVL,"^"),GMRGTLVL),GMRGLVL($P(GMRGLVL,"^"),GMRGTLVL),^TMP($J,"GMRGHDR",$P(GMRGLVL,"^"),GMRGTLVL)
5 F GMRG2=1:1 S GMRG0=$O(GMRGUSL(GMRG0)) Q:GMRG0="" D STUT^GMRGED6
6JS F GMRGSLVL=0:0 S GMRGSLVL=$O(^TMP($J,"GMRGLVL",$P(GMRGLVL,"^"),GMRGTLVL,GMRGSLVL)) Q:GMRGSLVL'>0 S $P(GMRGLVL($P(GMRGLVL,"^"),GMRGTLVL),"^")=GMRGSLVL D PRCSEL Q:GMRGOUT
7 K ^TMP($J,"GMRGLVL",$P(GMRGLVL,"^"),GMRGTLVL),^TMP($J,"GMRGHDR",$P(GMRGLVL,"^"),GMRGTLVL)
8 I GMRGTLVL>1 K GMRGLVL($P(GMRGLVL,"^"),GMRGTLVL) S GMRGTLVL=$P(GMRGLVL($P(GMRGLVL,"^")),"^")-1,$P(GMRGLVL($P(GMRGLVL,"^")),"^")=GMRGTLVL,GMRGSLVL=$P(GMRGLVL($P(GMRGLVL,"^"),GMRGTLVL),"^")
9 E S GMRGSLVL=+$P(GMRGLVL($P(GMRGLVL,"^"),GMRGTLVL),"^",2),GMRGTLVL=$P(GMRGLVL($P(GMRGLVL,"^")),"^",2) K GMRGLVL(+$P(GMRGLVL,"^")) S $P(GMRGLVL,"^")=$P(GMRGLVL,"^")-1
10 S GMRGPRC=$S($D(^TMP($J,"GMRGLVL",$P(GMRGLVL,"^"),GMRGTLVL,GMRGSLVL)):^(GMRGSLVL),1:""),GMRGPRC(0)=$S($D(^TMP($J,"GMRGLVL",$P(GMRGLVL,"^"),GMRGTLVL,GMRGSLVL,0)):^(0),1:"")
11 S:GMRGTOP(0)=+GMRGTERM GMRGTOP(0)=+GMRGRT S GMRGTERM=$P(GMRGPRC,"^")_"^"_$P(GMRGPRC(0),"^",1,2),GMRGTERM(0)=$S($D(^GMRD(124.2,+GMRGTERM,0)):^(0),1:""),GMRGNORD=$P(GMRGPRC,"^",3)
12 Q
13PRCSEL ;
14 S GMRGPRC=$S($D(^TMP($J,"GMRGLVL",$P(GMRGLVL,"^"),GMRGTLVL,GMRGSLVL)):^(GMRGSLVL),1:"") Q:GMRGPRC="" S GMRGNORD=$P(GMRGPRC,"^",3)
15 I $P(GMRGPRC,"^")["*"!($P(GMRGPRC,"^")["T") S $P(GMRGLVL,"^")=$P(GMRGLVL,"^")+1,GMRGTLVL=1 D JS Q:$P(GMRGPRC,"^")'["T" K GMRGTPLT S GMRGSCRP=0 Q
16 S GMRG2=$S($D(^GMRD(124.2,+GMRGPRC,0)):^(0),1:"") I $P(GMRGPRC,"^",2)'="@",GMRGTOP=+GMRGRT S:$S($D(^GMRD(124.25,+$P(GMRG2,"^",4),0)):$P(^(0),"^",3),1:0) GMRGTOP(0)=+GMRGPRC
17 S GMRGMIN=0
18 I $P(GMRGPRC,"^")="A" D ADDITION^GMRGED5 Q
19 S GMRGPRC(0)=$S($D(^TMP($J,"GMRGLVL",$P(GMRGLVL,"^"),GMRGTLVL,GMRGSLVL,0)):^(0),1:"")
20 I $P(GMRGPRC,"^",2)="J" S GMRGTLVL=GMRGTLVL+1,$P(GMRGLVL($P(GMRGLVL,"^")),"^")=GMRGTLVL,GMRGTERM=$P(GMRGPRC,"^")_"^"_$P(GMRGPRC(0),"^",1,2),GMRGTERM(0)=$S($D(^GMRD(124.2,+GMRGTERM,0)):^(0),1:"")
21 I X:$D(^GMRD(124.2,+GMRGTERM,7)) ^(7) Q:GMRGOUT D HDR^GMRGEDB,JS,SETSEL^GMRGED4 Q:$P(GMRGPRC,"^",3)=11 G QP:GMRGOUT
22 I $P(GMRGPRC,"^",2)="S" D SCRPT^GMRGED9 Q:GMRGOUT D EN1,SETSEL^GMRGED4 G QP:GMRGOUT
23 I $P(GMRGPRC,"^",2)="@" S GMRGKU=GMRGTERM,GMRGKU(0)=GMRGTERM(0),GMRGTERM=$P(GMRGPRC,"^")_"^"_$P(GMRGPRC(0),"^",1,2),GMRGTERM(0)=$S($D(^GMRD(124.2,+GMRGTERM,0)):^(0),1:"") D DELETE^GMRGED6 S GMRGTERM=GMRGKU,GMRGTERM(0)=GMRGKU(0) Q
24 I '$D(^GMR(124.3,GMRGPDA,1,"ALIST",$P(GMRGPRC,"^"))),$P(GMRGPRC(0),"^")["]",$P(GMRGPRC,"^",2)'["/" S $P(GMRGPRC,"^",2)=$P(GMRGPRC,"^",2)_"/"
25 S GMRGKU=$O(^GMR(124.3,GMRGPDA,1,"B",$P(GMRGPRC,"^"),0)) I GMRGKU'>0 S GMRGSTAT="^^"
26 E S GMRGST=GMRGKU,GMRGST(1)=GMRGPDA D STAT^GMRGRUT0
27 I +GMRGPRC=+GMRGRT S GMRGSTAT="^^1"
28 I '$P(GMRGPRC(0),"^",2),GMRGKU S $P(GMRGPRC(0),"^",2,3)=GMRGKU_"^"_$P($G(^GMR(124.3,GMRGPDA,1,GMRGKU,0)),"^",2)
29 I '$P(GMRGSTAT,"^",3) D ADSEL^GMRGEDB
30 I $P(GMRGPRC,"^",2)?0.1";".E1"/".E D INTERNAL^GMRGED6 G QP:GMRGOUT
31 I $P(GMRGPRC,"^",2)?1";".E D APPEND^GMRGED5 G QP:GMRGOUT
32REPRC S GMRGKU=GMRGTERM,GMRGKU(0)=GMRGTERM(0),GMRGTERM=$P(GMRGPRC,"^")_"^"_$P(GMRGPRC(0),"^",1,2),GMRGTERM(0)=$S($D(^GMRD(124.2,+GMRGTERM,0)):^(0),1:""),GMRGTCHK=$S($P(GMRGTERM(0),"^",2):$P(GMRGTERM(0),"^",2),1:3)
33 I GMRGTCHK=3 X:$D(^GMRD(124.2,$P(GMRGTERM,"^"),7)) ^(7) D:'GMRGOUT HDR^GMRGEDB,PRCTRM^GMRGED6 X:$D(^GMRD(124.2,$P(GMRGTERM,"^"),9))&'GMRGOUT ^(9) S GMRGTERM=GMRGKU,GMRGTERM(0)=GMRGKU(0) Q
34 I $P(GMRGPRC,"^",2)'="S"!($P(GMRGPRC,"^",2)="S"&'($P(GMRGPRC,"^",3)#2)) D EN1^GMRGED1
35QP S GMRG2=$S(+$P(GMRGTERM,"^",3)'>0:0,'$D(^GMR(124.3,GMRGPDA,1,$P(GMRGTERM,"^",3),"ADD")):0,^("ADD")'="":1,1:0)
36 F GMRG1=0:0 S GMRG1=$O(GMRGSEL(GMRG1)) Q:GMRG1'>0 I $P(GMRGSEL(GMRG1),"^",3) S GMRG2=GMRG2+1
37 S GMRGMIN=$S(GMRG2<$P(GMRGTERM(0),"^",6):1,1:0)
38 I 'GMRGMIN D PRCTRM^GMRGED6
39 I GMRGMIN D
40 . D NOTMIN^GMRGED7 Q:GMRGOUT!($P(GMRGTERM(0),"^",12)#2)
41 . W !!?3,$C(7),"THE MINIMUM NUMBER OF SELECTIONS HAVE NOT BEEN SELECTED FOR THIS FRAME",!?3,"THEREFORE IT WILL NOT BE FILED WITH THE PATIENT DATA."
42 . F R !,"Press return to continue, ^ to exit ",X:DTIME S:'$T X="^^" S:X="^"!(X="^^") GMRGOUT=1 Q:"^^"[X W !?3,$C(7),"<RET> WILL CONTINUE WITH DATA ENTRY, ^ OR ^^ WILL EXIT FROM THE APPLICATION."
43 . Q
44 S GMRGRDIS=0 X:$D(^GMRD(124.2,$P(GMRGTERM,"^"),9))&(GMRGUP!GMRGOUT) ^(9)
45 I GMRGRDIS S $P(GMRGPRC,"^",3)=+($P(GMRGPRC,"^",3)\10_0),$P(^TMP($J,"GMRGLVL",+GMRGLVL,+GMRGLVL(+GMRGLVL),+GMRGLVL(+GMRGLVL,+GMRGLVL(+GMRGLVL))),"^",3)=$P(GMRGPRC,"^",3) G:GMRGRDIS REPRC
46 Q
Note: See TracBrowser for help on using the repository browser.