source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSGAFAP1.m@ 1036

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

initial load of WorldVistAEHR

File size: 1.2 KB
Line 
1YSGAFAP1 ;ALB/ASF-GLOBAL ASSESSMENT OF FUNCTIONING ;2/4/00 13:55
2 ;;5.01;MENTAL HEALTH;**64**;Dec 30, 1994
3 Q
4ENT(YSDATA,YS) ;Enter GAF information
5 ; DFN - Patient IEN
6 ; GAF - GAF Score (Axis 5)
7 ; DATE - Date/Time of Diagnosis
8 ; STAFF - Diagnosis By DUZ
9PARSE ;
10 S YSPN=$G(YS("DFN"))
11 S YSGN=$G(YS("GAF"))
12 S YSGD=$G(YS("DATE"),"NOW") S X=YSGD,%DT="T" D ^%DT S YSGD=Y
13 S YSGC=$G(YS("STAFF"))
14 IF YSPN'>0!('$D(^DPT(YSPN,0))) S YSDATA(1)="[ERROR]",YSDATA(2)="bad DFN" Q ;------->
15 IF YSGC'>0!('$D(^VA(200,YSGC,0))) S YSDATA(1)="[ERROR]",YSDATA(2)="bad staff" Q ;---->
16 IF YSGN'?1N.N!(YSGN<1)!(YSGN>100) S YSDATA(1)="[ERROR]",YSDATA(2)="bad dx" Q ;----->
17 IF YSGD<0 S YSDATA(1)="[ERROR]",YSDATA(2)="bad date" Q ;---->
18 ;
19SET K DD,DO,DA,DINUM
20 S DLAYGO=627.8,X="NOW",%DT="TR" D ^%DT S X=Y
21 S DIC="^YSD(627.8,",DIC(0)="L"
22 D FILE^DICN Q:Y'>0 S YSDA=+Y
23 S DFN=+YSPN
24 D PATSTAT^YSDX3B
25 I '$D(DFN) D QUIT ;--->
26 . D EN^YSGAFOBX(YSDA)
27 S DIE="^YSD(627.8,",DA=YSDA
28 S DR=".02////"_YSPN_";.03////"_YSGD_";.04////"_YSGC_";.05////"_DUZ
29 S DR=DR_";65////"_YSGN_";66////"_YSSTAT
30 L +^YSD(627.8,YSDA):9999 Q:'$T
31 D ^DIE
32 L -^YSD(627.8,YSDA)
33 K YSDATA S YSDATA(1)="[DATA]"
34 D EN^YSGAFOBX(YSDA)
35 K %DT,DA,DIC,DIE,DLAYGO,DR,X,Y,YSDA,YSPN,YSGN,YSGD,YSGC,YSSTAT
36 Q
Note: See TracBrowser for help on using the repository browser.