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

MAGVIM13.m

Go to the documentation of this file.
  1. MAGVIM13 ;WOIFO/BT/JL - Utilities for RPC calls for DICOM file processing ; May 05, 2023@080:09:32
  1. ;;3.0;IMAGING;**357**;Mar 19, 2002;Build 29
  1. ;; Per VA Directive 6402, this routine should not be modified.
  1. ;; +---------------------------------------------------------------+
  1. ;; | Property of the US Government. |
  1. ;; | No permission to copy or redistribute this software is given. |
  1. ;; | Use of unreleased versions of this software requires the user |
  1. ;; | to execute a written test agreement with the VistA Imaging |
  1. ;; | Development Office of the Department of Veterans Affairs, |
  1. ;; | telephone (301) 734-0100. |
  1. ;; | The Food and Drug Administration classifies this software as |
  1. ;; | a medical device. As such, it may not be changed in any way. |
  1. ;; | Modifications to this software may result in an adulterated |
  1. ;; | medical device under 21CFR820, the use of which is considered |
  1. ;; | to be a violation of US Federal Statutes. |
  1. ;; +---------------------------------------------------------------+
  1. ;;
  1. ;+++++ UPDATE IMAGE SERVICE MAPPING #2006.9423
  1. ; RPC: MAGV UPDATE WORK ITEM SERVICE
  1. ;
  1. ; .MAGRY Reference to a local variable where the results are returned.
  1. ;
  1. ; MDL MODALITY of image WORK ITEM (DICOM)
  1. ; PROC PROCEDURE of image WORK ITEM (DICOM)
  1. ; NEWSRV NEW SERVICE where File 2006.941 and 2006.9423
  1. ;
  1. ; This RPC Updates or Adds Service in both
  1. ; File 2006.941 (for IEN: WIEN) - Service is inside TAGS
  1. ; and File 2006.9423 (SERVICE (Field #1) )
  1. ;
  1. ; Return Values
  1. ; =============
  1. ; If MAGRY 1st '^'-piece is 0, then OKay. Otherwise, the output
  1. ; is as follows:
  1. ;
  1. ; MAGRY Description
  1. ; ^01: 0 or -1
  1. ; ^02: -1 Error message if any
  1. ;
  1. UPDSRV(OUT,PRVSRV,MDL,PROC,NEWSRV) ;
  1. N FILE,SRV,IEN,MPIEN,TAGIDX,ERR
  1. N MAGFDA,MAGXE,MAGIEN,SHORT
  1. ;---- update Service in Work Item Service File #2006.9423 --------------
  1. S FILE=2006.9423
  1. I $G(MDL)="" S OUT="-1"_U_"Modality must not be empty" Q
  1. I $G(NEWSRV)="" S OUT="-1"_U_"New Service must not be empty" Q
  1. S MDL=$$UPCASE(MDL)
  1. S PROC=$$UPCASE($G(PROC))
  1. S SHORT=""
  1. I NEWSRV="Radiology" S SHORT="RAD"
  1. I NEWSRV="Lab" S SHORT="LAB"
  1. I NEWSRV="Consult" S SHORT="CON"
  1. I SHORT="" S OUT="-1"_U_"Invalid Service" Q
  1. S SRV=""
  1. S MPIEN=$O(^MAGV(FILE,"B",MDL_"|"_PROC,""))
  1. I MPIEN S SRV=$$GET1^DIQ(FILE,MPIEN,1)
  1. I 'MPIEN D
  1. . S MPIEN=$O(^MAGV(FILE,"B",MDL,""))
  1. . I MPIEN S SRV=$$GET1^DIQ(FILE,MPIEN,1)
  1. I SRV'=SHORT D
  1. . S MPIEN=$$UPDSRV^MAGVIM12(SHORT,MDL,PROC)
  1. I $P(MPIEN,U,1)="-1" S OUT=MPIEN Q ;return error
  1. S OUT=0
  1. Q
  1. ;
  1. UPCASE(X) ;
  1. Q $TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
  1. ;