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

ABMPSPLT.m

Go to the documentation of this file.
  1. ABMPSPLT ; IHS/SD/SDR - Split claim based on Insurer setup ;
  1. ;;2.6;IHS 3P BILLING SYSTEM;**22**;NOV 12, 2009;Build 418
  1. ;
  1. ;IHS/SD/SDR 2.6*22 HEAT335246 New routine; uses setup from 3P Insurer file to see if claim should be split so
  1. ; there is one charge per claim or one page (from the claim editor) per claim.
  1. ;
  1. I "^H^I^"[("^"_SERVCAT_"^") Q ;skip claims that have a service category of H or I
  1. I $O(^ABMNINS(ABMP("LDFN"),ABMP("INS"),6,"B",""))="" Q ;there aren't any splits setup for this insurer
  1. ;build list of pages that should be split with dates and how to split them
  1. S ABMP("PG")=""
  1. F S ABMP("PG")=$O(^ABMNINS(ABMP("LDFN"),ABMP("INS"),6,"B",ABMP("PG"))) Q:$G(ABMP("PG"))="" D
  1. .S ABMP("PGIEN")=0
  1. .F S ABMP("PGIEN")=$O(^ABMNINS(ABMP("LDFN"),ABMP("INS"),6,"B",ABMP("PG"),ABMP("PGIEN"))) Q:'ABMP("PGIEN") D
  1. ..S ABMPREC=$G(^ABMNINS(ABMP("LDFN"),ABMP("INS"),6,ABMP("PGIEN"),0))
  1. ..I $P(ABMPREC,U,2)'="",$P(ABMPREC,U,3)'="",$P(ABMPREC,U,2)=$P(ABMPREC,U,3) Q ;there is a start and end date but they are the same; entry is 'deleted'
  1. ..Q:$P(ABMPREC,U,3)=0 ;don't split
  1. ..S ABMP("SPGS",ABMP("PG"))=$P(ABMPREC,U,2)_U_$P(ABMPREC,U,4)_U_$P(ABMPREC,U,3) ;start date ^ end date ^ split how (by charge or by claim-editor-page)
  1. ;
  1. ;check that there's actually something in the what-should-split array, and split the claim if there is
  1. I $O(ABMP("SPGS",""))="" Q ;nothing to split
  1. S ABMPGS=""
  1. F S ABMPGS=$O(ABMP("SPGS",ABMPGS)) Q:$G(ABMPGS)="" D
  1. .S ABMMLT=$S(ABMPGS="8D":23,ABMPGS="8E":37,ABMPGS="8F":35,1:43)
  1. .I +$O(^ABMDCLM(ABMP("LDFN"),ABMP("CDFN"),ABMMLT,0))=0 Q ;no entries for multiple
  1. .I ABMP("VDT")<($P(ABMP("SPGS",ABMPGS),U)) Q ;visit date is before start date
  1. .I $P(ABMP("SPGS",ABMPGS),U,2)'=""&(ABMP("VDT")>$P(ABMP("SPGS",ABMPGS),U,2)) Q ;there is an end date and the visit date is after that
  1. .I $P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),ABMMLT,0)),U,4)<2 Q ;must have multiple entries on a split page that need to be split
  1. .;if it gets here there is data on this page to split
  1. .S ABMY("SPLITHOW")=$P(ABMP("SPGS",ABMPGS),U,3)
  1. .S ABMY("INS")=ABMP("INS")
  1. .S ABMY("PGS")="^"_ABMPGS_"^"
  1. .S ^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),ABMPGS)=$P($G(^ABMDCLM(ABMP("LDFN"),ABMP("CDFN"),ABMMLT,0)),U,4)
  1. .S ABMY("SPLIT")="A" ;this makes it label the split claims as auto-split, not manual
  1. .I +$G(ABMY("AUTODT"))=0 D
  1. ..D NOW^%DTC
  1. ..S ABMY("AUTODT")=%
  1. .S ABMY("INS",ABMY("INS"))=""
  1. .S ABMY("DT")="C"
  1. .D SPLITCLM^ABMRSTI2 ;split claim
  1. .D INSSTMP^ABMRSTI4
  1. .K ^TMP("ABM-SPIN",$J)
  1. Q