PSOUTIL ;IHS/DSD/JCM - outpatient pharmacy utility routine ;12/28/15 4:01pm
Source file <PSOUTIL.m>
Package | Total | Call Graph |
---|---|---|
VA FileMan | 4 | DD^%DT C^%DTC $$GET1^DIQ ^DIR |
Outpatient Pharmacy | 2 | (COSIGN,PROV)^PSODIR ($$PRVDETOX,$$RXDEA)^PSOUTIL |
Pharmacy Data Management | 2 | $$DETOX^PSSOPKI $$MXDAYSUP^PSSUTIL1 |
Kernel | 1 | ($$DETOX,$$SDEA)^XUSER |
Order Entry Results Reporting | 1 | ARCHIVE^ORDEA |
Name | Comments | DBIA/ICR reference |
---|---|---|
NPSOSD(PSORX) | ; Entry point to add newly added rx to patients PSOSD array
|
|
RNPSOSD | ;update PSOSD array for renewals
|
|
PROV(PSORENW) | ;called from psoornew
|
|
CHKPRV | ;check inactive providers and cosinging providers called from PSORENW (renew rx)
|
|
CHKPRVX | ||
NEXT(PSOX) | ;
|
|
NEXTX | ;
|
|
SUSDATE(PSOX) | ;
|
|
SUSDATEK(PSOX) | ;
|
|
STATUS(PSOREA,PSOSTAT) | ;
|
|
ACP | ||
RENFDT(PSOX) | ;gets the correct fill date
|
|
SDTX | ;
|
|
GFDT | ;
|
|
ISSPLY() | ;is the drug a supply item
|
|
DAYSUP(DRUG,RXARR,RCLQTY) | ; Adjusts DAYS SUPPLY and QUANTITY based on the maximum allowed
; Input: DRUG - DRUG file (#50) IEN ; RXARR - Array containing prescription information ; RVWQTY - Re-calculate Quantity (1: YES / 0: NO) |
|
MAXNUMRF(DRUG,DAYSUP,PTST,CLOZPAT) | ; Returns the Maximum Number of Refills Allowed
; Input: DRUG - DRUG file (#50) IEN ; DAYSUP - Number of DAYS SUPPLY per fill ; PTST - RX PATIENT STATUES (#53) IEN ; CLOZPAT - Clozapine Indicator Variable (used throughout PSO) |
|
BADADDFL(RXIEN) | ; Indicate whether an Rx should be flagged with a Bad Address
; Input: RXIEN - Rx IEN (#52) to be checked |
|
PRVDETOX(PRVIEN) | ; Returns the Provider DETOX#, if available and not expired
; Input: (r) PRVIEN - Provider IEN (Pointer to VA PERSON file (#200)) |
|
RXDEA(RXIEN,ORIEN) | ; Returns the Provider DEA# associated with the Prescription/CPRS Order (At least one of RXIEN or ORIEN is required)
; Input: (o) RXIEN - Prescription IEN (Pointer to the PRESCRIPTION file (#52)) ; (o) ORIEN - CPRS Order IEN (Pointer to ORDER file (#100)) |
|
RXDETOX(RXIEN,ORIEN) | ; Returns the Provider DETOX# associated with the Prescription/CPRS Order (At least one of RXIEN or ORIEN is required)
; Input: (o) RXIEN - Prescription IEN (Pointer to the PRESCRIPTION file (#52)) ; (o) ORIEN - CPRS Order IEN (Pointer to the ORDER file (#100)) |
|
CHKRXPRV(RXIEN,PRVIEN) | ; Check if the Provider can be assigned to a specific Prescription (Used for Rx Copy, Rx Renewal, etc.)
; Input: (r) RXIEN - Prescription IEN (Pointer to the PRESCRIPTION file (#52)) ; (o) PRVIEN - Provider IEN (Pointer to the NEW PERSON file (#200)) |
|
DRUGSCHD(DRUGIEN) | ; Return Drug DEA Schedule or "" (blank) for non-controlled substances
; Input: (r) DRUGIEN - Dispense Drug IEN (Pointer to the DRUG file (#50)) |
Name | Field # of Occurrence |
---|---|
DD^%DT | SUSDATEK+2 |
C^%DTC | NEXT+8, NEXT+18, NEXT+20 |
$$GET1^DIQ | DAYSUP+13, MAXNUMRF+16, MAXNUMRF+32, RXDEA+5, RXDETOX+5, CHKRXPRV+6, CHKRXPRV+8, DRUGSCHD+4, DRUGSCHD+5 |
^DIR | STATUS+39, DAYSUP+21 |
ARCHIVE^ORDEA | RXDEA+6, RXDETOX+6 |
COSIGN^PSODIR | CHKPRV+22 |
PROV^PSODIR | CHKPRV+4, CHKPRV+10, CHKPRV+16 |
$$PRVDETOX^PSOUTIL | CHKRXPRV+19 |
$$RXDEA^PSOUTIL | CHKRXPRV+14 |
$$DETOX^PSSOPKI | CHKRXPRV+19 |
$$MXDAYSUP^PSSUTIL1 | DAYSUP+9 |
$$DETOX^XUSER | PRVDETOX+5 |
$$SDEA^XUSER | CHKRXPRV+14 |
Name | Line Occurrences |
---|---|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Routine Call |
|
FileNo | Call Tags |
---|---|
^PSDRUG - [#50] | GET1^DIQ |
^PSNDF(50.68 - [#50.68] | GET1^DIQ |
^PSRX - [#52] | GET1^DIQ |
^PS(53 - [#53] | GET1^DIQ |
Name | Line Occurrences (* Changed, ! Killed) |
---|---|
^DD("DD" | SUSDATE+6, SDTX+2 |
^DD(52 | STATUS+33 |
^PS(52.5 - [#52.5] | SUSDATE+4, GFDT+5, GFDT+6, GFDT+8 |
^PSDRUG - [#50] | DAYSUP+7, MAXNUMRF+9 |
^PSDRUG("ACLOZ" | CHKRXPRV+9 |
^PSRX - [#52] | NPSOSD+2, NPSOSD+4, NPSOSD+5, RNPSOSD+2, RNPSOSD+4, RNPSOSD+5, RNPSOSD+8, RNPSOSD+9, NEXT+1, NEXT+2 , NEXT+3, NEXT+5, NEXT+13, NEXT+14, ACP, RENFDT+6, RENFDT+7, RENFDT+8, GFDT+1, GFDT+3 , BADADDFL+5, BADADDFL+6, BADADDFL+8, CHKRXPRV+5 |
^PSRX("ACP" | ACP* |
^TMP("PS" | NPSOSD+6*, RNPSOSD+10* |
^TMP($J | RXDEA+6!, RXDETOX+6! |
^VA(200 - [#200] | CHKPRV+2, CHKPRV+7, CHKPRV+9, CHKPRV+13, CHKPRV+15, CHKPRV+19, CHKRXPRV+7 |
^XUSEC("ORSUPPLY" | CHKPRV+8 |
^XUSEC("YSCL AUTHORIZED" | CHKRXPRV+10 |
>> | Not killed explicitly |
* | Changed |
! | Killed |
~ | Newed |
Name | Field # of Occurrence |
---|---|
>> ACOM | STATUS+1*, STATUS+4*, STATUS+7*, STATUS+11*, STATUS+15*, STATUS+19*, STATUS+23*, STATUS+27* |
BADADDFL | BADADDFL+3~, BADADDFL+4*, BADADDFL+5, BADADDFL+8*, BADADDFL+9 |
CHKRXPRV | CHKRXPRV+4~ |
CLOZDRUG | CHKRXPRV+4~, CHKRXPRV+9*, CHKRXPRV+10 |
CLOZPAT | MAXNUMRF~, MAXNUMRF+12 |
CSDRUG | MAXNUMRF+7~, MAXNUMRF+17*, MAXNUMRF+20 |
DAYSUP | MAXNUMRF~, MAXNUMRF+9, MAXNUMRF+12, MAXNUMRF+21, MAXNUMRF+22, MAXNUMRF+24, MAXNUMRF+26, MAXNUMRF+27, MAXNUMRF+29 |
DEAHDLG | MAXNUMRF+7~, MAXNUMRF+15*, MAXNUMRF+16*, MAXNUMRF+17 |
DIR | STATUS+39!, DAYSUP+21~ |
DIR("A" | STATUS+39*, DAYSUP+21* |
DIR(0 | STATUS+39*, DAYSUP+21* |
DIRUT | STATUS+39! |
DRUG | DAYSUP~, DAYSUP+7, DAYSUP+9, DAYSUP+13, MAXNUMRF~, MAXNUMRF+9, MAXNUMRF+16 |
DRUGDEA | CHKRXPRV+4~, CHKRXPRV+11*, CHKRXPRV+12, CHKRXPRV+14, CHKRXPRV+17, DRUGSCHD+3~, DRUGSCHD+4*, DRUGSCHD+6, DRUGSCHD+7, DRUGSCHD+8 |
DRUGIEN | CHKRXPRV+4~, CHKRXPRV+8*, CHKRXPRV+9, CHKRXPRV+11, CHKRXPRV+19, DRUGSCHD~, DRUGSCHD+4, DRUGSCHD+5 |
>> DSMSG | STATUS+1*, STATUS+3, STATUS+6, STATUS+10, STATUS+14, STATUS+18, STATUS+22, STATUS+26, STATUS+29, STATUS+36 |
DT | CHKPRV+14, CHKPRV+19, RENFDT+9 |
DTOUT | STATUS+39! |
DUOUT | STATUS+39! |
LBL | RENFDT+4~, GFDT+3* |
LBP | RENFDT+4~, GFDT+3*, GFDT+4 |
LSTLBLSQ | BADADDFL+3~, BADADDFL+6*, BADADDFL+7, BADADDFL+8 |
LSTLBLTX | BADADDFL+3~, BADADDFL+8* |
MAXNUMRF | MAXNUMRF+7~, MAXNUMRF+22*, MAXNUMRF+24*, MAXNUMRF+27*, MAXNUMRF+29*, MAXNUMRF+32*, MAXNUMRF+34 |
MAXPTST | MAXNUMRF+7~, MAXNUMRF+32* |
MXDAYSUP | DAYSUP+8~, DAYSUP+9*, DAYSUP+11, DAYSUP+13, DAYSUP+14, DAYSUP+17 |
NDFIEN | DRUGSCHD+3~, DRUGSCHD+5*, DRUGSCHD+6 |
NDFSCHD | DRUGSCHD+3~, DRUGSCHD+4*, DRUGSCHD+5*, DRUGSCHD+6 |
NEWQTY | DAYSUP+8~, DAYSUP+17*, DAYSUP+18, DAYSUP+19 |
OK | CHKPRV+1~, CHKPRV+2, CHKPRV+8*, CHKPRV+9* |
>> OR0 | STATUS+1, STATUS+4, STATUS+7, STATUS+11, STATUS+15, STATUS+19, STATUS+23, STATUS+27 |
ORIEN | RXDEA~, RXDEA+5*, RXDEA+6, RXDETOX~, RXDETOX+5*, RXDETOX+6 |
>> POERR | STATUS+3, STATUS+6, STATUS+10, STATUS+14, STATUS+18, STATUS+22, STATUS+26, STATUS+29, STATUS+35, STATUS+36 |
PRVDEA | CHKRXPRV+13~, CHKRXPRV+14*, CHKRXPRV+15, CHKRXPRV+16 |
PRVDETOX | PRVDETOX+4~, PRVDETOX+5* |
PRVIEN | PRVDETOX~, PRVDETOX+5, CHKRXPRV~, CHKRXPRV+6*, CHKRXPRV+7, CHKRXPRV+10, CHKRXPRV+14, CHKRXPRV+19 |
PSOA | STATUS+33*, STATUS+34, STATUS+35, STATUS+36, STATUS+37! |
PSOB | STATUS+33*, STATUS+37! |
PSODIR | CHKPRVX! |
PSODIR("COSIG | NING PROVIDER" , CHKPRV+22, CHKPRV+23 |
PSODIR("FIELD" | CHKPRV+4*, CHKPRV+10*, CHKPRV+16*, CHKPRV+21* |
PSODIR("PROVIDER" | CHKPRV+21* |
>> PSODRUG("DEA" | ISSPLY+2, ISSPLY+4 |
>> PSODRUG("NAME" | NPSOSD+3, NPSOSD+4, NPSOSD+5, NPSOSD+6, RNPSOSD+3, RNPSOSD+4, RNPSOSD+5, RNPSOSD+6, RNPSOSD+8, RNPSOSD+9 , RNPSOSD+10 |
>> PSODRUG("NDF" | NPSOSD+4, NPSOSD+5 |
>> PSODRUG("VA C | LASS" , NPSOSD+4, NPSOSD+5, ISSPLY+3, ISSPLY+4 |
>> PSOOPT | STATUS+1 |
PSOREA | STATUS~, STATUS+2, STATUS+5, STATUS+9, STATUS+13, STATUS+17, STATUS+21, STATUS+25, STATUS+29, STATUS+31 |
PSORENW | PROV~, CHKPRV+4, CHKPRV+10, CHKPRV+16 |
PSORENW("COSI | GNING PROVIDER" , CHKPRV+19, CHKPRV+23* |
PSORENW("COSIGNER" | CHKPRV+19 |
PSORENW("DFLG" | CHKPRV+2, CHKPRV+5*, CHKPRV+7, CHKPRV+11*, CHKPRV+14, CHKPRV+17*, CHKPRV+22* |
PSORENW("IRXN" | RNPSOSD+4, RNPSOSD+5, RNPSOSD+8, RNPSOSD+9 |
PSORENW("OIRXN" | RNPSOSD+2, RNPSOSD+3, RNPSOSD+4, RNPSOSD+6 |
PSORENW("OLD | FILL DATE" , SUSDATEK+2 |
PSORENW("PROVIDER" | CHKPRV+2, CHKPRV+4!, CHKPRV+5, CHKPRV+7, CHKPRV+8, CHKPRV+9, CHKPRV+10!, CHKPRV+11, CHKPRV+13, CHKPRV+15 , CHKPRV+16!, CHKPRV+17, CHKPRV+21 |
>> PSORNW("FILL | DATE" , RENFDT+9 |
PSORX | NPSOSD~ |
PSORX("FILL D | ATE" , SUSDATE+2, SUSDATE+6*, SUSDATEK+3*, RENFDT+2, SDTX+2* |
PSORX("IRXN" | NPSOSD+2, NPSOSD+4, NPSOSD+5 |
PSORX("OLD FI | LL DATE" , SUSDATE+2*, SUSDATEK+2*, SUSDATEK+3, SUSDATEK+4!, RENFDT+2* |
>> PSOSD | NPSOSD+6* |
>> PSOSD( | NPSOSD+3, NPSOSD+4*, NPSOSD+5*, RNPSOSD+3, RNPSOSD+4*, RNPSOSD+5*, RNPSOSD+6!, RNPSOSD+8*, RNPSOSD+9* |
PSOSTAT | STATUS~, STATUS+32*, STATUS+33 |
PSOX | CHKPRV+13!*, CHKPRV+14, CHKPRV+19!*, CHKPRVX!, NEXT~, SUSDATE~, SUSDATEK~, RENFDT~ |
PSOX("FILL DA | TE" , SUSDATE+1, SUSDATE+3*, SUSDATE+4*, SUSDATE+5, SUSDATEK+1*, RENFDT+1, RENFDT+3*, RENFDT+9*, SDTX+1 , GFDT+9* |
PSOX("IRXN" | NEXT+1, NEXT+2, NEXT+3, NEXT+5, NEXT+13, NEXT+14, SUSDATE+4, ACP, RENFDT+5 |
PSOX("OLD FIL | L DATE" , SUSDATE+1*, SUSDATEK+1, SUSDATEK+4!, RENFDT+1* |
PSOX("RX0" | NEXT+1*, NEXT+7, NEXT+17, NEXT+19 |
PSOX("RX2" | NEXT+2*, NEXT+4 |
PSOX("RX3" | NEXT+3*, NEXT+6*, NEXT+9*, NEXT+16*, NEXT+21*, SUSDATE+3, SUSDATE+4, RENFDT+3, GFDT+7, GFDT+9 |
PSOX1 | NEXT+4*, NEXT+6, NEXT+19, NEXTX+1! |
PSOX2 | NEXT+15*, NEXT+16, NEXTX+1! |
PSOY | NEXT+13*, NEXT+14*, NEXT+15, NEXTX+1! |
PSOY1 | NEXT+13*, NEXT+14, NEXTX+1! |
PSOY2 | NEXT+12*, NEXT+13*, NEXT+19, NEXTX+1! |
PSOY3 | NEXT+18*, NEXT+21, NEXTX+1! |
PSOY4 | NEXT+20*, NEXT+21, NEXTX+1! |
PTST | MAXNUMRF~, MAXNUMRF+32 |
RCLQTY | DAYSUP~, DAYSUP+16 |
REASON | CHKRXPRV+4~, CHKRXPRV+12*, CHKRXPRV+17*, CHKRXPRV+18* |
RF | RENFDT+4~, RENFDT+7*, RENFDT+8*, GFDT+2, GFDT+7 |
RFD | RENFDT+4~, GFDT+7*, GFDT+8 |
RFN | RENFDT+4~, RENFDT+5*, RENFDT+7*, RENFDT+8, GFDT+1, GFDT+2, GFDT+3, GFDT+7 |
RXARR | DAYSUP~, DAYSUP+7 |
RXARR("DAYS S | UPPLY" , DAYSUP+10, DAYSUP+14* |
RXARR("QTY" | DAYSUP+15, DAYSUP+19* |
RXDAYSUP | DAYSUP+8~, DAYSUP+10*, DAYSUP+11, DAYSUP+12, DAYSUP+17 |
RXDEA | RXDEA+4~, RXDEA+6*, RXDEA+7 |
RXDETOX | RXDETOX+4~, RXDETOX+6* |
RXIEN | BADADDFL~, BADADDFL+5, BADADDFL+6, BADADDFL+8, RXDEA~, RXDEA+5, RXDETOX~, RXDETOX+5, CHKRXPRV~, CHKRXPRV+5 , CHKRXPRV+6, CHKRXPRV+8, CHKRXPRV+14 |
RXQTY | DAYSUP+8~, DAYSUP+15*, DAYSUP+16, DAYSUP+17, DAYSUP+18 |
RXY | RENFDT+4~, RENFDT+5*, RENFDT+6, RENFDT+7, RENFDT+8, GFDT+1, GFDT+3, GFDT+5 |
>> SPEED | STATUS+2, STATUS+3, STATUS+5, STATUS+6, STATUS+9, STATUS+10, STATUS+13, STATUS+14, STATUS+17, STATUS+18 , STATUS+21, STATUS+22, STATUS+25, STATUS+26, STATUS+29, STATUS+34, STATUS+35, STATUS+36, STATUS+39 |
>> STA | NPSOSD+1*, NPSOSD+2, RNPSOSD+1*, RNPSOSD+2 |
>> STAT | NPSOSD+2*, NPSOSD+3, NPSOSD+4, NPSOSD+5, NPSOSD+6, RNPSOSD+2*, RNPSOSD+3, RNPSOSD+4, RNPSOSD+5, RNPSOSD+6 , RNPSOSD+8, RNPSOSD+9, RNPSOSD+10 |
SUPN | RENFDT+4~, GFDT+5*, GFDT+6, GFDT+8 |
>> VALMBCK | STATUS+3*, STATUS+6*, STATUS+10*, STATUS+14*, STATUS+18*, STATUS+22*, STATUS+26*, STATUS+29*, STATUS+36* |
>> VALMSG | STATUS+3*, STATUS+6*, STATUS+10*, STATUS+14*, STATUS+18*, STATUS+22*, STATUS+26*, STATUS+29*, STATUS+36* |
X | NEXT+9, NEXT+10!, NEXT+18, NEXT+20, NEXTX+1! |
>> X1 | NEXT+6*, NEXT+16*, NEXT+19* |
>> X2 | NEXT+7*, NEXT+17*, NEXT+19* |
Y | SUSDATE+5*, SUSDATE+6!, SUSDATEK+2*!, SDTX+1*, SDTX+2! |