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

ABMRPVET.m

Go to the documentation of this file.
  1. ABMRPVET ; IHS/SD/SDR - Vet w/Visit in Date Range Listing ;
  1. ;;2.6;IHS 3P BILLING SYSTEM;**12,21**;NOV 12, 2009;Build 379
  1. ;Original;SDR;
  1. ;IHS/SD/SDR - 2.6*21 - HEAT134720 - added total by visit location and how many registered patients for each
  1. ; visit location
  1. ;
  1. K ABM,ABMY
  1. S ABM("RTYP","NM")="Vets with Visits Report"
  1. S ABM("PG")=0
  1. ;
  1. SEL ;EP
  1. D DTYP
  1. Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)!$D(DIRUT)
  1. S ABM("HD",0)="VET LISTING of VISITS"
  1. S ABM("HD",1)="For VISIT DATES: "_$$SDT^ABMDUTL(ABMY("DT",1))_" thru "_$$SDT^ABMDUTL(ABMY("DT",2))
  1. S $P(ABMLINE,"=",80)=""
  1. S ABMQ("RC")="COMPUTE^ABMRPVET"
  1. S ABMQ("RX")="POUT^ABMDRUTL"
  1. S ABMQ("NS")="ABM"
  1. S ABMQ("RP")="PRINT^ABMRPVET"
  1. D ^ABMDRDBQ
  1. Q
  1. DTYP ;
  1. W !!," ============ Entry of VISIT DATE Range =============",!
  1. S DIR("A")="Enter STARTING VISIT DATE for the Report"
  1. S DIR(0)="DO^::EP"
  1. D ^DIR
  1. Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)!$D(DIRUT)
  1. S ABMY("DT",1)=Y
  1. W !
  1. S DIR("A")="Enter ENDING DATE for the Report"
  1. D ^DIR
  1. K DIR
  1. G DTYP:$D(DIRUT)!$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
  1. S ABMY("DT",2)=Y
  1. I ABMY("DT",1)>ABMY("DT",2) W !!,*7,"INPUT ERROR: Start Date is Greater than than the End Date, TRY AGAIN!",!! G DTYP
  1. Q
  1. COMPUTE ;EP - Entry Point for Setting up Data
  1. S ABM("SUBR")="ABM-VET"
  1. K ^TMP($J,"ABM-VET")
  1. DATA ;EP
  1. S ABMSTART=ABMY("DT",1)-.5
  1. S ABMEND=ABMY("DT",2)+.999999
  1. F S ABMSTART=$O(^AUPNVSIT("B",ABMSTART)) Q:'ABMSTART!(ABMSTART>ABMEND) D
  1. .S ABMVIEN=0
  1. .F S ABMVIEN=$O(^AUPNVSIT("B",ABMSTART,ABMVIEN)) Q:'ABMVIEN D
  1. ..S ABMPT=$$GET1^DIQ(9000010,ABMVIEN,".05","I")
  1. ..I $$GET1^DIQ(2,ABMPT,1901,"I")'="Y" Q ;not a Vet
  1. ..S ^TMP($J,"ABM-VET",ABMPT)=+$G(^TMP($J,"ABM-VET",ABMPT))+1 ;visit count
  1. ..S ABMNAME=$$GET1^DIQ(2,ABMPT,".01","E")
  1. ..S ^TMP($J,"ABM-VET","S",ABMNAME)=ABMPT
  1. ..;start new abm*2.6*21 IHS/SD/SDR HEAT134720
  1. ..S ABMVLOC=$$GET1^DIQ(9000010,ABMVIEN,".06","I")
  1. ..S ^TMP($J,"ABM-VET","VTOT",ABMVLOC)=+$G(^TMP($J,"ABM-VET","VTOT",ABMVLOC))+1 ;count visits by site
  1. ..Q:+$G(^TMP($J,"ABM-VET","UNQ PTS",ABMVLOC,ABMPT))=1 ;pt already counted for visit location
  1. ..Q:'$D(^AUPNPAT(ABMPT,41,ABMVLOC)) ;skip if pt isn't registered at location
  1. ..S ^TMP($J,"ABM-VET","UPTOT",ABMVLOC)=+$G(^TMP($J,"ABM-VET","UPTOT",ABMVLOC))+1 ;count how many unique registered pts
  1. ..S ^TMP($J,"ABM-VET","UNQ PTS",ABMVLOC,ABMPT)=1 ;track unique pts
  1. ;end new abm*2.6*21 IHS/SD/SDR HEAT134720
  1. Q
  1. PRINT ;
  1. D HDR
  1. S ABMN=""
  1. S ABMQFLG=0
  1. F S ABMN=$O(^TMP($J,"ABM-VET","S",ABMN)) Q:ABMN="" D Q:($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT))
  1. .I $Y+5>IOSL D HDR Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
  1. .S ABMPT=$G(^TMP($J,"ABM-VET","S",ABMN))
  1. .S ABMVCNT=$G(^TMP($J,"ABM-VET",ABMPT))
  1. .S ABMDOB=$$SDT^ABMDUTL($$GET1^DIQ(2,ABMPT,".03","I"))
  1. .S ABMSSN=$$GET1^DIQ(2,ABMPT,".09")
  1. .S ABMHRN=$P($G(^AUPNPAT(ABMPT,41,DUZ(2),0)),U,2)
  1. .W !,ABMN,?40,ABMHRN,?48,ABMDOB,?59,ABMSSN,?76,ABMVCNT
  1. ;start new abm*2.6*21 IHS/SD/SDR HEAT134720
  1. W !
  1. S ABMVLOC=0
  1. F S ABMVLOC=$O(^TMP($J,"ABM-VET","VTOT",ABMVLOC)) Q:'ABMVLOC D
  1. .W !?5,$$GET1^DIQ(9999999.06,ABMVLOC,".02","E"),?20,+$G(^TMP($J,"ABM-VET","VTOT",ABMVLOC))_" "_$S(+$G(^TMP($J,"ABM-VET","VTOT",ABMVLOC))=1:"visit",1:"visits")
  1. .W ?35,+$G(^TMP($J,"ABM-VET","UPTOT",ABMVLOC))_" registered"
  1. K ^TMP($J,"ABM-VET")
  1. ;end new abm*2.6*21 IHS/SD/SDR HEAT134720
  1. Q
  1. HDR ;EP
  1. I +$G(ABM("PG"))'=0,$E(IOST)="C" S DIR(0)="E" D ^DIR K DIR Q:(IOST["C")&($G(Y)<0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT))
  1. S ABM("PG")=ABM("PG")+1
  1. D WHD^ABMDRHD
  1. W !,"PATIENT NAME",?40,"HRN",?48,"DOB",?59,"SSN",?69,"VISIT CNT"
  1. W !,ABMLINE
  1. Q