ABSPIN1 ; GENERATED FROM 'ABSP SETUP PHARMACY' INPUT TEMPLATE(#2388), FILE 9002313.56;08/30/18
D DE G BEGIN
DE S DIE="^ABSP(9002313.56,",DIC=DIE,DP=9002313.56,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^ABSP(9002313.56,DA,""))=""
I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,2) S:%]"" DE(11)=% S %=$P(%Z,U,3) S:%]"" DE(16)=% S %=$P(%Z,U,4) S:%]"" DE(49)=% S %=$P(%Z,U,6) S:%]"" DE(8)=%
I $D(^("CAID")) S %Z=^("CAID") S %=$P(%Z,U,1) S:%]"" DE(22)=% S %=$P(%Z,U,2) S:%]"" DE(28)=%
I $D(^("REP")) S %Z=^("REP") S %=$P(%Z,U,3) S:%]"" DE(38)=% S %=$P(%Z,U,4) S:%]"" DE(40)=%
K %Z Q
;
W W !?DL+DL-2,DLB_": "
Q
O D W W Y W:$X>45 !?9
I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
TR R X:DTIME E S (DTOUT,X)=U W $C(7)
Q
A K DQ(DQ) S DQ=DQ+1
B G @DQ
RE G PR:$D(DE(DQ)) D W,TR
N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
RD G QS:X?."?" I X["^" D D G ^DIE17
I X="@" D D G Z^DIE2
I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I W:'$D(DB(DQ)) " "_% G V
K DDER G X
P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
V D @("X"_DQ) K YS
Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
S X="?BAD"
QS S DZ=X D D,QQ^DIEQ G B
D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
I I DV'["I",DV'["#" G RD
D E^DIE0 G RD:$D(X),PR
Q
SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
D ^DIR I 'DDER S %=Y(0),X=Y
Q
SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
Q
NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
BEGIN S DNM="ABSPIN1",DQ=1
N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
M DIEZAR=^DIE(2388,"AR") S DICRREC="TRIG^DIE17"
S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=2388,U="^"
1 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=1 D X1 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X1 W !!,"OUTPATIENT SITE: One or more of the RPMS pharmacy package's",!
Q
2 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 D X2 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X2 W ?10,"Outpatient Sites (File 59) must be associated with",!
Q
3 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=3 D X3 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X3 W ?10,"this Point of Sale pharmacy entry",!
Q
4 S D=0 K DE(1) ;13800
S DIFLD=13800,DGO="^ABSPIN11",DC="3^9002313.5601P^OPSITE^",DV="9002313.5601MP59'",DW="0;1",DOW="OUTPATIENT SITE",DLB=$P($$EZBLD^DIALOG(8042,DOW),":") S:D DC=DC_D
S DU="PS(59,"
G RE:D I $D(DSC(9002313.5601))#2,$P(DSC(9002313.5601),"I $D(^UTILITY(",1)="" X DSC(9002313.5601) S D=$O(^(0)) S:D="" D=-1 G M4
S D=$S($D(^ABSP(9002313.56,DA,"OPSITE",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
M4 I D>0 S DC=DC_D I $D(^ABSP(9002313.56,DA,"OPSITE",+D,0)) S DE(4)=$P(^(0),U,1)
G RE
R4 D DE
S D=$S($D(^ABSP(9002313.56,DA,"OPSITE",0)):$P(^(0),U,3,4),1:1) G 4+1
;
5 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 D X5 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X5 W !!,"ENVOY TERMINAL ID: This is a number assigned to",!
Q
6 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=6 D X6 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X6 W ?10,"your pharmacy by Envoy. The number is sent as part of ",!
Q
7 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=7 D X7 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X7 W ?10,"each claim you send to Envoy.",!
Q
8 S DW="0;6",DV="NJ10,0a",DU="",DLB="ENVOY TERMINAL ID",DIFLD=.06
S DE(DW)="C8^ABSPIN1"
G RE
C8 G C8S:$D(DE(8))[0 K DB
S X=DE(8),DIIX=2_U_DIFLD D AUDIT^DIET
C8S S X="" G:DG(DQ)=X C8F1 K DB
I $D(DE(8))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C8F1 Q
X8 K:+X'=X!(X>9999999999)!(X<1)!(X?.E1"."1N.N) X
Q
;
9 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=9 D X9 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X9 W !!,"NCPDP #: This is a number assigned to your pharmacy",!
Q
10 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=10 D X10 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X10 W ?10,"by the NCPDP. It used to be called the NABP #",!
Q
11 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW="0;2",DV="Fa",DU="",DLB="NCPDP #",DIFLD=.02
S DE(DW)="C11^ABSPIN1"
G RE
C11 G C11S:$D(DE(11))[0 K DB
S X=DE(11),DIIX=2_U_DIFLD D AUDIT^DIET
C11S S X="" G:DG(DQ)=X C11F1 K DB
I $D(DE(11))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C11F1 Q
X11 K:$L(X)>10!($L(X)<3) X
I $D(X),X'?.ANP K X
Q
;
12 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X12 W !!,"DEFAULT DEA #: Many insurances require the prescriber's",!
Q
13 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X13 W ?10,"DEA number as part of the claim. If your pharmacy has",!
Q
14 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X14 W ?10,"a DEA # that may be used in case a prescriber doesn't have",!
Q
15 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=15 D X15 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X15 W ?10,"his DEA # on file with you, enter that default DEA # here.",!
Q
16 D:$D(DG)>9 F^DIE17,DE S DQ=16,DW="0;3",DV="Fa",DU="",DLB="DEFAULT DEA #",DIFLD=.03
S DE(DW)="C16^ABSPIN1"
G RE
C16 G C16S:$D(DE(16))[0 K DB
S X=DE(16),DIIX=2_U_DIFLD D AUDIT^DIET
C16S S X="" G:DG(DQ)=X C16F1 K DB
I $D(DE(16))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C16F1 Q
X16 K:$L(X)>12!($L(X)<3) X
I $D(X),X'?.ANP K X
Q
;
17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X17 W !!,"MEDICAID #: If you are sending claims to your state's",!
Q
18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X18 W ?10,"Medicaid program, and Medicaid has assigned a special",!
Q
19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X19 W ?10,"Medicaid pharmacy number to your pharmacy, enter that",!
Q
20 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X20 W ?10,"number here. It is usually required as part of",!
Q
21 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=21 D X21 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X21 W ?10,"the Medicaid claim.",!
Q
22 D:$D(DG)>9 F^DIE17,DE S DQ=22,DW="CAID;1",DV="Fa",DU="",DLB="MEDICAID #",DIFLD=3001.01
S DE(DW)="C22^ABSPIN1"
G RE
C22 G C22S:$D(DE(22))[0 K DB
S X=DE(22),DIIX=2_U_DIFLD D AUDIT^DIET
C22S S X="" G:DG(DQ)=X C22F1 K DB
I $D(DE(22))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C22F1 Q
X22 K:$L(X)>12!($L(X)<3) X
I $D(X),X'?.ANP K X
Q
;
23 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X23 W !!,"DEFAULT MEDICAID PROVIDER #: Usually, Medicaid assigns ID numbers",!
Q
24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X24 W ?10,"to prescribers and those numbers must be sent as part of a",!
Q
25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X25 W ?10,"Medicaid claim. If you have a default number which may be ",!
Q
26 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=26 D X26 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X26 W ?10,"used when you don't have a provider's Medicaid number on file",!
Q
27 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=27 D X27 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X27 W ?10,"enter that number here.",!
Q
28 D:$D(DG)>9 F^DIE17,DE S DQ=28,DW="CAID;2",DV="Fa",DU="",DLB="DEFAULT CAID PROVIDER #",DIFLD=3001.02
S DE(DW)="C28^ABSPIN1"
G RE
C28 G C28S:$D(DE(28))[0 K DB
S X=DE(28),DIIX=2_U_DIFLD D AUDIT^DIET
C28S S X="" G:DG(DQ)=X C28F1 K DB
I $D(DE(28))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C28F1 Q
X28 K:$L(X)>10!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
29 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=29 D X29 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X29 W !!,"INSURER-ASSIGNED #: Usually, private insurance claims require the",!
Q
30 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=30 D X30 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X30 W ?10,"NCPDP #. But if any insurers have special numbers assigned to",!
Q
31 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=31 D X31 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X31 W ?10,"your pharmacy to be used on their claims, then enter those",!
Q
32 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=32 D X32 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X32 W ?10,"insurers and the numbers they assigned to you.",!
Q
33 D:$D(DG)>9 F^DIE17,DE S DQ=33,D=0 K DE(1) ;950
S DIFLD=950,DGO="^ABSPIN12",DC="4^9002313.6P^INSURER-ASSIGNED #^",DV="9002313.6MP9999999.18'a",DW="0;1",DOW="INSURER",DLB=$P($$EZBLD^DIALOG(8042,DOW),":") S:D DC=DC_D
S DU="AUTNINS("
G RE:D I $D(DSC(9002313.6))#2,$P(DSC(9002313.6),"I $D(^UTILITY(",1)="" X DSC(9002313.6) S D=$O(^(0)) S:D="" D=-1 G M33
S D=$S($D(^ABSP(9002313.56,DA,"INSURER-ASSIGNED #",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
M33 I D>0 S DC=DC_D I $D(^ABSP(9002313.56,DA,"INSURER-ASSIGNED #",+D,0)) S DE(33)=$P(^(0),U,1)
G RE
R33 D DE
S D=$S($D(^ABSP(9002313.56,DA,"INSURER-ASSIGNED #",0)):$P(^(0),U,3,4),1:1) G 33+1
;
34 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=34 D X34 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X34 W !!,"Auto-Print Pharmacy Expense Report for:",!
Q
35 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=35 D X35 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X35 W ?10,"""1"" All Patients.",!
Q
36 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=36 D X36 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X36 W ?10,"""0"" No Patients. (Do not print)",!
Q
37 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=37 D X37 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X37 W ?10,"""NB"" Non-Beneficiary Patients only.",!
Q
38 S DW="REP;3",DV="Sa",DU="",DLB="AUTOPRINT PHARMACY EXPENSE RPT",DIFLD=115
S DE(DW)="C38^ABSPIN1"
S DU="1:All Patients;0:No Patients;NB:Only Non-Beneficiary Patients;"
G RE
C38 G C38S:$D(DE(38))[0 K DB
S X=DE(38),DIIX=2_U_DIFLD D AUDIT^DIET
C38S S X="" G:DG(DQ)=X C38F1 K DB
I $D(DE(38))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C38F1 Q
X38 Q
39 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=39 D X39 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X39 W !!,"What Device should the Pharmacy Expense Reports print to? ",!
Q
40 D:$D(DG)>9 F^DIE17,DE S DQ=40,DW="REP;4",DV="P3.5'a",DU="",DLB="DEFAULT DEVICE",DIFLD=115.01
S DE(DW)="C40^ABSPIN1"
S DU="%ZIS(1,"
G RE
C40 G C40S:$D(DE(40))[0 K DB
S X=DE(40),DIIX=2_U_DIFLD D AUDIT^DIET
C40S S X="" G:DG(DQ)=X C40F1 K DB
I $D(DE(40))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C40F1 Q
X40 Q
41 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=41 D X41 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X41 I '$$ILCAR^ABSPOSS1 S Y="@999"
Q
42 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=42 D X42 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X42 W !!,"These fields are used for printing pharmacy claims for non-electronic",!
Q
43 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=43 D X43 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X43 W "insurers. If you omit this data, the system will use the general",!
Q
44 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=44 D X44 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X44 W "billing system setup information.",!
Q
45 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=45 D X45 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X45 W !!,"The AR TYPE is required. When charges from this pharmacy",!
Q
46 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=46 D X46 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X46 W "are posted to Accounts Receivable, this is the AR TYPE assigned",!
Q
47 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=47 D X47 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X47 W "to those accounts. It might default if you have an RX type",!
Q
48 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=48 D X48 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X48 W "but you should explicitly assign an A/R type here.",!
Q
49 D:$D(DG)>9 F^DIE17,DE S DQ=49,DW="0;4",DV="P9001626'",DU="",DLB="AR TYPE",DIFLD=.04
S DU="ABSBTYP("
G RE
X49 Q
50 D:$D(DG)>9 F^DIE17 G ^ABSPIN13
ABSPIN1 ; GENERATED FROM 'ABSP SETUP PHARMACY' INPUT TEMPLATE(#2388), FILE 9002313.56;08/30/18
+1 DO DE
GOTO BEGIN
DE SET DIE="^ABSP(9002313.56,"
SET DIC=DIE
SET DP=9002313.56
SET DL=1
SET DIEL=0
SET DU=""
KILL DG,DE,DB
IF $ORDER(^ABSP(9002313.56,DA,""))=""
QUIT
+1 IF $DATA(^(0))
SET %Z=^(0)
SET %=$PIECE(%Z,U,2)
IF %]""
SET DE(11)=%
SET %=$PIECE(%Z,U,3)
IF %]""
SET DE(16)=%
SET %=$PIECE(%Z,U,4)
IF %]""
SET DE(49)=%
SET %=$PIECE(%Z,U,6)
IF %]""
SET DE(8)=%
+2 IF $DATA(^("CAID"))
SET %Z=^("CAID")
SET %=$PIECE(%Z,U,1)
IF %]""
SET DE(22)=%
SET %=$PIECE(%Z,U,2)
IF %]""
SET DE(28)=%
+3 IF $DATA(^("REP"))
SET %Z=^("REP")
SET %=$PIECE(%Z,U,3)
IF %]""
SET DE(38)=%
SET %=$PIECE(%Z,U,4)
IF %]""
SET DE(40)=%
+4 KILL %Z
QUIT
+5 ;
W WRITE !?DL+DL-2,DLB_": "
+1 QUIT
O DO W
WRITE Y
IF $X>45
WRITE !?9
+1 IF $LENGTH(Y)>19
IF 'DV
IF DV'["I"
IF (DV["F"!(DV["K"))
GOTO RW^DIR2
+2 IF Y]""
WRITE "// "
IF 'DV
IF DV["I"
IF $DATA(DE(DQ))#2
SET X=""
WRITE " (No Editing)"
QUIT
TR READ X:DTIME
IF '$TEST
SET (DTOUT,X)=U
WRITE $CHAR(7)
+1 QUIT
A KILL DQ(DQ)
SET DQ=DQ+1
B GOTO @DQ
RE IF $DATA(DE(DQ))
GOTO PR
DO W
DO TR
N IF X=""
IF $DATA(^DD("KEY","F",DP,DIFLD))
GOTO NKEY
IF DV'["R"
GOTO A
IF 'DV
GOTO X
IF D'>0
GOTO X
GOTO A
RD IF X?."?"
GOTO QS
IF X["^"
DO D
GOTO ^DIE17
+1 IF X="@"
DO D
GOTO Z^DIE2
+2 IF X=" "
IF DV["d"
IF DV'["P"
IF $DATA(^DISV(DUZ,"DIE",DLB))
SET X=^(DLB)
IF DV'["D"
IF DV'["S"
WRITE " "_X
T IF DV
GOTO M^DIE17
IF DV["V"
GOTO ^DIE3
IF DV'["S"
GOTO P
IF $DATA(^DD(DP,DIFLD,12.1))
XECUTE ^(12.1)
IF X?.ANP
DO SET
IF 'DDER
IF $DATA(DIC("S"))
XECUTE DIC("S")
IF $TEST
IF '$DATA(DB(DQ))
WRITE " "_%
GOTO V
+1 KILL DDER
GOTO X
P IF DV["P"
SET DIC=U_DU
SET DIC(0)=$EXTRACT("EN",$DATA(DB(DQ))+1)_"M"_$EXTRACT("L",DV'["'")
IF DIC(0)["L"
SET DLAYGO=+$PIECE(DV,"P",2)
IF DV["*"
GOTO AST^DIED
DO NOSCR^DIED
SET X=+Y
SET DIC=DIE
IF X<0
GOTO X
+1 IF DV'["N"
GOTO V
DO D
IF $LENGTH($PIECE(X,"."))>24
KILL X
GOTO Z
+2 IF $PIECE(DQ(DQ),U,5)'["$"
IF X?.1"-".N.1".".N
IF $PIECE(DQ(DQ),U,5,99)["+X'=X"
SET X=+X
V DO @("X"_DQ)
KILL YS
Z KILL DIC("S"),DLAYGO
IF $DATA(X)
IF X'=U
IF $GET(DE(DW,"INDEX"))
DO SAVEVALS
IF '$$KEYCHK
GOTO UNIQFERR^DIE17
SET DG(DW)=X
IF DV["d"
SET ^DISV(DUZ,"DIE",DLB)=X
GOTO A
X IF '$DATA(ZTQUEUED)
WRITE $CHAR(7),"??"
IF $DATA(DB(DQ))
GOTO Z^DIE17
+1 SET X="?BAD"
QS SET DZ=X
DO D
DO QQ^DIEQ
GOTO B
D SET D=DIFLD
SET DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$PIECE($TEXT(@("X"_DQ))," ",2,99)
QUIT
Y IF '$DATA(DE(DQ))
DO O
IF "@"'[X
GOTO RD
IF DV'["R"&(X="@")
GOTO A
IF X="@"
GOTO X
SET X=Y
GOTO N
PR SET DG=DV
SET Y=DE(DQ)
SET X=DU
IF $DATA(DQ(DQ,2))
XECUTE DQ(DQ,2)
GOTO RP
R IF DG["P"
IF @("$D(^"_X_"0))")
SET X=+$PIECE(^(0),U,2)
IF '$DATA(^(Y,0))
GOTO RP
SET Y=$PIECE(^(0),U)
SET X=$PIECE(^DD(X,.01,0),U,3)
SET DG=$PIECE(^(0),U,2)
GOTO R
+1 IF DG["V"
IF +Y
IF $PIECE(Y,";",2)["("
IF $DATA(@(U_$PIECE(Y,";",2)_"0)"))
SET X=+$PIECE(^(0),U,2)
IF '$DATA(^(+Y,0))
GOTO RP
SET Y=$PIECE(^(0),U)
IF $DATA(^DD(+X,.01,0))
SET DG=$PIECE(^(0),U,2)
SET X=$PIECE(^(0),U,3)
GOTO R
+2 IF DG["D"
XECUTE ^DD("DD")
IF DG["S"
SET %=$PIECE($PIECE(";"_X,";"_Y_":",2),";")
IF %]""
SET Y=%
RP DO O
IF X=""
SET X=DE(DQ)
IF 'DV
GOTO A
IF DC<2
GOTO A
GOTO N^DIE17
I IF DV'["I"
IF DV'["#"
GOTO RD
+1 DO E^DIE0
IF $DATA(X)
GOTO RD
GOTO PR
+2 QUIT
SET NEW DIR
SET DIR(0)="SV"_$EXTRACT("o",$DATA(DB(DQ)))_U_DU
SET DIR("V")=1
+1 IF $DATA(DB(DQ))
IF '$DATA(DIQUIET)
NEW DIQUIET
SET DIQUIET=1
+2 DO ^DIR
IF 'DDER
SET %=Y(0)
SET X=Y
+3 QUIT
SAVEVALS SET @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$GET(DE(DQ))
IF $DATA(^("F"))[0
SET ^("F")=$GET(DE(DQ))
+1 IF $DATA(DE(DW,"4/"))
SET @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
+2 IF '$TEST
KILL @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
+3 QUIT
NKEY IF '$DATA(ZTQUEUED)
WRITE "?? Required key field"
SET X="?BAD"
GOTO QS
KEYCHK() IF $GET(DE(DW,"KEY"))=""
QUIT 1
QUIT @DE(DW,"KEY")
BEGIN SET DNM="ABSPIN1"
SET DQ=1
+1 NEW DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR
KILL DIEFIRE,DIEBADK
SET DIEZTMP=$$GETTMP^DIKC1("DIEZ")
+2 MERGE DIEZAR=^DIE(2388,"AR")
SET DICRREC="TRIG^DIE17"
+3 IF $DATA(DTIME)[0
SET DTIME=300
SET D0=DA
SET DIIENS=DA_","
SET DIEZ=2388
SET U="^"
1 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=1
DO X1
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X1 WRITE !!,"OUTPATIENT SITE: One or more of the RPMS pharmacy package's",!
+1 QUIT
2 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=2
DO X2
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X2 WRITE ?10,"Outpatient Sites (File 59) must be associated with",!
+1 QUIT
3 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=3
DO X3
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X3 WRITE ?10,"this Point of Sale pharmacy entry",!
+1 QUIT
4 ;13800
SET D=0
KILL DE(1)
+1 SET DIFLD=13800
SET DGO="^ABSPIN11"
SET DC="3^9002313.5601P^OPSITE^"
SET DV="9002313.5601MP59'"
SET DW="0;1"
SET DOW="OUTPATIENT SITE"
SET DLB=$PIECE($$EZBLD^DIALOG(8042,DOW),":")
IF D
SET DC=DC_D
+2 SET DU="PS(59,"
+3 IF D
GOTO RE
IF $DATA(DSC(9002313.5601))#2
IF $PIECE(DSC(9002313.5601),"I $D(^UTILITY(",1)=""
XECUTE DSC(9002313.5601)
SET D=$ORDER(^(0))
IF D=""
SET D=-1
GOTO M4
+4 SET D=$SELECT($DATA(^ABSP(9002313.56,DA,"OPSITE",0)):$PIECE(^(0),U,3,4),$ORDER(^(0))'="":$ORDER(^(0)),1:-1)
M4 IF D>0
SET DC=DC_D
IF $DATA(^ABSP(9002313.56,DA,"OPSITE",+D,0))
SET DE(4)=$PIECE(^(0),U,1)
+1 GOTO RE
R4 DO DE
+1 SET D=$SELECT($DATA(^ABSP(9002313.56,DA,"OPSITE",0)):$PIECE(^(0),U,3,4),1:1)
GOTO 4+1
+2 ;
5 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=5
DO X5
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X5 WRITE !!,"ENVOY TERMINAL ID: This is a number assigned to",!
+1 QUIT
6 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=6
DO X6
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X6 WRITE ?10,"your pharmacy by Envoy. The number is sent as part of ",!
+1 QUIT
7 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=7
DO X7
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X7 WRITE ?10,"each claim you send to Envoy.",!
+1 QUIT
8 SET DW="0;6"
SET DV="NJ10,0a"
SET DU=""
SET DLB="ENVOY TERMINAL ID"
SET DIFLD=.06
+1 SET DE(DW)="C8^ABSPIN1"
+2 GOTO RE
C8 IF $DATA(DE(8))[0
GOTO C8S
KILL DB
+1 SET X=DE(8)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C8S SET X=""
IF DG(DQ)=X
GOTO C8F1
KILL DB
+1 IF $DATA(DE(8))'[0!(^DD(DP,DIFLD,"AUDIT")'="e")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C8F1 QUIT
X8 IF +X'=X!(X>9999999999)!(X<1)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
9 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=9
DO X9
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X9 WRITE !!,"NCPDP #: This is a number assigned to your pharmacy",!
+1 QUIT
10 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=10
DO X10
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X10 WRITE ?10,"by the NCPDP. It used to be called the NABP #",!
+1 QUIT
11 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=11
SET DW="0;2"
SET DV="Fa"
SET DU=""
SET DLB="NCPDP #"
SET DIFLD=.02
+1 SET DE(DW)="C11^ABSPIN1"
+2 GOTO RE
C11 IF $DATA(DE(11))[0
GOTO C11S
KILL DB
+1 SET X=DE(11)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C11S SET X=""
IF DG(DQ)=X
GOTO C11F1
KILL DB
+1 IF $DATA(DE(11))'[0!(^DD(DP,DIFLD,"AUDIT")'="e")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C11F1 QUIT
X11 IF $LENGTH(X)>10!($LENGTH(X)<3)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
12 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=12
DO X12
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X12 WRITE !!,"DEFAULT DEA #: Many insurances require the prescriber's",!
+1 QUIT
13 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=13
DO X13
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X13 WRITE ?10,"DEA number as part of the claim. If your pharmacy has",!
+1 QUIT
14 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=14
DO X14
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X14 WRITE ?10,"a DEA # that may be used in case a prescriber doesn't have",!
+1 QUIT
15 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=15
DO X15
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X15 WRITE ?10,"his DEA # on file with you, enter that default DEA # here.",!
+1 QUIT
16 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=16
SET DW="0;3"
SET DV="Fa"
SET DU=""
SET DLB="DEFAULT DEA #"
SET DIFLD=.03
+1 SET DE(DW)="C16^ABSPIN1"
+2 GOTO RE
C16 IF $DATA(DE(16))[0
GOTO C16S
KILL DB
+1 SET X=DE(16)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C16S SET X=""
IF DG(DQ)=X
GOTO C16F1
KILL DB
+1 IF $DATA(DE(16))'[0!(^DD(DP,DIFLD,"AUDIT")'="e")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C16F1 QUIT
X16 IF $LENGTH(X)>12!($LENGTH(X)<3)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
17 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=17
DO X17
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X17 WRITE !!,"MEDICAID #: If you are sending claims to your state's",!
+1 QUIT
18 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=18
DO X18
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X18 WRITE ?10,"Medicaid program, and Medicaid has assigned a special",!
+1 QUIT
19 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=19
DO X19
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X19 WRITE ?10,"Medicaid pharmacy number to your pharmacy, enter that",!
+1 QUIT
20 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=20
DO X20
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X20 WRITE ?10,"number here. It is usually required as part of",!
+1 QUIT
21 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=21
DO X21
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X21 WRITE ?10,"the Medicaid claim.",!
+1 QUIT
22 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=22
SET DW="CAID;1"
SET DV="Fa"
SET DU=""
SET DLB="MEDICAID #"
SET DIFLD=3001.01
+1 SET DE(DW)="C22^ABSPIN1"
+2 GOTO RE
C22 IF $DATA(DE(22))[0
GOTO C22S
KILL DB
+1 SET X=DE(22)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C22S SET X=""
IF DG(DQ)=X
GOTO C22F1
KILL DB
+1 IF $DATA(DE(22))'[0!(^DD(DP,DIFLD,"AUDIT")'="e")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C22F1 QUIT
X22 IF $LENGTH(X)>12!($LENGTH(X)<3)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
23 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=23
DO X23
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X23 WRITE !!,"DEFAULT MEDICAID PROVIDER #: Usually, Medicaid assigns ID numbers",!
+1 QUIT
24 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=24
DO X24
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X24 WRITE ?10,"to prescribers and those numbers must be sent as part of a",!
+1 QUIT
25 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=25
DO X25
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X25 WRITE ?10,"Medicaid claim. If you have a default number which may be ",!
+1 QUIT
26 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=26
DO X26
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X26 WRITE ?10,"used when you don't have a provider's Medicaid number on file",!
+1 QUIT
27 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=27
DO X27
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X27 WRITE ?10,"enter that number here.",!
+1 QUIT
28 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=28
SET DW="CAID;2"
SET DV="Fa"
SET DU=""
SET DLB="DEFAULT CAID PROVIDER #"
SET DIFLD=3001.02
+1 SET DE(DW)="C28^ABSPIN1"
+2 GOTO RE
C28 IF $DATA(DE(28))[0
GOTO C28S
KILL DB
+1 SET X=DE(28)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C28S SET X=""
IF DG(DQ)=X
GOTO C28F1
KILL DB
+1 IF $DATA(DE(28))'[0!(^DD(DP,DIFLD,"AUDIT")'="e")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C28F1 QUIT
X28 IF $LENGTH(X)>10!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
29 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=29
DO X29
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X29 WRITE !!,"INSURER-ASSIGNED #: Usually, private insurance claims require the",!
+1 QUIT
30 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=30
DO X30
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X30 WRITE ?10,"NCPDP #. But if any insurers have special numbers assigned to",!
+1 QUIT
31 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=31
DO X31
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X31 WRITE ?10,"your pharmacy to be used on their claims, then enter those",!
+1 QUIT
32 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=32
DO X32
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X32 WRITE ?10,"insurers and the numbers they assigned to you.",!
+1 QUIT
33 ;950
IF $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=33
SET D=0
KILL DE(1)
+1 SET DIFLD=950
SET DGO="^ABSPIN12"
SET DC="4^9002313.6P^INSURER-ASSIGNED #^"
SET DV="9002313.6MP9999999.18'a"
SET DW="0;1"
SET DOW="INSURER"
SET DLB=$PIECE($$EZBLD^DIALOG(8042,DOW),":")
IF D
SET DC=DC_D
+2 SET DU="AUTNINS("
+3 IF D
GOTO RE
IF $DATA(DSC(9002313.6))#2
IF $PIECE(DSC(9002313.6),"I $D(^UTILITY(",1)=""
XECUTE DSC(9002313.6)
SET D=$ORDER(^(0))
IF D=""
SET D=-1
GOTO M33
+4 SET D=$SELECT($DATA(^ABSP(9002313.56,DA,"INSURER-ASSIGNED #",0)):$PIECE(^(0),U,3,4),$ORDER(^(0))'="":$ORDER(^(0)),1:-1)
M33 IF D>0
SET DC=DC_D
IF $DATA(^ABSP(9002313.56,DA,"INSURER-ASSIGNED #",+D,0))
SET DE(33)=$PIECE(^(0),U,1)
+1 GOTO RE
R33 DO DE
+1 SET D=$SELECT($DATA(^ABSP(9002313.56,DA,"INSURER-ASSIGNED #",0)):$PIECE(^(0),U,3,4),1:1)
GOTO 33+1
+2 ;
34 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=34
DO X34
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X34 WRITE !!,"Auto-Print Pharmacy Expense Report for:",!
+1 QUIT
35 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=35
DO X35
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X35 WRITE ?10,"""1"" All Patients.",!
+1 QUIT
36 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=36
DO X36
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X36 WRITE ?10,"""0"" No Patients. (Do not print)",!
+1 QUIT
37 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=37
DO X37
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X37 WRITE ?10,"""NB"" Non-Beneficiary Patients only.",!
+1 QUIT
38 SET DW="REP;3"
SET DV="Sa"
SET DU=""
SET DLB="AUTOPRINT PHARMACY EXPENSE RPT"
SET DIFLD=115
+1 SET DE(DW)="C38^ABSPIN1"
+2 SET DU="1:All Patients;0:No Patients;NB:Only Non-Beneficiary Patients;"
+3 GOTO RE
C38 IF $DATA(DE(38))[0
GOTO C38S
KILL DB
+1 SET X=DE(38)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C38S SET X=""
IF DG(DQ)=X
GOTO C38F1
KILL DB
+1 IF $DATA(DE(38))'[0!(^DD(DP,DIFLD,"AUDIT")'="e")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C38F1 QUIT
X38 QUIT
39 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=39
DO X39
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X39 WRITE !!,"What Device should the Pharmacy Expense Reports print to? ",!
+1 QUIT
40 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=40
SET DW="REP;4"
SET DV="P3.5'a"
SET DU=""
SET DLB="DEFAULT DEVICE"
SET DIFLD=115.01
+1 SET DE(DW)="C40^ABSPIN1"
+2 SET DU="%ZIS(1,"
+3 GOTO RE
C40 IF $DATA(DE(40))[0
GOTO C40S
KILL DB
+1 SET X=DE(40)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C40S SET X=""
IF DG(DQ)=X
GOTO C40F1
KILL DB
+1 IF $DATA(DE(40))'[0!(^DD(DP,DIFLD,"AUDIT")'="e")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C40F1 QUIT
X40 QUIT
41 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=41
DO X41
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X41 IF '$$ILCAR^ABSPOSS1
SET Y="@999"
+1 QUIT
42 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=42
DO X42
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X42 WRITE !!,"These fields are used for printing pharmacy claims for non-electronic",!
+1 QUIT
43 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=43
DO X43
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X43 WRITE "insurers. If you omit this data, the system will use the general",!
+1 QUIT
44 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=44
DO X44
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X44 WRITE "billing system setup information.",!
+1 QUIT
45 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=45
DO X45
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X45 WRITE !!,"The AR TYPE is required. When charges from this pharmacy",!
+1 QUIT
46 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=46
DO X46
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X46 WRITE "are posted to Accounts Receivable, this is the AR TYPE assigned",!
+1 QUIT
47 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=47
DO X47
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X47 WRITE "to those accounts. It might default if you have an RX type",!
+1 QUIT
48 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=48
DO X48
IF $DATA(DIEFIRE)#2
DO FIREREC^DIE17
IF $DATA(Y)[0
GOTO A
IF Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X48 WRITE "but you should explicitly assign an A/R type here.",!
+1 QUIT
49 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=49
SET DW="0;4"
SET DV="P9001626'"
SET DU=""
SET DLB="AR TYPE"
SET DIFLD=.04
+1 SET DU="ABSBTYP("
+2 GOTO RE
X49 QUIT
50 IF $DATA(DG)>9
DO F^DIE17
GOTO ^ABSPIN13