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

APCDATC.m

Go to the documentation of this file.
APCDATC ; IHS/CMI/TUCSON - POV LOOKUP ;
 ;;2.0;IHS PCC SUITE;**8**;MAY 14, 2009;Build 2
 ;
START ;
 X:$D(^DD(9000010.33,.01,12.1)) ^DD(9000010.33,.01,12.1)
 S DIC="^BCMTCF(",DIC(0)="AEMQ"
 I $G(APCDCANI),$P($G(^BCMSITE(DUZ(2),0)),U,2)="C" S DIC("S")="I $P(^(0),U,5)=APCDCANI"
 I $G(APCDCANI),$P($G(^BCMSITE(DUZ(2),0)),U,2)="D" S DIC("S")="I $P(^(0),U,9)=APCDCANI"
 S DIC("A")="Enter TRANSACTION CODE: "
 D ^DIC K DIC
 G:Y="" XIT
 I Y=-1,X=""!(X="^") S APCDTSKI=1,APCDLOOK="" G XIT
 I Y=-1 S APCDTERR=1,APCDLOOK="" G XIT
 S APCDLOOK="`"_+Y
XIT K Y,X,DO,D,DD,DIPGM
 Q
 ;
CAN ;EP - called from APCD CTC and APCD CTE templates
 I $P($G(^BCMSITE(DUZ(2),0)),U,2)="D" G DEPT
 S DIC="^AUTTCAN(",DIC(0)="AEMQ"
 S DIC("A")="Enter the CAN number you will be processing: "
 D ^DIC K DIC
 G:Y="" XITCAN
 I Y=-1,X=""!(X="^") S APCDTSKI=1,APCDLOOK="" G XITCAN
 I Y=-1 S APCDTERR=1,APCDLOOK="" G XITCAN
 S APCDCANI=+Y
 D XITCAN
 Q
XITCAN K Y,X,DO,D,DD,DIPGM
 Q
DEPT ;EP - called from APCD CTC and APCD CTE templates
 S DIC="^BCMDEPT(",DIC(0)="AEMQ"
 S DIC("A")="Enter the DEPARTMENT number you will be processing: "
 D ^DIC K DIC
 G:Y="" XITDEPT
 I Y=-1,X=""!(X="^") S APCDTSKI=1,APCDLOOK="" G XITDEPT
 I Y=-1 S APCDTERR=1,APCDLOOK="" G XITDEPT
 S APCDCANI=+Y
 D XITDEPT
 Q
XITDEPT ;
 K Y,X,DO,D,DD,DIPGM
 Q
CTC ;
 D EN^XBNEW("CTC1^APCDATC","APCDLOOK;APCDVSIT;APCDPAT;APCDTERR;APCDTT;AUPN*")
 K APCDTT
 K Y
 Q
 ;
CTC1 ;
 ;get can
 D CAN
 I $G(APCDCANI)="" W !!,"No ",$S($$CAND(DUZ(2)):"CAN",1:"DEPARTMENT")," selected." Q
 S APCDQ="" F  D CTC2 Q:APCDQ
 Q
 ;
CTC2 ;
 X:$D(^DD(9000010.33,.01,12.1)) ^DD(9000010.33,.01,12.1)
 S DIC="^BCMTCF(",DIC(0)="AEMQ"
 I $G(APCDCANI) D
 .I $$CAND(DUZ(2)) S DIC("S")="I $P(^(0),U,5)=APCDCANI" Q
 .I '$$CAND(DUZ(2)) S DIC("S")="I $P(^(0),U,9)=APCDCANI"
 S DIC("A")="Enter TRANSACTION CODE: "
 D ^DIC K DIC
 I Y=-1,X=""!(X="^") S APCDQ=1 Q
 I Y=-1 S APCDQ=1,APCDLOOK="" Q
 S APCDLOOK="`"_+Y
 S DIC="^AUPNVTC(",DIADD=1,DLAYGO=9000010.33,X=APCDLOOK,DIC(0)="L",DIC("DR")=".02////"_APCDPAT_";.03////"_APCDVSIT_";1216////"_$$NOW^XLFDT K DO,D0,DD D ^DIC K DIADD,DLAYGO
 I Y=-1 W !!,"adding V transaction failed..." D ^XBFMK Q
 S DA=+Y
 S DIE="^AUPNVTC(",DR="[APCD TC EDIT]" D ^DIE K DIE,DA,DR
CTCXIT ;
 K Y,X,DO,D,DD,DIPGM
 Q
 ;
CAND(D) ;
 I $P($G(^BCMSITE(DUZ(2),0)),U,2)="D" Q 0
 Q 1