source: FOIAVistA/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR31U.m@ 1720

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

initial load of FOIAVistA 6/30/08 version

File size: 2.7 KB
Line 
1RMPR31U ;PHX/RFM-FUNCTIONS ;8/29/1994
2 ;;3.0;PROSTHETICS;;Feb 09, 1996
3ITM(X) ; Displays external name of an item
4 ; X=Internal number from 661
5 S X=+X
6 I '$D(^RMPR(661,X,0)) Q "Item not Found"
7 S X=$P(^PRC(441,$P(^RMPR(661,X,0),U),0),U,2)
8 Q X
9ITM1(X) ; Display # of an item
10 ; X=Internal number from 661
11 S X=+X
12 I '$D(^RMPR(661,X,0)) Q "Item not Found"
13 S X=$P(^PRC(441,$P(^RMPR(661,X,0),U),0),U,1)
14 Q X
15 ;
16VEN(X) ; Displays external name of a vendor
17 ; X=Internal number of vendor from 440
18 S X=+X
19 I '$D(^PRC(440,X,0)) Q "Vendor not found"
20 S X=$P(^PRC(440,X,0),U)
21 Q X
22 ;
23PAT(X) ; Displays name of Patient
24 N RX
25 S RX=X,X=$$NAMESSN^RMPRU(RX)
26 Q $P(X,U,1)
27 ; X=Patient IEN
28 ;S X=+X
29 ;II'$D(^DPT(X,0)) Q "Patient not found"
30 ;S X=$P(^DPT(X,0),U)
31 ;Q X
32 ;
33EMP(X) ; Displays name of employee
34 ; X=Internal number from 200
35 S X=+X
36 S X=$S($D(^VA(200,X,0)):$P(^(0),U),1:"")
37 Q X
38 ;
39ITEM(X) ; Displays name of item from 660
40 ; X=IEN of record from 660
41 S X=+X
42 I '$D(^RMPR(660,X,0)) Q ""
43 I '$D(^RMPR(661,+$P(^RMPR(660,X,0),U,6),0)) Q ""
44 S X=$P(^PRC(441,$P(^RMPR(661,$P(^RMPR(660,X,0),U,6),0),U),0),U,2)
45 Q X
46ITMN(X) ; Displays NUMBER of item from 660
47 ; X=IEN of record from 660
48 S X=+X
49 I '$D(^RMPR(660,X,0)) Q ""
50 I '$D(^RMPR(661,+$P(^RMPR(660,X,0),U,6),0)) Q ""
51 S X=$P(^PRC(441,$P(^RMPR(661,$P(^RMPR(660,X,0),U,6),0),U),0),U,1)
52 Q X
53SIG(X) ;Displays Printed signature bock from file 200
54 S X=+X
55 S X=$S($D(^VA(200,X,20)):$P(^(20),U,2),1:"")
56 Q X
57STA(X) ;Displays Station Name from file Institution File
58 S X=+X
59 S X=$S($D(^DIC(4,X,0)):$P(^(0),U),1:"")
60 Q X
61STAN(X) ;Displays Station Number from file Institution File
62 S X=+X
63 S X=$S($D(^DIC(4,X,99)):$P(^(99),U),1:"")
64 Q X
65CODE(PZD,TYPE,SRC) ;GET ORTHOTIC OR RESTORATION CODE
66 ;N RAM
67 I TYPE="X",SRC="R" S AMIS=$S(+$P(RMPRAM,U,2):"134",1:$P($G(^RMPR(663,+$P(PZD,U,8),0)),U,5))_U_$S($D(RMPRGEC):$P($G(^RMPR(663,+$P(PZD,U,8),0)),U),1:+$P(PZD,U,8))
68 I TYPE="X",SRC'="R" S AMIS=$S(+$P(RMPRAM,U,2):"138",1:$P($G(^RMPR(663,+$P(PZD,U,6),0)),U,5))_U_$S($D(RMPRGEC):$P($G(^RMPR(663,+$P(PZD,U,6),0)),U),1:+$P(PZD,U,6))
69 I TYPE'="X",SRC'="R" S AMIS=$S(+$P(RMPRAM,U,2):"138",1:$P($G(^RMPR(663,+$P(PZD,U,5),0)),U,5))_U_$S($D(RMPRGEC):$P($G(^RMPR(663,+$P(PZD,U,5),0)),U),1:+$P(PZD,U,5))
70 I TYPE'="X",SRC="R" S AMIS=$S(+$P(RMPRAM,U,2):"134",1:$P($G(^RMPR(663,+$P(PZD,U,7),0)),U,5))_U_$S($D(RMPRGEC):$P($G(^RMPR(663,+$P(PZD,U,7),0)),U),1:+$P(PZD,U,7))
71 I '$D(RMPRGEC),$G(RMPRE),RMPRE'=$P(AMIS,U,2) S AMIS=""
72 Q AMIS
73BLD ;BUILD TMP GLOBAL FOR LAB/RESTORATION AMIS
74 N RI,RA,RT
75 F RI=132,133,135,136,137 F RT=0:0 S RT=$O(^RMPR(663,"E",RI,RT)) Q:RT'>0 I $D(^RMPR(663,RT,0)) S ^TMP($J,RI_U_$P(^RMPR(663,RT,0),U))="0^0^0^0^0^0^0^0^0"
76 F RA=134,138 F RI="01","02","03","04","05","06","07","08","09","10" S ^TMP($J,RA_U_RI)="0^0^0^0^0^0^0"
77 Q
Note: See TracBrowser for help on using the repository browser.