source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YTAR1.m@ 1147

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

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1YTAR1 ;SLC/TGA,DKG-RESUME TESTS; ;5/30/02 14:57
2 ;;5.01;MENTAL HEALTH;**37,76**;Dec 30, 1994
3 ;
4 ; 3/11/94 LJA
5 I $D(^YTD(601.4,YSDFN,1,"AC")) D
6 . S (X,YSX)=$O(^YTD(601.4,+YSDFN,1,"AC",0))
7 . W !?2,"("
8 . I $G(^YTD(601.4,+YSDFN,1,14,99))'="MMPIR" W $P(^YTT(601,X,0),U)
9 . I $G(^YTD(601.4,+YSDFN,1,14,99))="MMPIR" D
10 . . W $S(YSX=60:"MMPIR",YSX=61:"MMPR",1:"??")
11 . W " Test was discontinued in Clerical Entry mode)"
12 ;
13 S Z=0 F S Z=$O(^YTD(601.4,YSDFN,1,Z)) Q:'Z S Z1=$P(^YTT(601,Z,0),U) I Z1'="CLERK" S X2=$S($P(^YTD(601.4,YSDFN,1,Z,0),U,8):$P(^(0),U,8),1:$P(^(0),U,2)) D DAT I X S Z(Z1)=Z_"^"_$P(^YTD(601.4,YSDFN,1,Z,0),U,2)
14R11 ;
15 I $D(Z)>10 W !!,"Interactive instruments to restart: " S Z1="" F S Z1=$O(Z(Z1)) Q:Z1="" W ?36,Z1 W:$P(Z(Z1),U,2)']"" ! I $P(Z(Z1),U,2)]"" S M=$P(Z(Z1),U,2) W ?44,$$FMTE^XLFDT(M,"5ZD") W !
16 I $D(Z)<11 G A10^YTAR
17R2 ;
18 R !!?2,"Restart Instrument: ",YSTEST:DTIME S YSTOUT='$T,YSUOUT=YSTEST["^" G:YSTOUT!YSUOUT KAR^YTS G:YSTEST["?" R11
19 I YSTEST="",T1 D DEL G:"Nn^"[$E(A1) KAR^YTS
20 I YSTEST="" G A10^YTAR
21 I '$D(Z(YSTEST)) W " ??",$C(7,7) G R2
22 S (YSENT,YSTEST)=$P(Z(YSTEST),U)
23 S (B,C)="",J=+$P(^YTD(601.4,YSDFN,1,YSENT,0),U,4),C=$P(^(0),U,5),YSORD=$P(^(0),U,7) S:$P(^(0),U,8) YSBEGIN=$P(^(0),U,8)
24 I $D(^YTD(601.4,YSDFN,1,YSENT,"B"))#2 S B=^("B")
25 S YSRP=$S(J#200=1:"",1:^YTD(601.4,YSDFN,1,YSENT,J+198\200)) S:'J J=1
26MCMI2 ;
27 I $P(^YTT(601,YSTEST,0),U)?1"MCMI"1N X ^YTT(601,YSTEST,"C") ;ASF 5/30/02
28 S YSXT=YSTEST_"^" S:$D(^YTD(601.4,YSDFN,1,YSENT,"R")) YSXT=YSXT_^("R") S YSXTP=1,YSDEMO="N",YSRESTRT=1 G A3^YTAR
29DEL ;
30 W !!?2,"Delete discontinued ",$P(^YTT(601,YSXT,0),U) R "? Y// ",A1:DTIME S YSTOUT='$T,YSUOUT=A1["^" Q:YSTOUT!YSUOUT S:A1="" A1="Y"
31 I "Yy"[$E(A1) S YSTEST=YSXT,YSENT=$P(Z($P(^YTT(601,YSXT,0),U)),U) D ENKIL^YTFILE S YSTEST="" W !,"DELETED!" Q
32 I "Yy"'[$E(A1) W !,$C(7),"You must either restart or delete this ",$P(^YTT(601,YSXT,0),U),"!"
33 Q
34DAT ;
35 N YTLM S YTLM=YSRSLMT
36 I T1,YSXT'=Z S X=0 Q
37 I $P($G(^YTT(601,Z,0)),U,16) S YTLM=$P(^(0),U,16)
38 S X=$$FMDIFF^XLFDT(DT,X2,1) I X'>YTLM S X=1 K YTLM Q
39 W !!?2,Z1,?9,"discontinued " I $D(%Y),%Y W X," days ago "
40 W "- not restartable" S X=0 K YTLM Q
Note: See TracBrowser for help on using the repository browser.