source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSRS2B.m@ 1361

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

initial load of WorldVistAEHR

File size: 1.7 KB
Line 
1GMTSRS2B ; SLC/KER - Selection Items Resequence 2 ; 02/11/2003 [11/14/03 2:27pm]
2 ;;2.7;Health Summary;**62,69**;Oct 20, 1995
3 ;
4 Q
5RES(ARY) ; Reset Input Array - .ARY
6 N GMTSI,GMTSC S (GMTSI,GMTSC)=0 F S GMTSI=$O(ARY(GMTSI)) Q:+GMTSI=0 S ^TMP("GMTSRS",$J,GMTSI)=$G(ARY(GMTSI)),^TMP("GMTSRS",$J,GMTSI,1)=$G(ARY(GMTSI,1))
7 K ARY F S GMTSI=$O(^TMP("GMTSRS",$J,GMTSI)) Q:+GMTSI=0 S GMTSC=GMTSC+1,ARY(GMTSC)=$G(^TMP("GMTSRS",$J,GMTSI)),ARY(GMTSC,1)=$G(^TMP("GMTSRS",$J,GMTSI,1))
8 K ^TMP("GMTSRS",$J)
9 Q
10DIS(ARY) ; Display Array - .ARY
11 N GMTSI,GMTSTY,GMTSSM S GMTSI=0 F S GMTSI=$O(ARY(GMTSI)) Q:+GMTSI=0 S GMTSTY=$P($G(ARY(GMTSI,1)),"^",1),GMTSSM=$P($G(ARY(GMTSI,1)),"^",2) D
12 . W !,$J(GMTSI,4)," ",GMTSTY,", ",GMTSSM
13 Q
14 ;
15INA(GMTST,GMTSS,ARY) ; Creates Input Array
16 N DA,GMTSC,GMTSI,GMTSVAL,GMTSPTR,GMTSFRT,GMTSCRT,GMTSFFRT,GMTSFCRT
17 N GMTSRT,GMTSUB,GMTSTYP
18 S DA(2)=+($G(GMTST)) Q:+DA(2)'>0 Q:'$D(^GMT(142,+DA(2)))
19 S DA(1)=+($G(GMTSS)) Q:+DA(1)'>0 Q:'$D(^GMT(142,+DA(2),1,+DA(1)))
20 S (GMTSC,GMTSI)=0 F S GMTSI=$O(^GMT(142,DA(2),1,DA(1),1,GMTSI)) Q:+GMTSI=0 D
21 . S GMTSVAL=$G(^GMT(142,DA(2),1,DA(1),1,GMTSI,0))
22 . S GMTSPTR=+GMTSVAL,GMTSFRT=$P(GMTSVAL,";",2)
23 . Q:GMTSFRT'["(" S:GMTSFRT'["^" GMTSFRT="^"_GMTSFRT
24 . S GMTSCRT=$$CREF^DILF(GMTSFRT)
25 . S GMTSFFRT=GMTSFRT_GMTSPTR_","
26 . S GMTSFCRT=$$CREF^DILF(GMTSFFRT)
27 . Q:'$D(@GMTSFCRT) Q:'$L($G(@($P(GMTSFCRT,")",1)_",0)")))
28 . S GMTSUB=$P($G(@($P(GMTSFCRT,")",1)_",0)")),"^",1)
29 . I GMTSCRT'["(" D
30 . . S GMTSTYP=$P(@($P(GMTSCRT,")",1)_"(0)"),"^",1),GMTSC=GMTSC+1
31 . I GMTSCRT["(" D
32 . . S GMTSTYP=$P(@($P(GMTSCRT,")",1)_",0)"),"^",1),GMTSC=GMTSC+1
33 . S GMTSRT=$TR(GMTSFRT,"^","")
34 . S ARY(GMTSC)=GMTSPTR_";"_GMTSRT,ARY(GMTSC,1)=GMTSTYP_"^"_GMTSUB
35 . S INA(GMTSC)=GMTSPTR_";"_GMTSRT,INA(GMTSC,1)=GMTSTYP_"^"_GMTSUB
36 Q
Note: See TracBrowser for help on using the repository browser.