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

ABSPDB1B.m

Go to the documentation of this file.
ABSPDB1B ; IHS/OIT/CASSevern/Pieran ran 1/19/2011 - Handling of outgoing NCPDP Billing "B1" Claims for D.0 (PRICING,PRESCRIBER, and PROVIDER Segments)
 ;;1.0;PHARMACY POINT OF SALE;**42**;JUN 21, 2001;Build 38
PRICING ;EP CALLED FROM ABSPDB1 to set up PRICING SEGMENT
 N FIELD
 S RECORD=$G(RECORD)
 F FIELD="111",409,412,433,438,478,479,480,481,482,483,484,426,430,423 D
 . Q:$D(SUPRESF(FIELD))
 . I (ACTION["CLAIM"),(FIELD'=111) D
 . . D @(FIELD_"GET")
 . . D @(FIELD_"FMT")
 . . D @(FIELD_"SET")
 . ELSE  D APPEND(FIELD)
 Q
 ;Segment identifier
111GET S ABSP("X")=11
 Q
111FMT S ABSP("X")=$$ANFF^ABSPECFM(ABSP("X"),2)
 Q
111SET ;This isn't used for the 111 Field
 Q
 ;Ingredient Cost Submitted
409GET I '$D(SPECIAL(409)) S ABSP("X")=$G(ABSP("RX",ABSP(9002313.0201),"Ingredient Cost"))
 ELSE  X SPECIAL(409)
 Q
409FMT S:ABSP("X")'="" ABSP("X")="D9"_$$DFF^ABSPECFM(ABSP("X"),8) ;Spec says Length is 6?
 Q
409SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),400),U,9)=ABSP("X")
 Q
 ;Dispensing Fee
412GET I '$D(SPECIAL(412)) D
 . S ABSP("X")=$G(ABSP("Site","Dispensing Fee"))
 . I $D(ABSP("RX",ABSP(9002313.0201),"Dispensing Fee")) S ABSP("X")=ABSP("RX",ABSP(9002313.0201),"Dispensing Fee")
 ELSE  X SPECIAL(412)
 Q
412FMT S:ABSP("X")'="" ABSP("X")="DC"_$$DFF^ABSPECFM(ABSP("X"),8)
 Q
412SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),400),U,12)=ABSP("X")
 Q
 ;Patient Paid Amount
433GET I '$D(SPECIAL(433)) S ABSP("X")=$G(ABSP("RX",ABSP(9002313.0201),"Patient Paid Amount"))
 ELSE  X SPECIAL(433)
 Q
433FMT S:ABSP("X")'="" ABSP("X")="DX"_$$DFF^ABSPECFM($G(ABSP("X")),8)
 Q
433SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),430),U,3)=ABSP("X")
 Q
 ;Incentive Amount
438GET I '$D(SPECIAL(438)) S ABSP("X")=$G(ABSP("RX",ABSP(9002313.0201),"Incentive Amount"))
 ELSE  X SPECIAL(438)
 Q
438FMT S:ABSP("X")'="" ABSP("X")="E3"_$$DFF^ABSPECFM($G(ABSP("X")),8)
 Q
438SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),430),U,8)=ABSP("X")
 Q
 ;Other Amt Clmd Sub Cnt
478GET I '$D(SPECIAL(478)) S ABSP("X")=$G(ABSP("Pricing",ABSP(9002313.0201),"Oth Amt Clmd Sub Cnt"))
 ELSE  X SPECIAL(478)
 Q
478FMT S:ABSP("X")'="" ABSP("X")="H7"_$$NFF^ABSPECFM(ABSP("X"),2)
 Q
478SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),470),U,8)=ABSP("X")
 Q
 ;Other Amount Clmd Sub Qual
479GET I '$D(SPECIAL(479)) S ABSP("X")=$G(ABSP("Pricing","Other Amt Claimed Sub Qual"))
 ELSE  X SPECIAL(479)
 Q
479FMT S:ABSP("X")'="" ABSP("X")="H8"_$$ANFF^ABSPECFM(ABSP("X"),2)
 Q
479SET ;No code exists yet.
 Q
 ;Other amt claimed sub
480GET I '$D(SPECIAL(480)) S ABSP("X")=$G(ABSP("Pricing","Other Amt Claimed Sub"))
 ELSE  X SPECIAL(480)
 Q
480FMT S:ABSP("X")'="" ABSP("X")="H9"_$$DFF^ABSPECFM(ABSP("X"),8)
 Q
480SET ;No code exists yet.
 Q
 ;Flat Sales Tax Amt
481GET I '$D(SPECIAL(481)) S ABSP("X")=$G(ABSP("Pricing",ABSP(9002313.0201),"Flat Sales Tx Amt Sub"))
 ELSE  X SPECIAL(481)
 Q
481FMT S:ABSP("X")'="" ABSP("X")="HA"_$$DFF^ABSPECFM(ABSP("X"),8)
 Q
481SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),480),U,1)=ABSP("X")
 Q
 ;Percentage Sales Tax Amt
482GET I '$D(SPECIAL(482)) S ABSP("X")=$G(ABSP("Pricing",ABSP(9002313.0201),"Percnt Sale Tx Amt Sb"))
 ELSE  X SPECIAL(482)
 Q
482FMT S:ABSP("X")'="" ABSP("X")="GE"_$$DFF^ABSPECFM(ABSP("X"),8)
 Q
482SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),480),U,2)=ABSP("X")
 Q
 ;Percentage Sales Tax Rate
483GET I '$D(SPECIAL(483)) S ABSP("X")=$G(ABSP("Pricing",ABSP(9002313.0201),"Prcnt Sls Tx Rt Sub"))
 ELSE  X SPECIAL(483)
 Q
483FMT S:ABSP("X")'="" ABSP("X")="HE"_$$DFF^ABSPECFM(ABSP("X"),7)
 Q
483SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),480),U,3)=ABSP("X")
 Q
 ;Percentage Sales Tax Basis
484GET I '$D(SPECIAL(484)) S ABSP("X")=$G(ABSP("Pricing",ABSP(9002313.0201),"Prcnt Sls Tx Bs Sub"))
 ELSE  X SPECIAL(484)
 Q
484FMT S:ABSP("X")'="" ABSP("X")="JE"_$$NFF^ABSPECFM(ABSP("X"),2)
 Q
484SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),480),U,4)=ABSP("X")
 Q
 ;Usual and Customary Charge
426GET I '$D(SPECIAL(426)) S ABSP("X")=$G(ABSP("RX",ABSP(9002313.0201),"Usual & Customary"))
 ELSE  X SPECIAL(426)
 Q
426FMT S:ABSP("X")'="" ABSP("X")="DQ"_$$DFF^ABSPECFM($G(ABSP("X")),8)
 Q
426SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),400),U,26)=ABSP("X")
 Q
 ;Gross Amnt Due
430GET I '$D(SPECIAL(430)) S ABSP("X")=$G(ABSP("RX",ABSP(9002313.0201),"Gross Amount Due"))
 ELSE  X SPECIAL(430)
 Q
430FMT S:ABSP("X")'="" ABSP("X")="DU"_$$DFF^ABSPECFM($G(ABSP("X")),8)
 Q
430SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),400),U,30)=ABSP("X")
 Q
 ;Basis of Cost Determination
423GET I '$D(SPECIAL(423)) S ABSP("X")=$G(ABSP("RX",ABSP(9002313.0201),"Basis of Cost Determination"))
 ELSE  X SPECIAL(423)
 Q
423FMT S:ABSP("X")'="" ABSP("X")="DN"_$$ANFF^ABSPECFM($G(ABSP("X")),2)
 Q
423SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),400),U,23)=ABSP("X")
 Q
PROVIDER ;EP CALLED FROM ABSPDB1 to set up PRICING SEGMENT
 Q:$D(SUPRESSG("Provider"))
 N FIELD
 S RECORD=$G(RECORD)
 F FIELD="111A",465,444 D
 . Q:$D(SUPRESF(FIELD))
 . I (ACTION["CLAIM"),(FIELD'=111) D
 . . D @(FIELD_"GET")
 . . D @(FIELD_"FMT")
 . . D @(FIELD_"SET")
 . ELSE  D APPEND(FIELD)
 Q
 ;Segment identifier
111AGET S ABSP("X")="02"
 Q
111AFMT S ABSP("X")=$$ANFF^ABSPECFM(ABSP("X"),2)
 Q
111ASET ;This isn't used for the 111 Field
 Q
 ;Provider ID Qualifier
465GET I '$D(SPECIAL(465)) S ABSP("X")=$G(ABSP("Pharmacy",ABSP(9002313.0201),"Provider ID Qual"))
 ELSE  X SPECIAL(465)
 Q
465FMT S:ABSP("X")'="" ABSP("X")="EY"_$$ANFF^ABSPECFM(ABSP("X"),2)
 Q
465SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),460),U,5)=ABSP("X")
 Q
 ;Provider ID
444GET I '$D(SPECIAL(444)) S ABSP("X")=$G(ABSP("Pharmacy",ABSP(9002313.0201),"Provider ID"))
 ELSE  X SPECIAL(444)
 Q
444FMT S:ABSP("X")'="" ABSP("X")="E9"_$$ANFF^ABSPECFM(ABSP("X"),15)
 Q
444SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),440),U,4)=ABSP("X")
 Q
PRESCRIBER ;EP CALLED FROM ABSPDB1 to set up PRICING SEGMENT
 N FIELD
 S RECORD=$G(RECORD)
 F FIELD="111B",466,411,427,498,468,421,470,364,365,366,367,368 D
 . Q:$D(SUPRESF(FIELD))
 . I (ACTION["CLAIM"),(FIELD'=111) D
 . . D @(FIELD_"GET")
 . . D @(FIELD_"FMT")
 . . D @(FIELD_"SET")
 . ELSE  D APPEND(FIELD)
 Q
 ;Segment identifier
111BGET S ABSP("X")="03"
 Q
111BFMT S ABSP("X")=$$ANFF^ABSPECFM(ABSP("X"),2)
 Q
111BSET ;This isn't used for the 111 Field
 Q
 ;Prescriber ID Qualifier
466GET I '$D(SPECIAL(466)) S ABSP("X")=$G(ABSP("Prescriber",ABSP(9002313.0201),"Prescriber ID Qual"))
 ELSE  X SPECIAL(466)
 Q
466FMT S:ABSP("X")'="" ABSP("X")="EZ"_$$ANFF^ABSPECFM(ABSP("X"),2)
 Q
466SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),460),U,6)=ABSP("X")
 Q
 ;Prescriber ID
411GET I '$D(SPECIAL(411)) S ABSP("X")=$G(ABSP("RX",ABSP(9002313.0201),"Prescriber ID"))
 ELSE  X SPECIAL(411)
 Q
411FMT S:ABSP("X")'="" ABSP("X")="DB"_$$ANFF^ABSPECFM($G(ABSP("X")),15)
 Q
411SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),400),U,11)=ABSP("X")
 Q
 ;Prescriber Last Name
427GET I '$D(SPECIAL(427)) S ABSP("X")=$G(ABSP("RX",ABSP(9002313.0201),"Prescriber Last Name"))
 ELSE  X SPECIAL(427)
 Q
427FMT S:ABSP("X")'="" ABSP("X")="DR"_$$ANFF^ABSPECFM(ABSP("X"),15)
 Q
427SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),420),U,27)=ABSP("X")
 Q
 ;Prescriber Phone Number
498GET I '$D(SPECIAL(498)) S ABSP("X")=$G(ABSP("Prescriber",ABSP(9002313.0201),"Phone"))
 ELSE  X SPECIAL(498)
 Q
498FMT S:ABSP("X")'="" ABSP("X")="PM"_$$NFF^ABSPECFM($G(ABSP("X")),10)
 Q
498SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),498),U,12)=ABSP("X")
 Q
 ;Primary Care Provider ID Qual
468GET I '$D(SPECIAL(468)) S ABSP("X")=$G(ABSP("Prescriber",ABSP(9002313.0201),"Prim Care ID Qual"))
 ELSE  X SPECIAL(468)
 Q
468FMT S:ABSP("X")'="" ABSP("X")="2E"_$$ANFF^ABSPECFM(ABSP("X"),2)
 Q
468SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),460),U,8)=ABSP("X")
 Q
 ;Primary Care Provider ID
421GET I '$D(SPECIAL(421)) S ABSP("X")=$G(ABSP("RX",ABSP(9002313.0201),"Primary Prescriber"))
 ELSE  X SPECIAL(421)
 Q
421FMT S:ABSP("X")'="" ABSP("X")="DL"_$$ANFF^ABSPECFM($G(ABSP("X")),15)
 Q
421SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),400),U,21)=ABSP("X")
 Q
 ;Primary Care Provider Last Name
470GET I '$D(SPECIAL(470)) S ABSP("X")=$G(ABSP("Prescriber",ABSP(9002313.0201),"Prim Care Lst Name"))
 ELSE  X SPECIAL(470)
 Q
470FMT S:ABSP("X")'="" ABSP("X")="4E"_$$ANFF^ABSPECFM(ABSP("X"),15)
 Q
470SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),460),U,10)=ABSP("X")
 Q
 ;Prescriber First Name
364GET I '$D(SPECIAL(364)) S ABSP("X")=""
 ELSE  X SPECIAL(364)
 Q
364FMT S:ABSP("X")'="" ABSP("X")="2J"_$$ANFF^ABSPECFM($G(ABSP("X")),12)
 Q
364SET ;Not Yet Implemented **
 Q
 ;Prescriber Street Address
365GET I '$D(SPECIAL(365)) S ABSP("X")=""
 ELSE  X SPECIAL(365)
 Q
365FMT S:ABSP("X")'="" ABSP("X")="2K"_$$ANFF^ABSPECFM($G(ABSP("X")),30)
 Q
365SET ;Not Yet Implemented **
 Q
 ;Prescriber City Address
366GET I '$D(SPECIAL(366)) S ABSP("X")=""
 ELSE  X SPECIAL(366)
 Q
366FMT S:ABSP("X")'="" ABSP("X")="2M"_$$ANFF^ABSPECFM($G(ABSP("X")),20)
 Q
366SET ;Not Yet Implemented **
 Q
 ;Prescriber State Address
367GET I '$D(SPECIAL(367)) S ABSP("X")="",STCODE=$G(ABSP("RX",ABSP(9002313.0201),"Prescriber State/Prov")) S:STCODE'="" ABSP("X")=$P($G(^DIC(5,STCODE,0)),U,2)
 ELSE  X SPECIAL(367)
 Q
367FMT S:ABSP("X")'="" ABSP("X")="2N"_$$ANFF^ABSPECFM($G(ABSP("X")),2)
 Q
367SET S $P(^ABSPC(ABSP(9002313.02),400,ABSP(9002313.0201),360),U,7)=ABSP("X")
 Q
 ;Prescriber Zip
368GET I '$D(SPECIAL(368)) S ABSP("X")=""
 ELSE  X SPECIAL(368)
 Q
368FMT S:ABSP("X")'="" ABSP("X")="2P"_$$ANFF^ABSPECFM($G(ABSP("X")),15)
 Q
368SET ;Not Yet Implemented **
 Q
APPEND(FIELD) ;This is where the record is built field by field
 I FIELD["111" D
 . D @(FIELD_"GET")
 . D @(FIELD_"FMT")
 . S RECORD=RECORD_$C(30,28)_"AM"_ABSP("X")
 ELSE  D
 . I $G(ABSP(9002313.0201,IEN(9002313.01),FIELD,"I"))'="" S RECORD=RECORD_$C(28)_$G(ABSP(9002313.0201,IEN(9002313.01),FIELD,"I"))
 . ELSE  I $D(SPECIAL(FIELD)) D
 . . X SPECIAL(FIELD)
 . . D @(FIELD_"FMT")
 . . S RECORD=RECORD_$C(28)_ABSP("X")
 Q