source: WorldVistAEHR/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPRPIYY.m@ 1579

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

initial load of WorldVistAEHR

File size: 4.2 KB
RevLine 
[613]1RMPRPIYY ;HINCIO/ODJ - PIP EDIT - PROMPTS AND BARCODE ;3/8/01
2 ;;3.0;PROSTHETICS;**61,132**;Feb 09, 1996;Build 13
3 Q
4 ; The following subroutines are for selecting Orders (661.41)
5 ;
6 ;***** OK - Prompt for an OK
7OK(RMPRYN,RMPREXC) ;
8 N DIR,X,Y,DA,DUOUT,DTOUT,DIROUT,DIRUT
9 S RMPREXC=""
10 S RMPRYN="N"
11 S DIR("A")=" ...OK"
12 S DIR("B")="Yes"
13 S DIR(0)="Y"
14 D ^DIR
15 I $D(DTOUT) S RMPREXC="T" G OKX
16 I $D(DIROUT) S RMPREXC="P" G OKX
17 I X=""!(X["^") S RMPREXC="^" G OKX
18 S RMPRYN="N" S:Y RMPRYN="Y"
19OKX Q
20 ;
21 ;***** PVEN - Prompt for an Open order
22PORD(RMPRSTN,RMPRHCPC,RMPRITM,RMPR41,RMPREXC) ;
23 N RMPRERR,DIR,X,Y,DUOUT,DTOUT,DIROUT,DA,DIRUT,RMPRA,RMPRGBLR,RMPRIEN1
24 N RMPRMAX,RMPRLIN,RMPRGBL,RMPR41I,RMPRS,STS,RMPROCNT,RMPRIEN,RMPRD
25 S (RMPRERR,RMPROCNT)=0
26 S RMPREXC=""
27 S RMPRMAX=15
28 S RMPRLIN=0
29 K RMPR41
30 ;
31 ; See if just 1 record - no need to list if there is
32 ; Loop on open orders
33 K RMPRORD,RMPRIEN1
34 F STS="O","R" S RMPRD="" F S RMPRD=$O(^RMPR(661.41,"ASSHID",RMPRSTN,STS,RMPRHCPC,RMPRITM,RMPRD)) Q:RMPRD="" D Q:RMPRERR
35 . S RMPRIEN=""
36 . F S RMPRIEN=$O(^RMPR(661.41,"ASSHID",RMPRSTN,STS,RMPRHCPC,RMPRITM,RMPRD,RMPRIEN)) Q:RMPRIEN="" D Q:RMPRERR
37 .. K RMPR41 S RMPR41("IEN")=RMPRIEN
38 .. S RMPRERR=$$GET^RMPRPIXN(.RMPR41,)
39 .. I RMPRERR S RMPRERR=99 Q
40 .. I RMPR41("BALANCE QTY")<1 Q
41 .. S RMPRORD(RMPRD,RMPRIEN)=STS,RMPRIEN1=RMPRIEN,RMPROCNT=RMPROCNT+1
42 .. Q
43 . Q
44 I RMPROCNT=0 K RMPR41 G PORDX
45 I RMPROCNT=1 S RMPR41("IEN")=RMPRIEN1 G PORDG
46 ;
47 ; Selection list of current stock records
48PORDL1 S RMPRD=0
49PORDL1A S RMPRD=$O(RMPRORD(RMPRD)) I RMPRD="" G:'RMPRLIN PORDX G PORDP
50PORDL1B S RMPRIEN=$O(RMPRORD(RMPRD,RMPRIEN)) G:RMPRIEN="" PORDL1A
51 K RMPR41,RMPR41I
52 S RMPR41("IEN")=RMPRIEN
53 S RMPR41I("IEN")=RMPR41("IEN")
54 S RMPRERR=$$GETI^RMPRPIXN(.RMPR41I,)
55 S RMPRERR=$$GET^RMPRPIXN(.RMPR41,)
56 I RMPRLIN,'(RMPRLIN#RMPRMAX) D G PORDP
57 . S DIR("A",1)="Press <RETURN> to see more, '^' to exit this list, or"
58 . Q
59PORDL2 S RMPRLIN=RMPRLIN+1
60 I RMPRLIN=1 D PORDH
61 S RMPRS=$P(RMPR41I("DATE ORDER"),".",1)
62 W !,$J(RMPRLIN,2)," ",$E(RMPRS,4,5)_"/"_$E(RMPRS,6,7)_"/"_$E(RMPRS,2,3)
63 W ?11,$J(RMPR41("ORDER QTY"),5,0)
64 W ?18,$E(RMPR41("VENDOR"),1,30)
65 I +RMPR41("RECEIVE QTY") D
66 . W ?49,$J(RMPR41("RECEIVE QTY"),5,0)
67 . S RMPRS=$P(RMPR41I("DATE RECEIVE"),".",1)
68 . W " ",$E(RMPRS,4,5)_"/"_$E(RMPRS,6,7)_"/"_$E(RMPRS,2,3)
69 . Q
70 S RMPRA(RMPRLIN)=RMPR41("IEN")
71 K RMPR41,RMPR41I
72 G PORDL1B
73 ;
74 ; Prompt for selection
75PORDP S DIR(0)="FAO"
76 S DIR("A")="Choose 1 - "_RMPRLIN_" : "
77 D ^DIR
78 I $D(DTOUT) S RMPREXC="T" G PORDX
79 I $D(DIROUT) S RMPREXC="P" G PORDX
80 I X="",$D(DIR("A",1)) K DIR("A",1) D PORDH G PORDL2
81 I X="" S RMPREXC="^" G PORDX
82 I X["^"!($D(DUOUT)) S RMPREXC="^" G PORDX
83 I '$D(RMPRA(X)) D G PORDP
84 . W !,"Please select a stock order record"
85 . W !,"by entering a line number in range 1 - "
86 . W RMPRLIN
87 . Q
88 S RMPR41("IEN")=RMPRA(X)
89PORDG K RMPR41I
90 S RMPR41I("IEN")=RMPR41("IEN")
91 S RMPRERR=$$GETI^RMPRPIXN(.RMPR41I,)
92 S RMPRERR=$$GET^RMPRPIXN(.RMPR41,)
93 S RMPR41("VENDOR IEN")=RMPR41I("VENDOR")
94PORDX Q
95PORDE() ;
96 Q:$QS(RMPRGBL,1)'=661.41 1
97 Q:$QS(RMPRGBL,2)'="ASSHID" 1
98 Q:$QS(RMPRGBL,3)'=RMPRSTN 1
99 Q:$QS(RMPRGBL,4)'="O" 1
100 Q:$QS(RMPRGBL,5)'=RMPRHCPC 1
101 Q:$QS(RMPRGBL,6)'=RMPRITM 1
102 Q 0
103PORDH W !
104 W !,"Select a current stock order record, or ^ if not receiving against an order.",!
105 W ?3,"Date",?13,"Qty",?18,"Vendor",?49,"Received"
106 Q
107 ;
108 ;***** NLAB - call prompt for number of labels to print
109NLAB S RMPRNLAB=RMPR6("QUANTITY")
110 W ! D NLABP^RMPRPIYS(.RMPRNLAB,RMPR6("QUANTITY"),.RMPREXC)
111 I RMPREXC="T" G RCX
112 I RMPREXC="P" G RCNX
113 I RMPREXC="^" G RCNX
114 I RMPRNLAB=0 G RCNX
115 ;
116 ;***** SELP - call prompt for barcode print device
117SELP ;
118 I RMPREXC'="" G NLAB
119 ;K RMPR7I
120 ;S RMPRERR=$$ETOI^RMPRPIX7(.RMPR7,.RMPR7I)
121 S RMPRBARC=RMPR11("HCPCS")_"-"_$P(RMPR6("DATE&TIME"),".",1)_$P(RMPR6("DATE&TIME"),".",2)
122 S RMPRITXT("DATE")=$E(RMPR6("DATE&TIME"),4,5)_"/"_$E(RMPR6("DATE&TIME"),6,7)_"/"_(1700+$E(RMPR6("DATE&TIME"),1,3))
123 S RMPRITXT("ITEM")=RMPR11("HCPCS-ITEM")
124 S RMPRITXT("ITEM DESC")=RMPR11("DESCRIPTION")
125 S RMPRITXT("MASTER DESC")=RMPR11("ITEM MASTER")
126 S RMPRITXT("UNIT PRICE")=RMPRUCST
127 S RMPRITXT("VENDOR")=RMPRVEND("NAME")
128 S RMPRITXT("LOCATION")=RMPR5("NAME")
129 D PRINT^RMPRPIYS
130RCNX ;K RMPR6,RMPRTVAL,RMPRQTY,RMPRUCST,RMPRBCP,RMPRQ,RMPRIOP,RMPRNLAB
131 ;K RMPRBARC,RMPRITXT,RMPR41N,RMPR41,RMPRVEND
132RCX Q
Note: See TracBrowser for help on using the repository browser.