source: FOIAVistA/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNPSR21.m@ 1522

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1SPNPSR21 ;HIRMFO/DAD,WAA-HUNT: STATE,COUNTY ;8/1/95 14:16
2 ;;2.0;Spinal Cord Dysfunction;**2**;01/02/1997
3 ;
4EN1(D0,SPNSTAT,SPNCOUN) ; *** Search entry point
5 ; Input:
6 ; ACTION,SEQUENCE = Search ACTION,SEQUENCE number
7 ; D0 = SCD (SPINAL CORD) REGISTRY file (#154) IEN
8 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"STATE",IEN) = State IEN ^ State
9 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"COUNTY",IEN) = County IEN ^ County
10 ; SPNCOUN = COUNTY IEN
11 ; SPNSTAT = STATE IEN
12 ; Output:
13 ; $S( D0_Meets_Search_Criteria : 1 , 1 : 0 )
14 ;
15 N STATE,COUNTY,DFN,I,MEETSRCH,VA,VADM,VAERR
16 S MEETSRCH=0
17 S DFN=+$P($G(^SPNL(154,+D0,0)),U)
18 D ADD^VADPT
19 I 'VAERR D
20 . S STATE=+$G(VAPA(5)) Q:'STATE
21 . I STATE'=SPNSTAT Q
22 . S COUNTY=+$G(VAPA(7)) Q:'COUNTY
23 . I COUNTY'=SPNCOUN Q
24 . S MEETSRCH=1
25 . Q
26 Q MEETSRCH
27 ;
28EN2(ACTION,SEQUENCE) ; *** Prompt entry point
29 ; Input:
30 ; ACTION,SEQUENCE = Search ACTION,SEQUENCE number
31 ; Output:
32 ; SPNLEXIT = $S( User_Abort/Timeout : 1 , 1 : 0 )
33 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"STATE",IEN) = State IEN ^ State
34 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"COUNTY",IEN) = County IEN ^ County
35 ; ^TMP($J, "SPNPRT",ACTION,SEQUENCE,0) = $$EN1^SPNPSR21(D0,STATE,COUNTY)
36 ;
37 ; Select the state
38 N STATE,COUNTY,DTOUT,DUOUT
39 S SPNLEXIT=0 D Q:SPNLEXIT!(Y<1)
40 .N DIC
41 .S DIC="^DIC(5,",DIC(0)="AEMQ" D ^DIC
42 .I $D(DTOUT)!($D(DUOUT)) S SPNLEXIT=1 Q
43 .Q:Y<1
44 .S STATE=Y
45 .Q
46 I '$D(STATE) W !,"You must select a STATE to sort by inorder to use this sort.",$C(7) Q
47 I 'SPNLEXIT,Y'="" D Q:SPNLEXIT
48 .N DIC
49 .S DIC="^DIC(5,"_+STATE_",1,",DIC(0)="AEQ" D ^DIC
50 .I $D(DTOUT)!($D(DUOUT)) S SPNLEXIT=1 Q
51 .Q:Y<1
52 .S COUNTY=Y
53 I '$D(COUNTY) W !,"You must select a county to sort by inorder to use this sort.",$C(7) Q
54 I 'SPNLEXIT D
55 .S ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"STATE",+STATE)=STATE
56 .S ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"COUNTY",+COUNTY)=COUNTY
57 .S ^TMP($J,"SPNPRT",ACTION,SEQUENCE,0)="$$EN1^SPNPSR21(D0,"_+STATE_","_+COUNTY_")"
58 .Q
59 Q
Note: See TracBrowser for help on using the repository browser.