source: FOIAVistA/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNLGEAA.m@ 1446

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

initial load of FOIAVistA 6/30/08 version

File size: 1.8 KB
Line 
1SPNLGEAA ;ISC-SF/REM - RETRIEVE DATA FROM FILE 154 ;7/24/95 14:08
2 ;;2.0;Spinal Cord Dysfunction;**2**;01/02/1997
3 ;;
4EXTRACT(RECN,FORMAT,FLAG) ;
5 ;RECN...........This is the IEN of file 154.
6 ;FORMAT.........This is determines whether the data will be in
7 ; internal or external format. (IS NOT USED IN THIS VERSION)
8 ;FLAG...........This is set to 1 and error message text if there is an
9 ;error retrieveing the data.
10 ;
11 N REC,REC1,REC2,REC3,REC4,NLOIRN,ETRN,RECNN,SPNPHY
12 K DIC,DIQ,SPNLDIQ
13 I '$D(^SPNL(154,RECN,0)) S FLAG="1^NO ZERO NODE FOR RECORD "_RECN_" IN FILE 154" D END Q
14 I '$P($G(^SPNL(154,RECN,"XMT")),U) D END Q
15 S DIC="^SPNL(154,",DR=".02;.03;.05;1.1:3.3;999.03",DA=RECN,DIQ="SPNLDIQ",DIQ(0)="EI" D EN^DIQ1 K DIC,DIQ
16 I $G(SPNLDIQ(154,DA,.03,"I"))="X" D END Q ; Patient is dead
17 S REC1=$G(SPNLDIQ(154,DA,.02,"I"))_U_$G(SPNLDIQ(154,DA,.05,"I"))_U_$G(SPNLDIQ(154,DA,.03,"I"))_U_""_U
18 S SPNPHY="" I $O(^SPNL(154,DA,"REHAB",0)) D
19 . S SPNPHY=$O(^SPNL(154,DA,"REHAB","B",""),-1)\1
20 . I SPNPHY'?7N S SPNPHY=""
21 . Q
22 S REC1=REC1_SPNPHY_U_$G(SPNLDIQ(154,DA,999.03,"E"))
23 S REC2=$G(SPNLDIQ(154,DA,2.3,"I"))
24 S NLOIRN=$G(SPNLDIQ(154,DA,2.1,"I"))
25 S REC4=$P($G(^SPNL(154.01,+NLOIRN,0)),U)
26 I $O(^SPNL(154,RECN,"E",0)) D
27 . S RECNN=0
28 . F S RECNN=$O(^SPNL(154,RECN,"E",RECNN)) Q:RECNN'>0 D
29 .. S ETRN=$G(^SPNL(154,RECN,"E",RECNN,0))
30 .. S REC3=$P(ETRN,U,2)_U_$P($G(^SPNL(154.03,+$P(ETRN,U),0)),U)_U_$P($G(^(0)),U,2)
31 .. I +REC3 D ADDREC
32 .. Q
33 . Q
34END K SPNLDIQ,DA,DR,NLOI
35 Q
36ADDREC ;
37 ; REC = Registration_Date ^ Date_of_Last_Update ^ Registration_Status
38 ; SCD_Service_Connection ^ Last_Physical_Exam ^
39 ; Completeness_of_Injury ^ Information_Source_for_NLOI ^
40 ; Date_of_Onset ^ Etiology ^ Type_of_Cause ^
41 ; Highest_Level_of_Injury
42 ;
43 S REC=$G(REC1)_U_$G(REC2)_U_$G(REC3)_U_$G(REC4)
44 D ADDREC^SPNLGE("AA",REC)
45 Q
Note: See TracBrowser for help on using the repository browser.