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

ABMRSCIN.m

Go to the documentation of this file.
  1. ABMRSCIN ; IHS/SD/SDR - Setup option to split claims in claim generator;
  1. ;;2.6;IHS 3P BILLING SYSTEM;**22**;NOV 12, 2009;Build 418
  1. ;IHS/SD/SDR 2.6*22 HEAT335246 - New routine
  1. ;
  1. Q
  1. START ;
  1. S ABMP("RTN")="ABMRSCIN" ;Routine used to get data
  1. S ABMMENU="Split claim setup for claim generator"
  1. SEL ;
  1. K ABMY,ABM
  1. K DTOUT,DIRUT,DUOUT,DIROUT
  1. I $D(ABMY("RTYP")) S ABM("HD",0)=ABMY("RTYP","NM")_" "_ABMMENU
  1. E S ABM("HD",0)=ABMMENU
  1. W !!,"This option allows sites to have claims automatically split into"
  1. W !,"multiple claims for billing. The split will occur when the claim"
  1. W !,"generator runs. You can split each page of the claim editor into"
  1. W !,"a new claim, or you can split each individual charge into a new"
  1. W !,"claim. The pages available for splitting are 8D Medications,"
  1. W !,"8E Laboratory, 8F Radiology, or 8H HCPCS."
  1. W !!,"NOTE: This option does NOT split claims that have a Service"
  1. W !,"Category of Hospitalization (H) or In Hospital (I)."
  1. W !!,"For example, if you have an outpatient visit with three medications"
  1. W !,"and the setup is done so each charge is on its own claim, you will end"
  1. W !,"up with"
  1. W !,"4 claims --> 1 with the E&M code"
  1. W !," --> 3 with one medication each"
  1. W !!,"A different example, if you have an outpatient visit with four labs"
  1. W !,"and the setup is for a page to be on its own claim, you will end up with"
  1. W !,"2 claims --> 1 with the E&M code"
  1. W !," --> 1 with all four lab codes"
  1. W !!,"NOTE: all prompts are required"
  1. W !
  1. S DIR(0)="Y",DIR("A")="Do you wish to continue" D ^DIR K DIR
  1. I 'Y Q ;quit if they say NO
  1. SEL2 ;EP
  1. D INS ;select insurer(s)
  1. I +$G(ABMY("INS"))=0 Q ;no insurer was selected
  1. SEL3 ;EP
  1. D INSCHK ;check if this insurer already has something setup and display if so.
  1. I +$G(ABMIFLG)=1 D ;ABMIFLG means this insurer has something setup - display it
  1. .S ABMEFLG=1
  1. .I $P(Y,U,3)'=1 D ;not a new entry; display what we found and ask add/term an existing entry
  1. ..S DIR(0)="S^A:ADD;T:TERMINATE"
  1. ..S DIR("A")="Add or Terminate Entry?"
  1. ..S DIR("B")="A"
  1. ..D ^DIR K DIR
  1. ..Q:$D(DUOUT)!$D(DTOUT)!$D(DIROUT)!$D(DIRUT)
  1. ..S ABMANS=Y
  1. ..I ((ABMANS="T")&(ABMICNT>1)) D ;multiple entries - pick which one to end (that's the only edit option)
  1. ...D ^XBFMK
  1. ...S DIR(0)="NO^1:"_ABMICNT
  1. ...W !!
  1. ...S DIR("A",1)="Entries that are already terminated can't be terminated again"
  1. ...S DIR("A")="Terminate which entry?"
  1. ...D ^DIR
  1. ...Q:$D(DUOUT)!$D(DTOUT)!$D(DIROUT)!$D(DIRUT)
  1. ...Q:+Y<0
  1. ...S ABMENTR=+Y
  1. ...I +$P($G(^ABMNINS(DUZ(2),ABMY("INS"),6,ABMENTR,0)),U,4)'=0 W !!,"That entry has already been terminated and is therefore unselectable.",! H 1 K ABMANS S ABMEFLG=0
  1. ..Q:$D(DUOUT)!$D(DTOUT)!$D(DIROUT)!$D(DIRUT)
  1. ..I ABMICNT=1 S ABMENTR=1
  1. ..I $G(ABMANS)="T" D END
  1. Q:$D(DUOUT)!$D(DTOUT)!$D(DIROUT)!$D(DIRUT)
  1. I +$G(ABMEFLG)=0&($G(ABMIFLG)=1) Q
  1. ;
  1. D PGS ;what pages do you want to split (8D, 8E, 8F, 8H, 8Z)
  1. I '$D(ABMY("PGS")) Q ;no pages were selected
  1. D PGCK ;check if insurer/page combination already exists
  1. I ABMPGCK=1 D G SEL2
  1. .W !!,"That insurer/page combination has already been setup."
  1. .W !,"If you need to change something you'll need to term the"
  1. .W !,"Existing setup and create a new entry."
  1. .H 1
  1. D SDT ;select visit or approval date range
  1. I '$D(ABMY("DT",1)) Q ;no dates were entered
  1. D SPLITHOW ;split
  1. I '$D(ABMY("SPLITHOW")) Q ;no split option was selected
  1. ;
  1. D DISPLAY
  1. ;
  1. W !!
  1. D ^XBFMK
  1. S DIR(0)="Y",DIR("A")="Do you wish to continue" D ^DIR K DIR
  1. Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)!$D(DIRUT)
  1. I 'Y G SEL2 ;start over if they say NO
  1. D SAVE ;save what they setup
  1. Q
  1. INS ;EP
  1. K ABMY("INS")
  1. W !!,"Insurers selected here MUST be the active insurer in order for claims/bills"
  1. W !,"to use this setup!",!
  1. D ^XBFMK
  1. S DIC="^AUTNINS("
  1. S DIC(0)="QEAMZ"
  1. D ^DIC
  1. Q:+Y<0
  1. ;check if the insurer they selected is merged
  1. I $$GET1^DIQ(9999999.18,+Y,".27","E")'="" D Q:(+Y<1)!$D(DUOUT)!$D(DTOUT)!$D(DIROUT)!$D(DIRUT)
  1. .W !!!,"The insurer you selected has been merged into insurer "_$$GET1^DIQ(9999999.18,+Y,".27","E")
  1. .S ABMITMP=+Y
  1. .D ^XBFMK
  1. .S DIR(0)="Y",DIR("A")="Do you wish to continue" D ^DIR K DIR
  1. .Q:+Y<1
  1. .S Y=ABMITMP
  1. S ABMY("INS")=+Y
  1. Q:$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,+ABMY("INS"),".211","I"),1,"I")'="R" ;stop here if not Medicare FI insurer type
  1. W !!,"You selected a MEDICARE FI insurer type",!
  1. S DIR(0)="Y",DIR("A")="Do you really wish to continue" D ^DIR K DIR
  1. I 'Y Q ;exit if they say NO, don't continue
  1. Q
  1. INSCHK ;EP
  1. K ABMIFLG
  1. S ABMICNT=0
  1. Q:+$O(^ABMNINS(DUZ(2),ABMY("INS"),6,0))=0 ;quit because no entries exist
  1. S ABMIFLG=1
  1. W !!,"There is already data setup for that insurer:"
  1. W !!,"#",?4,"PAGE",?9,"START DT",?20,"SPLIT CLAIM HOW",?37,"END DATE",?50,"CREATED",?61,"BY",?68,"ENDED",?77,"BY"
  1. S ABMI=0
  1. F S ABMI=$O(^ABMNINS(DUZ(2),ABMY("INS"),6,ABMI)) Q:'ABMI D
  1. .S ABMREC=$G(^ABMNINS(DUZ(2),ABMY("INS"),6,ABMI,0))
  1. .S ABMPG=$P(ABMREC,U) ;page to split
  1. .S ABMSDT=$P(ABMREC,U,2) ;start date
  1. .S ABMSPLHW=$P(ABMREC,U,3) ;split claim how
  1. .S ABMEDT=$P(ABMREC,U,4) ;end date
  1. .S ABMCRDT=$P(ABMREC,U,5) ;entry created on
  1. .S ABMCRU=$P(ABMREC,U,6) ;entry created by
  1. .S ABMENDDT=$P(ABMREC,U,7) ;end date was entered on
  1. .S ABMENDDU=$P(ABMREC,U,8) ;entry created by
  1. .W !,ABMI,?5,ABMPG
  1. .W ?9,$$SDTO^ABMDUTL(ABMSDT)
  1. .W ?21,$S(ABMSPLHW=1:"1 Clm/CHRG",ABMSPLHW=2:"1 Clm/PAGE",1:"Don't split")
  1. .W:ABMEDT ?37,$$SDTO^ABMDUTL(ABMEDT)
  1. .;
  1. .W ?50,$$SDTO^ABMDUTL(ABMCRDT)
  1. .W ?61,$P($G(^VA(200,ABMCRU,0)),U,2)
  1. .W:ABMENDDT ?66,$$SDTO^ABMDUTL(ABMENDDT)
  1. .W:ABMENDDU ?77,$P($G(^VA(200,ABMENDDU,0)),U,2)
  1. .S ABMICNT=+$G(ABMICNT)+1
  1. W !
  1. Q
  1. SDT ;EP
  1. W !,"Enter a start date. The DOS on a claim will be compared to this date"
  1. W !,"to determine if it should be split or not. Claims with a DOS prior"
  1. W !,"to this date will not split."
  1. S DIR("A")="Enter START date"
  1. S DIR(0)="DO^::EP"
  1. D ^DIR
  1. Q:$D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)
  1. S ABMY("DT",1)=Y
  1. Q
  1. PGS ;
  1. S ABMSTRG=""
  1. K ABMY("PGS")
  1. S DIR(0)="SO^8D:MEDICATIONS;8E:LABORATORY;8F:RADIOLOGY;8H:HCPCS"
  1. S DIR("A")="Move Which Section(s)? "
  1. D ^DIR
  1. Q:'Y
  1. S ABMY("PGS")="^"_Y_"^"
  1. Q
  1. PGCK ;EP
  1. S ABMPGCK=0
  1. S ABMY("PGCK")=$TR(ABMY("PGS"),"^")
  1. S ABMICK=0
  1. F S ABMICK=$O(^ABMNINS(DUZ(2),ABMY("INS"),6,"B",ABMY("PGCK"),ABMICK)) Q:'ABMICK D
  1. .Q:$P($G(^ABMNINS(DUZ(2),ABMY("INS"),6,ABMICK,0)),U,4)'="" ;there's an end date on it
  1. .S ABMPGCK=1
  1. Q
  1. SPLITHOW ;EP
  1. K ABMY("SPLITHOW")
  1. S DIR(0)="SO^C:Yes, 1 Claim for each CHARGE;P:Yes, 1 Claim for each PAGE;N:No, don't split the claim"
  1. S DIR("A")="Split the claim? "
  1. S DIR("B")="N"
  1. D ^DIR
  1. Q:$G(Y)=""
  1. Q:$D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)
  1. S ABMY("SPLITHOW")=$S(Y="C":1,Y="P":2,1:0)
  1. Q
  1. DISPLAY ;EP
  1. W !!,"You selected: "
  1. W !?11,"Insurer: ",$P($G(^AUTNINS(ABMY("INS"),0)),U)
  1. W !?8,"Start Date: ",$$SDT^ABMDUTL(ABMY("DT",1))
  1. W !?8,"Split page: ",$TR(ABMY("PGS"),"^","")_" "_$S(ABMY("PGS")["8D":"MEDICATIONS",ABMY("PGS")["8E":"LABORATORY",ABMY("PGS")["8F":"RADIOLOGY",ABMY("PGS")["8H":"HCPCS",1:"")
  1. W !?3,"Split claim how: "_$S(ABMY("SPLITHOW")=1:"1 Claim for each CHARGE",ABMY("SPLITHOW")=2:"1 Claim for each PAGE",1:"No, don't split the claim")
  1. Q
  1. SAVE ;EP
  1. W !!,"Saving setup.."
  1. K DIC,DIE,DA,DR,X,Y
  1. S DA(1)=ABMY("INS")
  1. S X=$TR(ABMY("PGS"),"^")
  1. S DIC="^ABMNINS("_DUZ(2)_","_DA(1)_",6,"
  1. S DIC("P")=$P(^DD(9002274.09,6,0),U,2)
  1. S DIC(0)="LX"
  1. S DIC("DR")=".02////"_ABMY("DT",1) ;start date for this split entry
  1. S DIC("DR")=DIC("DR")_";.03///"_ABMY("SPLITHOW") ;1 chg/clm or 1 pg/clm
  1. S DIC("DR")=DIC("DR")_";.05///NOW" ;entry created date
  1. S DIC("DR")=DIC("DR")_";.06////"_DUZ ;who created
  1. K DD,DO
  1. D FILE^DICN
  1. I Y<0 W !!,"Entry not saved."
  1. D PAZ^ABMDRUTL
  1. Q
  1. END ;EP
  1. S ABMEFLG=0
  1. K DIC,DIE,DIR,DA,DR,X,Y
  1. S DIR(0)="DO^"_$P($G(^ABMNINS(DUZ(2),ABMY("INS"),6,ABMENTR,0)),U,2)
  1. S DIR("A",1)="End date must be ON or AFTER the start date for this entry"
  1. S DIR("A")="END DATE"
  1. D ^DIR
  1. I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) Q
  1. I +Y<1
  1. S ABMEDT=+Y ;end date
  1. K DIC,DIE,DIR,DA,DR,X,Y
  1. S DIR(0)="Y"
  1. S DIR("A")="Are you sure you wish to terminate this entry"
  1. S DIR("B")="N"
  1. D ^DIR
  1. I +Y<1 W !!,"Entry not terminated." H 1 Q
  1. ;
  1. ;save entry
  1. W !!,"Saving setup.."
  1. S DA(1)=ABMY("INS")
  1. S DA=ABMENTR
  1. S DIE="^ABMNINS("_DUZ(2)_","_DA(1)_",6,"
  1. S DR=".04////"_ABMEDT ;end date
  1. S DR=DR_";.07///NOW;.08////"_DUZ ;end date entered on and by whom
  1. D ^DIE
  1. D PAZ^ABMDRUTL
  1. Q