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

MAGNDCMC.m

Go to the documentation of this file.
  1. MAGNDCMC ;WOIFO/NST - Imaging Capture DICOM utilities ; 09 Oct 2010 3:52 AM
  1. ;;3.0;IMAGING;**106**;Mar 19, 2002;Build 2002;Feb 28, 2011
  1. ;; Per VHA Directive 2004-038, 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. Q
  1. ;
  1. ;***** Returns all records in IMAGING DICOM FIELDS file (#2005.71)
  1. ; per SOP type (e.g. "TELEDERM")
  1. ; RPC: MAG3 DICOM CAPTURE GE LIST
  1. ;
  1. ; Input Parameters
  1. ; ================
  1. ; MAGSOP = SOP type (e.g. "TELEDERM")
  1. ;
  1. ; Return Values
  1. ; =============
  1. ; if error found during execution
  1. ; MAGRY(0) = "0^Error"
  1. ; if success
  1. ; MAGRY(0) = "1^#CNT" - where #CNT is a number of records returned
  1. ; MAGRY(1) = "MODULE^ELEMENT^ELEMENT NAME^VALUE MULTIPLICITY^VALUE REPRESENTATION^GUI CONTROL"
  1. ; MAGRY(2..n) = "^" delimited string with values of fields listed in MAGRY(1)
  1. ;
  1. GGELIST(MAGRY,MAGSOP) ;RPC [MAG3 DICOM CAPTURE GE LIST]
  1. N OUT,OUT1,CNT,DA0,DA1,MODULE
  1. N X,I,J,ERR,CNT
  1. N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGGTERR"
  1. ;
  1. S MAGRY(0)="0^Error"
  1. S MAGRY(1)="MODULE^ELEMENT^ELEMENT NAME^VALUE MULTIPLICITY^VALUE REPRESENTATION^GUI CONTROL"
  1. S CNT=1
  1. S DA0=$$FIND1^DIC(2005.71,"","X",MAGSOP,"","","ERR") ; Find "SOP type" IEN
  1. I DA0=0 S MAGRY(0)="1^"_(CNT-1) Q ; nothing found
  1. I $D(ERR) Q ; Error
  1. D LIST^DIC(2005.712,","_DA0_",",";@;.01","P","*","","","#","","","OUT","OUT") ; Get all modules
  1. S I=0
  1. F S I=$O(OUT("DILIST",I)) Q:I="" D
  1. . S X=OUT("DILIST",I,0)
  1. . S DA1=$P(X,"^",1),MODULE=$P(X,"^",2) D
  1. . K OUT1
  1. . D LIST^DIC(2005.713,","_DA1_","_DA0_",",";@;.01;2;3;4;5I","P","*","","","#","","","OUT1","OUT1") ; Get all elements
  1. . S J=0
  1. . F S J=$O(OUT1("DILIST",J)) Q:J="" D
  1. . . S X=OUT1("DILIST",J,0)
  1. . . S CNT=CNT+1
  1. . . S MAGRY(CNT)=MODULE_"^"_$P(X,"^",2,6)
  1. . . Q
  1. . Q
  1. S MAGRY(0)="1^"_(CNT-1)
  1. Q
  1. ;
  1. ;***** Returns SOP CLASS UID per SOP type (e.g. "TELEDERM")
  1. ;
  1. ; RPC: MAG3 DICOM CAPTURE SOP CLASS
  1. ;
  1. ; Input Parameters
  1. ; ================
  1. ; MAGSOP = SOP type (e.g. "TELEDERM")
  1. ;
  1. ; Return Values
  1. ; =============
  1. ; If error found during execution
  1. ; MAGRY(0) = "0^Error Message"
  1. ; If success
  1. ; MAGRY(0) = "1^IEN^SOP CLASS UID
  1. ; where IEN is the IEN of the SOP CLASS UID in DICOM SOP CLASS file (#2006.532)
  1. ;
  1. GSOPCLAS(MAGRY,MAGSOP) ;RPC [MAG3 DICOM CAPTURE SOP CLASS]
  1. N IEN,SOPCLASS
  1. I MAGSOP="TELEDERM" D Q
  1. . ; SOP CLASS should come from IMAGING DICOM FIELDS file (#2005.71)
  1. . ; SOP CLASS field should be added to (#2005.71)
  1. . S SOPCLASS="1.2.840.10008.5.1.4.1.1.77.1.4" ; VL Photographic Image Storage
  1. . S IEN=$$FIND1^DIC(2006.532,"","BX",SOPCLASS)
  1. . I IEN'>0 S MAGRY="0^Error getting SOP CLASS UID IEN" Q
  1. . S MAGRY="1^"_IEN_"^"_SOPCLASS
  1. . Q
  1. S MAGRY="0^Error SOP type is not found"
  1. Q