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**;9/30/97;Build 41
  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