source: FOIAVistA/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSGAF2.m@ 1540

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

initial load of FOIAVistA 6/30/08 version

File size: 1.8 KB
Line 
1YSGAF2 ;ASF/ALB- GLOBAL ASSESSMENT OF FUNCTIONNING CONT ;11/13/97 09:09
2 ;;5.01;MENTAL HEALTH;**33**;Dec 30, 1994
3 Q
4EDENT ;edit /error
5 N %DT,DA,DIE,DIR,DIRUT,DLAYGO,DR,K,X,X1,X2,Y,G,YSDATE,YSDAYS,YSDATR,YSBY,YSENT,YSGAF
6 W !,"Edit Global Assessment of functioning Diagnosis",!
7 K DFN
8 D ^YSLRP Q:'$D(DFN)
9 I '$D(^YSD(627.8,"AX5",DFN)) W !,"No previous GAF on record for this patient",!,"Please enter any new GAF data through the entry options",! H 2 Q
10 D LST
11 I '$D(^TMP("YSGAF",$J)) W !!,"No Axis 5 dx's by "_$P(^VA(200,DUZ,0),U) H 1 Q
12 D SHOW,SEL
13 Q:$D(DIRUT)!(Y'>0)
14 D APART
15 I YSDAYS>2 D
16 . W !,"Dx made ",YSDAYS," days ago and cannot be changed. Do you wish to mark it as an error? "
17 . K DIR S DIR(0)="Y",DIR("B")="No" D ^DIR Q:$D(DIRUT)
18 . I Y D NOW^%DTC S Y=% X ^DD("DD") S DIE="^YSD(627.8,",DR="80///Error: entered in error noted on "_Y_" by "_$P(^VA(200,DUZ,0),U),DA=+G D ^DIE
19 . Q
20 I YSDAYS<3 D
21 . S DIE="^YSD(627.8,",DR=65,DA=+G D ^DIE
22 . Q
23 Q
24SHOW ; display dxs
25 W !!
26 S K=0 F S K=$O(^TMP("YSGAF",$J,K)) Q:K'>0 D
27 . W:($X>45) !
28 . W $J(K,3),". GAF:",$J($P(^TMP("YSGAF",$J,K),U,3),3)_" on "
29 . S Y=$P(^TMP("YSGAF",$J,K),U,2) X ^DD("DD") W Y
30 . W ?40
31 Q
32LST ;LIST AXIS 5 FOR CURRENT PT AND DUZ
33 K ^TMP("YSGAF",$J) S YSENT=0
34 S YSDATR=0 F S YSDATR=$O(^YSD(627.8,"AX5",DFN,YSDATR)) Q:YSDATR'>0 S DA=0 F S DA=$O(^YSD(627.8,"AX5",DFN,YSDATR,DA)) Q:DA'>0 D
35 . S YSGAF=$P($G(^YSD(627.8,DA,60)),U,3) Q:YSGAF'>0
36 . S YSBY=$P(^YSD(627.8,DA,0),U,4) Q:YSBY'=DUZ
37 . Q:$L($G(^YSD(627.8,DA,80,1,0)))
38 . S YSENT=YSENT+1
39 . S ^TMP("YSGAF",$J,YSENT)=DA_U_$P(^YSD(627.8,DA,0),U,3)_U_YSGAF
40 Q
41SEL ;select dx
42 K DIR S DIR(0)="N^1:"_YSENT_":0",DIR("A")="Select GAF to edit: ",DIR("B")=1
43 D ^DIR
44 Q
45APART ;time since dx
46 S G=^TMP("YSGAF",$J,Y)
47 D NOW^%DTC S X1=%,X2=$P(G,U,2) D ^%DTC S YSDAYS=X
48 Q
Note: See TracBrowser for help on using the repository browser.