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

ABPVRX02.m

Go to the documentation of this file.
ABPVRX02 ;EXTRACT RX VISITS FOR RX BILLING SUMMARY;[ 06/02/91  9:38 AM ]
 ;;2.0;FACILITY PVT-INS TRACKING;*0*;IHS-OKC/KJR;AUGUST 7, 1991
START D INIT,XTRACT,ZTLOAD
 Q
 ;
INIT S ABPVSD=ABPV("BEG"),ABPVFD=ABPV("END"),ABPV("TASK")=ZTSK Q
 ;
XTRACT S ABPVS=ABPVSD-.0001 F I=0:0 S ABPVS=$O(^PSRX("AD",ABPVS)) Q:+ABPVS=0!(ABPVS>ABPVFD)  D C1
 Q
 ;
C1 S ABPVPDFN="" F J=0:0 S ABPVPDFN=$O(^PSRX("AD",ABPVS,ABPVPDFN)) Q:ABPVPDFN=""  D C2
 Q
C2 Q:'$D(^PSRX(ABPVPDFN,0))
 S DFN=$P(^PSRX(ABPVPDFN,0),"^",2) Q:DFN']""
 Q:'$D(^AUPNPRVT(DFN,11))
 S ABPVDRG=$P(^PSRX(ABPVPDFN,0),"^",6) Q:ABPVDRG']""  Q:'$D(^PSDRUG(ABPVDRG,0))  Q:$P(^(0),"^",3)["9"
 S ABPVPRVI=0 F K=0:0 S ABPVPRVI=$O(^AUPNPRVT(DFN,11,ABPVPRVI)) Q:ABPVPRVI'=+ABPVPRVI  D C3
 Q
C3 S ABPVPRV=^AUPNPRVT(DFN,11,ABPVPRVI,0)
 S ABPVPRVE=$P(ABPVPRV,"^",7),ABPVPRVS=$P(ABPVPRV,"^",6) I ABPVPRVE]"",ABPVPRVE<ABPVS Q
 Q:ABPVPRVS>ABPVS
 S ABPVHRN=$S($D(^AUPNPAT(DFN,41,ABPV("SITE"),0)):$P(^(0),"^",2),1:"No HRN")
 S ^%ZTSK(ZTSK,"RX",ABPVHRN_"."_DFN,ABPVS,ABPVPDFN)=""
 Q
 ;
ZTLOAD S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