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

ABMMUFC4.m

Go to the documentation of this file.
ABMMUFC4 ;IHS/SD/SDR - EHR Incentive Report (MU) ;
 ;;2.6;IHS 3P BILLING SYSTEM;**15,20**;NOV 12, 2009;Build 317
 ;IHS/SD/SDR - 2.6*15 - HEAT183309 - split routine due to size
 ;IHS/SD/SDR - 2.6*20 - HEAT256154 - Added MCR/MCD and VISIT W/NO ELIG categories; Also made only IP CHGS show on detail.  Added bill type and visit type to
 ;  detail output for validating purposes.
WRTDTLHO ;
 S ABM("HD",0)="HOSPITAL CALCULATION MU INCENTIVE REPORT"
 S ABM("PG")=1  ;abm*2.6*7
 S ABMTYP="DET" D WHD^ABMMUFAC
 S CENTER=IOM/2
 ;F ABMITYP="MEDICARE","MEDICAID","PRIVATE","PRI/MCD","KIDSCARE XIX","KIDSCARE XXI","VMBP","OTHER" D  ;abm*2.6*20 IHS/SD/SDR HEAT256154
 F ABMITYP="MEDICARE","MEDICAID","MCR/MCD","PRIVATE","PRI/MCD","KIDSCARE XIX","KIDSCARE XXI","VMBP","OTHER","VISIT W/NO ELIG" D  ;abm*2.6*20 IHS/SD/SDR HEAT256154
 .S (ABMTBILD,ABMTPD,ABMTCDYS,ABMTNDYS)=0
 .;abm*2.6*15 HEAT183309 Req#B - Rewrote everything below to use ABMREC, added ABMRT loop, and removed BDFN and DUZ(2) loops
 .S ABMRT=""
 .F  S ABMRT=$O(^TMP($J,"ABM-MUFAC","DETAIL",ABMITYP,ABMRT)) Q:($G(ABMRT)="")  D
 ..S ABMCHG=""
 ..F  S ABMCHG=$O(^TMP($J,"ABM-MUFAC","DETAIL",ABMITYP,ABMRT,ABMCHG)) Q:($G(ABMCHG)="")  D
 ...I ABMCHG="IP CHGS" Q  ;abm*2.6*20 IHS/SD/SDR HEAT256154
 ...S (ABMTBILD,ABMTPD,ABMTCDYS,ABMTNDYS)=0
 ...S ABMINS=""
 ...F  S ABMINS=$O(^TMP($J,"ABM-MUFAC","DETAIL",ABMITYP,ABMRT,ABMCHG,ABMINS)) Q:ABMINS=""  D
 ....S ABMP("VDFN")=0
 ....F  S ABMP("VDFN")=$O(^TMP($J,"ABM-MUFAC","DETAIL",ABMITYP,ABMRT,ABMCHG,ABMINS,ABMP("VDFN"))) Q:'ABMP("VDFN")  D
 .....S ABMREC=$G(^TMP($J,"ABM-MUFAC","DETAIL",ABMITYP,ABMRT,ABMCHG,ABMINS,ABMP("VDFN")))
 .....S ABMDOSB=$P(ABMREC,U)
 .....S ABMDOSE=$P(ABMREC,U,2)
 .....S ABMBILLD=$P(ABMREC,U,3)
 .....S ABMPD=$P(ABMREC,U,4)
 .....S ABMCDAYS=$P(ABMREC,U,5)
 .....S ABMNDAYS=$P(ABMREC,U,6)
 .....S ABMVLOC=$P(ABMREC,U,7)
 .....S ABMDUZ2=+$P(ABMREC,U,8)
 .....S ABMP("BDFN")=+$P(ABMREC,U,9)
 .....S ABMP("BTYP")=$P(ABMREC,U,11)  ;abm*2.6*20 IHS/SD/SDR HEAT256154
 .....S ABMP("VTYP")=$P(ABMREC,U,12)  ;abm*2.6*20 IHS/SD/SDR HEAT256154
 .....S ABMITYPA=$P(ABMREC,U,13)  ;abm*2.6*20 IHS/SD/SDR HEAT256154
 .....S ABMATYP=$P(ABMREC,U,14)  ;abm*2.6*20 IHS/SD/SDR HEAT256154
 .....S ABMBILLN=0
 .....S:ABMP("BDFN") ABMBILLN=$P($G(^ABMDBILL(ABMDUZ2,ABMP("BDFN"),0)),U)
 .....S ABMP("PDFN")=$P($G(^AUPNVSIT(ABMP("VDFN"),0)),U,5)
 .....S IENS=$P($G(^AUPNVSIT(ABMP("VDFN"),0)),U,6)_","_ABMP("PDFN")_","
 .....S ABMHRN=$$GET1^DIQ(9000001.41,IENS,".02")
 .....S:ABMBILLN ABMBILLN=ABMBILLN_$S($P($G(^ABMDPARM(ABMDUZ2,1,2)),U,4)]"":"-"_$P(^ABMDPARM(ABMDUZ2,1,2),U,4),1:"")
 .....I $P($G(^ABMDPARM(ABMDUZ2,1,3)),U,3),($P($G(^AUPNPAT(ABMP("PDFN"),41,ABMDUZ2,0)),U,2)),ABMBILLN S ABMBILLN=ABMBILLN_"-"_$P(^AUPNPAT(ABMP("PDFN"),41,ABMDUZ2,0),U,2)
 .....W !,ABMITYP_U_$S(ABMRT="NOTBLD":"TOT",1:ABMRT)_U_ABMCHG  ;abm*2.6*15 HEAT183309 Req#B
 .....W U_$P(ABMINS,"|")_U_$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,$P(ABMINS,"|",2),".211","I"),1,"I")
 .....W U_ABMBILLN
 .....W U_$$SDTO^ABMDUTL(ABMDOSB)_U_$$SDTO^ABMDUTL(ABMDOSE)_U_$FN(ABMBILLD,",",2)_U_$FN(ABMPD,",",2)
 .....;W U_+ABMCDAYS_U_+ABMNDAYS_U_ABMHRN_U_$$CDT^ABMDUTL($P($G(^AUPNVSIT(ABMP("VDFN"),0)),U))_U_ABMVLOC  ;abm*2.6*15
 .....W U_+ABMCDAYS_U_+ABMNDAYS_U_ABMHRN_U_$$BDT^ABMDUTL($P($G(^AUPNVSIT(ABMP("VDFN"),0)),U))_U_ABMVLOC  ;abm*2.6*15
 .....W U_ABMP("BTYP")_U_ABMP("VTYP")_U_ABMITYPA_U_ABMATYP_"|"  ;abm*2.6*20 IHS/SD/SDR HEAT256154
 .....S ABMTBILD=+$G(ABMTBILD)+ABMBILLD
 .....S ABMTPD=+$G(ABMTPD)+ABMPD
 .....S ABMTCDYS=+$G(ABMTCDYS)+ABMCDAYS
 .....S ABMTNDYS=+$G(ABMTNDYS)+ABMNDAYS
 S DUZ(2)=ABMDUZ2
 Q