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

DVBCPSH1.m

Go to the documentation of this file.
DVBCPSH1 ;ALB/AKG - CAPRI PUSH UTILITY RPC CONT; MAY 9, 2023@9:47am ; 5/16/23 3:35pm
 ;;2.7;AMIE;**248**;Apr 10, 1995;Build 6
 ;Per VHA Directive 6402 this routine should not be modified
 ;
 Q
 ;
EXINACT(DVBMSG,DVBIEN,DVBSTAT) ;
 ;inactivates entry in 396.6
 N DVBNWSTT K DIC,DIE,DA,DR,X,Y
 S DA=DVBIEN,DIE="^DVB(396.6,",DIC(0)="L"
 S DR=".5///"_DVBSTAT D ^DIE
 K DIC,DIE,DA,DR,X,Y
 S DVBNWSTT=$$GET1^DIQ(396.6,DVBIEN,.5,"I")
 S DVBMSG=$S(DVBNWSTT=DVBSTAT:"1^Record edited",1:"0^Record not edited")
 Q
EXEDIT(DVBMSG,DVBIEN,DVBNAME) ; 
 N DVBBODY,DVBPNM,DVBWK,DVBSTAT,DVBNSTT
 I $G(DVBIEN)="" S DVBMSG="0^Missing IEN" Q
 I $G(DVBNAME)="" S DVBMSG="0^Missing Name" Q
 S DVBWK=$$GET1^DIQ(396.6,DVBIEN,.07,"I")
 S DVBBODY=$$GET1^DIQ(396.6,DVBIEN,2,"I")
 S DVBPNM=$$GET1^DIQ(396.6,DVBIEN,6,"I")
 S DVBSTAT="I"
 D EXINACT(.DVBMSG,DVBIEN,DVBSTAT)
 I $P(DVBMSG,U,1)=0 S DVBMSG="RECORD NOT EDITED" Q
 K DIC,DA,DR,DIE,X,Y
 S DIC=396.6,DIC(0)="Z",X=DVBNAME D FILE^DICN
 S (DA,X)=+Y,DIE=DIC
 S DR=".07///"_DVBWK_";2///"_DVBBODY_";6///"_DVBPNM_";.5///A"
 D ^DIE
 S DVBNSTT=$$GET1^DIQ(396.6,DVBIEN,.5,"I")
 K DIC,DA,DR,DIE,X,Y
 S DVBMSG=$S(DVBNSTT=DVBSTAT:"1^Record edited",1:"0^Record not edited")
 Q
LISTSTAT(DVBMSG,DVBSTAT) ;
 ;list AMIE Exam Names according to status
 N DVBIEN,DVBCNT,DVBRET
 K ^TMP("DVBLSTAT",$J)
 S DVBIEN=0,DVBCNT=0
 F  S DVBIEN=$O(^DVB(396.6,DVBIEN)) Q:DVBIEN=""!('DVBIEN)  D
 .I $P($G(^DVB(396.6,DVBIEN,0)),U,5)'=DVBSTAT Q
 .S DVBRET(DVBCNT)=$P(^DVB(396.6,DVBIEN,0),"^",1)_"^"_DVBIEN
 .M ^TMP("DVBLSTAT",$J,DVBCNT)=DVBRET(DVBCNT)
 .S DVBCNT=DVBCNT+1
 .Q
 S DVBMSG=$NA(^TMP("DVBLSTAT",$J))
 Q