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

RMPR4UTL.m

Go to the documentation of this file.
RMPR4UTL ;PHX/HNB - PURCHASE CARD MODULE ;3/1/1996
 ;;3.0;PROSTHETICS;**3,12,20,25,30,44,41**;Feb 09, 1996
 Q
EDT ;Edit Purchase Card
 S HY=+Y I '$D(^RMPR(664,RMPRA,1)) S ^RMPR(664,RMPRA,1,0)="^664.02PA^0^0" G FILE
 I $D(^RMPR(664,RMPRA,1,"B",+Y)) S DA=$O(^RMPR(664,RMPRA,1,"B",+Y,0)) G CHK
FILE S Y=HY,NUM=$P(^RMPR(664,RMPRA,1,0),U,4)+1,$P(^(0),U,4)=NUM,$P(^(0),U,3)=$P(^(0),U,3)+1,^RMPR(664,RMPRA,1,NUM,0)=+Y,DA=NUM,^RMPR(664,RMPRA,1,"B",+Y,NUM)="" S NEW=1
ENT K DR,DQ S DA(1)=RMPRA,DIE="^RMPR(664,"_RMPRA_",1," ;S DR=$S($D(NEW):"",1:".01;") K NEW
 S DR="17;16;8////^S X=$G(RMTYPE);9////^S X=$G(RMCAT);10////^S X=$G(RMSPE);1R~BRIEF DESCRIPTION OF ITEM (for Vendor);"
 S DR=DR_"14;3;2;4R;11////C;7"
 D ^DIE Q:$D(DTOUT)  K NUM,DA,NEW,Y,DR Q
NFRM S DR=DR_"17;8TYPE OF TRANSACTION;9PATIENT CATEGORY;S RMPRDIS=+$P(^RMPR(664,DA(1),1,DA,0),U,10);S Y=$S(RMPRDIS=4:""@1"",1:""@2"");@2;3QTY;2;4UNIT OF ISSUE;11////C;"
 S DR=DR_"7REMARKS;S Y="""";@1;10SPECIAL CATEGORY;S Y=""@2"";"
 D ^DIE K NUM,DA,NEW,Y,DR
 Q
 ;
SS ;add IFCAP Site Parameter
 D DIV4^RMPRSIT Q:$D(X)
 W !!,?5,"Enter the IFCAP Site used with the Purchase Card Module"
 W !,?5,"The following site you select will be used on all your"
 W !,?5,"Purchase Card Transactions in IFCAP only.",!
 D ^PRCFSITE
 S:$G(PRC("SITE"))'="" $P(^RMPR(669.9,RMPRSITE,4),U,1)=PRC("SITE")
 D KILL^XUSCLEAN
 Q
CHK ;Add Duplicate Item
 K DIR,Y S DIR(0)="S^Y:YES;N:NO",DIR("A")="DO YOU WANT TO ADD A DUPLICATE ITEM?",DIR("B")="NO" D ^DIR Q:$D(DIRUT)!($D(DTOUT))  I X["Y"!(X["y") G FILE
 S RD=0 F RDA=0:0 S RDA=$O(^RMPR(664,RMPRA,1,"B",HY,RDA)) Q:RDA'>0  S RD=RD+1
LKP ;DISPLAY DUPLICATE AND SINGLE ITEMS
 I RD>1 D  Q:$D(DIRUT)!$D(DTOUT)  I '$D(RD(+Y)) W $C(7) G LKP
 .F RDA=0:0 S RDA=$O(^RMPR(664,RMPRA,1,"B",HY,RDA)) Q:RDA'>0  S RD(RDA)=^RMPR(664,RMPRA,1,RDA,0) W !?5,RDA,?10,$P(^PRC(441,$P(^RMPR(661,$P(RD(RDA),U),0),U),0),U,2),"  $",$P(RD(RDA),U,3)
 .K DIR,Y S DIR(0)="N" D ^DIR I +Y S DA=+Y
 G ENT
 ;
CHKCPT(RDATA) ;check for cpt modifier, change of Type of Transaction.
 ;
 N RMHCPC,RMCPT,RMCI,RMC,RMCLEN,RMLPIECE,RMF,RMFPIECE,RMTYPE,RMPRA,R4DA
 S RMTYPE=$P(RDATA,U,1),RMPRA=$P(RDATA,U,2),R4DA=$P(RDATA,U,3)
 Q:'$D(^RMPR(664,RMPRA,1,R4DA))
 S RMHCPC=$P($G(^RMPR(664,RMPRA,1,R4DA,0)),U,16) Q:'$G(RMHCPC)
 S RMCPT=$P($G(^RMPR(664,RMPRA,1,R4DA,4)),U,2)
 I ((RMTYPE="R")!(RMTYPE="X")),(RMCPT'["RP"),($G(^RMPR(661.1,RMHCPC,4))["RP") D ADDRP
 I ((RMTYPE="I")!(RMTYPE="S")),(RMCPT["RP") D DELRP
 K RMHCPC,RMCI,RMC,RMCLEN,RMLPIECE,RMF,RMFPIECE,RMTYPE,RMPRA,R4DA
 Q
 ;return to (PC) close out option
DELRP ;logic for deleting 'RP' modifier with transaction change.
 F RMCI=1:1:8 S RMC=$P(RMCPT,",",RMCI) I RMC="RP" S $P(RMCPT,",",RMCI)="" D
 .S RMF=$F(RMCPT,",,"),RMFPIECE=$E(RMCPT,1,RMF-2)
 .S RMLPIECE=$E(RMCPT,RMF,32),RMCPT=RMFPIECE_RMLPIECE
 .S RMCLEN=$L(RMCPT)
 .I $E(RMCPT,1)="," S RMCPT=$E(RMCPT,2,RMCLEN)
 .I $E(RMCPT,RMCLEN)="," S RMCPT=$E(RMCPT,1,RMCLEN-1)
 .S $P(^RMPR(664,RMPRA,1,R4DA,4),U,2)=RMCPT
 ;
 Q
 ;
ADDRP ;logic for adding 'RP' modifier with transaction change.
 S RMCPT=RMCPT_",RP" S $P(^RMPR(664,RMPRA,1,R4DA,4),U,2)=RMCPT
 Q
 ;end