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

ABMDICST.m

Go to the documentation of this file.
ABMDICST ; IHS/SD/TPF - Pending Claims Status Report ; JUN 29, 2005
 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
 ;
 ; IHS/SD/SDR - V2.5 P10 - IM21520
 ;    Added code to allow no date range selection
 ;
EN ;EP - PENDING CLAIMS STATUS REPORT
 K ABM,ABMY
 S ABM("RTYP")=1,ABM("RTYP","NM")="BRIEF LISTING (80 Width)"
 S ABM("STA")="P"
 ;cancelled claims
 S ABM("DT")="V"    ;by visit date
 S ABM("SORT")="C"
 S ABM("L")=DUZ(2)
 S ABM("STA","NM")="PENDING STATUS"
 S ABM("REASON")="PEND"  ;flag for RTYP^ABMDRSL2 to not ask for EXTENDED
SEL S ABM("NODX")="" D ^ABMDRSEL Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
 S ABM("HD",0)="PENDING CLAIMS STATUS LISTING"
 D ^ABMDRHD
 S ABMQ("RC")="COMPUTE^ABMDICST",ABMQ("RX")="POUT^ABMDRUTL",ABMQ("NS")="ABM"
 S ABMQ("RP")="PRINT^ABMDPST"_ABM("RTYP")
 D ^ABMDRDBQ
 Q
 ;
COMPUTE ;EP - Entry Point for Setting up Data
 S ABM("SUBR")="ABM-ICS" K ^TMP("ABM-ICS",$J) Q:'$D(ABM("STA"))  S ABM("PG")=0
 D SLOOP
 Q
SLOOP ;EP - LOOP TO PULL PENDING CLAIMS
 I $D(ABMY("DT")) D  Q
 .S ABM("RD")=ABMY("DT",1)-1
 .F  S ABM("RD")=$O(^ABMDCLM(DUZ(2),"AD",ABM("RD"))) Q:'+ABM("RD")!($P(ABM("RD"),".")>ABMY("DT",2))  D
 ..S ABM=""
 ..F  S ABM=$O(^ABMDCLM(DUZ(2),"AD",ABM("RD"),ABM)) Q:'ABM  D DATA
 S ABMP=0
 F  S ABMP=$O(^ABMDCLM(DUZ(2),"AS",ABMP)) Q:ABMP=""  D
 .S ABM=0
 .F  S ABM=$O(^ABMDCLM(DUZ(2),"AS",ABMP,ABM)) Q:'ABM  D DATA
 Q
 ;
DATA ;EP - COMPILE DATA FOR PENDING CLAIM STATUS
 S ABMP("HIT")=0
 D INCOM^ABMDRCHK(ABM,.ABM,.ABMY)
 Q:'ABMP("HIT")
 S ABM("SORT")=$S($G(ABMY("SORT"))="C":$G(ABM("CLINIC")),1:$G(ABM("VISIT TYPE")))
 S:ABM("SORT")="" ABM("SORT")="UNDEFINED"
 S ABM("HRN")=$S($G(ABM("PATIENT"))'="":$P($G(^AUPNPAT(ABM("PATIENT"),41,ABM("L"),0)),U,2),1:"UNDEFINED")
 S ABM("LOCATION NAME")=$S($G(ABM("LOCATION"))'="":$P($G(^DIC(4,ABM("LOCATION"),0)),U),1:"UNDEFINED")
 S SUBSCRIP=$G(ABM("LOCATION NAME"))_U_$G(ABM("SORT"))
 S SUBSCRIP=SUBSCRIP_U_$S($G(ABM("PATIENT"))="":"",1:$P($G(^DPT(ABM("PATIENT"),0)),U))
 S SUBSCRIP=SUBSCRIP_U_$G(ABM("HRN"))_U_$G(ABM)_U_$G(ABM("VISIT TYPE"))
 S SUBSCRIP=SUBSCRIP_U_$G(ABM("CLINIC"))_U_$G(ABM("PS REASON"))_U_$G(ABM("VISIT DATE"))
 S SUBSCRIP=SUBSCRIP_U_$G(ABM("ACTIVE INSURER"))_U_$G(ABM("PS UPDATER"))
 S ^TMP("ABM-ICS",$J,SUBSCRIP)=""
 S ABM("ST",ABM("LOCATION NAME"),ABM("PS UPDATER"),ABM("SORT"),ABM("ACTIVE INSURER"),ABM("PS REASON"))=+$G(ABM("ST",ABM("LOCATION NAME"),ABM("PS UPDATER"),ABM("SORT"),ABM("ACTIVE INSURER"),ABM("PS REASON")))+1
 Q
 ;CALL THIS TAG TO SET UP SOME CLAIMS FOR TESTING
TEST ;
 S CNT=0
 S FAC=0
 F  S FAC=$O(^ABMDCLM(FAC)) Q:'FAC  D
 .S CLAIM=0,CNT=0
 .F  S CLAIM=$O(^ABMDCLM(FAC,CLAIM)) Q:'CLAIM!(CNT>30)  D
 ..S RANDUZ=$R(400)
 ..Q:RANDUZ=0
 ..Q:'$D(^VA(200,RANDUZ))
 ..S RANREAS=$R(18)
 ..Q:RANREAS=0
 ..Q:'$D(^ABMPSTAT(RANREAS))
 ..S CNT=CNT+1
 ..S $P(^ABMDCLM(FAC,CLAIM,0),U,4)="P"
 ..S $P(^ABMDCLM(FAC,CLAIM,0),U,19)=RANDUZ
 ..S $P(^ABMDCLM(FAC,CLAIM,0),U,18)=RANREAS
 ..W !,FAC,"--",CLAIM
 Q
QPRT ;
 S FAC=0
 F  S FAC=$O(^ABMDCLM(FAC)) Q:'FAC  D
 .S CLAIM=0
 .F  S CLAIM=$O(^ABMDCLM(FAC,CLAIM)) Q:'CLAIM  D
 ..I $P($G(^ABMDCLM(FAC,CLAIM,0)),U,19)'="",($P($G(^ABMDCLM(FAC,CLAIM,0)),U,4)="P") D
 ...W !,FAC,"--",CLAIM,"--",$P($G(^ABMDCLM(FAC,CLAIM,0)),U,2)
 ...W:$P(^ABMDCLM(FAC,CLAIM,0),U,18)="" "*"
 Q