BPSOSO ;BHAM ISC/FCS/DRS/DLF - "O" is for Override NCPDP field values ;06/01/2004
 ;;1.0;E CLAIMS MGMT ENGINE;**1,5**;JUN 2004;Build 45
 ;;Per VHA Directive 2004-038, this routine should not be modified.
 ;
 ; File 9002313.511 BPS NCPDP OVERRIDE
 ;
 ; IHS/SD/lwj 8/20/02 NCPDP 5.1 changes
 ; In 5.1 there is now some repeating fields/records.  The DUR/PPS
 ; segment is a repeating segment (i.e. all the fields in this
 ; segment repeat.)  Much like the values for the BPS NCPDP
 ; Overrides are stored in a separate file, and referenced in
 ; the prescription file, the DUR/PPS values will be stored in
 ; a separate file (BPS DUR/PPS) and simply referenced in the
 ; prescription file.  For this reason, I'm adding the retrieval
 ; of the prescription DUR/PPS pointer in this routine to keep
 ; things consistent.
 ;
 Q
 ;
OVERRIDE(IEN) ; main entry point
 ; IEN points to file 9002313.511
 ; Sometimes we have IEN; sometimes we don't
 ; called from pharmacy package
 ; called from somewhere in POS, too
 I $D(IEN) D
 . I '$D(^BPS(9002313.511,IEN)) D  ; it must have been winnowed
 . . S IEN=$$NEW^BPSOSO2
 E  D
 . I '$D(IEN) S IEN=$$NEW^BPSOSO2
 I 'IEN N RETVAL S RETVAL=$$IMPOSS^BPSOSUE("FM,P","TI","Failed to create Overrides record / or bad parameter in call",,"OVERRIDE",$T(+0)) Q ""
 D MENU^BPSOSO1(IEN)
 Q IEN
OVERRIDR(RXI,RXR) ; alternative entry point - given RXI,RXR instead of IEN
 N IEN
 I $G(RXR) S IEN=$$GETIEN(RXI,RXR)
 E  S IEN=$$GETIEN(RXI)
 S IEN=$$OVERRIDE(IEN)
 Q IEN
GETIEN(RXI,RXR) ;EP -  also called from claim construction
 Q ""
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HBPSOSO   1595     printed  Sep 23, 2025@19:28:01                                                                                                                                                                                                      Page 2
BPSOSO    ;BHAM ISC/FCS/DRS/DLF - "O" is for Override NCPDP field values ;06/01/2004
 +1       ;;1.0;E CLAIMS MGMT ENGINE;**1,5**;JUN 2004;Build 45
 +2       ;;Per VHA Directive 2004-038, this routine should not be modified.
 +3       ;
 +4       ; File 9002313.511 BPS NCPDP OVERRIDE
 +5       ;
 +6       ; IHS/SD/lwj 8/20/02 NCPDP 5.1 changes
 +7       ; In 5.1 there is now some repeating fields/records.  The DUR/PPS
 +8       ; segment is a repeating segment (i.e. all the fields in this
 +9       ; segment repeat.)  Much like the values for the BPS NCPDP
 +10      ; Overrides are stored in a separate file, and referenced in
 +11      ; the prescription file, the DUR/PPS values will be stored in
 +12      ; a separate file (BPS DUR/PPS) and simply referenced in the
 +13      ; prescription file.  For this reason, I'm adding the retrieval
 +14      ; of the prescription DUR/PPS pointer in this routine to keep
 +15      ; things consistent.
 +16      ;
 +17       QUIT 
 +18      ;
OVERRIDE(IEN) ; main entry point
 +1       ; IEN points to file 9002313.511
 +2       ; Sometimes we have IEN; sometimes we don't
 +3       ; called from pharmacy package
 +4       ; called from somewhere in POS, too
 +5        IF $DATA(IEN)
               Begin DoDot:1
 +6       ; it must have been winnowed
                   IF '$DATA(^BPS(9002313.511,IEN))
                       Begin DoDot:2
 +7                        SET IEN=$$NEW^BPSOSO2
                       End DoDot:2
               End DoDot:1
 +8       IF '$TEST
               Begin DoDot:1
 +9                IF '$DATA(IEN)
                       SET IEN=$$NEW^BPSOSO2
               End DoDot:1
 +10       IF 'IEN
               NEW RETVAL
               SET RETVAL=$$IMPOSS^BPSOSUE("FM,P","TI","Failed to create Overrides record / or bad parameter in call",,"OVERRIDE",$TEXT(+0))
               QUIT ""
 +11       DO MENU^BPSOSO1(IEN)
 +12       QUIT IEN
OVERRIDR(RXI,RXR) ; alternative entry point - given RXI,RXR instead of IEN
 +1        NEW IEN
 +2        IF $GET(RXR)
               SET IEN=$$GETIEN(RXI,RXR)
 +3       IF '$TEST
               SET IEN=$$GETIEN(RXI)
 +4        SET IEN=$$OVERRIDE(IEN)
 +5        QUIT IEN
GETIEN(RXI,RXR) ;EP -  also called from claim construction
 +1        QUIT ""