source: FOIAVistA/trunk/r/HEALTH_SUMMARY-GMTS/GMTSRM4.m@ 1689

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

initial load of FOIAVistA 6/30/08 version

File size: 1.2 KB
Line 
1GMTSRM4 ;SLC/JER,DLT - Create/Modify - Ins/Apnd/Del Comp ; 08/27/2002
2 ;;2.7;Health Summary;**56**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 10013 ^DIK (file #142)
6 ;
7INSRT ; Sets Summary Order to Insert Prior to Existing Node
8 N LO,NO S (NO,LO)=0 F S NO=$O(^GMT(142,GMTSIFN,1,NO)) Q:NO=SO S LO=NO
9 S CMP(.01)=+$J(((SO-LO)/2+LO),0,3),CMP(0)="^"_$P($G(CMP(0)),U,2,5),GMTSNEW=1
10 I '$D(^GMT(142,GMTSIFN,1,CMP(.01),0)) S CMP(.01)=CMP(.01)
11 W !,"Inserted as SUMMARY ORDER: ",CMP(.01)_" "_CMP("NM")
12 Q
13APPND ; Sets Summary Order to Insert After Existing Node
14 N NO S NO=$O(^GMT(142,GMTSIFN,1,SO)) S CMP(.01)=$S(NO>0:+$J(((NO-SO)/2+SO),0,3),1:SO+5),GMTSNEW=1
15 I '$D(^GMT(142,GMTSIFN,1,CMP(.01),0)) S CMP(.01)=CMP(.01)
16 S CMP(0)="^"_$P($G(CMP(0)),U,2,5)
17 W !,"Appended as SUMMARY ORDER: ",CMP(.01)_" "_CMP("NM")
18 Q
19DELCMP ; Deletes Component from Summary
20 N DA,DIK S DIK="^GMT(142,"_GMTSIFN_",1,",DA=OLDSO,DA(1)=GMTSIFN
21 S OLDSO("NM")=$S($D(^GMT(142,GMTSIFN,1,OLDSO,0)):$P(^GMT(142.1,$P(^GMT(142,GMTSIFN,1,OLDSO,0),U,2),0),U,1),1:"")
22 D ^DIK I SOACTION="D"!(SOACTION="O") W !,$S(SOACTION="O":"Overwriting",1:"Deleting")_" Summary Order "_OLDSO_" "_OLDSO("NM")
23 S CNT=$$GETCNT^GMTSRM(GMTSIFN)
24 Q
Note: See TracBrowser for help on using the repository browser.