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

APCDRV.m

Go to the documentation of this file.
APCDRV ; IHS/CMI/LAB - REVIEW A VISIT ;
 ;;2.0;IHS PCC SUITE;**2**;MAY 14, 2009
 ;
 ;IHS/CMI/LAB - patch 1 for file 200 converted sites
START ;
 Q:'$D(APCDVSIT)
 Q:APCDVSIT=""
 K APCDTALK,APCDERR
 I $D(AUPNTALK) S APCDTALK=""
 S:'$D(AUPNTALK) AUPNTALK=""
 S APCDEC=1,APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT
 I '$D(^AUPNVSIT(APCDVSIT,0)) S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E127" D ERR Q
 S APCDVREC=^AUPNVSIT(APCDVSIT,0)
 Q:$P(APCDVREC,U,11)
 D ZERO
 I $D(APCDERR) G EOJ
 D ^APCDR00
 D CHKV
 D CHKCHA  ;PER PETERSON ON 11/13/09
 K APCDRV
 D:$P(APCDVREC,U,7)="H" ^APCDRVH
EOJ ;
 I '$D(APCDTALK) K AUPNTALK,APCDTALK
 K APCDVFLE,APCDVNM,APCDVDG,APCDVIGR,APCDTALK,APCDE,APCDCLN,APCDEC,APCDPPRV,APCDVREC,APCDLDFN,APCDPCOD,APCDPDIS,APCDPAFF,APCDEDFN
 K X,Y
 K AUPNPAT,AUPNDAYS,AUPNSEX,AUPNDOD,AUPNDOB
 Q
ERR ; EP;PROCESS ERROR
 Q:$D(APCDERR("B",APCDE("FILE"),APCDE("ENTRY"),APCDE))
 S APCDERR(APCDEC)=$O(^APCDERR("B",APCDE,"")),APCDERR(APCDEC,"FILE")=APCDE("FILE"),APCDERR(APCDEC,"ENTRY")=APCDE("ENTRY")
 S APCDERR("B",APCDERR(APCDEC,"FILE"),APCDERR(APCDEC,"ENTRY"),APCDE)="",APCDEC=APCDEC+1
 Q
ZERO ;EP;check for dependent entries, if none, save information
 S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT
 I '$P(^AUPNVSIT(APCDVSIT,0),U,9) S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E100" D ERR
 Q
CHKV ;
 S X2=AUPNDOB,X1=$P($P(APCDVREC,U),".") D ^%DTC S AUPNDAYS=X
 S APCDVFLE=9000010 F  S APCDVFLE=$O(^DIC(APCDVFLE)) Q:APCDVFLE>9000010.99!(APCDVFLE'=+APCDVFLE)  D CHKV2
 Q
 ;
CHKV2 ;
 S APCDVNM=$P(^DIC(APCDVFLE,0),U),APCDVDG=^DIC(APCDVFLE,0,"GL"),APCDVIGR=APCDVDG_"""AD"",APCDVSIT,APCDEDFN)"
 S APCDEDFN="" F  S APCDEDFN=$O(@APCDVIGR) Q:APCDEDFN=""  D CHKV3
 Q
 ;
CHKV3 ;
 S X="APCDR"_$P(APCDVFLE,".",2) X ^%ZOSF("TEST") Q:'$T
 S X="^"_X
 D @(X)
 Q
 ;
CHKCHA ;
 Q:'$P($G(^APCDSITE(DUZ(2),0)),U,35)
CHA ;
 Q:DUZ("AG")'="I"
 Q:$P(^APCPSITE(1,0),U,9)'="Y"
 Q:"ETC"[$P(APCDVREC,U,7)
 Q:"V"[$P(APCDVREC,U,3)
 Q:'$D(^AUPNVPRV("AD",APCDVSIT))
 Q:'$D(^AUPNVPOV("AD",APCDVSIT))
 S APCDRV("CHA")=0
 S (APCDRV(1),APCDRV(2))=0
 F  S APCDRV(2)=$O(^AUPNVPRV("AD",APCDVSIT,APCDRV(2))) Q:APCDRV(2)=""   D DISC
 ;check secondary providers
CHA2 ;
 Q:APCDRV("CHA")=0
 I '$D(^AUPNVTM("AD",APCDVSIT)) S APCDE="E054",APCDE("ENTRY")=APCDVSIT,APCDE("FILE")=9000010 D ERR Q
 K APCDRV
 Q
DISC ;
 I $P(^DD(9000010.06,.01,0),U,2)[200 D DISC200 Q
 S APCDRV("AP")=$P(^AUPNVPRV(APCDRV(2),0),U,1),APCDRV("DISC")=""
 Q:'$D(^DIC(6,APCDRV("AP")))
 S APCDRV("Y")=$P(^DIC(6,APCDRV("AP"),0),U,4)
 Q:APCDRV("Y")=""
 Q:'$D(^DIC(7,APCDRV("Y"),9999999))
 S APCDRV("CHA DISC")=$P(^DIC(7,APCDRV("Y"),9999999),U,1) I APCDRV("CHA DISC")="" Q
 Q:APCDRV("CHA DISC")'=13&(APCDRV("CHA DISC")'=32)
 S APCDRV("CHA")=APCDRV("CHA")+1
 ;
 Q
DISC200 ;IHS/CMI/LAB - patch 1 for file 200 converted sites
 S APCDRV("AP")=$P(^AUPNVPRV(APCDRV(2),0),U,1)
 Q:'APCDRV("AP")
 S APCDRV("CHA DISC")=$$PROVCLSC^XBFUNC1(APCDRV("AP"))
 Q:APCDRV("CHA DISC")'=13&(APCDRV("CHA DISC")'=32)
 S APCDRV("CHA")=APCDRV("CHA")+1
 ;
 Q