RMPRPIXC ;HINCIO/ODJ - APIs for 660 file ;3/8/01
;;3.0;PROSTHETICS;**61**;Feb 09, 1996
Q
;
;***** GET - read in 660 patient 2319 record
GET(RMPR60,RMPR11) ;
N RMPRI,RMPRA,RMPRFME,RMPRERR,RMPRLIN,RMPRC
S RMPRERR=0
I $G(RMPR60("IEN"))="" S RMPRERR=1 G GETX
S RMPRI=RMPR60("IEN")_","
D GETS^DIQ(660,RMPRI,"*","","RMPRA","RMPRFME")
I $D(RMPRFME) S RMPRERR=99 G GETX
S RMPR60("ENTRY DATE")=RMPRA(660,RMPRI,.01)
S RMPR60("PATIENT")=RMPRA(660,RMPRI,.02)
S RMPR60("REQ DATE")=RMPRA(660,RMPRI,1)
S RMPR60("ISSUE TYPE")=RMPRA(660,RMPRI,2)
S RMPR60("IFCAP ITEM")=RMPRA(660,RMPRI,4)
S RMPR60("QUANTITY")=RMPRA(660,RMPRI,5)
S RMPR11("UNIT")=RMPRA(660,RMPRI,78)
S RMPR60("UNIT")=RMPRA(660,RMPRI,78)
S RMPR60("VENDOR")=RMPRA(660,RMPRI,7)
S RMPR11("STATION")=RMPRA(660,RMPRI,8)
S RMPR60("SERIAL NUM")=RMPRA(660,RMPRI,9)
S RMPR60("DELIV DATE")=RMPRA(660,RMPRI,10)
S RMPR60("REQ TYPE")=RMPRA(660,RMPRI,11)
S RMPR11("SOURCE")=RMPRA(660,RMPRI,12)
S RMPR60("COST")=RMPRA(660,RMPRI,14)
S RMPR60("REMARKS")=RMPRA(660,RMPRI,16)
S RMPR11("CPT CODE")=RMPRA(660,RMPRI,4.1)
S RMPR60("LOT NUM")=RMPRA(660,RMPRI,21)
S RMPR60("USER")=RMPRA(660,RMPRI,27)
;
; for the type 1 rec.
S RMPR11("SHORT DESC")=RMPRA(660,RMPRI,24)
S RMPR11("IEN")=RMPRA(660,RMPRI,4.5)
S RMPR60("CPT MOD")=RMPRA(660,RMPRI,4.7)
;S RMPR60("TRANS IEN")=RMPRA(660,RMPRI,4.6)
S RMPR60("TRANS IEN")=$P(^RMPR(660,RMPR60("IEN"),1),"^",5)
;
; for the type 2 rec.
S RMPR11("HCPCS-ITEM")=RMPRA(660,RMPRI,37)
S RMPR11("DESCRIPTION")=RMPRA(660,RMPRI,38)
;
; for the type AM rec.
S RMPR60("PAT CAT")=RMPRA(660,RMPRI,62)
S RMPR60("SPEC CAT")=RMPRA(660,RMPRI,63)
;
; for the type AMS rec.
S RMPR60("AMIS GROUPER")=RMPRA(660,RMPRI,68)
;
; 'DES'
S RMPRLIN="",RMPRC=0
F S RMPRLIN=$O(RMPRA(660,RMPRI,28,RMPRLIN)) Q:RMPRLIN="" D
. S RMPRC=RMPRC+1
. S RMPR60("DES",RMPRC)=RMPRA(660,RMPRI,28,RMPRLIN)
. Q
GETX Q RMPRERR
;
;***** ETOI - convert external to internal form
ETOI(RMPR60,RMPR11,RMPR60I,RMPR11I) ;
N RMPRERR,RMPRFDA,RMPRFDI,RMPRFME,RMPRI,X,Y,DA
S RMPRERR=0
S RMPRI=RMPR60("IEN")_","
D GETS^DIQ(660,RMPRI,"*","I","RMPRFDI","RMPRFME")
I $D(RMPRFME) S RMPRERR=99 G ETOIX
S RMPR60I("ENTRY DATE")=RMPRFDI(660,RMPRI,.01,"I")
S RMPR60I("PATIENT")=RMPRFDI(660,RMPRI,.02,"I")
S RMPR60I("REQ DATE")=RMPRFDI(660,RMPRI,1,"I")
S RMPR60I("ISSUE TYPE")=RMPRFDI(660,RMPRI,2,"I")
S RMPR60I("IFCAP ITEM")=$P(^RMPR(660,RMPR60("IEN"),0),"^",6) ;FM problem
S RMPR60I("QUANTITY")=RMPRFDI(660,RMPRI,5,"I")
S RMPR11I("UNIT")=RMPRFDI(660,RMPRI,78,"I")
S RMPR60I("UNIT")=RMPRFDI(660,RMPRI,78,"I")
S RMPR60I("VENDOR")=RMPRFDI(660,RMPRI,7,"I")
S RMPR11I("STATION")=RMPRFDI(660,RMPRI,8,"I")
S RMPR60I("SERIAL NUM")=RMPRFDI(660,RMPRI,9,"I")
S RMPR60I("DELIV DATE")=RMPRFDI(660,RMPRI,10,"I")
S RMPR60I("REQ TYPE")=RMPRFDI(660,RMPRI,11,"I")
S RMPR11I("SOURCE")=RMPRFDI(660,RMPRI,12,"I")
S RMPR60I("COST")=RMPRFDI(660,RMPRI,14,"I")
S RMPR60I("REMARKS")=RMPRFDI(660,RMPRI,16,"I")
S RMPR11I("CPT IEN")=RMPRFDI(660,RMPRI,4.1,"I")
S RMPR60I("LOT NUM")=RMPRFDI(660,RMPRI,21,"I")
;
; for the type 1 rec.
S RMPR11I("SHORT DESC")=RMPRFDI(660,RMPRI,24,"I")
S RMPR11I("IEN")=RMPRFDI(660,RMPRI,4.5,"I")
S RMPR60I("CPT MOD")=RMPRFDI(660,RMPRI,4.7,"I")
;
; for the type AM rec.
S RMPR60I("PAT CAT")=RMPRFDI(660,RMPRI,62,"I")
S RMPR60I("SPEC CAT")=RMPRFDI(660,RMPRI,63,"I")
ETOIX Q RMPRERR
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRMPRPIXC 3454 printed Dec 13, 2024@02:36:41 Page 2
RMPRPIXC ;HINCIO/ODJ - APIs for 660 file ;3/8/01
+1 ;;3.0;PROSTHETICS;**61**;Feb 09, 1996
+2 QUIT
+3 ;
+4 ;***** GET - read in 660 patient 2319 record
GET(RMPR60,RMPR11) ;
+1 NEW RMPRI,RMPRA,RMPRFME,RMPRERR,RMPRLIN,RMPRC
+2 SET RMPRERR=0
+3 IF $GET(RMPR60("IEN"))=""
SET RMPRERR=1
GOTO GETX
+4 SET RMPRI=RMPR60("IEN")_","
+5 DO GETS^DIQ(660,RMPRI,"*","","RMPRA","RMPRFME")
+6 IF $DATA(RMPRFME)
SET RMPRERR=99
GOTO GETX
+7 SET RMPR60("ENTRY DATE")=RMPRA(660,RMPRI,.01)
+8 SET RMPR60("PATIENT")=RMPRA(660,RMPRI,.02)
+9 SET RMPR60("REQ DATE")=RMPRA(660,RMPRI,1)
+10 SET RMPR60("ISSUE TYPE")=RMPRA(660,RMPRI,2)
+11 SET RMPR60("IFCAP ITEM")=RMPRA(660,RMPRI,4)
+12 SET RMPR60("QUANTITY")=RMPRA(660,RMPRI,5)
+13 SET RMPR11("UNIT")=RMPRA(660,RMPRI,78)
+14 SET RMPR60("UNIT")=RMPRA(660,RMPRI,78)
+15 SET RMPR60("VENDOR")=RMPRA(660,RMPRI,7)
+16 SET RMPR11("STATION")=RMPRA(660,RMPRI,8)
+17 SET RMPR60("SERIAL NUM")=RMPRA(660,RMPRI,9)
+18 SET RMPR60("DELIV DATE")=RMPRA(660,RMPRI,10)
+19 SET RMPR60("REQ TYPE")=RMPRA(660,RMPRI,11)
+20 SET RMPR11("SOURCE")=RMPRA(660,RMPRI,12)
+21 SET RMPR60("COST")=RMPRA(660,RMPRI,14)
+22 SET RMPR60("REMARKS")=RMPRA(660,RMPRI,16)
+23 SET RMPR11("CPT CODE")=RMPRA(660,RMPRI,4.1)
+24 SET RMPR60("LOT NUM")=RMPRA(660,RMPRI,21)
+25 SET RMPR60("USER")=RMPRA(660,RMPRI,27)
+26 ;
+27 ; for the type 1 rec.
+28 SET RMPR11("SHORT DESC")=RMPRA(660,RMPRI,24)
+29 SET RMPR11("IEN")=RMPRA(660,RMPRI,4.5)
+30 SET RMPR60("CPT MOD")=RMPRA(660,RMPRI,4.7)
+31 ;S RMPR60("TRANS IEN")=RMPRA(660,RMPRI,4.6)
+32 SET RMPR60("TRANS IEN")=$PIECE(^RMPR(660,RMPR60("IEN"),1),"^",5)
+33 ;
+34 ; for the type 2 rec.
+35 SET RMPR11("HCPCS-ITEM")=RMPRA(660,RMPRI,37)
+36 SET RMPR11("DESCRIPTION")=RMPRA(660,RMPRI,38)
+37 ;
+38 ; for the type AM rec.
+39 SET RMPR60("PAT CAT")=RMPRA(660,RMPRI,62)
+40 SET RMPR60("SPEC CAT")=RMPRA(660,RMPRI,63)
+41 ;
+42 ; for the type AMS rec.
+43 SET RMPR60("AMIS GROUPER")=RMPRA(660,RMPRI,68)
+44 ;
+45 ; 'DES'
+46 SET RMPRLIN=""
SET RMPRC=0
+47 FOR
SET RMPRLIN=$ORDER(RMPRA(660,RMPRI,28,RMPRLIN))
if RMPRLIN=""
QUIT
Begin DoDot:1
+48 SET RMPRC=RMPRC+1
+49 SET RMPR60("DES",RMPRC)=RMPRA(660,RMPRI,28,RMPRLIN)
+50 QUIT
End DoDot:1
GETX QUIT RMPRERR
+1 ;
+2 ;***** ETOI - convert external to internal form
ETOI(RMPR60,RMPR11,RMPR60I,RMPR11I) ;
+1 NEW RMPRERR,RMPRFDA,RMPRFDI,RMPRFME,RMPRI,X,Y,DA
+2 SET RMPRERR=0
+3 SET RMPRI=RMPR60("IEN")_","
+4 DO GETS^DIQ(660,RMPRI,"*","I","RMPRFDI","RMPRFME")
+5 IF $DATA(RMPRFME)
SET RMPRERR=99
GOTO ETOIX
+6 SET RMPR60I("ENTRY DATE")=RMPRFDI(660,RMPRI,.01,"I")
+7 SET RMPR60I("PATIENT")=RMPRFDI(660,RMPRI,.02,"I")
+8 SET RMPR60I("REQ DATE")=RMPRFDI(660,RMPRI,1,"I")
+9 SET RMPR60I("ISSUE TYPE")=RMPRFDI(660,RMPRI,2,"I")
+10 ;FM problem
SET RMPR60I("IFCAP ITEM")=$PIECE(^RMPR(660,RMPR60("IEN"),0),"^",6)
+11 SET RMPR60I("QUANTITY")=RMPRFDI(660,RMPRI,5,"I")
+12 SET RMPR11I("UNIT")=RMPRFDI(660,RMPRI,78,"I")
+13 SET RMPR60I("UNIT")=RMPRFDI(660,RMPRI,78,"I")
+14 SET RMPR60I("VENDOR")=RMPRFDI(660,RMPRI,7,"I")
+15 SET RMPR11I("STATION")=RMPRFDI(660,RMPRI,8,"I")
+16 SET RMPR60I("SERIAL NUM")=RMPRFDI(660,RMPRI,9,"I")
+17 SET RMPR60I("DELIV DATE")=RMPRFDI(660,RMPRI,10,"I")
+18 SET RMPR60I("REQ TYPE")=RMPRFDI(660,RMPRI,11,"I")
+19 SET RMPR11I("SOURCE")=RMPRFDI(660,RMPRI,12,"I")
+20 SET RMPR60I("COST")=RMPRFDI(660,RMPRI,14,"I")
+21 SET RMPR60I("REMARKS")=RMPRFDI(660,RMPRI,16,"I")
+22 SET RMPR11I("CPT IEN")=RMPRFDI(660,RMPRI,4.1,"I")
+23 SET RMPR60I("LOT NUM")=RMPRFDI(660,RMPRI,21,"I")
+24 ;
+25 ; for the type 1 rec.
+26 SET RMPR11I("SHORT DESC")=RMPRFDI(660,RMPRI,24,"I")
+27 SET RMPR11I("IEN")=RMPRFDI(660,RMPRI,4.5,"I")
+28 SET RMPR60I("CPT MOD")=RMPRFDI(660,RMPRI,4.7,"I")
+29 ;
+30 ; for the type AM rec.
+31 SET RMPR60I("PAT CAT")=RMPRFDI(660,RMPRI,62,"I")
+32 SET RMPR60I("SPEC CAT")=RMPRFDI(660,RMPRI,63,"I")
ETOIX QUIT RMPRERR