source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCBCC.m@ 1638

Last change on this file since 1638 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.0 KB
Line 
1PRCBCC ;WISC@ALTOONA/CTB-COST CENTER EDIT ;9-27-89/11:47 AM
2V ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4OUT K DQ,D0,DI,DLAYGO,DWLW,I,J,NEW,NEWNAME,OLD,OLDNAME,OLDNUM,PRCFA,Y,X,DIC,DIE,DR,DA Q
5REA ;REACTIVATE AN INACTIVE COST CENTER
6 K PRCFA S PRCFA("REACTIVATE")="",DIC=420.1,DIC(0)="AEMQN" D ^DIC G:Y<0 OUT S DA=+Y
7 W !,$C(7) S %A="Are you sure that you wish to reactivate this Cost Center",%B="",%=1 D ^PRCFYN I %'=1 G OUT:%<0,REA:%=2
8 S $P(^PRCD(420.1,DA,0),"^",2,4)="0^^",X=" --Cost Center has been reactivated*" D MSG^PRCFQ S DIC("A")="Select Next COST CENTER: " G REA
9DEA ;DEACTIVATE AN A COST CENTER
10 K PRCFA S DIC=420.1,DIC(0)="AEMQN" D ^DIC G:Y<0 OUT S DA=+Y
11 W !,$C(7) S %A="Are you sure that you wish to deactivate this Cost Center",%B="",%=1 D ^PRCFYN I %'=1 G OUT:%<0,DEA:%=2
12 S $P(^PRCD(420.1,DA,0),"^",2)="1^"_DUZ_"^"_DT,X=" --Cost Center has been deactivated*" D MSG^PRCFQ W ! S DIC("A")="Select Next COST CENTER: " G DEA
13ADD ;ADD NEW COST CENTER
14 K PRCFA S PRCFA("ALL")="" S (DLAYGO,DIC)=420.1,DIC(0)="AEMNLQZ" D ^DIC G:Y<0 OUT S DA=+Y
15 S OLD=$P(Y(0),"^"),OLDNUM=$P(OLD," "),OLDNAME=$P(OLD," ",2,99)
16 W ! S %A="Do you need to edit the Cost Center Name",%B="",%=2 D ^PRCFYN G OUT:%<0,AD1:%=2
17 W ! S %A="You may edit only the NAME of this Cost Center, you may NOT change the number",%A(1)="Do you REALLY wish to change the NAME of this Cost Center",%B="",%=1 D ^PRCFYN G OUT:%<0,AD1:%=2
18AD2 S Y=OLDNAME W !,"Cost Center NAME: ",Y W:$X>48 !?9 W "// "
19 I $L(OLDNAME)>19 D RW^PRCBSA G OUT:$D(X)[0
20 I $L(OLDNAME)<20 R X:DTIME I '$T!(X["^") G OUT
21 G:X="" AD1
22 I X["?"!($L(X)>72)!(+X=+OLDNUM)!(X'?1.72ANP) W !,$C(7),"Enter COST CENTER NAME, do not include the NUMBER" G AD2
23 S NEW=OLDNUM_" "_X,NEWNAME=X,%A=" ",%A(1)="The NEW cost center Number and Name will be:",%A(2)=NEW,%A(3)="IS THIS CORRECT",%B="",%=2 D ^PRCFYN G OUT:%<0,AD2:%=2
24 S %A="OK to update the file",%=1,%B="" D ^PRCFYN G OUT:%<0 I %=2 S X=" <No Updating has Occurred>*" D MSG^PRCFQ
25 K ^PRCD(420.1,"B",$E(OLD,1,30),DA),^PRCD(420.1,"C",$E(OLDNAME,1,30),DA)
26 S $P(^PRCD(420.1,DA,0),"^")=NEW,^PRCD(420.1,"B",$E(NEW,1,30),DA)="",^PRCD(420.1,"C",$E(NEWNAME,1,30),DA)="",X=" <Cost Center name has been changed.>*" D MSG^PRCFQ
27AD1 S DIE=DIC,DR="2" D ^DIE,A1 S DIC("A")="Select next COST CENTER: "
28 G ADD
29 ;
30A1 W ! S %A="Do you wish to edit the BOC list for this Cost Center",%B="",%=1
31 D ^PRCFYN G OUT:%<0 Q:%=2
32 W ! S %A="Do you want me to add or delete ALL BOCs to this cost center before",%A(1)="you begin editing the BOC list",%B="",%=2 D ^PRCFYN G OUT:%<0 I %=1 D ALL Q:%<0
33 K PRCFA("ALL") S DR=1 D ^DIE Q
34 ;
35ALL ;
36 W ! S %A="You will now be permitted to add or delete ALL BOC from the list",%A(1)="ARE YOU SURE YOU WANT TO CONTINUE",%B="",%=2 D ^PRCFYN Q:%'=1
37ALL1 R !!,"Add or Delete? ",X:DTIME I '$T!(X["^") S %=-1 Q
38 I X=""!("AaDd"'[$E(X,1)) W !,"Select an 'A' to ADD or 'D' to DELETE all BOCs from the list. ",! G ALL1
39 I "Dd"[$E(X,1) G D
40A ;ADD ALL BOC TO A COST CENTER
41 S %A="LAST CHANCE, Is it OK to ADD all BOCs to this list",%B="",%=1 D ^PRCFYN Q:%'=1
42 D WAIT^PRCFYN S COUNT=0,N=0 F I=1:1 S N=$O(^PRCD(420.2,N)) Q:'N I $D(^(N,0)),+$P(^(0),"^",2)=0 S LAST=N,COUNT=COUNT+1,^PRCD(420.1,DA,1,N,0)=N,^PRCD(420.1,DA,1,"B",N,N)=""
43 S ^PRCD(420.1,DA,1,0)="^420.11P^"_LAST_"^"_COUNT S X=" --Done--" D MSG^PRCFQ S %=1
44 Q
45D ;DELETE ALL BOCS FROM A COST CENTER
46 I $G(^PRCD(420.1,DA,1,0))="" W ! D EN^DDIOL("No BOCs for this Cost Center.") W ! QUIT
47 S %A="LAST CHANCE, Is it OK to DELETE all BOCs from this list",%B="",%=1 D ^PRCFYN Q:%'=1
48 D WAIT^PRCFYN S A=$P(^PRCD(420.1,DA,1,0),"^",1,2) K ^PRCD(420.1,DA,1) S ^PRCD(420.1,DA,1,0)=A K A S X=" --Done--" D MSG^PRCFQ S %=1 Q
49PRT1 ;PRINT CC LISTING WITH DEACTIVATED
50 S DIC="^PRCD(420.1,",L=0,FLDS="[PRCB CC LISTING]",BY="@COST CENTER NUMBER",PRCFA("ALL")=1
51 D EN1^DIP K PRCFA("ALL"),DIC,L,FLDS,BY Q
52PRT2 ;PRINT CC LISTING WITH BOCS--ACTIVE ONLY
53 S DIC="^PRCD(420.1,",L=0,FLDS="[PRCB CC LISTING W/SUBACCT]",BY="@COST CENTER NUMBER" K PRCFA("ALL")
54 D EN1^DIP K DIC,L,FLDS,BY Q
Note: See TracBrowser for help on using the repository browser.