PSS50 ;BIR/LDT - API FOR INFORMATION FROM FILE 50 ;5 Sep 03
;;1.0;PHARMACY DATA MANAGEMENT;**85,104,192**;9/30/97;Build 25
;
DATA(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
;Returns Drug File (#50) Data
D DATA^PSS50DAT
Q
CMOP(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
;Returns CMOP information from Drug File (#50)
D CMOP^PSS50CMP
Q
DRG(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
;Returns information from Drug File (#50) used by Inpatient Meds/Unit Dose
D DRG^PSS50DAT
Q
ATC(PSSIEN,PSSFT,PSSFL,PSSPK,LIST) ;
;Returns ATC fields from the Drug File (#50)
N PSSRTOI
D ATC^PSS50ATC
Q
INV(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
;Returns inventory fields from the Drug File (#50)
D INV^PSS50B
Q
NDF(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
;Returns NDF fields from the Drug File (#50)
D NDF^PSS50B
Q
LAB(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
;Returns Lab information from the Drug File (#50)
D LAB^PSS50LAB
Q
CLOZ(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
;Returns Clozapine information from the Drug File (#50)
D CLOZ^PSS50B2
Q
ARWS(PSSIEN,PSSFT,LIST) ;
;Returns fields utilized by the Automatic Replenishment/Ward Stock extract in PBM
N PSSFL,PSSPK,PSSRTOI
D ARWS^PSS50WS
Q
DOSE(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
;Returns Dosing fields from the Drug File (#50)
D DOSE^PSS50B
Q
WS(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
;Returns Ward Stock fields from the Drug File (#50)
D WS^PSS50C
Q
MRTN(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
;Returns Lab Test Monitor fields from the Drug File (#50)
D MRTN^PSS50C
Q
ZERO(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
;Returns Zero node information from the Drug File (#50)
D ZERO^PSS50C
Q
NOCMOP(PSSIEN,PSSFL) ;
;Returns drugs from the Drug file (#50) with the CMOP Dispense Field set to Null or No
Q $$NOCMOP^PSS50C(PSSIEN,$S($G(PSSFL)]"":PSSFL,1:""))
Q
MSG(LIST) ;
;Returns entries and data from the Drug File (#50) with data in the Quantity Dispense Message field
D MSG^PSS50C
Q
IEN(LIST) ;
;Returns Active Outpatient Drugs with a VA Product Name entry
D IEN^PSS50C
Q
B(PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
;Returns Drug information based on B cross reference
D B^PSS50D
Q
VAC(PSSVAL,PSSFL,PSSPK,LIST) ;
;Returns Generic Name based on National Drug Class
N PSSRTOI
D VAC^PSS50D
Q
NDC(PSSVAL,PSSFL,PSSPK,LIST) ;
;Returns Generic Name or IEN for drugs when passed an NDC
D NDC^PSS50D
Q
ASP(PSSVAL,PSSFL,PSSPK,LIST) ;
;Returns drug entries when passed an Orderable Item
N PSSRTOI
D ASP^PSS50D
Q
AND(PSSVAL,PSSFL,PSSPK,LIST) ;
;Returns drug entries when passed a National Drug File entry
N PSSRTOI
D AND^PSS50D
Q
AP(PSSVAL,PSSFL,PSSPK,LIST) ;
;Returns drug entries when passed a Primary Drug entry
N PSSRTOI
D AP^PSS50D
Q
DSPUNT(PSSIEN,PSSIEN2,LIST) ;
;Returns Dispense Units Per Order Unit when passed in the Drug and Synonym
D DSPUNT^PSS50C1
Q
SKB(PSSIEN,PSSFL) ;
;Sets and kills B cross reference on the Name field when the Drug is passed
I +$G(PSSIEN)'>0 Q 0
I $G(PSSFL)']"" Q 0
I "SK"'[$G(PSSFL) Q 0
Q $$SKB^PSS50E(PSSIEN,PSSFL)
AOC(PSSVAL,PSSFL,PSSPK,LIST) ;
;Returns generic name or IEN for drugs when passed the VA CLASSIFICATION
D AOC^PSS50E
Q
C(PSSVAL,PSSFL,PSSPK,LIST) ;
;Returns information from the Synonym multiple of the Drug File (#50)
D C^PSS50E
Q
AQ(PSSIEN) ;
;Checks for existence of "AQ" x-ref for PSSIEN passed
I +$G(PSSIEN)'>0 Q 0
Q +$G(^PSDRUG(+PSSIEN,3))
SKAQ(PSSIEN,PSSFL) ;
;Sets and kills "AQ" x-ref on the CMOP Dispense field for PSSIEN passed
I +$G(PSSIEN)'>0 Q 0
I $G(PSSFL)']"" Q 0
I "SK"'[$G(PSSFL) Q 0
Q $$SKAQ^PSS50E(PSSIEN,$G(PSSFL))
SKAQ1(PSSIEN) ;
;Sets and kills "AQ1" x-ref on the CMOP ID field for PSSIEN passed
I +$G(PSSIEN)'>0 Q 0
Q $$SKAQ1^PSS50E(PSSIEN)
AQ1(PSSVAL,PSSFL,PSSPK,LIST) ;
;Returns a list of drugs associated with the CMOP ID passed
D AQ1^PSS50B1
Q
A526(PSSIEN,LIST) ;
;Returns a list of additives associated with the Drug passed
D A526^PSS50E
Q
A527(PSSIEN,LIST) ;
;Returns a list of solutions associated with the drug passed
D A527^PSS50E
Q
AIU(PSSFT,PSSPK,PSSFL,LIST) ;
;Returns a list of drugs based on Application Packages' Use and Inactive Date
D AIU^PSS50B1
Q
IU(PSSFL,LIST) ;
;Returns a list of drugs based on Application Packages' Use not containing "O", "U", "I", or "N"
D IU^PSS50B1
Q
SKAIU(PSSIEN,PSSFL) ;
;Sets and Kills the "AIU" x-ref on the APPLICATION PACKAGES' USE field for PSSIEN and PSSPK passed
I +$G(PSSIEN)'>0 Q 0
I $G(PSSFL)']"" Q 0
I "SK"'[$G(PSSFL) Q 0
Q $$SKAIU^PSS50E(PSSIEN,PSSFL)
SKIU(PSSIEN) ;
;Sets and Kills the "IU" x-ref on the APPLICATION PACKAGES' USE field for PSSIEN and PSSPK passed
I +$G(PSSIEN)'>0 Q 0
Q $$SKIU^PSS50E(PSSIEN)
AB(PSSVAL,PSSFL,PSSPK,LIST) ;
;Returns a list of drugs associated with an IFCAP Item Number
D AB^PSS50C
Q
AVSN(PSSVAL,PSSFL,PSSPK,LIST) ;
;Returns synonym multiple for Synonym value passed
D AVSN^PSS50B1
Q
FRMALT(PSSIEN,PSSFT,PSSFL,PSSPK,LIST) ;
;Returns the Formulary Altenative for the drug value passed
N PSSRTOI
D FRMALT^PSS50B2
Q
LABEL(PSSIEN,LIST) ;
;Returns Information for the scanner for the drug IEN passed
D LABEL^PSS50A1
Q
SORT(PSSIEN,LIST) ;
;Returns a list of drugs for the IEN passed
D SORT^PSS50A1
Q
OLDNM(PSSIEN,PSSFT,PSSFL,PSSPK,LIST) ;
;Returns OLD NAME multiple from the Drug File (#50)
N PSSRTOI
D OLDNM^PSS50F
Q
ADDOLDNM(PSSIEN,PSSONM,PSSDT) ;
;Adds an entry to the OLD NAME Multiple of the Drug file (#50)
Q $$ADDOLDNM^PSS50F($G(PSSIEN),$G(PSSONM),$G(PSSDT))
LIST(PSSFT,PSSFL,PSSD,PSSPK,LIST) ;
;Returns a list containing GENERIC NAME field (#.01) and PHARMCY ORDERABLE ITEM field (#2.1)
N PSSRTOI
D LIST^PSS50F1
Q
EDTIFCAP(PSSIEN,PSSVAL) ;
;Adds an entry to the IFCAP ITEM NUMBER multiple of the DRUG file (#50)
Q $$EDTIFCAP^PSS50F($G(PSSIEN),$G(PSSVAL))
LOOKUP(PSSFT,PSSFL,PSSPK,PSSRTOI,PSSIFCAP,PSSCMOP,PSSD,LIST) ;
D LOOKUP^PSS50F1
Q
CSYN(PSSIEN,PSSVAL,LIST) ;
;returns synonym information from the synonym multiple of the Drug file (#50)
D CSYN^PSS50C1
Q
PSSBILSD(PSSIEN,EPHBILSD) ;
; returns eBillable & Sensitive Diagnosis Drug fields from the Drug File(#50)
; Input:PSSIEN - File #50 Drug IEN
; Output:Drug File billable and sensitive diagnosis drug fields
; EPHBILL - EPHARMACY BILLABLE field #84
; EPHTRI - EPHARMACY BILLABLE (TRICARE) field #85
; EPHCHAMP - EPHARMACY BILLABLE (CHAMPVA) field #86
; EPHSENS - EPHARMACY SENSITIVE DIAGNOSIS DRUG field #87
;
; EPHBILSD=EPHBILL^EPHTRI^EPHCHAMP^EPHSENS
;
N EPHNODE,EPHBILL,EPHTRI,EPHCHAMP,EPHSENS,EPHBILSD
I $G(PSSIEN)="" Q 0
S EPHNODE=$G(^PSDRUG(PSSIEN,"EPH"))
S EPHBILL=$P(EPHNODE,U,4)
S EPHTRI=$P(EPHNODE,U,5)
S EPHCHAMP=$P(EPHNODE,U,6)
S EPHSENS=$P(EPHNODE,U,7)
S EPHBILSD=EPHBILL_U_EPHTRI_U_EPHCHAMP_U_EPHSENS
Q EPHBILSD
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSS50 7012 printed Dec 13, 2024@02:29:39 Page 2
PSS50 ;BIR/LDT - API FOR INFORMATION FROM FILE 50 ;5 Sep 03
+1 ;;1.0;PHARMACY DATA MANAGEMENT;**85,104,192**;9/30/97;Build 25
+2 ;
DATA(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
+1 ;Returns Drug File (#50) Data
+2 DO DATA^PSS50DAT
+3 QUIT
CMOP(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
+1 ;Returns CMOP information from Drug File (#50)
+2 DO CMOP^PSS50CMP
+3 QUIT
DRG(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
+1 ;Returns information from Drug File (#50) used by Inpatient Meds/Unit Dose
+2 DO DRG^PSS50DAT
+3 QUIT
ATC(PSSIEN,PSSFT,PSSFL,PSSPK,LIST) ;
+1 ;Returns ATC fields from the Drug File (#50)
+2 NEW PSSRTOI
+3 DO ATC^PSS50ATC
+4 QUIT
INV(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
+1 ;Returns inventory fields from the Drug File (#50)
+2 DO INV^PSS50B
+3 QUIT
NDF(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
+1 ;Returns NDF fields from the Drug File (#50)
+2 DO NDF^PSS50B
+3 QUIT
LAB(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
+1 ;Returns Lab information from the Drug File (#50)
+2 DO LAB^PSS50LAB
+3 QUIT
CLOZ(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
+1 ;Returns Clozapine information from the Drug File (#50)
+2 DO CLOZ^PSS50B2
+3 QUIT
ARWS(PSSIEN,PSSFT,LIST) ;
+1 ;Returns fields utilized by the Automatic Replenishment/Ward Stock extract in PBM
+2 NEW PSSFL,PSSPK,PSSRTOI
+3 DO ARWS^PSS50WS
+4 QUIT
DOSE(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
+1 ;Returns Dosing fields from the Drug File (#50)
+2 DO DOSE^PSS50B
+3 QUIT
WS(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
+1 ;Returns Ward Stock fields from the Drug File (#50)
+2 DO WS^PSS50C
+3 QUIT
MRTN(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
+1 ;Returns Lab Test Monitor fields from the Drug File (#50)
+2 DO MRTN^PSS50C
+3 QUIT
ZERO(PSSIEN,PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
+1 ;Returns Zero node information from the Drug File (#50)
+2 DO ZERO^PSS50C
+3 QUIT
NOCMOP(PSSIEN,PSSFL) ;
+1 ;Returns drugs from the Drug file (#50) with the CMOP Dispense Field set to Null or No
+2 QUIT $$NOCMOP^PSS50C(PSSIEN,$SELECT($GET(PSSFL)]"":PSSFL,1:""))
+3 QUIT
MSG(LIST) ;
+1 ;Returns entries and data from the Drug File (#50) with data in the Quantity Dispense Message field
+2 DO MSG^PSS50C
+3 QUIT
IEN(LIST) ;
+1 ;Returns Active Outpatient Drugs with a VA Product Name entry
+2 DO IEN^PSS50C
+3 QUIT
B(PSSFT,PSSFL,PSSPK,PSSRTOI,LIST) ;
+1 ;Returns Drug information based on B cross reference
+2 DO B^PSS50D
+3 QUIT
VAC(PSSVAL,PSSFL,PSSPK,LIST) ;
+1 ;Returns Generic Name based on National Drug Class
+2 NEW PSSRTOI
+3 DO VAC^PSS50D
+4 QUIT
NDC(PSSVAL,PSSFL,PSSPK,LIST) ;
+1 ;Returns Generic Name or IEN for drugs when passed an NDC
+2 DO NDC^PSS50D
+3 QUIT
ASP(PSSVAL,PSSFL,PSSPK,LIST) ;
+1 ;Returns drug entries when passed an Orderable Item
+2 NEW PSSRTOI
+3 DO ASP^PSS50D
+4 QUIT
AND(PSSVAL,PSSFL,PSSPK,LIST) ;
+1 ;Returns drug entries when passed a National Drug File entry
+2 NEW PSSRTOI
+3 DO AND^PSS50D
+4 QUIT
AP(PSSVAL,PSSFL,PSSPK,LIST) ;
+1 ;Returns drug entries when passed a Primary Drug entry
+2 NEW PSSRTOI
+3 DO AP^PSS50D
+4 QUIT
DSPUNT(PSSIEN,PSSIEN2,LIST) ;
+1 ;Returns Dispense Units Per Order Unit when passed in the Drug and Synonym
+2 DO DSPUNT^PSS50C1
+3 QUIT
SKB(PSSIEN,PSSFL) ;
+1 ;Sets and kills B cross reference on the Name field when the Drug is passed
+2 IF +$GET(PSSIEN)'>0
QUIT 0
+3 IF $GET(PSSFL)']""
QUIT 0
+4 IF "SK"'[$GET(PSSFL)
QUIT 0
+5 QUIT $$SKB^PSS50E(PSSIEN,PSSFL)
AOC(PSSVAL,PSSFL,PSSPK,LIST) ;
+1 ;Returns generic name or IEN for drugs when passed the VA CLASSIFICATION
+2 DO AOC^PSS50E
+3 QUIT
C(PSSVAL,PSSFL,PSSPK,LIST) ;
+1 ;Returns information from the Synonym multiple of the Drug File (#50)
+2 DO C^PSS50E
+3 QUIT
AQ(PSSIEN) ;
+1 ;Checks for existence of "AQ" x-ref for PSSIEN passed
+2 IF +$GET(PSSIEN)'>0
QUIT 0
+3 QUIT +$GET(^PSDRUG(+PSSIEN,3))
SKAQ(PSSIEN,PSSFL) ;
+1 ;Sets and kills "AQ" x-ref on the CMOP Dispense field for PSSIEN passed
+2 IF +$GET(PSSIEN)'>0
QUIT 0
+3 IF $GET(PSSFL)']""
QUIT 0
+4 IF "SK"'[$GET(PSSFL)
QUIT 0
+5 QUIT $$SKAQ^PSS50E(PSSIEN,$GET(PSSFL))
SKAQ1(PSSIEN) ;
+1 ;Sets and kills "AQ1" x-ref on the CMOP ID field for PSSIEN passed
+2 IF +$GET(PSSIEN)'>0
QUIT 0
+3 QUIT $$SKAQ1^PSS50E(PSSIEN)
AQ1(PSSVAL,PSSFL,PSSPK,LIST) ;
+1 ;Returns a list of drugs associated with the CMOP ID passed
+2 DO AQ1^PSS50B1
+3 QUIT
A526(PSSIEN,LIST) ;
+1 ;Returns a list of additives associated with the Drug passed
+2 DO A526^PSS50E
+3 QUIT
A527(PSSIEN,LIST) ;
+1 ;Returns a list of solutions associated with the drug passed
+2 DO A527^PSS50E
+3 QUIT
AIU(PSSFT,PSSPK,PSSFL,LIST) ;
+1 ;Returns a list of drugs based on Application Packages' Use and Inactive Date
+2 DO AIU^PSS50B1
+3 QUIT
IU(PSSFL,LIST) ;
+1 ;Returns a list of drugs based on Application Packages' Use not containing "O", "U", "I", or "N"
+2 DO IU^PSS50B1
+3 QUIT
SKAIU(PSSIEN,PSSFL) ;
+1 ;Sets and Kills the "AIU" x-ref on the APPLICATION PACKAGES' USE field for PSSIEN and PSSPK passed
+2 IF +$GET(PSSIEN)'>0
QUIT 0
+3 IF $GET(PSSFL)']""
QUIT 0
+4 IF "SK"'[$GET(PSSFL)
QUIT 0
+5 QUIT $$SKAIU^PSS50E(PSSIEN,PSSFL)
SKIU(PSSIEN) ;
+1 ;Sets and Kills the "IU" x-ref on the APPLICATION PACKAGES' USE field for PSSIEN and PSSPK passed
+2 IF +$GET(PSSIEN)'>0
QUIT 0
+3 QUIT $$SKIU^PSS50E(PSSIEN)
AB(PSSVAL,PSSFL,PSSPK,LIST) ;
+1 ;Returns a list of drugs associated with an IFCAP Item Number
+2 DO AB^PSS50C
+3 QUIT
AVSN(PSSVAL,PSSFL,PSSPK,LIST) ;
+1 ;Returns synonym multiple for Synonym value passed
+2 DO AVSN^PSS50B1
+3 QUIT
FRMALT(PSSIEN,PSSFT,PSSFL,PSSPK,LIST) ;
+1 ;Returns the Formulary Altenative for the drug value passed
+2 NEW PSSRTOI
+3 DO FRMALT^PSS50B2
+4 QUIT
LABEL(PSSIEN,LIST) ;
+1 ;Returns Information for the scanner for the drug IEN passed
+2 DO LABEL^PSS50A1
+3 QUIT
SORT(PSSIEN,LIST) ;
+1 ;Returns a list of drugs for the IEN passed
+2 DO SORT^PSS50A1
+3 QUIT
OLDNM(PSSIEN,PSSFT,PSSFL,PSSPK,LIST) ;
+1 ;Returns OLD NAME multiple from the Drug File (#50)
+2 NEW PSSRTOI
+3 DO OLDNM^PSS50F
+4 QUIT
ADDOLDNM(PSSIEN,PSSONM,PSSDT) ;
+1 ;Adds an entry to the OLD NAME Multiple of the Drug file (#50)
+2 QUIT $$ADDOLDNM^PSS50F($GET(PSSIEN),$GET(PSSONM),$GET(PSSDT))
LIST(PSSFT,PSSFL,PSSD,PSSPK,LIST) ;
+1 ;Returns a list containing GENERIC NAME field (#.01) and PHARMCY ORDERABLE ITEM field (#2.1)
+2 NEW PSSRTOI
+3 DO LIST^PSS50F1
+4 QUIT
EDTIFCAP(PSSIEN,PSSVAL) ;
+1 ;Adds an entry to the IFCAP ITEM NUMBER multiple of the DRUG file (#50)
+2 QUIT $$EDTIFCAP^PSS50F($GET(PSSIEN),$GET(PSSVAL))
LOOKUP(PSSFT,PSSFL,PSSPK,PSSRTOI,PSSIFCAP,PSSCMOP,PSSD,LIST) ;
+1 DO LOOKUP^PSS50F1
+2 QUIT
CSYN(PSSIEN,PSSVAL,LIST) ;
+1 ;returns synonym information from the synonym multiple of the Drug file (#50)
+2 DO CSYN^PSS50C1
+3 QUIT
PSSBILSD(PSSIEN,EPHBILSD) ;
+1 ; returns eBillable & Sensitive Diagnosis Drug fields from the Drug File(#50)
+2 ; Input:PSSIEN - File #50 Drug IEN
+3 ; Output:Drug File billable and sensitive diagnosis drug fields
+4 ; EPHBILL - EPHARMACY BILLABLE field #84
+5 ; EPHTRI - EPHARMACY BILLABLE (TRICARE) field #85
+6 ; EPHCHAMP - EPHARMACY BILLABLE (CHAMPVA) field #86
+7 ; EPHSENS - EPHARMACY SENSITIVE DIAGNOSIS DRUG field #87
+8 ;
+9 ; EPHBILSD=EPHBILL^EPHTRI^EPHCHAMP^EPHSENS
+10 ;
+11 NEW EPHNODE,EPHBILL,EPHTRI,EPHCHAMP,EPHSENS,EPHBILSD
+12 IF $GET(PSSIEN)=""
QUIT 0
+13 SET EPHNODE=$GET(^PSDRUG(PSSIEN,"EPH"))
+14 SET EPHBILL=$PIECE(EPHNODE,U,4)
+15 SET EPHTRI=$PIECE(EPHNODE,U,5)
+16 SET EPHCHAMP=$PIECE(EPHNODE,U,6)
+17 SET EPHSENS=$PIECE(EPHNODE,U,7)
+18 SET EPHBILSD=EPHBILL_U_EPHTRI_U_EPHCHAMP_U_EPHSENS
+19 QUIT EPHBILSD