source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSMTI.m@ 1437

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

initial load of WorldVistAEHR

File size: 3.7 KB
Line 
1YSMTI ;ALB.ASF-MUTLIPLE PSYCH TESTS AND INTERVIEWS ;7/23/99 09:50
2 ;;5.01;MENTAL HEALTH;**53**;Dec 30, 1994
3 W @IOF,!?10,"Psychological Testing Mutliple Administraion Reporting",!
4PTALL ; SELECT PT
5 W ! K DIC,DIK S YSDFN=0,DIC("A")="Select Patient: ",DIC="^YTD(601.2,",DIC(0)="AEQ" D ^DIC Q:Y'>0 S YSDFN=+Y
6 K ^TMP("YSMTI",$J,YSDFN)
7 I $O(^YTD(601.2,YSDFN,1,0))'>0 W !,"No Tests found" Q
8SELTST ;select test
9 K DIC S DIC="^YTD(601.2,YSDFN,1,",DIC(0)="AEMZ" D ^DIC Q:Y'>0 S (YSET,YSTEST)=+Y,YSTESTA=$P(^YTT(601,YSTEST,0),U)
10 I $P(^YTT(601,YSTEST,0),U,9)'="T" W !,"Only Tests can be graphed" H 2 G SELTST
11 D ENFRNT
12SELSCAL ;
13 S Y="N" I YSTESTA?1."MMP".E!(YSTESTA?1"MCMI".E) K DIR S DIR("A")="Show Full Profile? ",DIR("B")="NO",DIR(0)="Y" D ^DIR Q:$D(DIROUT)
14 I Y=1 D ^YSMTI0 G SELSCAL
15 K DIC S DIC("A")="Select Scale Number or Name: ",DIC(0)="AEQZM",DIC="^YTT(601,YSTEST,"""_"S"_""",",DIC("W")="W ?10,$P(^(0),U,2)" D ^DIC G:Y'>0 SELTST S YSCALEN=+Y,YSCALET=$P(Y(0),U,2)
16 K IOP S %ZIS="Q" D ^%ZIS Q:POP
17 I $D(IO("Q")) K IO("Q") S ZTRTN="ENTASK^YSMTI",ZTDESC="YSMTI" S ZTSAVE("YS*")="" D ^%ZTLOAD W !,$S($D(ZTSK):"QUEUED",1:"Not queued"),$C(7) G SELSCAL
18 U IO D HDR,CR,HOME^%ZIS D ^%ZISC U IO
19 G SELSCAL
20ENTASK ;taskman entry
21 S:$D(ZTQUEUED) ZTREQ="@"
22 D ENFRNT,HDR,CR Q
23HDR ;
24 S YSLN="",$P(YSLN,"_",79)=""
25 W @IOF,!?7,"**** M U L T I P L E T E S T A D M I N I S T R A T I O N S ****"
26 W !,VADM(1),?40,"SSN: ",$P(VADM(2),U,2)," ",$P(VADM(5),U,2),?60," DOB: ",$P(VADM(3),U,2)
27 S X=$P(^YTT(601,YSTEST,"P"),U) W !?(72-$L(X)/2),X
28 S X="Scale: "_YSCALET W !,YSLN,!?(72-$L(X)/2),X,!,YSLN
29 W !,"Entered: Days between Raw Scaled"
30 Q
31CR ;loop thru TMP
32 S (YSED,YSED1)=0 F S YSED=$O(^TMP("YSMTI",$J,YSDFN,YSTEST,YSCALEN,YSED)) Q:YSED'>0 D CR1 S YSED1=YSED
33 W !! Q
34CR1 S Y=^TMP("YSMTI",$J,YSDFN,YSTEST,YSCALEN,YSED)
35 S R=$P(Y,U),S=$P(Y,U,2) S:YSED1 YSED1=$$FMDIFF^XLFDT(YSED,YSED1,1)
36 ;W !,$E(YSED,4,5)_"/"_$E(YSED,6,7)_"/"_$E(YSED,2,3),?12,$S(YSED1:$J(YSED1,5),1:" "),?22,$J(R,6)," ",$J(S,6)
37 W !,$$FMTE^XLFDT(YSED,"5ZD"),?14,$S(YSED1:$J(YSED1,5),1:" "),?24,$J(R,6)," ",$J(S,6)
38 Q
39ENFRNT ;
40 S YSET=YSTEST,DFN=YSDFN D DEM^VADPT,PID^VADPT
41 S YSNM=VADM(1),(YSSX,YSSEX)=$P(VADM(5),U),YSDOB=$P(VADM(3),U,2),YSAGE=VADM(4),YSSSN=VA("PID")
42LK2 ;LOOP THRU DATES
43 S (YSDAT,YSED)=0 F S YSED=$O(^YTD(601.2,YSDFN,1,YSTEST,1,YSED)) Q:YSED'>0 S YSDAT=YSED D EXEC,FSD
44 Q
45EXEC ;SELECT TYPE OF TEST AND EXECUTE PROPER RTN
46 K S,R S YSTN=$P(^YTT(601,YSTEST,0),U) Q:'$D(^YTT(601,YSTEST,"R")) S X=^YTT(601,YSTEST,"R")
47 S YSR(0)=$G(^YTT(601.6,YSET,0))
48 I $P(YSR(0),U,2)="Y" S X=^YTT(601.6,YSET,1) X X
49 Q
50FSD ;file scale data
51 I '$D(R) S ^TMP("YSMTI",$J,YSDFN,YSET,1,YSED)="" Q
52 I $L(R) F I=1:1 Q:$P(R,U,I)="" S ^TMP("YSMTI",$J,YSDFN,YSET,I,YSED)=$P(R,U,I) S:$D(S) $P(^(YSED),U,2)=$P(S,U,I)
53 S I1=0,YSCALEN=0 F S I1=$O(R(I1)) Q:I1'>0 D FSD1
54 Q
55FSD1 ;
56 F I=1:1 Q:$P(R(I1),U,I)="" S YSCALEN=YSCALEN+1,^TMP("YSMTI",$J,YSDFN,YSET,YSCALEN,YSED)=$P(R(I1),U,I) S:$D(S(I1)) $P(^(YSED),U,2)=$P(S(I1),U,I)
57 Q
58FRONT ; front end output
59 S YSDFN=P3,(YSET,YSTEST)=P4,YSNSCALE=P5 K ^TMP("YSMTI",$J)
60 D ENFRNT
61 W "11111<BOT>",$C(13)
62FOUT2 S YSED=0 F S YSED=$O(^TMP("YSMTI",$J,YSDFN,YSET,YSNSCALE,YSED)) Q:YSED'>0 D FRONT1
63 W "<EOT>",$C(13) Q
64FRONT1 S Y=^TMP("YSMTI",$J,YSDFN,YSET,YSNSCALE,YSED)
65 ;S Y1=$P(^YTT(601,YSET,0),U,1)_U_$E(YSED,4,5)_"/"_$E(YSED,6,7)_"/"_$E(YSED,2,3)_U_$S(+Y:YSNSCALE,1:"")_U_$P(Y,U,1)_U_$P(Y,U,2)
66 S Y1=$P(^YTT(601,YSET,0),U,1)_U_$$FMTE^XLFDT(YSED,"5ZD")_U_$S(+Y:YSNSCALE,1:"")_U_$P(Y,U,1)_U_$P(Y,U,2)
67 W Y1,$C(13)
68 Q
69TLIST ;list of tests for a pt
70 S YSDFN=P3 W "11111<BOT>",$C(13)
71 S YSTEST=0 F S YSTEST=$O(^YTD(601.2,YSDFN,1,YSTEST)) Q:YSTEST'>0 I $D(^YTT(601,YSTEST,0)) W YSTEST_U_$P(^YTT(601,YSTEST,0),U)_U_$P(^YTT(601,YSTEST,"P"),"---",2)_$C(13)
72 W "<EOT>",$C(13) Q
Note: See TracBrowser for help on using the repository browser.