MAGNTLR6 ;WOIFO/NST - TeleReader Configuration ; 23 Apr 2012 2:30 PM
;;3.0;IMAGING;**127**;Mar 19, 2002;Build 4231;Apr 01, 2013
;; Per VHA Directive 2004-038, this routine should not be modified.
;; +---------------------------------------------------------------+
;; | Property of the US Government. |
;; | No permission to copy or redistribute this software is given. |
;; | Use of unreleased versions of this software requires the user |
;; | to execute a written test agreement with the VistA Imaging |
;; | Development Office of the Department of Veterans Affairs, |
;; | telephone (301) 734-0100. |
;; | The Food and Drug Administration classifies this software as |
;; | a medical device. As such, it may not be changed in any way. |
;; | Modifications to this software may result in an adulterated |
;; | medical device under 21CFR820, the use of which is considered |
;; | to be a violation of US Federal Statutes. |
;; +---------------------------------------------------------------+
;;
Q
;
;***** Add/Update/Delete a service in TELEREADER ACQUISITION SERVICE file (#2006.5841)
; RPC: MAG3 TELEREADER ACQ SRVC SETUP
;
; Input Parameters
; ================
; Delete action:
; MAGPARAM("ACTION") = "DELETE"
; MAGPARAM("IEN") = IEN of the record that will be deleted
; Add or Update action:
; MAGPARAM("ACTION") = "ADD" or "UPDATE"
; MAGPARAM("NAME") = A pointer to REQUEST SERVICES file (#123.5)
; MAGPARAM("PROCEDURE") = A pointer to GMRC PROCEDURE file (#123.3)
; MAGPARAM("SPECIALTY INDEX") = A pointer to the SPECIALTY file (#2005.84)
; MAGPARAM("PROCEDURE INDEX") = A pointer to the PROCEDURE/EVENT file (#2005.85)
; MAGPARAM("ACQUISITION SITE") = A pointer to the INSTITUTION file (#4)
; MAGPARAM("UNREAD LIST CREATION TRIGGER") = I/O/F
; MAGPARAM("TIU NOTE FILE") = A pointer to TIU DOCUMENT file (#8925.1)
;
; Return Values
; =============
; if error MAGRY = "0^Error"
; if success MAGRY = "1^IEN" - IEN of the record that is updated
; or IEN of the added record
;
UASRVC(MAGRY,MAGPARAM) ;RPC [MAG3 TELEREADER ACQ SRVC SETUP]
;
N $ETRAP,$ESTACK S $ETRAP="D ERR^MAGGTERR"
;
N MAGNFDA,MAGNIEN,MAGNXE,IENS,MAGRESA
N DA,DIK
;
;^MAG(2006.5841,D0,0)=1=NAME, 2=PROCEDURE, 3=SPECIALTY INDEX, 4=PROCEDURE INDEX,
; 5=ACQUISITION SITE, 6=UNREAD LIST CREATION TRIGGER, 7=TIU NOTE FILE
;
I MAGPARAM("ACTION")="DELETE" D Q ; Delete an entry IEN and exit
. S DIK="^MAG(2006.5841,"
. S DA=MAGPARAM("IEN")
. D ^DIK
. S MAGRY=1
. Q
;
S MAGRY=""
I MAGPARAM("ACTION")="ADD" D Q:MAGRY'="" ; Quit if a (Service, Procedure) pair already exists
. I $$FINDSRVC^MAGNTLR6(MAGPARAM("NAME"),MAGPARAM("PROCEDURE")) S MAGRY="0^(Service, Procedure) pair already exists." Q
. S IENS="+1,"
. Q
E S IENS=MAGPARAM("IEN")_",",MAGNIEN(1)=MAGPARAM("IEN")
;
; A new record is created in two steps because of "AC" cross-reference definition for PROCEDURE field (#1).
; First create a record with empty procedure, then update the record if the procedure is not blank.
S MAGNFDA(2006.5841,IENS,.01)=MAGPARAM("NAME")
S:MAGPARAM("ACTION")'="ADD" MAGNFDA(2006.5841,IENS,1)=MAGPARAM("PROCEDURE")
S MAGNFDA(2006.5841,IENS,2)=MAGPARAM("SPECIALTY INDEX")
S MAGNFDA(2006.5841,IENS,3)=MAGPARAM("PROCEDURE INDEX")
S MAGNFDA(2006.5841,IENS,4)=MAGPARAM("ACQUISITION SITE")
S MAGNFDA(2006.5841,IENS,5)=MAGPARAM("UNREAD LIST CREATION TRIGGER")
S MAGNFDA(2006.5841,IENS,6)=MAGPARAM("TIU NOTE FILE")
;
D UPDATE^DIE("S","MAGNFDA","MAGNIEN","MAGNXE")
;
I $D(MAGNXE("DIERR","E")) D Q
. D MSG^DIALOG("A",.MAGRESA,245,5,"MAGNXE")
. S MAGRY="0^"_MAGRESA(1)
. Q
;
I (MAGPARAM("ACTION")'="ADD")!(MAGPARAM("PROCEDURE")="") S MAGRY="1^"_MAGNIEN(1) Q ; Edit is done or procedure is blank
;
; Update procedure if it not blank
K MAGNFDA
S IENS=MAGNIEN(1)_","
S MAGNFDA(2006.5841,IENS,1)=MAGPARAM("PROCEDURE")
D UPDATE^DIE("S","MAGNFDA","MAGNIEN","MAGNXE")
;
I $D(MAGNXE("DIERR","E")) D Q
. D MSG^DIALOG("A",.MAGRESA,245,5,"MAGNXE")
. S MAGRY="0^"_MAGRESA(1)
. Q
S MAGRY="1^"_MAGNIEN(1)
Q
;
;+++++ Finds if a (Service, Procedure) pair is defined in
; TELEREADER ACQUISITION SERVICE file (#2006.5841)
;
; Input Parameters
; ================
; TOSERV = A pointer to REQUEST SERVICES file (#123.5)
; PROC = A pointer to GMRC PROCEDURE file (#123.3)
;
; Return Values
; =============
; 1 if a pair (Service, Procedure) is defined in
; TELEREADER ACQUISITION SERVICE file (#2006.5841)
; 0 Otherwise
;
FINDSRVC(TOSERV,PROC) ; Is (Service, Procedure) pair defined
N IEN
S TOSERV=+$G(TOSERV)
S PROC=+$G(PROC)
S IEN=$O(^MAG(2006.5841,"AC",TOSERV,PROC,""))
Q IEN>0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGNTLR6 5005 printed Dec 13, 2024@02:07:23 Page 2
MAGNTLR6 ;WOIFO/NST - TeleReader Configuration ; 23 Apr 2012 2:30 PM
+1 ;;3.0;IMAGING;**127**;Mar 19, 2002;Build 4231;Apr 01, 2013
+2 ;; Per VHA Directive 2004-038, this routine should not be modified.
+3 ;; +---------------------------------------------------------------+
+4 ;; | Property of the US Government. |
+5 ;; | No permission to copy or redistribute this software is given. |
+6 ;; | Use of unreleased versions of this software requires the user |
+7 ;; | to execute a written test agreement with the VistA Imaging |
+8 ;; | Development Office of the Department of Veterans Affairs, |
+9 ;; | telephone (301) 734-0100. |
+10 ;; | The Food and Drug Administration classifies this software as |
+11 ;; | a medical device. As such, it may not be changed in any way. |
+12 ;; | Modifications to this software may result in an adulterated |
+13 ;; | medical device under 21CFR820, the use of which is considered |
+14 ;; | to be a violation of US Federal Statutes. |
+15 ;; +---------------------------------------------------------------+
+16 ;;
+17 QUIT
+18 ;
+19 ;***** Add/Update/Delete a service in TELEREADER ACQUISITION SERVICE file (#2006.5841)
+20 ; RPC: MAG3 TELEREADER ACQ SRVC SETUP
+21 ;
+22 ; Input Parameters
+23 ; ================
+24 ; Delete action:
+25 ; MAGPARAM("ACTION") = "DELETE"
+26 ; MAGPARAM("IEN") = IEN of the record that will be deleted
+27 ; Add or Update action:
+28 ; MAGPARAM("ACTION") = "ADD" or "UPDATE"
+29 ; MAGPARAM("NAME") = A pointer to REQUEST SERVICES file (#123.5)
+30 ; MAGPARAM("PROCEDURE") = A pointer to GMRC PROCEDURE file (#123.3)
+31 ; MAGPARAM("SPECIALTY INDEX") = A pointer to the SPECIALTY file (#2005.84)
+32 ; MAGPARAM("PROCEDURE INDEX") = A pointer to the PROCEDURE/EVENT file (#2005.85)
+33 ; MAGPARAM("ACQUISITION SITE") = A pointer to the INSTITUTION file (#4)
+34 ; MAGPARAM("UNREAD LIST CREATION TRIGGER") = I/O/F
+35 ; MAGPARAM("TIU NOTE FILE") = A pointer to TIU DOCUMENT file (#8925.1)
+36 ;
+37 ; Return Values
+38 ; =============
+39 ; if error MAGRY = "0^Error"
+40 ; if success MAGRY = "1^IEN" - IEN of the record that is updated
+41 ; or IEN of the added record
+42 ;
UASRVC(MAGRY,MAGPARAM) ;RPC [MAG3 TELEREADER ACQ SRVC SETUP]
+1 ;
+2 NEW $ETRAP,$ESTACK
SET $ETRAP="D ERR^MAGGTERR"
+3 ;
+4 NEW MAGNFDA,MAGNIEN,MAGNXE,IENS,MAGRESA
+5 NEW DA,DIK
+6 ;
+7 ;^MAG(2006.5841,D0,0)=1=NAME, 2=PROCEDURE, 3=SPECIALTY INDEX, 4=PROCEDURE INDEX,
+8 ; 5=ACQUISITION SITE, 6=UNREAD LIST CREATION TRIGGER, 7=TIU NOTE FILE
+9 ;
+10 ; Delete an entry IEN and exit
IF MAGPARAM("ACTION")="DELETE"
Begin DoDot:1
+11 SET DIK="^MAG(2006.5841,"
+12 SET DA=MAGPARAM("IEN")
+13 DO ^DIK
+14 SET MAGRY=1
+15 QUIT
End DoDot:1
QUIT
+16 ;
+17 SET MAGRY=""
+18 ; Quit if a (Service, Procedure) pair already exists
IF MAGPARAM("ACTION")="ADD"
Begin DoDot:1
+19 IF $$FINDSRVC^MAGNTLR6(MAGPARAM("NAME"),MAGPARAM("PROCEDURE"))
SET MAGRY="0^(Service, Procedure) pair already exists."
QUIT
+20 SET IENS="+1,"
+21 QUIT
End DoDot:1
if MAGRY'=""
QUIT
+22 IF '$TEST
SET IENS=MAGPARAM("IEN")_","
SET MAGNIEN(1)=MAGPARAM("IEN")
+23 ;
+24 ; A new record is created in two steps because of "AC" cross-reference definition for PROCEDURE field (#1).
+25 ; First create a record with empty procedure, then update the record if the procedure is not blank.
+26 SET MAGNFDA(2006.5841,IENS,.01)=MAGPARAM("NAME")
+27 if MAGPARAM("ACTION")'="ADD"
SET MAGNFDA(2006.5841,IENS,1)=MAGPARAM("PROCEDURE")
+28 SET MAGNFDA(2006.5841,IENS,2)=MAGPARAM("SPECIALTY INDEX")
+29 SET MAGNFDA(2006.5841,IENS,3)=MAGPARAM("PROCEDURE INDEX")
+30 SET MAGNFDA(2006.5841,IENS,4)=MAGPARAM("ACQUISITION SITE")
+31 SET MAGNFDA(2006.5841,IENS,5)=MAGPARAM("UNREAD LIST CREATION TRIGGER")
+32 SET MAGNFDA(2006.5841,IENS,6)=MAGPARAM("TIU NOTE FILE")
+33 ;
+34 DO UPDATE^DIE("S","MAGNFDA","MAGNIEN","MAGNXE")
+35 ;
+36 IF $DATA(MAGNXE("DIERR","E"))
Begin DoDot:1
+37 DO MSG^DIALOG("A",.MAGRESA,245,5,"MAGNXE")
+38 SET MAGRY="0^"_MAGRESA(1)
+39 QUIT
End DoDot:1
QUIT
+40 ;
+41 ; Edit is done or procedure is blank
IF (MAGPARAM("ACTION")'="ADD")!(MAGPARAM("PROCEDURE")="")
SET MAGRY="1^"_MAGNIEN(1)
QUIT
+42 ;
+43 ; Update procedure if it not blank
+44 KILL MAGNFDA
+45 SET IENS=MAGNIEN(1)_","
+46 SET MAGNFDA(2006.5841,IENS,1)=MAGPARAM("PROCEDURE")
+47 DO UPDATE^DIE("S","MAGNFDA","MAGNIEN","MAGNXE")
+48 ;
+49 IF $DATA(MAGNXE("DIERR","E"))
Begin DoDot:1
+50 DO MSG^DIALOG("A",.MAGRESA,245,5,"MAGNXE")
+51 SET MAGRY="0^"_MAGRESA(1)
+52 QUIT
End DoDot:1
QUIT
+53 SET MAGRY="1^"_MAGNIEN(1)
+54 QUIT
+55 ;
+56 ;+++++ Finds if a (Service, Procedure) pair is defined in
+57 ; TELEREADER ACQUISITION SERVICE file (#2006.5841)
+58 ;
+59 ; Input Parameters
+60 ; ================
+61 ; TOSERV = A pointer to REQUEST SERVICES file (#123.5)
+62 ; PROC = A pointer to GMRC PROCEDURE file (#123.3)
+63 ;
+64 ; Return Values
+65 ; =============
+66 ; 1 if a pair (Service, Procedure) is defined in
+67 ; TELEREADER ACQUISITION SERVICE file (#2006.5841)
+68 ; 0 Otherwise
+69 ;
FINDSRVC(TOSERV,PROC) ; Is (Service, Procedure) pair defined
+1 NEW IEN
+2 SET TOSERV=+$GET(TOSERV)
+3 SET PROC=+$GET(PROC)
+4 SET IEN=$ORDER(^MAG(2006.5841,"AC",TOSERV,PROC,""))
+5 QUIT IEN>0