- MAGNDCMC ;WOIFO/NST - Imaging Capture DICOM utilities ; 09 Oct 2010 3:52 AM
- ;;3.0;IMAGING;**106**;Mar 19, 2002;Build 2002;Feb 28, 2011
- ;; 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
- ;
- ;***** Returns all records in IMAGING DICOM FIELDS file (#2005.71)
- ; per SOP type (e.g. "TELEDERM")
- ; RPC: MAG3 DICOM CAPTURE GE LIST
- ;
- ; Input Parameters
- ; ================
- ; MAGSOP = SOP type (e.g. "TELEDERM")
- ;
- ; Return Values
- ; =============
- ; if error found during execution
- ; MAGRY(0) = "0^Error"
- ; if success
- ; MAGRY(0) = "1^#CNT" - where #CNT is a number of records returned
- ; MAGRY(1) = "MODULE^ELEMENT^ELEMENT NAME^VALUE MULTIPLICITY^VALUE REPRESENTATION^GUI CONTROL"
- ; MAGRY(2..n) = "^" delimited string with values of fields listed in MAGRY(1)
- ;
- GGELIST(MAGRY,MAGSOP) ;RPC [MAG3 DICOM CAPTURE GE LIST]
- N OUT,OUT1,CNT,DA0,DA1,MODULE
- N X,I,J,ERR,CNT
- N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGGTERR"
- ;
- S MAGRY(0)="0^Error"
- S MAGRY(1)="MODULE^ELEMENT^ELEMENT NAME^VALUE MULTIPLICITY^VALUE REPRESENTATION^GUI CONTROL"
- S CNT=1
- S DA0=$$FIND1^DIC(2005.71,"","X",MAGSOP,"","","ERR") ; Find "SOP type" IEN
- I DA0=0 S MAGRY(0)="1^"_(CNT-1) Q ; nothing found
- I $D(ERR) Q ; Error
- D LIST^DIC(2005.712,","_DA0_",",";@;.01","P","*","","","#","","","OUT","OUT") ; Get all modules
- S I=0
- F S I=$O(OUT("DILIST",I)) Q:I="" D
- . S X=OUT("DILIST",I,0)
- . S DA1=$P(X,"^",1),MODULE=$P(X,"^",2) D
- . K OUT1
- . D LIST^DIC(2005.713,","_DA1_","_DA0_",",";@;.01;2;3;4;5I","P","*","","","#","","","OUT1","OUT1") ; Get all elements
- . S J=0
- . F S J=$O(OUT1("DILIST",J)) Q:J="" D
- . . S X=OUT1("DILIST",J,0)
- . . S CNT=CNT+1
- . . S MAGRY(CNT)=MODULE_"^"_$P(X,"^",2,6)
- . . Q
- . Q
- S MAGRY(0)="1^"_(CNT-1)
- Q
- ;
- ;***** Returns SOP CLASS UID per SOP type (e.g. "TELEDERM")
- ;
- ; RPC: MAG3 DICOM CAPTURE SOP CLASS
- ;
- ; Input Parameters
- ; ================
- ; MAGSOP = SOP type (e.g. "TELEDERM")
- ;
- ; Return Values
- ; =============
- ; If error found during execution
- ; MAGRY(0) = "0^Error Message"
- ; If success
- ; MAGRY(0) = "1^IEN^SOP CLASS UID
- ; where IEN is the IEN of the SOP CLASS UID in DICOM SOP CLASS file (#2006.532)
- ;
- GSOPCLAS(MAGRY,MAGSOP) ;RPC [MAG3 DICOM CAPTURE SOP CLASS]
- N IEN,SOPCLASS
- I MAGSOP="TELEDERM" D Q
- . ; SOP CLASS should come from IMAGING DICOM FIELDS file (#2005.71)
- . ; SOP CLASS field should be added to (#2005.71)
- . S SOPCLASS="1.2.840.10008.5.1.4.1.1.77.1.4" ; VL Photographic Image Storage
- . S IEN=$$FIND1^DIC(2006.532,"","BX",SOPCLASS)
- . I IEN'>0 S MAGRY="0^Error getting SOP CLASS UID IEN" Q
- . S MAGRY="1^"_IEN_"^"_SOPCLASS
- . Q
- S MAGRY="0^Error SOP type is not found"
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGNDCMC 3692 printed Feb 18, 2025@23:33:42 Page 2
- 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
- +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 ;***** Returns all records in IMAGING DICOM FIELDS file (#2005.71)
- +20 ; per SOP type (e.g. "TELEDERM")
- +21 ; RPC: MAG3 DICOM CAPTURE GE LIST
- +22 ;
- +23 ; Input Parameters
- +24 ; ================
- +25 ; MAGSOP = SOP type (e.g. "TELEDERM")
- +26 ;
- +27 ; Return Values
- +28 ; =============
- +29 ; if error found during execution
- +30 ; MAGRY(0) = "0^Error"
- +31 ; if success
- +32 ; MAGRY(0) = "1^#CNT" - where #CNT is a number of records returned
- +33 ; MAGRY(1) = "MODULE^ELEMENT^ELEMENT NAME^VALUE MULTIPLICITY^VALUE REPRESENTATION^GUI CONTROL"
- +34 ; MAGRY(2..n) = "^" delimited string with values of fields listed in MAGRY(1)
- +35 ;
- GGELIST(MAGRY,MAGSOP) ;RPC [MAG3 DICOM CAPTURE GE LIST]
- +1 NEW OUT,OUT1,CNT,DA0,DA1,MODULE
- +2 NEW X,I,J,ERR,CNT
- +3 NEW $ETRAP,$ESTACK
- SET $ETRAP="D ERRA^MAGGTERR"
- +4 ;
- +5 SET MAGRY(0)="0^Error"
- +6 SET MAGRY(1)="MODULE^ELEMENT^ELEMENT NAME^VALUE MULTIPLICITY^VALUE REPRESENTATION^GUI CONTROL"
- +7 SET CNT=1
- +8 ; Find "SOP type" IEN
- SET DA0=$$FIND1^DIC(2005.71,"","X",MAGSOP,"","","ERR")
- +9 ; nothing found
- IF DA0=0
- SET MAGRY(0)="1^"_(CNT-1)
- QUIT
- +10 ; Error
- IF $DATA(ERR)
- QUIT
- +11 ; Get all modules
- DO LIST^DIC(2005.712,","_DA0_",",";@;.01","P","*","","","#","","","OUT","OUT")
- +12 SET I=0
- +13 FOR
- SET I=$ORDER(OUT("DILIST",I))
- if I=""
- QUIT
- Begin DoDot:1
- +14 SET X=OUT("DILIST",I,0)
- +15 SET DA1=$PIECE(X,"^",1)
- SET MODULE=$PIECE(X,"^",2)
- Begin DoDot:2
- End DoDot:2
- +16 KILL OUT1
- +17 ; Get all elements
- DO LIST^DIC(2005.713,","_DA1_","_DA0_",",";@;.01;2;3;4;5I","P","*","","","#","","","OUT1","OUT1")
- +18 SET J=0
- +19 FOR
- SET J=$ORDER(OUT1("DILIST",J))
- if J=""
- QUIT
- Begin DoDot:2
- +20 SET X=OUT1("DILIST",J,0)
- +21 SET CNT=CNT+1
- +22 SET MAGRY(CNT)=MODULE_"^"_$PIECE(X,"^",2,6)
- +23 QUIT
- End DoDot:2
- +24 QUIT
- End DoDot:1
- +25 SET MAGRY(0)="1^"_(CNT-1)
- +26 QUIT
- +27 ;
- +28 ;***** Returns SOP CLASS UID per SOP type (e.g. "TELEDERM")
- +29 ;
- +30 ; RPC: MAG3 DICOM CAPTURE SOP CLASS
- +31 ;
- +32 ; Input Parameters
- +33 ; ================
- +34 ; MAGSOP = SOP type (e.g. "TELEDERM")
- +35 ;
- +36 ; Return Values
- +37 ; =============
- +38 ; If error found during execution
- +39 ; MAGRY(0) = "0^Error Message"
- +40 ; If success
- +41 ; MAGRY(0) = "1^IEN^SOP CLASS UID
- +42 ; where IEN is the IEN of the SOP CLASS UID in DICOM SOP CLASS file (#2006.532)
- +43 ;
- GSOPCLAS(MAGRY,MAGSOP) ;RPC [MAG3 DICOM CAPTURE SOP CLASS]
- +1 NEW IEN,SOPCLASS
- +2 IF MAGSOP="TELEDERM"
- Begin DoDot:1
- +3 ; SOP CLASS should come from IMAGING DICOM FIELDS file (#2005.71)
- +4 ; SOP CLASS field should be added to (#2005.71)
- +5 ; VL Photographic Image Storage
- SET SOPCLASS="1.2.840.10008.5.1.4.1.1.77.1.4"
- +6 SET IEN=$$FIND1^DIC(2006.532,"","BX",SOPCLASS)
- +7 IF IEN'>0
- SET MAGRY="0^Error getting SOP CLASS UID IEN"
- QUIT
- +8 SET MAGRY="1^"_IEN_"^"_SOPCLASS
- +9 QUIT
- End DoDot:1
- QUIT
- +10 SET MAGRY="0^Error SOP type is not found"
- +11 QUIT