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

APCDR00.m

Go to the documentation of this file.
APCDR00 ; IHS/CMI/LAB - REVIEW VISIT RECORD ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
 ;IHS/CMI/TUCSON - patch 1 for file 200 conversion sites
START ;
 D PPPV
 D GETACC
 D VISIT^APCDR001
EOJ ;clean up and exit
 K APCD1,APCD2,APCDE,APCDY,APCDL,APCDX,APCDCLN,APCDLDFN,APCDAP,APCDLL
 K X,Y,%DT
 Q
ERR ;
 D ERR^APCDRV
 Q
PPPV ;EP;check for primary prov and pov
 Q:"EI"[$P(APCDVREC,U,7)
 I $G(APCDRTYP)="R",'$D(^AUPNVRAD("AD",APCDVSIT)) Q
 I $G(APCDRTYP)="L",'$D(^AUPNVLAB("AD",APCDVSIT)) Q
 I $G(APCDRTYP)="I",'$D(^AUPNVIMM("AD",APCDVSIT)) Q
 I $G(APCDRTYP)="P",'$D(^AUPNVMED("AD",APCDVSIT)) Q
 I '$D(^AUPNVPOV("AD",APCDVSIT)) S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E102" D ERR
 D:$P(APCDVREC,U,7)="H" CHECKPV
 S (APCD1,APCD2,APCDPPRV)=0 F  S APCD2=$O(^AUPNVPRV("AD",APCDVSIT,APCD2)) Q:APCD2=""  I $P(^AUPNVPRV(APCD2,0),U,4)="P" S APCD1=APCD1+1,APCDPPRV=$P(^(0),U),APCDAP=APCD2
 I APCD1=0 S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E101" D ERR,EOJ Q
 I APCD1>1 S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E103" D ERR,EOJ Q
PRIPRV ; 
 D PRI200
 Q
CHECKPV ; 
 S (APCD1,APCD2)=0 F  S APCD2=$O(^AUPNVPOV("AD",APCDVSIT,APCD2)) Q:APCD2=""  I $P(^AUPNVPOV(APCD2,0),U,12)="P" S APCD1=APCD1+1
 I APCD1=0 S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E300" D ERR I 1
 E  I APCD1>1 S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E301" D ERR
 Q
 ;
 ;
GETACC ;get accept command if there is one and save variable
 K APCDACC
 ;$O THRU V POV'S FOR ACCEPT
 S APCD2=0 F  S APCD2=$O(^AUPNVPOV("AD",APCDVSIT,APCD2)) Q:APCD2=""  I $P(^AUPNVPOV(APCD2,0),U,14)]"" S APCDACC=""
 Q:$D(APCDACC)
 ;$O THRU V PROCEDURES FOR ACCEPT
 S APCD2=0 F  S APCD2=$O(^AUPNVPRC("AD",APCDVSIT,APCD2)) Q:APCD2=""  I $P(^AUPNVPRC(APCD2,0),U,9)]"" S APCDACC=""
 Q:$D(APCDACC)
 Q:$P(APCDVREC,U,7)'="H"
 Q:'$D(^AUPNVINP("AD",APCDVSIT))
 S APCD1=$O(^AUPNVINP("AD",APCDVSIT,""))
 I $P(^AUPNVINP(APCD1,0),U,14)]"" S APCDACC=""
 Q
PRI200 ;CMI/TUCSON/LAB - for file 200 conversion PATCH 1
 S (APCDPDIS,APCDX,APCDPAFF,APCDPCOD,APCDY)=""
 I $G(^VA(200,APCDPPRV,9999999))="" S APCDE("FILE")=9000010.06,APCDE("ENTRY")=APCDAP,APCDE="E002" D ERR,EOJ Q
 S APCDPAFF=$$PROVAFFL^XBFUNC1(APCDPPRV,"I") I APCDPAFF="" S APCDE("FILE")=9000010.06,APCDE("ENTRY")=APCDAP,APCDE="E028" D ERR,EOJ Q
 S APCDPDIS=$$PROVCLSC^XBFUNC1(APCDPPRV) I APCDPDIS="" S APCDE("FILE")=9000010.06,APCDE("ENTRY")=APCDAP,APCDE="E027" D ERR,EOJ Q
 S APCDPCOD=$$PROVCODE^XBFUNC1(APCDPPRV) I APCDPCOD="" S APCDE("FILE")=9000010.06,APCDE("ENTRY")=APCDAP,APCDE="E002" D ERR,EOJ Q
 D EOJ
 Q