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

ABMDFRA.m

Go to the documentation of this file.
  1. ABMDFRA ; IHS/ASDST/DMJ - FLAT RATE ADJUSTMENT ;
  1. ;;2.6;IHS 3P BILLING SYSTEM;**9**;NOV 12, 2009
  1. ;
  1. ; IHS/SD/SDR - v2.5 p12 - UFMS
  1. ; If user isn't logged into cashiering session they can't do
  1. ; this option
  1. ;
  1. START ;START
  1. ;start new code abm*2.6*9 NOHEAT - ensure UFMS is setup
  1. I $P($G(^ABMDPARM(DUZ(2),1,4)),U,15)="" D Q
  1. .W !!,"* * UFMS SETUP MUST BE DONE BEFORE ANY BILLING FUNCTIONS CAN BE USED! * *",!
  1. .S DIR(0)="E",DIR("A")="Enter RETURN to Continue" D ^DIR K DIR
  1. ;end new code
  1. I $P($G(^ABMDPARM(DUZ(2),1,4)),U,15)=1 D Q:+$G(ABMUOPNS)=0
  1. .S ABMUOPNS=$$FINDOPEN^ABMUCUTL(DUZ)
  1. .I +$G(ABMUOPNS)=0 D Q
  1. ..W !!,"* * YOU MUST SIGN IN TO BE ABLE TO PERFORM BILLING FUNCTIONS! * *",!
  1. ..S DIR(0)="E",DIR("A")="Enter RETURN to Continue" D ^DIR K DIR
  1. W !!,"This option will adjust the amount billed field for all claims"
  1. W !,"for the insurer and visit type you select beginning with the date"
  1. W !,"you select to reflect a new flat rate.",!
  1. W !,"An adjustment will then be passed to the A/R system.",!
  1. S DIC="^ABMNINS(DUZ(2),",DIC(0)="AEMQ" D ^DIC Q:+Y<0 S ABMINS=+Y
  1. S DIC="^ABMNINS(DUZ(2),ABMINS,1,",DIC(0)="AEMQ" D ^DIC Q:+Y<0 S ABMVTYP=+Y
  1. S DIR(0)="D" D ^DIR K DIR Q:'Y S ABMDATE=Y
  1. S DIR(0)="N",DIR("A")="Enter Old Rate " D ^DIR K DIR S ABMORAT=Y
  1. W !!,"I am going to adjust the amount billed field for all bills with visit date ",!,$$MDT^ABMDUTL(ABMDATE)
  1. W "or later for insurer ",$P(^AUTNINS(ABMINS,0),U),", visit type ",ABMVTYP,", billed at"
  1. W !,"the old rate of ",ABMORAT,"."
  1. S ABMFLAT=$$FLAT^ABMDUTL(ABMINS,ABMVTYP,ABMDATE)
  1. W !!,"NOTE: The flat rate for this insurer, visit type, and date is $",ABMFLAT,".",!
  1. D PRO Q:Y'=1
  1. S ABMCOUNT=0
  1. S ABMI=ABMDATE-.5 F S ABMI=$O(^ABMDBILL(DUZ(2),"AD",ABMI)) Q:'ABMI D
  1. .S ABMJ=0 F S ABMJ=$O(^ABMDBILL(DUZ(2),"AD",ABMI,ABMJ)) Q:'ABMJ D
  1. ..D ONE
  1. W !!,"Finished - ",ABMCOUNT," bills changed.",!!
  1. S DIR(0)="E" D ^DIR K DIR
  1. K ABMFLAT,ABMVTYP,ABMDATE,ABMINS,ABMZERO,ABMCOUNT,ABMOLD,ABMI,ABMJ,ABMAO
  1. Q
  1. ONE ;EP - one bill
  1. S DA=ABMJ
  1. S ABMZERO=^ABMDBILL(DUZ(2),DA,0)
  1. Q:$P(ABMZERO,"^",7)'=ABMVTYP
  1. Q:$P(ABMZERO,"^",8)'=ABMINS
  1. S ABMDAYS=$P($G(^ABMDBILL(DUZ(2),DA,7)),"^",3)
  1. S:+ABMDAYS<2 ABMDAYS=1
  1. S ABMOLD=$P(^ABMDBILL(DUZ(2),DA,2),U)
  1. S ABMOTOT=ABMORAT*ABMDAYS
  1. Q:ABMOLD'=ABMOTOT
  1. S ABMNEW=ABMFLAT*ABMDAYS
  1. Q:ABMOLD=ABMNEW
  1. S $P(^ABMDBILL(DUZ(2),DA,2),U)=ABMNEW
  1. S:$P(^ABMDBILL(DUZ(2),DA,2),"^",3)=ABMOLD $P(^(2),"^",3)=ABMNEW
  1. S ^ABMDBILL(DUZ(2),DA,"AF",$H,.21)=DUZ_"^"_ABMOLD
  1. W "."
  1. S ABMCOUNT=ABMCOUNT+1
  1. S ABMFR("ADJ AMT")=ABMNEW-ABMOLD
  1. S ABMFR("USER")=DUZ
  1. S ABMFR("ARLOC")=$P(^ABMDBILL(DUZ(2),DA,2),"^",6)
  1. I ABMFR("ARLOC")="" D
  1. .S ABMFR("ARLOC")=$$FIND(DA)
  1. .I ABMFR("ARLOC")="" Q
  1. .S DIE="^ABMDBILL(DUZ(2),",DR=".26///"_ABMFR("ARLOC")
  1. .D ^DIE
  1. S ABMFR("TRAN TYPE")=503
  1. S ABMTEST=$$EN^BARFRAPI(.ABMFR)
  1. Q
  1. PRO ;PROCEED
  1. W !
  1. S DIR(0)="Y",DIR("A")="Proceed",DIR("B")="NO" D ^DIR K DIR
  1. Q
  1. FIND(DA) ;find bill in A/R
  1. S ABMARLOC=""
  1. S ABMNAME=$P(^ABMDBILL(DUZ(2),DA,0),U),ABMLOC=$P(^(0),"^",3)
  1. N I
  1. S I=0
  1. F S I=$O(^BARBL(I)) Q:'I D
  1. .Q:ABMARLOC'=""
  1. .S ABMNXT=$O(^BARBL(I,"B",ABMNAME))
  1. .Q:ABMNXT'[ABMNAME
  1. .S ABMIEN=$O(^BARBL(I,"B",ABMNXT,0))
  1. .I $P(^BARBL(I,ABMIEN,0),"^",17)=DA S ABMARLOC=I_","_ABMIEN
  1. Q ABMARLOC