source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YTRPEXT.m@ 1154

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

initial load of WorldVistAEHR

File size: 1.1 KB
Line 
1YTRPEXT ;DALOI/YH-I/O FOR STAFF REMARKS ;8/22/2001
2 ;;5.01;MENTAL HEALTH;**71**;Dec 30, 1994
3 ;
4ADDCOMM(RESULT,YSDATA,YSCOMMT) ;YTAPI SAVE TEST COMMENT
5 N YSDFN,YSET,YSED
6 S YSDFN=+$P(YSDATA,"^"),YSET=$P(YSDATA,"^",4),YSET=$O(^YTT(601,"B",YSET,0)),YSED=+$P(YSDATA,"^",3)
7 I '$D(^YTD(601.2,YSDFN,1,YSET,1,YSED)) S RESULT(1)="[ERROR]",RESULT(2)="No test found" Q
8 N YSAUTHOR,YSDUZ,YSDN,I S I=+$P(YSDATA,"^",6)
9 I I=0 S RESULT(1)="[ERROR]",RESULT(2)="No comment entered" Q
10 S YSAUTHOR=+$P(YSDATA,"^",2),YSDUZ=+$P(YSDATA,"^",5)
11 S:'$D(^YTD(601.2,YSDFN,1,YSET,1,YSED,"R",0)) ^(0)="^601.2213D^^" S DIC="^YTD(601.2,YSDFN,1,YSET,1,YSED,""R"",",DIC(0)="L",DLAYGO=601,X="T" D ^DIC G:Y<1 OUT S YSDN=+Y
12 S DIE=DIC,DA=+Y,DR="1///TODAY;2///`"_DUZ_";3///`"_YSAUTHOR,DA(3)=YSDFN,DA(2)=YSET,DA(1)=YSED L +^YTD(601.2,YSDFN):0 Q:'$T D ^DIE
13 S ^YTD(601.2,YSDFN,1,YSET,1,YSED,"R",YSDN,1,0)="^^"_I_"^"_I_"^"_$P(^YTD(601.2,YSDFN,1,YSET,1,YSED,"R",YSDN,0),"^",2)_"^"
14 N YS F YS=1:1:I S ^YTD(601.2,YSDFN,1,YSET,1,YSED,"R",YSDN,1,YS,0)=YSCOMMT(YS)
15 L -^YTD(601.2,YSDFN)
16 S RESULT(1)="[DATA]",RESULT(2)="Save ok"
17 Q
18OUT S RESULT(1)="[ERROR]",RESULT(2)="Comment line not created" Q
Note: See TracBrowser for help on using the repository browser.