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

MAGJUTL6.m

Go to the documentation of this file.
  1. MAGJUTL6 ;WOIFO/JHC,NST - Imaging Utility for getting Radiology Printset; 10/17/2022
  1. ;;3.0;IMAGING;**118,341**;Dec 21, 2022;Build 28
  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. ; Reference to ACCFIND^RAAPI in ICR #5020
  1. ; Reference to EN2^RAUTL20 in ICR #3270
  1. ;; ISI IMAGING;**99,102**
  1. Q
  1. DAYCASE(RADFN,RADTI,RACNI) ; return Acn # (or "^" delimited list of for PRINTSET) for exam
  1. ; RADFN,RADTI,RACNI -- Pointers to Rad Exam
  1. N ACNLIST,DAYCASE,I,LONGACN,PSET,RACN,RACNE,RADTE,RAPRTSET,X
  1. S DAYCASE=""
  1. I $G(RADFN),$G(RADTI),$G(RACNI) D
  1. . S X=$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)) ; ICR 65
  1. . Q:X=""
  1. . S RACN=$P(X,U) ; Case Number
  1. . S LONGACN=$P(X,U,31) ; Site Accesion Number
  1. . S RADTE=9999999.9999-RADTI
  1. . ; use site accesion number if it is defined or create the short one
  1. . S DAYCASE=$S(LONGACN]"":LONGACN,1:$E(RADTE,4,7)_$E(RADTE,2,3)_"-"_RACN)
  1. S ACNLIST=DAYCASE
  1. I DAYCASE]"" D
  1. . D EN2^RAUTL20(.PSET) ; get info re rad PrintSet
  1. . Q:'RAPRTSET
  1. . S RACNE=$S(LONGACN]"":DAYCASE,1:$P(DAYCASE,"-",2)) ; SSAN/OLDACN
  1. . S X="",ACNLIST=""
  1. . F S X=$O(PSET(X)) Q:'X S:RACNE'=$P(PSET(X),U) ACNLIST=ACNLIST_U_$P(PSET(X),U)
  1. . I LONGACN="" F I=2:1:$L(ACNLIST,U) S X=$E(RADTE,4,7)_$E(RADTE,2,3)_"-"_$P(ACNLIST,U,I),$P(ACNLIST,U,I)=X
  1. . S ACNLIST=DAYCASE_ACNLIST
  1. Q ACNLIST
  1. ;
  1. DAYCASE2(ACCN) ; return Acn # (or "^" delimited list of for PRINTSET) for exam
  1. ; ACCN -- Radiology Accession Number
  1. N ACNLIST,RAA,X,Y
  1. N RADFN,RADTI,RACNI
  1. ;
  1. S ACNLIST=""
  1. S X=$$ACCFIND^RAAPI(ACCN,.RAA)
  1. I X>0 D ; accession number found
  1. . ; For a given accession number, there will never be more than one set of values
  1. . ; for RADFN/RADTI/RACNI in RAA array
  1. . S Y=RAA(1)
  1. . S RADFN=$P(Y,"^",1),RADTI=$P(Y,"^",2),RACNI=$P(Y,"^",3)
  1. . S ACNLIST=$$DAYCASE^MAGJUTL6(RADFN,RADTI,RACNI) ; get all accession numbers
  1. . Q
  1. Q ACNLIST
  1. ;
  1. DAYCASE3(ACCN) ; return RADFN_U_RADTI_U_RACNI for input accession #
  1. ; ACCN -- Radiology Accession Number
  1. N RAA,X,Y
  1. S X=$$ACCFIND^RAAPI(ACCN,.RAA)
  1. S Y=""
  1. I X>0 S Y=RAA(1) ; accession number found
  1. Q Y