source: WorldVistAEHR/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNPRTSR.m@ 834

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

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1SPNPRTSR ;HIRMFO/WAA- Selective search questions ; 8/20/96
2 ;;2.0;Spinal Cord Dysfunction;;01/02/1997
3 ;;
4 ; This routine will ask the Selective Search question for the sort/
5 ; search questions.
6 ; The routine will store the data in the global
7 ; ^TMP($J,"SPNPRT","POST",SEQUENCE...
8 ;
9EN1 ; Main Entry Point
10 N ACTION,SEQUENCE,SPNLIEN
11 S SPNLEXIT=$G(SPNLEXIT,0)
12 W !!,"User Selectable Filters:"
13 S ACTION="POST",SPNLEXIT=0
14 K ^TMP($J,"SPNPRT",ACTION)
15SORT ; Select the fields to sort bye
16 S SPNLIEN=0
17 F SEQUENCE=1:1:3 D Q:SPNLEXIT!(SPNLIEN=-1)
18 . N EXECUTE
19 . I $D(^TMP($J,"SPNPRT",ACTION)) D DISPLAY
20 . D SELECT
21 . Q:SPNLIEN=-1!(SPNLEXIT)
22 . S SPNLIEN=+SPNLIEN,EXECUTE=$G(^SPNL(154.92,SPNLIEN,2))
23 . Q:EXECUTE=""
24 . X EXECUTE
25 . Q
26EXIT ; Exit
27 I SPNLEXIT K ^TMP($J,"SPNPRT",ACTION) Q
28 Q
29SELECT ; DIC call to select the field
30 N DIC
31 S DIC="^SPNL(154.92,",DIC(0)="AMEQ"
32 S DIC("A")="Select Filter: "
33 S DIC("S")="I '$$POST^SPNPRTSR(Y)"
34 D ^DIC
35 I $D(DUOUT)!($D(DTOUT)) S SPNLEXIT=1 Q
36 S SPNLIEN=Y
37 Q
38DISPLAY ; This subroutine will display all the fields that have been selected
39 ; by the user.
40 N SEQUENCE,ACTION,FIELD,IEN
41 S SEQUENCE=0,ACTION="POST"
42 F S SEQUENCE=$O(^TMP($J,"SPNPRT",ACTION,SEQUENCE)) Q:SEQUENCE<1 D
43 . W !,"Sequence: ",SEQUENCE
44 . S FIELD=0 F S FIELD=$O(^TMP($J,"SPNPRT",ACTION,SEQUENCE,FIELD)) Q:FIELD="" D
45 .. I $G(^TMP($J,"SPNPRT",ACTION,SEQUENCE,FIELD))'="" W !,?10,FIELD,"=",$P(^(FIELD),U,2)
46 .. S IEN="" F S IEN=$O(^TMP($J,"SPNPRT",ACTION,SEQUENCE,FIELD,IEN)) Q:IEN="" D
47 ... W !,?20,FIELD,"=",$P(^TMP($J,"SPNPRT",ACTION,SEQUENCE,FIELD,IEN),U,2)
48 ... Q
49 .. Q
50 . Q
51 Q
52POST(SPNIEN) ; This Function is to determine if the search is a pre action
53 ; INPUT:
54 ; SPNIEN = The interneal entry number of the search
55 ; Output
56 ; SPNFLG = 1 the action is a pre action 0 not a pre action
57 ;
58 N SPNFLG
59 S SPNFLG=0
60 I $G(^SPNL(154.92,SPNIEN,3))>0 S SPNFLG=1
61 I $G(^SPNL(154.92,SPNIEN,4))>0 S SPNFLG=1
62 Q SPNFLG
Note: See TracBrowser for help on using the repository browser.