Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSSBPSUT

PSSBPSUT.m

Go to the documentation of this file.
  1. PSSBPSUT ;BIRM/MFR - BPS (ECME) Utilities ;05/14/07
  1. ;;1.0;PHARMACY DATA MANAGEMENT;**127,214**;9/30/97;Build 43
  1. ;
  1. NCPDPQTY(DRUG,RXQTY) ; Return the NCPDP quantity (Billing Quantity)
  1. ; Input: (r) DRUG - DRUG file (#50) IEN
  1. ; (r) RXQTY - Quantity dispensed from the PRESCRIPTION file (#52))
  1. ;0utput: NCPDPQTY - Billing Quantity (3 decimal places)^NCPDP Dispense Unit (EA, GM or ML)
  1. ;
  1. N UNIT,MULTIP
  1. ;
  1. S DRUG=+$G(DRUG),RXQTY=+$G(RXQTY)
  1. ;
  1. ; - Invalid DRUG IEN or DRUG not on file
  1. I 'DRUG!'$D(^PSDRUG(DRUG,0)) Q "-1^INVALID DRUG"
  1. ;
  1. ; - Invalid NCPDP Dispense Unit
  1. S UNIT=$$GET1^DIQ(50,DRUG,82,"I") I UNIT'="EA",UNIT'="GM",UNIT'="ML" Q RXQTY
  1. ;
  1. ; - Invalid NCPDP Conversion Multiplier
  1. S MULTIP=+$$GET1^DIQ(50,DRUG,83) I MULTIP'>0 Q RXQTY_"^"_UNIT
  1. ;
  1. Q $J(RXQTY*MULTIP,0,3)_"^"_UNIT
  1. ;
  1. EPHARM(PSSDRUG) ; ePharmacy Billable fields check
  1. ; Check if the ePharmacy Billable fields are all nil. If so, give the user the
  1. ; opportunity to input a value into the fields.
  1. ;
  1. ; Input: (r) PSSDRUG - DRUG file (#50) IEN
  1. ;
  1. N ARRAY,DA,DATA,DIE,DIR,DR,I,PSSDRUG1,TODAY,Y
  1. ;
  1. ; Pull existing values from ^PSDRUG, for ePharmacy Billable fields, and put into ARRAY.
  1. S PSSDRUG1=PSSDRUG_","
  1. D GETS^DIQ(50,PSSDRUG1,"84;85;86;100","I","ARRAY")
  1. ;
  1. ; If INACTIVE DATE is not greater than today, QUIT. Do not check ePharmacy Billable Fields.
  1. S TODAY=$$DT^XLFDT
  1. I (ARRAY(50,PSSDRUG1,100,"I")'="")&(ARRAY(50,PSSDRUG1,100,"I")'>TODAY) Q
  1. ;
  1. ; Check the 3 fields in ARRAY. If any field has a value defined, QUIT.
  1. S DATA=""
  1. F I=84,85,86 I $G(ARRAY(50,PSSDRUG1,I,"I"))'="" S DATA=1
  1. I DATA=1 Q
  1. ;
  1. ; All 3 fields were nil. Prompt user if they would like to enter values.
  1. S DIR("A",1)=" "
  1. S DIR("A",2)=" None of the ePharmacy Billable fields are marked. ePharmacy claims"
  1. S DIR("A",3)=" will not be billed if not marked. Do you wish to mark any of the"
  1. S DIR("A")=" fields (Y/N)"
  1. S DIR(0)="Y"
  1. D ^DIR
  1. ;
  1. I Y'=1 Q ; If user did not respond YES to entering ePharmacy Billable fields, QUIT.
  1. ;
  1. W !
  1. ; Display the 3 ePharmacy Billable fields to the user.
  1. S DIE="^PSDRUG("
  1. S DA=PSSDRUG
  1. S DR="84ePharmacy Billable;85 ePharmacy Billable (TRICARE);86 ePharmacy Billable (CHAMPVA)"
  1. D ^DIE
  1. ;
  1. Q