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

MAGDMEDI.m

Go to the documentation of this file.
  1. MAGDMEDI ;WOIFO/LB - Routine for Medicine DICOM ID ; [ 06/20/2001 08:56 ]
  1. ;;3.0;IMAGING;;Mar 01, 2002
  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. ;; | |
  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. DICOMID(RETURN,MAGMFILE,MAGMFIEN,MAGPROC,MAGDFN) ;
  1. ;MAGMFILE= Medicine file number ( i.e. 699 , 699.5 etc)
  1. ;MAGMFIEN= Medicine file entry, IEN (699,xxx)
  1. ;MAGPROC= Medicine procedure IEN ( 697.2,yyy points to 699, 699.5 etc)
  1. ;MAGDFN= Patient's DFN
  1. ; RETURN piece 1= 1 or 0
  1. ; piece 2= DICOM ID
  1. ; DICOM ID= medicine file id code-Medicine file IEN
  1. N OK,MAGID,MCFILE
  1. S RETURN="0^Invalid information sent"
  1. Q:'MAGMFILE!('MAGMFIEN)!('MAGDFN)
  1. ; Will check to see if valid information is sent
  1. I '$D(^MAG(2005.03,MAGMFILE)) D Q
  1. . S RETURN="0^Invalid Imaging Parent file."
  1. S MCFILE=MAGMFILE
  1. S OK=$$VALID^MCUIMAG0(MAGMFILE,MAGMFIEN,MAGDFN,MAGPROC)
  1. I 'OK S RETURN=OK Q
  1. ;
  1. S MAGID=$$TYPE(MAGMFILE)
  1. S RETURN="1^DICOM ID: "_MAGID_"-"_MAGMFIEN
  1. Q
  1. TYPE(FILE) ;Set the id code for the Medicine file
  1. ; If we add addtl. Medicine files, the following will need to be chgd.
  1. N MAGCODE
  1. S MAGCODE="unknown"
  1. I 'FILE Q MAGCODE
  1. S MAGCODE=$S(FILE=691:"EC",FILE=691.1:"CC",FILE=691.5:"EL",FILE=694:"HE",FILE=699:"EN",1:"GM")
  1. Q MAGCODE
  1. FILE(CODE) ;Set the file number according to the Medicine id file code
  1. ; If we add addtl. Medicine files, the following will need to be chgd.
  1. ; Default is the Generalized Procedure/Consult Medicine file.
  1. N MAGFILE
  1. I '$D(CODE) Q 0
  1. S MAGFILE=$S(CODE="EC":691,CODE="CC":691.1,CODE="EL":691.5,CODE="HE":694,CODE="EN":699,1:699.5)
  1. Q MAGFILE