source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCFACR2.m@ 975

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

initial load of WorldVistAEHR

File size: 3.2 KB
RevLine 
[613]1PRCFACR2 ;WISC@ALTOONA/CTB-MISC ROUTINES FOR MANIPULATING BATCH CONTENTS ;4/12/93 13:09
2V ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4ADD S:'$D(PRCFASYS) PRCFASYS="FEEFENIRSCLI"
5 S DIC(0)="AEMNQ",DIC=423,DIC("S")="S XXX=^(0) I $P(XXX,U)'[""BCH"",PRCFASYS[$P(XXX,U,10)" D ^DIC K XXX,DIC G:Y<0 KILL S CSDA=+Y
6 I $D(^PRCF(423,CSDA,"TRANS")),$P(^("TRANS"),"^",5)'="" D W1,OUT Q
7A S DIC("A")="Select BATCH NUMBER: ",DIC(0)="AEMNQZ",DIC=421.2,DIC("S")="S XXX=^(0) I $P(XXX,U,3)=""B"",PRCFASYS[$P(XXX,""-"",2)" D ^DIC K DIC,XXX G:Y<0 OUT S BADA=+Y,PBAT=$P(Y,U,2),PTR=$P(Y(0),U,2)
8 I $P(^PRCF(421.2,BADA,0),"^",4)["" D QUES G:%'=1 OUT
9 S PBHDR="BCH-"_PBAT S HDDA=$S('$D(^PRCF(423,"B",PBHDR)):"",1:$O(^PRCF(423,"B",PBHDR,0)))
10 S DA=CSDA,$P(^PRCF(423,DA,"TRANS"),"^",1)="Y",$P(^("TRANS"),"^",5)=PBAT,$P(^("TRANS"),"^",6)=3,$P(^("TRANS"),"^",8)=PTR K ^PRCF(423,"AC","N",DA) S ^PRCF(423,"AD",PBAT,DA)=""
11 I HDDA]"",$D(^PRCF(423,HDDA,"CODE",1,0)) S A=$P(^(0),".",4),A=A+1,A=$E("0"_A,$L(A),$L(A)+1),$P(^(0),".",4)=A
12 W " Done",!
13 S %A="Do you wish to add another code sheet to a batch",%B="",%=1 D ^PRCFYN G:%=1 ADD
14KILL K %,A,CSDA,D,DIC,DIE,DA,DR,BADA,PBAT,PTR,HDDA,PBHDR Q
15OUT D KILL S X=" <Option Terminated>*" D MSG^PRCFQ Q
16REMOV ;REMOVE CODE SHEET FROM BATCH
17 S:'$D(PRCFASYS) PRCFASYS="FEEFENIRSCLILOG"
18 S DIC(0)="AEMNQ",DIC=423,DIC("S")="I $P(^(0),U)'[""BCH""" D ^DIC K DIC G:Y<0 OUT S CSDA=+Y
19 I '$D(^PRCF(423,CSDA,"TRANS")) W !,"There is an error in this code sheet, please edit it to insure it is correct!" D OUT Q
20 I $P(^PRCF(423,CSDA,"TRANS"),"^",5)="" W !,"This Code sheet has not been assigned to a batch, no action is necessary." D OUT Q
21 S PBAT=$P(^PRCF(423,CSDA,"TRANS"),"^",5),PBHDR="BCH-"_PBAT,HDDA=$S('$D(^PRCF(423,"B",PBHDR)):"",1:$O(^PRCF(423,"B",PBHDR,0)))
22 W ! S %A="I will now remove this code sheet from batch "_PBAT_".",%A(1)="OK TO CONTINUE",%B="",%=1 D ^PRCFYN G OUT:%<0 I %=2 S X=" <No Action Taken>*" D MSG^PRCFQ G REMOV
23 S X=" <Removal Completed>*" D MSG^PRCFQ
24 S $P(^PRCF(423,CSDA,"TRANS"),"^",5)="" K ^PRCF(423,"AD",PBAT,CSDA)
25 I HDDA]"",$D(^PRCF(423,HDDA,"CODE",1,0)) S A=$P(^(0),".",4),A=A-1,A=$E("0"_A,$L(A),$L(A)+1),$P(^(0),".",4)=A
26 E I PRCFASYS'["LOG" W !,"I was unable to correct the Batch Header in batch ",PBAT,". Please use",!,"the 'Edit Keypunched Code Sheet' option to correct prior to transmission.",!!,$C(7) R X:3
27D S %=1 S %A="Do you wish to add this code sheet to another batch",%B="" D ^PRCFYN I %=1 G A
28E S %=1 W ! S %A="Will this Code Sheet be transmitted at a later date",%B="A 'YES' will queue the code sheet for retransmission." D ^PRCFYN I %=1 S DA=CSDA,DIE="^PRCF(423,",DR=".3////N;.4///@;.5;.6" D ^DIE G KILL
29 W !,"Code Sheet has been retained in File, but will not be transmitted. " R X:3 G KILL
30 Q
31QUES S %A="Batch "_PBAT_" has already been released to Austin.",%A(1)="Are you sure you want to continue"
32 S %B="If you will not be retransmitting the batch, you are not permitted to",%B(1)="remove a code sheet from that batch." D ^PRCFYN Q
33W1 W !,$C(7),"This code sheet has already been assigned to Batch ",$P(^PRCF(423,CSDA,"TRANS"),"^",5),!,"You must remove the code sheet from the batch before assigning it to another." R X:3 Q
Note: See TracBrowser for help on using the repository browser.