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

ABSPOSI7.m

Go to the documentation of this file.
  1. ABSPOSI7 ; IHS/FCS/DRS - utilities to go with Page 7 ; [ 08/30/2002 7:20 AM ]
  1. ;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
  1. ;----------------------------------------------------------
  1. ;IHS/SD/lwj 8/29/02 NCPDP 5.1 changes
  1. ; new field added to the insurance/prior authorization screen
  1. ; to capture the Prior Authorization Type Code. Changed
  1. ; ENAB subroutine to enable and disable this field. The
  1. ; field will be enabled when the preauthorization code is
  1. ; enabled, and disabled when the preauth is disable.
  1. ; The only time the value of this field will be recorded in
  1. ; the claim is when the format for the claims is 5.1.
  1. ;----------------------------------------------------------
  1. Q
  1. DOPAGE() ;EP - should we do page 7? Only if one or more of the ques. are enabled
  1. ; this is used by the BRANCH logic of the NDC/CPT/HCPCS field
  1. ; to figure whether to set DDSSTACK="THE ASKS"
  1. ; Actual enabling is done by ENAB
  1. N DOIT
  1. I $$DOFIELD(1.01) S DOIT=1 ; insurance
  1. E I $$DOFIELD(1.02) S DOIT=1 ; preauth
  1. E I $$DOFIELD(1.03) S DOIT=1 ; pricing
  1. E S DOIT=0
  1. Q DOIT
  1. ISCPT() ; non-prescription, CPT code - detected by absence of RXI
  1. Q $$GET^DDSVAL(DIE,.DA,1.01)=""
  1. DOFIELD(N) ;EP - context: form, page 1, block ABSP PAGE 1 BOTTOM
  1. ; DIE = "^ABSP(9002313.51,DA(1),2,DA,"
  1. ; DA(1), DA point to the line item.
  1. ; But we're looking at the yes/no's at ^ABSP(9002313.51,DA(1),*)
  1. N RET S RET=$$GET^DDSVAL(9002313.51,DA(1),N)
  1. ; For insurance, you have to have had lines set up for insurance, too
  1. I N=1.01,RET S RET=RET&$D(^ABSP(9002313.51,DA(1),2,DA,"I",1))
  1. ; for pricing, this can't be POSTAGE (it's done on Page 11, not 7)
  1. I N=1.03 D
  1. . ; Do not ask pricing for POSTAGE; it has its own pricing page
  1. . I $$GET^DDSVAL(DIE,.DA,.03)="POSTAGE" S RET=0 Q
  1. . ; Do ask pricing for CPT codes (detected by absence of RXI)
  1. . I $$ISCPT S RET=1 Q
  1. Q RET
  1. ENAB ; enable/disable blocks,fields based on settings in fields 1.01 ff
  1. ; done on entry to page 7
  1. D ENAB1(1.01,4,1) ; insurance
  1. ;
  1. ;IHS/SD/lwj 8/30/02 NCPDP 5.1 changes
  1. ; A new field for the prior auth type code was needed- to have
  1. ; the screen flow, the new field, and the existing preauthorization
  1. ; field were reversed - field 1 is now the type, and field 2 is the
  1. ; prior auth number (formally preauthorization)
  1. D ENAB1(1.02,1,2) ;IHS/SD/lwj 8/30/02 now the prior auth type
  1. ;
  1. D ENAB1(1.02,2,2) ;IHS/SD/lwj 8/30/02 this is the prior auth number
  1. ;
  1. ;IHS/OIT/SCR 11/20/08 modified line to include incentive amount
  1. ;N F F F=11,12,14 D ENAB1(1.03,F,3) ; qty, unit price, dispense fee
  1. N F F F=11,12,17,14 D ENAB1(1.03,F,3) ; qty, unit price, dispense fee,incentive amount
  1. ; set up some pricing defaults if nothing is set up yet
  1. I $$DOFIELD(1.03),$$GET^DDSVAL(DIE,.DA,5.02)="" D PAGE7^ABSPOSQP
  1. ; set up some insurance defaults if nothing is set up yet
  1. I $$DOFIELD(1.01),$$GET^DDSVAL(DIE,.DA,7.01)="" D INIT^ABSPOSI8
  1. Q
  1. ENAB1(ORIG,FIELD,BLOCK,PAGE) ;EP
  1. I '$G(PAGE) S PAGE=7
  1. D UNED^DDSUTL(FIELD,BLOCK,PAGE,'$$DOFIELD(ORIG))
  1. Q
  1. RECALC1 ;EP - from ABSPOSI2,ABSPOSQP
  1. ; when you change quantity or unit price
  1. N X S X=$$GET^DDSVAL(DIE,.DA,5.01)
  1. N Y S Y=$$GET^DDSVAL(DIE,.DA,5.02)
  1. N Z S Z=X*Y
  1. S Z=$$ROUND(Z)
  1. D PUT^DDSVAL(DIE,.DA,5.03,$J(Z,0,2))
  1. D RECALC2 ; and then that affects the total price
  1. Q
  1. RECALC2 ; when you change dispense fee
  1. N X S X=$$GET^DDSVAL(DIE,.DA,5.03)
  1. N Y S Y=$$GET^DDSVAL(DIE,.DA,5.04)
  1. ;IHS/OIT/SCR 11/20/08
  1. N ABSPINCT S ABSPINCT=$$GET^DDSVAL(DIE,.DA,5.07)
  1. ; N Z S Z=X+Y
  1. N Z S Z=X+Y+ABSPINCT
  1. S Z=$$ROUND(Z)
  1. D PUT^DDSVAL(DIE,.DA,5.05,$J(Z,0,2))
  1. Q
  1. ROUND(X) Q X*100+.5\1/100