source: WorldVistAEHR/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPRPIX3.m@ 1154

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

initial load of WorldVistAEHR

File size: 2.1 KB
RevLine 
[613]1RMPRPIX3 ;HINCIO/ODJ - FILE 661.63 APIs ;3/8/01
2 ;;3.0;PROSTHETICS;**61**;Feb 09, 1996
3 Q
4 ;
5 ; Create patient issue transaction record (661.63)
6CRE(RMPR60,RMPR6,RMPR11) ;
7 N RMPRERR,RMPRFDA,RMPRFME,RMPRIEN,X,Y,DA
8 S RMPRERR=0
9 S RMPRFDA(661.63,"+1,",.01)=RMPR6("IEN")
10 S RMPRFDA(661.63,"+1,",2)=RMPR60("IEN")
11 S RMPRFDA(661.63,"+1,",3)=$G(RMPR60("661.2PTR"))
12 S RMPRFDA(661.63,"+1,",4)=$G(RMPR11("HCPCS"))
13 S RMPRFDA(661.63,"+1,",5)=$G(RMPR11("ITEM"))
14 S RMPRFDA(661.63,"+1,",6)=$G(RMPR60("DATE&TIME"))
15 S RMPRFDA(661.63,"+1,",7)=$G(RMPR11("STATION"))
16 S RMPRFDA(661.63,"+1,",8)=$G(RMPR6("LOCATION"))
17 S RMPRFDA(661.63,"+1,",9)=$G(RMPR6("VENDOR"))
18 S RMPRFDA(661.63,"+1,",10)=$G(RMPR60("COST"))
19 S RMPRFDA(661.63,"+1,",11)=$G(RMPR60("UNIT"))
20 S RMPRFDA(661.63,"+1,",12)=$G(RMPR60("QUANTITY"))
21 D UPDATE^DIE("","RMPRFDA","RMPRIEN","RMPRFME")
22 I $D(RMPRFME) S RMPRERR=99 G CREX
23CREX Q RMPRERR
24 ;
25UPD(RMPR60,RMPR63,RMPR11) ;
26 ;update file #661.63, cost and quantity
27 N RMDAT,RI
28 S RMPRERR=0
29 I '$G(RMPR63("IEN")) S RMPRERR=1 G UPDX
30 S RI=RMPR63("IEN")
31 S RMDAT(661.63,RI_",",12)=RMPR60("QUANTITY")
32 S RMDAT(661.63,RI_",",10)=RMPR60("COST")
33 D FILE^DIE("K","RMDAT","RMERR")
34 I $D(RMERR) S RMPRERR=1
35UPDX Q RMPRERR
36 ;
37 ; Delete patient issue transaction record
38DEL(RMPR6) ;
39 N RMPRERR,RMPRFDA,RMPRIEN,RMPRFME
40 S RMPRERR=0
41 S RMPRIEN=$O(^RMPR(661.63,"B",RMPR6("IEN"),""))_","
42 S RMPRFDA(661.63,RMPRIEN,.01)="@"
43 D FILE^DIE("","RMPRFDA","RMPRFME")
44 I $D(RMPRFME) S RMPRERR=99
45DELX Q RMPRERR
46 ;
47 ; Update all fields of patient issue transaction record
48UPALL(RMPR60,RMPR63,RMPR11) ;
49 N RMPRERR,RMPRFDA,RMPRIEN,RMPRFME
50 S RMPRERR=0
51 I '$G(RMPR63("IEN")) S RMPRERR=1 G UPALLX
52 S RI=RMPR63("IEN")
53 S:$D(RMPR11("HCPCS")) RMDAT(661.63,RI_",",4)=RMPR11("HCPCS")
54 S:$D(RMPR11("ITEM")) RMDAT(661.63,RI_",",5)=RMPR11("ITEM")
55 S:$D(RMPR60("DATE&TIME")) RMDAT(661.63,RI_",",6)=RMPR60("DATE&TIME")
56 S:$D(RMPR60("LOCATION")) RMDAT(661.63,RI_",",8)=RMPR60("LOCATION")
57 S RMDAT(661.63,RI_",",9)=RMPR60("VENDOR")
58 S RMDAT(661.63,RI_",",10)=RMPR60("COST")
59 S RMDAT(661.63,RI_",",11)=RMPR60("UNIT")
60 S RMDAT(661.63,RI_",",12)=RMPR60("QUANTITY")
61 D FILE^DIE("K","RMDAT","RMERR")
62UPALLX Q RMPRERR
Note: See TracBrowser for help on using the repository browser.