source: FOIAVistA/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YTAPI4.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 1.2 KB
Line 
1YTAPI4 ;ALB/ASF PSYCH TEST API PNOTES ;3/13/00 16:28
2 ;;5.01;MENTAL HEALTH;**62**;Dec 30, 1994
3 Q
4PNTEXT(YSDATA,YS) ;
5 Q
6PREVIEW(YSDATA,YS) ;
7 N DA,DIK,DFN,YSNCODE,YSCODE,YSADATE
8 K ^TMP($J,"YTAPI4")
9 D PARSE^YTAPI(.YS)
10 I '$D(^DPT(DFN,0)) S YSDATA(1)="[ERROR]",YSDATA(2)="no such pt" Q
11 I '$D(^YTT(601,"B",YSCODE)) S YSDATA(1)="[ERROR]",YSDATA(2)="INCORRECT TEST CODE" Q ;---> bad code
12 S YSNCODE=$O(^YTT(601,"B",YSCODE,-1))
13 I YSADATE'=DT S YSDATA(1)="[ERROR]",YSDATA(2)="bad date needs DT" Q ;---> bad date
14 L +^YTD(601.2,DFN,1,YSNCODE,1,YSADATE):1 I '$T S YSDATA(1)="[ERROR]",YSDATA(2)="no lock" Q ;--->
15 D:$D(^YTD(601.2,DFN,1,YSNCODE,1,YSADATE)) INTMP ;save old testing for a day
16 ;
17 D SAVEIT^YTAPI1(.YSDATA,.YS) ; save responses
18 I YSDATA(1)?1"[ERROR".E L -^YTD(601.2,DFN,1,YSNCODE,1,YSADATE) Q ;---> bad save
19 ;
20 D SCOREIT^YTAPI2(.YSDATA,.YS)
21DROP ;kill preview data
22 S DIK="^YTD(601.2,DFN,1,YSNCODE,1,",DA=YSADATE,DA(1)=YSNCODE,DA(2)=DFN D ^DIK
23 ;
24 D:$D(^TMP($J,"YTAPI4")) OUTTMP ;place back old testing
25 S DIK="^YTD(601.2,",DA=DFN D IX^DIK ; reindex
26 L -^YTD(601.2,DFN,1,YSNCODE,1,YSADATE)
27 Q
28INTMP ; SAVE OLD
29 M ^TMP($J,"YTAPI4")=^YTD(601.2,DFN,1,YSNCODE,1,YSADATE)
30 Q
31OUTTMP ;replace old testing
32 M ^YTD(601.2,DFN,1,YSNCODE,1,YSADATE)=^TMP($J,"YTAPI4")
33 Q
Note: See TracBrowser for help on using the repository browser.