- PSSBPSUT ;BIRM/MFR - BPS (ECME) Utilities ;05/14/07
- ;;1.0;PHARMACY DATA MANAGEMENT;**127,214**;9/30/97;Build 43
- ;
- NCPDPQTY(DRUG,RXQTY) ; Return the NCPDP quantity (Billing Quantity)
- ; Input: (r) DRUG - DRUG file (#50) IEN
- ; (r) RXQTY - Quantity dispensed from the PRESCRIPTION file (#52))
- ;0utput: NCPDPQTY - Billing Quantity (3 decimal places)^NCPDP Dispense Unit (EA, GM or ML)
- ;
- N UNIT,MULTIP
- ;
- S DRUG=+$G(DRUG),RXQTY=+$G(RXQTY)
- ;
- ; - Invalid DRUG IEN or DRUG not on file
- I 'DRUG!'$D(^PSDRUG(DRUG,0)) Q "-1^INVALID DRUG"
- ;
- ; - Invalid NCPDP Dispense Unit
- S UNIT=$$GET1^DIQ(50,DRUG,82,"I") I UNIT'="EA",UNIT'="GM",UNIT'="ML" Q RXQTY
- ;
- ; - Invalid NCPDP Conversion Multiplier
- S MULTIP=+$$GET1^DIQ(50,DRUG,83) I MULTIP'>0 Q RXQTY_"^"_UNIT
- ;
- Q $J(RXQTY*MULTIP,0,3)_"^"_UNIT
- ;
- EPHARM(PSSDRUG) ; ePharmacy Billable fields check
- ; Check if the ePharmacy Billable fields are all nil. If so, give the user the
- ; opportunity to input a value into the fields.
- ;
- ; Input: (r) PSSDRUG - DRUG file (#50) IEN
- ;
- N ARRAY,DA,DATA,DIE,DIR,DR,I,PSSDRUG1,TODAY,Y
- ;
- ; Pull existing values from ^PSDRUG, for ePharmacy Billable fields, and put into ARRAY.
- S PSSDRUG1=PSSDRUG_","
- D GETS^DIQ(50,PSSDRUG1,"84;85;86;100","I","ARRAY")
- ;
- ; If INACTIVE DATE is not greater than today, QUIT. Do not check ePharmacy Billable Fields.
- S TODAY=$$DT^XLFDT
- I (ARRAY(50,PSSDRUG1,100,"I")'="")&(ARRAY(50,PSSDRUG1,100,"I")'>TODAY) Q
- ;
- ; Check the 3 fields in ARRAY. If any field has a value defined, QUIT.
- S DATA=""
- F I=84,85,86 I $G(ARRAY(50,PSSDRUG1,I,"I"))'="" S DATA=1
- I DATA=1 Q
- ;
- ; All 3 fields were nil. Prompt user if they would like to enter values.
- S DIR("A",1)=" "
- S DIR("A",2)=" None of the ePharmacy Billable fields are marked. ePharmacy claims"
- S DIR("A",3)=" will not be billed if not marked. Do you wish to mark any of the"
- S DIR("A")=" fields (Y/N)"
- S DIR(0)="Y"
- D ^DIR
- ;
- I Y'=1 Q ; If user did not respond YES to entering ePharmacy Billable fields, QUIT.
- ;
- W !
- ; Display the 3 ePharmacy Billable fields to the user.
- S DIE="^PSDRUG("
- S DA=PSSDRUG
- S DR="84ePharmacy Billable;85 ePharmacy Billable (TRICARE);86 ePharmacy Billable (CHAMPVA)"
- D ^DIE
- ;
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSSBPSUT 2275 printed Feb 18, 2025@23:56:27 Page 2
- PSSBPSUT ;BIRM/MFR - BPS (ECME) Utilities ;05/14/07
- +1 ;;1.0;PHARMACY DATA MANAGEMENT;**127,214**;9/30/97;Build 43
- +2 ;
- NCPDPQTY(DRUG,RXQTY) ; Return the NCPDP quantity (Billing Quantity)
- +1 ; Input: (r) DRUG - DRUG file (#50) IEN
- +2 ; (r) RXQTY - Quantity dispensed from the PRESCRIPTION file (#52))
- +3 ;0utput: NCPDPQTY - Billing Quantity (3 decimal places)^NCPDP Dispense Unit (EA, GM or ML)
- +4 ;
- +5 NEW UNIT,MULTIP
- +6 ;
- +7 SET DRUG=+$GET(DRUG)
- SET RXQTY=+$GET(RXQTY)
- +8 ;
- +9 ; - Invalid DRUG IEN or DRUG not on file
- +10 IF 'DRUG!'$DATA(^PSDRUG(DRUG,0))
- QUIT "-1^INVALID DRUG"
- +11 ;
- +12 ; - Invalid NCPDP Dispense Unit
- +13 SET UNIT=$$GET1^DIQ(50,DRUG,82,"I")
- IF UNIT'="EA"
- IF UNIT'="GM"
- IF UNIT'="ML"
- QUIT RXQTY
- +14 ;
- +15 ; - Invalid NCPDP Conversion Multiplier
- +16 SET MULTIP=+$$GET1^DIQ(50,DRUG,83)
- IF MULTIP'>0
- QUIT RXQTY_"^"_UNIT
- +17 ;
- +18 QUIT $JUSTIFY(RXQTY*MULTIP,0,3)_"^"_UNIT
- +19 ;
- EPHARM(PSSDRUG) ; ePharmacy Billable fields check
- +1 ; Check if the ePharmacy Billable fields are all nil. If so, give the user the
- +2 ; opportunity to input a value into the fields.
- +3 ;
- +4 ; Input: (r) PSSDRUG - DRUG file (#50) IEN
- +5 ;
- +6 NEW ARRAY,DA,DATA,DIE,DIR,DR,I,PSSDRUG1,TODAY,Y
- +7 ;
- +8 ; Pull existing values from ^PSDRUG, for ePharmacy Billable fields, and put into ARRAY.
- +9 SET PSSDRUG1=PSSDRUG_","
- +10 DO GETS^DIQ(50,PSSDRUG1,"84;85;86;100","I","ARRAY")
- +11 ;
- +12 ; If INACTIVE DATE is not greater than today, QUIT. Do not check ePharmacy Billable Fields.
- +13 SET TODAY=$$DT^XLFDT
- +14 IF (ARRAY(50,PSSDRUG1,100,"I")'="")&(ARRAY(50,PSSDRUG1,100,"I")'>TODAY)
- QUIT
- +15 ;
- +16 ; Check the 3 fields in ARRAY. If any field has a value defined, QUIT.
- +17 SET DATA=""
- +18 FOR I=84,85,86
- IF $GET(ARRAY(50,PSSDRUG1,I,"I"))'=""
- SET DATA=1
- +19 IF DATA=1
- QUIT
- +20 ;
- +21 ; All 3 fields were nil. Prompt user if they would like to enter values.
- +22 SET DIR("A",1)=" "
- +23 SET DIR("A",2)=" None of the ePharmacy Billable fields are marked. ePharmacy claims"
- +24 SET DIR("A",3)=" will not be billed if not marked. Do you wish to mark any of the"
- +25 SET DIR("A")=" fields (Y/N)"
- +26 SET DIR(0)="Y"
- +27 DO ^DIR
- +28 ;
- +29 ; If user did not respond YES to entering ePharmacy Billable fields, QUIT.
- IF Y'=1
- QUIT
- +30 ;
- +31 WRITE !
- +32 ; Display the 3 ePharmacy Billable fields to the user.
- +33 SET DIE="^PSDRUG("
- +34 SET DA=PSSDRUG
- +35 SET DR="84ePharmacy Billable;85 ePharmacy Billable (TRICARE);86 ePharmacy Billable (CHAMPVA)"
- +36 DO ^DIE
- +37 ;
- +38 QUIT