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

XQALGUI.m

Go to the documentation of this file.
  1. XQALGUI ; SFCIOFO/JLI - KERNEL COMPONENTS FOR ALERTS ;07/24/11 15:02
  1. ;;8.0;KERNEL;**207,513**;Jul 10, 1995;Build 16
  1. ;Per VHA Directive 2004-038, this routine should not be modified
  1. ;
  1. ; added CURRSURO and SETSURO entry points 3/21/00 jli
  1. ;
  1. ; All entry is at the ENTRY tag. The type of processing is indicated by the
  1. ; variable LOC which contains the name of the tag to be used for processing.
  1. ; The following tags currently exist and expect the variable names indicated
  1. ;
  1. ; SEND
  1. ; GETLIST
  1. ; ISPEND
  1. ; ISNEW
  1. ; DELETE
  1. ; FORWARD
  1. ; CURRSURO
  1. ; SETSURO
  1. ;
  1. ENTRY(XQALRSLT,DATA) ;
  1. K ^TMP($J) N I,LOC,XQA,XQACTMSG,XQAEND,XQAID,XQALFWD,XQALRSL1,XQAMSG,XQASTART,XQASURO,XQATEXT
  1. N NAME,XQALSTO S NAME="" S XQALSTO=$NA(^TMP("XQALXQAL",$J)) K @XQALSTO
  1. F S NAME=$O(DATA(NAME)) Q:NAME="" D I $E(NAME)'=U S @("^TMP(""XQALXQAL"",$J,"_NAME1_")")=DATA(NAME)
  1. . I $E(NAME)=U S @NAME=DATA(NAME) Q
  1. . S NAME1=""""
  1. . F I=1:1 S X=$P(NAME,",",I) Q:X="" S NAME1=NAME1_$S(I>1:",""",1:"")_X_""""
  1. S NAME="" F S NAME=$O(@XQALSTO@(NAME)) Q:NAME="" D:$D(@XQALSTO@(NAME))>1 I $D(@XQALSTO@(NAME))=1 N @NAME S @NAME=@XQALSTO@(NAME)
  1. . N NAME1 S NAME1=""
  1. . F S NAME1=$O(@XQALSTO@(NAME,NAME1)) Q:NAME1="" S @(NAME_"("""_NAME1_""")")=^(NAME1)
  1. Q:'$D(LOC)
  1. ; need to add code here to check key if XQAUSER is defined and not DUZ
  1. G @LOC
  1. ;
  1. 2 ;
  1. SEND ;
  1. SETUP ; ENTRY FOR SETUP NEW ALERT
  1. I '$D(XQAUSER) S XQAUSER=DUZ
  1. Q:($O(XQA(""))="") Q:'$D(XQAMSG)
  1. I $D(^TMP($J,"XQAL1")) S XQATEXT=$NA(^TMP($J,"XQAL1"))
  1. D SETUP^XQALERT ; Supported Reference
  1. Q
  1. ;
  1. GETLIST ; GET LIST OF ALERTS FOR USER
  1. I '$D(XQAUSER) S XQAUSER=DUZ
  1. S XQALRSLT=$NA(^TMP($J)),XQALRSL1=$NA(^TMP("XQALXQAL",$J)) K @XQALRSL1,@XQALRSLT
  1. D GETUSER1^XQALDATA(XQALRSL1,XQAUSER) ;
  1. F I=0:0 S I=$O(@XQALRSL1@(I)) Q:I'>0 S X=^(I) K ^(I) S @XQALRSLT@(I)=X
  1. Q
  1. ;
  1. ISPEND ;
  1. S XQALRSLT=$NA(^TMP($J,"XQALXQAL")) K @XQALRSLT
  1. I $O(^XTV(8992,DUZ,"XQA",0))>0 S @XQALRSLT@(1)=1
  1. E S @XQALRSLT@(1)=0
  1. Q
  1. ;
  1. ISNEW ;
  1. S XQALRSLT=$NA(^TMP($J,"XQALXQAL")) K @XQALRSLT
  1. S @XQALRSLT@(1)=0
  1. F I=0:0 S I=$O(^XTV(8992,DUZ,"XQA",I)) Q:I'>0 I $P($G(^(I,0)),U,4)>0 S @XQALRSLT@(1)=1 Q
  1. Q
  1. ;
  1. DELETE ;
  1. I '$D(XQAUSER) S XQAUSER=DUZ
  1. D DELETE^XQALERT
  1. Q
  1. ;
  1. FORWARD ;
  1. I '$D(XQAUSER) N XQAUSER S XQAUSER=DUZ
  1. S XQALFWD(1)=IEN
  1. D FORWARD^XQALFWD(.XQALFWD,.XQA,"A",$G(XQACTMSG))
  1. Q
  1. ;
  1. GETSURO ; GET CURRENT SURROGATE INFORMATION (IF ANY)
  1. I '$D(XQAUSER) S XQAUSER=DUZ
  1. N X S X=$$GETSURO^XQALSURO(XQAUSER) I X'>0 S X="" ; SUPPORTED REFERENCE
  1. S XQALRSLT=$NA(^TMP($J,"XQALXQAL")) K @XQALRSLT
  1. S @XQALRSLT@(1)=X
  1. Q
  1. ;
  1. SETSURO ; SET NEW SURROGATE
  1. Q:XQASURO'>0
  1. I '$D(XQAUSER) S XQAUSER=DUZ
  1. S XQALRSLT=$NA(^TMP("XQALRSLT",$J)) K @XQALRSLT
  1. S @XQALRSLT@(1)=$$SETSURO1^XQALSURO(XQAUSER,XQASURO,XQASTART,XQAEND) ; SUPPORTED REFERENCE
  1. Q
  1. ;
  1. SUROFOR ;
  1. N SUROLIST S XQALRSLT=$NA(^TMP("XQALRSLT",$J)) K @XQALRSLT
  1. I '$D(XQAUSER) S XQAUSER=DUZ
  1. D SUROFOR^XQALSURO(.SUROLIST,XQAUSER)
  1. M @XQALRSLT=SUROLIST
  1. Q
  1. Q
  1. ;
  1. REMVSURO ; REMOVE SURROGATE
  1. I '$D(XQAUSER) S XQAUSER=DUZ
  1. D REMVSURO^XQALSURO(XQAUSER) ; SUPPORTED REFERENCE
  1. Q
  1. ;
  1. GETDATA ;
  1. S XQALRSLT=$NA(^TMP("XQALRSLT",$J)) K @XQALRSLT
  1. N IEN S IEN=$O(^XTV(8992,"AXQA",XQAID,DUZ,0)) Q:IEN'>0
  1. S @XQALRSLT@(1)=$P(^XTV(8992,DUZ,"XQA",IEN,0),U,7,8)
  1. S @XQALRSLT@(2)=$G(^XTV(8992,DUZ,"XQA",IEN,1))
  1. S @XQALRSLT@(3)=$P($G(^XTV(8992,DUZ,"XQA",IEN,3)),U)
  1. Q
  1. ;
  1. GETLONG ; TAKE LONG TEXT BACK TO THE CLIENT
  1. S XQALRSLT=$NA(^TMP("XQALRSLT",$J)) K @XQALRSLT
  1. I '$D(XQAUSER) N XQAUSER S XQAUSER=DUZ
  1. N IEN,IENS,XQALTMP S IEN=$O(^XTV(8992,"AXQA",XQAID,XQAUSER,0)) Q:IEN'>0
  1. S IENS=IEN_","_XQAUSER_",",XQALTMP=$NA(^TMP($J)) K @XQALTMP
  1. D GETS^DIQ(8992.01,(IEN_","_XQAUSER_","),"4","",XQALTMP)
  1. F I=0:0 S I=$O(@XQALTMP@(8992.01,IENS,4,I)) Q:I'>0 S @XQALRSLT@(I)=^(I)
  1. K @XQALTMP
  1. Q
  1. ;
  1. CHKADPAC ; Check for ADPAC or IRM status
  1. S XQALRSLT=$NA(^TMP("XQALRSLT",$J)) K @XQALRSLT
  1. N XQALVAL,RESULT S XQALVAL=0
  1. D OWNSKEY^XUSRB(.RESULT,"XQAL-DELETE") S XQALVAL=RESULT(0)
  1. S @XQALRSLT@(1)=XQALVAL
  1. Q
  1. ;