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

ABSPFUNC.m

Go to the documentation of this file.
  1. ABSPFUNC ;IHS/ITSC/ENM - MISC FUNCTIONS [ 02/24/2004 9:00 AM ]
  1. ;;1.0;PHARMACY POINT OF SALE;**10,46**;JUN 21, 2001;Build 38
  1. ;
  1. ;-------------------------------------------------------------
  1. ;IHS/SD/lwj 03/10/04 Patch 10
  1. ; This routine is being borrowed from Outpatient Pharmacy 6.0 and
  1. ; was originated by Edgar Moore. Eventually, the real routine
  1. ; (APSPFUNC) will be distributed in an official release of Outpatient
  1. ; Pharmacy V6.0 and V7.0 as an API, but due to urgent issues
  1. ; presented by the onset of the EHR project, an immediate release
  1. ; of this code needed to be done within the individual packages
  1. ; affected by the change in the NDC refill field location.
  1. ;
  1. ; This routine is being included in POS as a result of:
  1. ;NOTICE TO ALL DEVELOPERS WITH APPLICATIONS THAT REFERENCE THE
  1. ; OUTPATIENT PHARMACY PRESCRIPTION FILE #52 (REFILL SUB-FILE,
  1. ; NDC FIELD #11)
  1. ; The Veterans Administration, Outpatient Pharmacy Developers have
  1. ; made a Data Dictionary change to the NDC field #11 in the Prescription
  1. ; File 52, REFILL Sub-File. This change was made in Outpatient Pharmacy
  1. ; V.7.0 Patch #29.
  1. ;----------------------------------------------------------------------
  1. ;
  1. ; Return NDC value
  1. ;input: RXIEN - Prescription IEN
  1. ; RFIEN - Refill IEN
  1. ; Output: NDC value
  1. NDCVAL(RX,RF) ; EP - API Return NDC Value
  1. ; NDC value for prescription is returned if Refill IEN is not supplied
  1. N IENS,FILE,FLD
  1. S RF=$G(RF,0)
  1. Q:'$G(RX) ""
  1. S IENS=$S(RF:RF_","_RX_",",1:RX_",")
  1. S FILE=$S(RF:52.1,1:52)
  1. S FLD=$S(RF:11,1:27)
  1. Q $$GET1^DIQ(FILE,IENS,FLD)
  1. Q
  1. RFNDC(RX,RF,APSPNDC) ;EP API SET NDC FLD #11
  1. ;Set Refill NDC
  1. ;Input RX - Prescription IEN
  1. ; RF - Refill IEN
  1. ; APSPNDC - NDC
  1. Q:'$G(RX) ""
  1. S DA(1)=RX,DIE="^PSRX(DA(1),1,"
  1. S DA=RF
  1. S DR="11////"_APSPNDC
  1. D ^DIE
  1. K DA,DIE,DR,DA,APSPNDC,RX,RF
  1. Q
  1. ISOR1(RX) ;Find Filed 419 value using OR1 (Order #)
  1. ;OIT/CAS/RCS 090913 Patch 46
  1. N OR1,NEW
  1. S OR1=$P($G(^PSRX(RX,"OR1")),U,2)
  1. I 'OR1 Q "" ;Not set
  1. S NEW=$O(^OR(100,OR1,8,"C","NW","")) ;Find New entry
  1. I 'NEW Q "" ;No New entry found
  1. S TYP=$P($G(^OR(100,OR1,8,NEW,0)),U,12)
  1. I 'TYP Q "" ;Type not set
  1. I TYP=1 Q 0 ;Written
  1. I TYP=8 Q 1 ;Electronic
  1. Q "" ;Type not used