source: WorldVistAEHR/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNPSR00.m@ 767

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

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1SPNPSR00 ;HIRMFO/DAD,WAA-HUNT: UTILITIES ;8/10/95 13:51
2 ;;2.0;Spinal Cord Dysfunction;;01/02/1997
3 ;======================================================================
4EN1(ACTION,SEQUENCE,BDATE,EDATE) ; *** Date range
5 ; Input:
6 ; ACTION,SEQUENCE = Search ACTION,SEQUENCE number
7 ; Output:
8 ; SPNLEXIT = $S( User_Abort/Timeout : 1 , 1 : 0 )
9 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"BEGINNING DATE") = Date ^ Date_(Ext)
10 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"ENDING DATE") = Date ^ Date_(Ext)
11 ; BDATE = FM FORMAT BEGINNING DATE
12 ; EDATE.=.FM FORMAT ENDING DATE
13 ;
14 N DATE,DIR,DIRUT,DTOUT,DUOUT,I
15 F I="BEGINNING DATE","ENDING DATE" K ^TMP($J,"SPNPRT",ACTION,SEQUENCE,I)
16 K DIR S DIR(0)="DOA^::E"
17 S DIR("A")="Beginning date: "
18 D ^DIR S DATE("BEGINNING DATE")=Y_U_$G(Y(0))
19 S SPNLEXIT=$S($D(DTOUT):1,$D(DUOUT):1,1:0)
20 I 'SPNLEXIT,Y'="" D
21 . K DIR S DIR(0)="DOA^"_$P(DATE("BEGINNING DATE"),U)_"::E"
22 . S DIR("A")="Ending date: "
23 . D ^DIR S DATE("ENDING DATE")=Y_U_$G(Y(0))
24 . Q
25 S SPNLEXIT=$S($D(DTOUT):1,$D(DUOUT):1,1:0)
26 I 'SPNLEXIT,Y'="" D
27 . F I="BEGINNING DATE","ENDING DATE" D
28 .. S ^TMP($J,"SPNPRT",ACTION,SEQUENCE,I)=DATE(I)
29 .. Q
30 . S BDATE=$P(DATE("BEGINNING DATE"),U)
31 . S EDATE=$P(DATE("ENDING DATE"),U)
32 . Q
33 Q
34 ;======================================================================
35EN2 ; *** User entry of the SEARCH criteria
36 ; Returns:
37 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE, - Search code & parameters
38 ; SPNLSORT - 1^Patient Name, 2^SSN, 3^Diagnosis
39 ;
40 S SPNLMAX=3 ; Maximum # of search variables user may select
41 ;
42 W !!,"You may choose a maximum of ",SPNLMAX," search variables.",!
43 S SPNLEXIT=0 K ^TMP($J,"SPNPRT"),SPNPRT
44 F SEQUENCE=1:1:SPNLMAX D Q:SPNLEXIT
45 . S SPNLQUIT=0
46 . F D Q:SPNLQUIT
47 .. K DIC S DIC="^SPNL(154.92,",DIC(0)="AEMNQ"
48 .. S DIC("A")="Select SEARCH VARIABLE #"_SEQUENCE_": "
49 .. S DIC("S")="I $G(^SPNL(154.92,+Y,1))]"""""
50 .. W ! D ^DIC S SPNLD0=+Y
51 .. I $D(DTOUT)!$D(DUOUT) S SPNLQUIT=1,SPNLEXIT=2 Q
52 .. I SPNLD0'>0 S SPNLQUIT=1,SPNLEXIT=1 Q
53 .. I $G(SPNPRT(SPNLD0)) D Q
54 ... W !!?5,"*** You have already chosen that one! ***",$C(7)
55 ... Q
56 .. S SPNLINQR=$G(^SPNL(154.92,SPNLD0,2)),SPNLEXIT=0
57 .. I SPNLINQR]"" X SPNLINQR S SPNLEXIT=$S(SPNLEXIT:2,1:0)
58 .. S SPNLQUIT=1
59 .. Q
60 . I SPNLD0>0,SPNLEXIT'=2 D
61 .. S SPNPRT(SPNLD0)=SPNLD0
62 .. S ^TMP($J,"SPNPRT",ACTION,SEQUENCE)=$G(^SPNL(154.92,SPNLD0,1))
63 .. Q
64 . Q
65 S SPNLEXIT=$S($O(SPNPRT(0))'>0:1,1:(SPNLEXIT=2))
66EN11 ; *** User entry of the SORT criteria
67 I SPNLEXIT=0 D
68 . K DIR S DIR(0)="SAM^1:PATIENT NAME;2:SSN;3:DIAGNOSIS"
69 . S DIR("A")="How do you want the report sorted? ",DIR("B")="PATIENT"
70 . W ! D ^DIR S SPNLSORT=Y_U_$G(Y(0)),SPNLEXIT=$S($D(DIRUT):1,1:0)
71 . Q
72 Q
73 ;======================================================================
74PAUSE I $E(IOST)="C" K DIR S DIR(0)="E" D ^DIR S SPNLEXIT=$S(Y'>0:1,1:0)
75 Q
76HEAD I SPNLEXIT Q
77 W @IOF
78 W !!?26,"SEARCH / SORT SPECIFICATION"
79 W !?26,"---------------------------"
80 Q
Note: See TracBrowser for help on using the repository browser.