PSORTSUT ;BIRM/MFR - Return To Stock Utilities ;06/07/05
;;7.0;OUTPATIENT PHARMACY;**408**;DEC 1997;Build 100
;
LOGRTS(RXIEN,RXFILL) ; Log Return to Sock Transaction
; Input: RXIEN - PRESCRIPTION file (#52) IEN
; RXFILL - Fill Number ("0":Original,"1"..:Refill #1...,"P1"...: Partial #1...)
N RTSINFO,PSOMW
S RTSINFO(52.07,"+1,"_RXIEN_",",.01)=$$NOW^XLFDT ;.01 RETURN TO STOCK DATE/TIME
S RTSINFO(52.07,"+1,"_RXIEN_",",1)=RXFILL ; 1 FILL NUMBER
S RTSINFO(52.07,"+1,"_RXIEN_",",2)=$$RXFLDT^PSOBPSUT(RXIEN,RXFILL) ; 2 FILL DATE
S RTSINFO(52.07,"+1,"_RXIEN_",",3)=$$RXQTY^PSOBPSUT(RXIEN,RXFILL) ; 3 QUANTITY
S RTSINFO(52.07,"+1,"_RXIEN_",",4)=$$RXDAYSUP^PSOBPSUT(RXIEN,RXFILL) ; 4 DAYS SUPPLY
S RTSINFO(52.07,"+1,"_RXIEN_",",5)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,17,1.2,.042,0) ; 5 UNIT PRICE OF DRUG
S PSOMW="W" I RXFILL'["P" S:$$MWC^PSOBPSU2(RXIEN,RXFILL)'="W" PSOMW="M"
S RTSINFO(52.07,"+1,"_RXIEN_",",6)=PSOMW ; 6 MAIL/WINDOW
S RTSINFO(52.07,"+1,"_RXIEN_",",7)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,12,3,.03,0) ; 7 REMARKS
S RTSINFO(52.07,"+1,"_RXIEN_",",8)=$$RXRPH^PSOBPSUT(RXIEN,RXFILL) ; 8 PHARMACIST
S RTSINFO(52.07,"+1,"_RXIEN_",",9)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,24,5,.06,0) ; 9 LOT #
S RTSINFO(52.07,"+1,"_RXIEN_",",10)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,0,6,10,0) ; 10 CLERK CODE
S RTSINFO(52.07,"+1,"_RXIEN_",",11)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,21,7,.08,0) ; 11 LOGIN DATE
S RTSINFO(52.07,"+1,"_RXIEN_",",12)=$$RXSITE^PSOBPSUT(RXIEN,RXFILL) ; 12 DIVISION
S RTSINFO(52.07,"+1,"_RXIEN_",",13)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,106,9,13,0) ; 13 IB NUMBER
S RTSINFO(52.07,"+1,"_RXIEN_",",14)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,106.6,9.1,0,0) ; 14 COPAY EXCEEDING CAP
S RTSINFO(52.07,"+1,"_RXIEN_",",15)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,25,10.1,7.5,0) ; 15 DISPENSED DATE
S RTSINFO(52.07,"+1,"_RXIEN_",",16)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,27,11,1,1) ; 16 NDC
S RTSINFO(52.07,"+1,"_RXIEN_",",17)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,28,12,2,1) ; 17 MANUFACTURER
S RTSINFO(52.07,"+1,"_RXIEN_",",18)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,29,13,12,1) ; 18 DRUG EXPIRATION DATE
S RTSINFO(52.07,"+1,"_RXIEN_",",19)=$$RXPRV^PSOBPSUT(RXIEN,RXFILL) ; 19 PROVIDER
S RTSINFO(52.07,"+1,"_RXIEN_",",20)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,14,23,0,0) ; 20 ADMINISTERED IN CLINC
S RTSINFO(52.07,"+1,"_RXIEN_",",21)=$$RXRLDT^PSOBPSUT(RXIEN,RXFILL) ; 21 RELEASE DATE/TIME
S RTSINFO(52.07,"+1,"_RXIEN_",",22)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,30,16,7,0) ; 22 GENERIC PROVIDER
S RTSINFO(52.07,"+1,"_RXIEN_",",23)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,32.3,18,9,0) ; 23 BINGO BOARD WAIT TIME
S RTSINFO(52.07,"+1,"_RXIEN_",",24)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,38.1,19,10,0) ; 24 FILLING PERSON
S RTSINFO(52.07,"+1,"_RXIEN_",",25)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,38.2,20,11,0) ; 25 CHECKING PHARMACIST
S RTSINFO(52.07,"+1,"_RXIEN_",",26)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,125,21,0,0) ; 26 PFSS ACCOUNT REFERENCE
S RTSINFO(52.07,"+1,"_RXIEN_",",27)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,126,22,0,0) ; 27 PFSS CHARGE ID
S RTSINFO(52.07,"+1,"_RXIEN_",",28)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,81,81,0,0) ; 28 DAW CODE
S RTSINFO(52.07,"+1,"_RXIEN_",",29)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,83,83,0,0) ; 29 DATE/TIME NDC VALIDATED
S RTSINFO(52.07,"+1,"_RXIEN_",",30)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,84,84,0,0) ; 30 NDC VALIDATED BY
S RTSINFO(52.07,"+1,"_RXIEN_",",31)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,85,85,0,0) ; 31 BILLING ELIGIBILITY INDICATOR
S RTSINFO(52.07,"+1,"_RXIEN_",",32)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,85,85,0,0) ; 32 EPHARMACY SUSPENSE HOLD DATE
D UPDATE^DIE("","RTSINFO")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSORTSUT 3651 printed Dec 13, 2024@02:34:23 Page 2
PSORTSUT ;BIRM/MFR - Return To Stock Utilities ;06/07/05
+1 ;;7.0;OUTPATIENT PHARMACY;**408**;DEC 1997;Build 100
+2 ;
LOGRTS(RXIEN,RXFILL) ; Log Return to Sock Transaction
+1 ; Input: RXIEN - PRESCRIPTION file (#52) IEN
+2 ; RXFILL - Fill Number ("0":Original,"1"..:Refill #1...,"P1"...: Partial #1...)
+3 NEW RTSINFO,PSOMW
+4 ;.01 RETURN TO STOCK DATE/TIME
SET RTSINFO(52.07,"+1,"_RXIEN_",",.01)=$$NOW^XLFDT
+5 ; 1 FILL NUMBER
SET RTSINFO(52.07,"+1,"_RXIEN_",",1)=RXFILL
+6 ; 2 FILL DATE
SET RTSINFO(52.07,"+1,"_RXIEN_",",2)=$$RXFLDT^PSOBPSUT(RXIEN,RXFILL)
+7 ; 3 QUANTITY
SET RTSINFO(52.07,"+1,"_RXIEN_",",3)=$$RXQTY^PSOBPSUT(RXIEN,RXFILL)
+8 ; 4 DAYS SUPPLY
SET RTSINFO(52.07,"+1,"_RXIEN_",",4)=$$RXDAYSUP^PSOBPSUT(RXIEN,RXFILL)
+9 ; 5 UNIT PRICE OF DRUG
SET RTSINFO(52.07,"+1,"_RXIEN_",",5)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,17,1.2,.042,0)
+10 SET PSOMW="W"
IF RXFILL'["P"
if $$MWC^PSOBPSU2(RXIEN,RXFILL)'="W"
SET PSOMW="M"
+11 ; 6 MAIL/WINDOW
SET RTSINFO(52.07,"+1,"_RXIEN_",",6)=PSOMW
+12 ; 7 REMARKS
SET RTSINFO(52.07,"+1,"_RXIEN_",",7)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,12,3,.03,0)
+13 ; 8 PHARMACIST
SET RTSINFO(52.07,"+1,"_RXIEN_",",8)=$$RXRPH^PSOBPSUT(RXIEN,RXFILL)
+14 ; 9 LOT #
SET RTSINFO(52.07,"+1,"_RXIEN_",",9)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,24,5,.06,0)
+15 ; 10 CLERK CODE
SET RTSINFO(52.07,"+1,"_RXIEN_",",10)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,0,6,10,0)
+16 ; 11 LOGIN DATE
SET RTSINFO(52.07,"+1,"_RXIEN_",",11)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,21,7,.08,0)
+17 ; 12 DIVISION
SET RTSINFO(52.07,"+1,"_RXIEN_",",12)=$$RXSITE^PSOBPSUT(RXIEN,RXFILL)
+18 ; 13 IB NUMBER
SET RTSINFO(52.07,"+1,"_RXIEN_",",13)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,106,9,13,0)
+19 ; 14 COPAY EXCEEDING CAP
SET RTSINFO(52.07,"+1,"_RXIEN_",",14)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,106.6,9.1,0,0)
+20 ; 15 DISPENSED DATE
SET RTSINFO(52.07,"+1,"_RXIEN_",",15)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,25,10.1,7.5,0)
+21 ; 16 NDC
SET RTSINFO(52.07,"+1,"_RXIEN_",",16)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,27,11,1,1)
+22 ; 17 MANUFACTURER
SET RTSINFO(52.07,"+1,"_RXIEN_",",17)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,28,12,2,1)
+23 ; 18 DRUG EXPIRATION DATE
SET RTSINFO(52.07,"+1,"_RXIEN_",",18)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,29,13,12,1)
+24 ; 19 PROVIDER
SET RTSINFO(52.07,"+1,"_RXIEN_",",19)=$$RXPRV^PSOBPSUT(RXIEN,RXFILL)
+25 ; 20 ADMINISTERED IN CLINC
SET RTSINFO(52.07,"+1,"_RXIEN_",",20)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,14,23,0,0)
+26 ; 21 RELEASE DATE/TIME
SET RTSINFO(52.07,"+1,"_RXIEN_",",21)=$$RXRLDT^PSOBPSUT(RXIEN,RXFILL)
+27 ; 22 GENERIC PROVIDER
SET RTSINFO(52.07,"+1,"_RXIEN_",",22)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,30,16,7,0)
+28 ; 23 BINGO BOARD WAIT TIME
SET RTSINFO(52.07,"+1,"_RXIEN_",",23)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,32.3,18,9,0)
+29 ; 24 FILLING PERSON
SET RTSINFO(52.07,"+1,"_RXIEN_",",24)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,38.1,19,10,0)
+30 ; 25 CHECKING PHARMACIST
SET RTSINFO(52.07,"+1,"_RXIEN_",",25)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,38.2,20,11,0)
+31 ; 26 PFSS ACCOUNT REFERENCE
SET RTSINFO(52.07,"+1,"_RXIEN_",",26)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,125,21,0,0)
+32 ; 27 PFSS CHARGE ID
SET RTSINFO(52.07,"+1,"_RXIEN_",",27)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,126,22,0,0)
+33 ; 28 DAW CODE
SET RTSINFO(52.07,"+1,"_RXIEN_",",28)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,81,81,0,0)
+34 ; 29 DATE/TIME NDC VALIDATED
SET RTSINFO(52.07,"+1,"_RXIEN_",",29)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,83,83,0,0)
+35 ; 30 NDC VALIDATED BY
SET RTSINFO(52.07,"+1,"_RXIEN_",",30)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,84,84,0,0)
+36 ; 31 BILLING ELIGIBILITY INDICATOR
SET RTSINFO(52.07,"+1,"_RXIEN_",",31)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,85,85,0,0)
+37 ; 32 EPHARMACY SUSPENSE HOLD DATE
SET RTSINFO(52.07,"+1,"_RXIEN_",",32)=$$VALUE^PSOBPSUT(RXIEN,RXFILL,85,85,0,0)
+38 DO UPDATE^DIE("","RTSINFO")
+39 QUIT