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

ABSPOSIO.m

Go to the documentation of this file.
  1. ABSPOSIO ; IHS/FCS/DRS - NCPDP Overrides form ; [ 06/03/2002 4:40 AM ]
  1. ;;1.0;PHARMACY POINT OF SALE;**1,48**;JUN 21, 2001;Build 38
  1. ; Property of Indian Health Service
  1. ;
  1. ; IHS/OKCAO/POS IHS/ASDST/lwj 1/9/02 added logic for overrides
  1. ; For the "new" claim option, the adding and updating of
  1. ; override codes was not functioning properly - Patrick wrote
  1. ; code to first look up existing overrides for the prescription
  1. ; and/or add new overrides when requested.
  1. ; The original call from ABSPOSIB (at tag THEASKS) was altered
  1. ; to call into NEWENTR2 instead of to NEWENTRY.
  1. Q
  1. NEWENTRY ;EP - create new entry if needed
  1. I '$$GET^DDSVAL(DIE,.DA,1.09) D
  1. . ;W "Creating a new entry for Overrides",! R ">> ",%,!
  1. . D PUT^DDSVAL(DIE,.DA,1.09,$$NEW^ABSPOSO2,,"I")
  1. ;W "Field 1.09 = ",$$GET^DDSVAL(DIE,.DA,1.09,,"I"),!
  1. ;N % R ">>",%,!
  1. Q
  1. NEWENTR1() ;EP ;from a function call IHS/OKCAO/POS 1/9/02 overrides
  1. ; No routines are calling into this point at this time.
  1. ;
  1. ;
  1. NEWENTR2 ;EP - IHS/OKCAO/POS IHS/ASDST/lwj 1/9/02 updating of overrides
  1. ; The original logic for the maintaining of the override codes
  1. ; in the "new" claim feature was not correct - this routine
  1. ; will replace that logic.
  1. ;
  1. ; Called from ABSPOSIB
  1. ; If there isn't an RX - routine will simply quit
  1. ; If there is a RX, and it already has overrides, the overrides
  1. ; will be retrieved for updating
  1. ; If there is a RX, and it doesn't have overrides, a new override
  1. ; will be created to store with the transaction
  1. ;
  1. N RXI,RXR,OVERRIDE,FFDA,STRING,ZERR ; /IHS/OIT/RAM ; 12 JUN 17 ; ADD DBS CALL ERROR RETURN VARIABLE
  1. ;
  1. ; get the prescription information
  1. S RXI=$$GET^DDSVAL(DIE,.DA,1.01) ;RX IEN
  1. S RXR=$$GET^DDSVAL(DIE,.DA,1.02) ;RX Refill IEN
  1. I 'RXI D NEWENTRY Q:$Q OVERRIDE Q
  1. ;
  1. ; figure out if prescription already has override information
  1. S OVERRIDE=$$GETIEN^ABSPOSO(RXI,RXR) ;get override number
  1. ;
  1. ; if overrides exist - put on screen for updating
  1. I $G(OVERRIDE) D ;override exists
  1. . S STRING(1)="Will add override from IEN RX "_RXI ;msg on scrn
  1. . S:+RXR STRING(1)=STRING(1)_" IEN Refill "_RXR
  1. . D HLP^DDSUTL(.STRING) ;displays what is happening
  1. ;
  1. ; if override doesn't exist - create new code for use in trans file
  1. I '$G(OVERRIDE) D
  1. . S OVERRIDE=$$NEW^ABSPOSO2 ;get new code
  1. . S STRING(1)="Will add new Override "_OVERRIDE
  1. . D HLP^DDSUTL(.STRING)
  1. . ;
  1. . I '+$G(RXR) D ;if not a refill
  1. . . S FFDA(52,RXI_",",9999999.12)=OVERRIDE
  1. . . D FILE^DIE("","FFDA","ZERR") ; /IHS/OIT/RAM ; 12 JUN 17 ; UPDATE DBS CALL TO ALLOW FOR ERROR RETURN.
  1. . . I $D(ZERR) D LOG^ABSPOSL2("NEWENTR2+37^ABSPICNV",.ZERR) ; /IHS/OIT/RAM ; 12 JUN 17 ; AND LOG IT IF AN ERROR OCCURS.
  1. . ;
  1. . I +$G(RXR) D ;refill
  1. . . S FFDA(52.1,RXR_","_RXI_",",9999999.12)=OVERRIDE
  1. . . D FILE^DIE("","FFDA","ZERR") ; /IHS/OIT/RAM ; 12 JUN 17 ; UPDATE DBS CALL TO ALLOW FOR ERROR RETURN.
  1. . . I $D(ZERR) D LOG^ABSPOSL2("NEWENTR2+42^ABSPICNV",.ZERR) ; /IHS/OIT/RAM ; 12 JUN 17 ; AND LOG IT IF AN ERROR OCCURS.
  1. ;
  1. ; now- update the input data file with the override code
  1. D PUT^DDSVAL(DIE,.DA,1.09,OVERRIDE,,"I")
  1. ;
  1. Q:$Q OVERRIDE Q