source: WorldVistAEHR/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPRPIYB.m@ 1226

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

initial load of WorldVistAEHR

File size: 4.2 KB
Line 
1RMPRPIYB ;HINCIO/ODJ - PIP Prompts - Select Existing Location ;3/8/01
2 ;;3.0;PROSTHETICS;**61**;Feb 09, 1996
3 Q
4 ;
5 ;***** LOCNM - General Prompt for stock location.
6 ; Location must exist in ^RMPR(661.5 and be active
7LOCNM(RMPRSTN,RMPR5,RMPREXC) ;
8 N RMPRERR,DIR,X,Y,DA,DUOUT,DTOUT,DIROUT,RMPRYN,RMPRTDT
9STA D NOW^%DTC S RMPRTDT=X ;today's date
10 S RMPREXC=""
11 S RMPRERR=0
12 S DIR(0)="FOA^1:30"
13 S DIR("A")="Enter Pros Location: "
14 S DIR("?")="^D QM^RMPRPIYB"
15 S DIR("??")="^D QM2^RMPRPIYB"
16 W STA
17LOCNM1 D ^DIR
18 I $D(DTOUT) S RMPREXC="T" G LOCNMX
19 I $D(DIROUT) S RMPREXC="P" G LOCNMX
20 I X=""!(X["^")!($D(DUOUT)) S RMPREXC="^" G LOCNMX
21 K RMPR5
22 S RMPR5("STATION")=RMPRSTN
23 S RMPR5("NAME")=X
24 D LIKE(RMPRSTN,X,.RMPREXC,.RMPR5)
25 I $G(RMPR5("IEN"))="" D G LOCNM1
26 . W !,"Please enter a valid Location"
27 . Q
28 G LOCNMX
29 ;
30 ; exit
31LOCNMX Q RMPRERR
32 ;
33 ; Single ? Help
34QM D QM1 ;ask if want to list locns.
35 I RMPREXC'="" G QMX
36 I RMPRYN="N" G QMX
37 D QM2 ;list locns.
38 I $G(RMPR5("IEN"))'="" D QM1H
39QMX Q
40 ;
41 ; QM1 - ask if want to list locns
42 ;
43 ; require RMPRSTN - Station number
44 ;
45 ; returns RMPREXC - exit condition
46 ; RMPRYN - Y - list, N - don't bother
47 ;
48QM1 N DIR,X,Y,DA,DTOUT,DIROUT,DIRUT,DUOUT
49 S DIR("A",1)=" Answer with PROS ITEM LOCATION"
50 S DIR("A")=" Do you want the entire PROS ITEM LOCATION List"
51 S DIR("?")="^D QM1H^RMPRPIYB"
52 S DIR(0)="YO"
53 D ^DIR
54 I $D(DTOUT) S RMPREXC="T" G QM1X
55 I $D(DIROUT) S RMPREXC="P" G QM1X
56 I X=""!(X["^")!$D(DUOUT) S RMPREXC="^" G QM1X
57 S RMPRYN="N" S:Y RMPRYN="Y"
58 S RMPREXC=""
59QM1X Q
60QM1H S %A="V",X="^"
61 Q
62 ;
63 ; QM2 - List active Location names (only to called from DIR("?"))
64 ;
65 ; require RMPRSTN - Station number
66 ;
67QM2 D LIKE(RMPRSTN,"",.RMPREXC,.RMPR5)
68 I $G(RMPR5("IEN"))'="" D QM1H
69 Q
70 ;
71 ; LIKE - List active Locn. names with matching chars.
72LIKE(RMPRSTN,RMPRTXT,RMPREXC,RMPR5) ;
73 N RMPRMAX,RMPRLIN,RMPRGBL,DIR,X,Y,DA,DTOUT,DIROUT,DIRUT,DUOUT,RMPRA
74 N RMPRYN,RMPRI,RMPRJ,RMPRERR
75 S RMPREXC=""
76 S RMPRYN=""
77 S RMPRMAX=15
78 S RMPRJ=RMPRTXT
79 I RMPRJ="" G LIKEA0
80 I '$D(^RMPR(661.5,"ASSL","A",RMPRSTN,RMPRJ)) D
81 . S RMPRJ=$O(^RMPR(661.5,"ASSL","A",RMPRSTN,RMPRJ))
82 . Q
83 I RMPRJ=""!($E(RMPRJ,1,$L(RMPRTXT))'=RMPRTXT) S RMPR5("IEN")="" G LIKEX
84 S RMPRI=$O(^RMPR(661.5,"ASSL","A",RMPRSTN,RMPRJ))
85 I RMPRI=""!($E(RMPRI,1,$L(RMPRTXT))'=RMPRTXT) D
86 . S RMPR5("IEN")=$O(^RMPR(661.5,"ASSL","A",RMPRSTN,RMPRJ,""))
87 . W:RMPRJ'=RMPRTXT $E(RMPRJ,1+$L(RMPRTXT),$L(RMPRJ))
88 . S RMPRERR=$$GET^RMPRPIX5(.RMPR5)
89 . D OK^RMPRPIYB(.RMPRYN,)
90 . Q
91 I $G(RMPR5("IEN"))'="" S:RMPRYN'="Y" RMPR5("IEN")="",RMPREXC="^" G LIKEX
92LIKEA0 S RMPRGBL="^RMPR(661.5,"_"""ASSL"",""A"","_RMPRSTN_","""_RMPRTXT_""")"
93LIKEA1 K RMPRA S RMPRLIN=0
94LIKEA S RMPRGBL=$Q(@RMPRGBL)
95LIKEA2 I RMPRGBL="" G LIKEB
96 I $QS(RMPRGBL,1)'=661.5 G LIKEB
97 I $QS(RMPRGBL,2)'="ASSL" G LIKEB
98 I $QS(RMPRGBL,3)'="A" G LIKEB
99 I $QS(RMPRGBL,4)'=RMPRSTN G LIKEB
100 I $E($QS(RMPRGBL,5),1,$L(RMPRTXT))'=RMPRTXT G LIKEB
101 I RMPRLIN,'(RMPRLIN#RMPRMAX) D G LIKEB
102 . S DIR("A",1)="Press <RETURN> to see more, '^' to exit this list, OR"
103 . Q
104LIKEA3 S RMPRLIN=RMPRLIN+1
105 W !,?4,$J(RMPRLIN,2),?9,$QS(RMPRGBL,5)
106 S RMPRA(RMPRLIN)=$QS(RMPRGBL,6)
107 G LIKEA
108LIKEB I RMPRLIN=0 G LIKEX
109LIKEC S DIR(0)="NAO^1:"_RMPRLIN_":0"
110 S DIR("A")="CHOOSE 1-"_RMPRLIN_": "
111 D ^DIR
112 I $D(DTOUT) S RMPREXC="T" G LIKEX
113 I $D(DIROUT) S RMPREXC="P" G LIKEX
114 I X="",$D(DIR("A",1)) K DIR("A",1) G LIKEA3
115 I X="" S RMPREXC="^" G LIKEX
116 I X["^"!$D(DUOUT) S RMPREXC="^" G LIKEX
117 K RMPR5
118 S RMPR5("IEN")=RMPRA(X)
119 S RMPRERR=$$GET^RMPRPIX5(.RMPR5)
120 W " "_RMPR5("NAME")
121 S RMPREXC=""
122LIKEX Q
123 ;
124 ;***** OK - prompt for OK
125 ;
126 ; Outputs:
127 ; RMPRYN - Y - yes N - No
128 ; RMPREXC - Exit condition
129 ;
130OK(RMPRYN,RMPREXC) ;
131 N DIR,X,Y,DA,DUOUT,DTOUT,DIROUT,DIRUT
132 S RMPREXC="",RMPRYN="N"
133 S DIR("A")=" ...OK"
134 S DIR("B")="Yes"
135 S DIR(0)="Y"
136 D ^DIR
137 I $D(DTOUT) S RMPREXC="T" G OKX
138 I $D(DIROUT) S RMPREXC="P" G OKX
139 I X=""!(X["^")!$D(DUOUT) S RMPREXC="^" G OKX
140 S:Y RMPRYN="Y"
141OKX Q
142 ;
143 ; Function - returns location ien if 1 active location, else 0
144LOC1(RMPRSTN) ;
145 N RMPRL,RMPR1LOC
146 S RMPR1LOC=0
147 S RMPRL=$O(^RMPR(661.5,"ASSL","A",RMPRSTN,""))
148 I RMPRL'="" D
149 . S RMPR1LOC=$O(^RMPR(661.5,"ASSL","A",RMPRSTN,RMPRL,""))
150 . S RMPRL=$O(^RMPR(661.5,"ASSL","A",RMPRSTN,RMPRL))
151 . Q
152 S:RMPRL'="" RMPR1LOC=0
153 Q RMPR1LOC
Note: See TracBrowser for help on using the repository browser.