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

MCARUTL1.m

Go to the documentation of this file.
  1. MCARUTL1 ;HOIFO/WAA-Utility Routine ;11/07/00 11:16
  1. ;;2.3;Medicine;**29**;09/13/1996
  1. ;
  1. ; EN() This Entry point will SET/KILL the AV,AF,AS X-references
  1. ; for PULMONARY FUNCTION TESTS File (#700).
  1. ; FUNT = "SET","KILL" tells what X-ref action to execute
  1. ; IEN = Internal Entry Number of File 700 entry
  1. ; PAT = The internal Entry Number of the patient
  1. ; DATE = The Date of the procedure
  1. ; XREF = The Cross-Reference to be set.
  1. ; "ALL" all 3 cross references for the entry
  1. ; "AV" Volume Studies (Field 17, multiple field)
  1. ; "AF" Flow Studies (Field 18, multiple field)
  1. ; "AS" Special Study (Field 32, multiple field)
  1. ;
  1. EN(FUNT,IEN,PAT,DATE,XREF) ; Main entry point to set or kill X-refs
  1. Q:FUNT="" ; Required to tell the program what function to do set/kill
  1. Q:IEN="" ; Required to tell the program what entry in 700 to X-ref
  1. Q:PAT="" ; Required to tell the program what patient
  1. Q:DATE="" ; Required to tell the program the date of the Procedure
  1. Q:XREF="" ; Required to tell the program what X-ref
  1. I FUNT'="SET",FUNT'="KILL" Q ; Quit if the FUNT is not a set/kill
  1. I '($D(^MCAR(700,IEN,0))#10) Q ; Quit if there is no entry in 700
  1. I XREF'="ALL" D PRO Q ; tell the program that it is only one X-ref
  1. I XREF="ALL" F XREF="AV","AF","AS" D PRO ; Tell the program all
  1. Q
  1. PRO ; Process the data for the given cross-reference
  1. N REFN ; this variable will contain the sub node of the entry
  1. S REFN=$S(XREF="AV":3,XREF="AF":4,XREF="AS":"S",1:0)
  1. Q:REFN=0
  1. Q:'$D(^MCAR(700,IEN,REFN)) ; Quit if there is no data for the entry
  1. N ENT
  1. S ENT=0
  1. Q:($D(^MCAR(700,IEN,REFN,1))'=10) ; no zero node or children
  1. F S ENT=$O(^MCAR(700,IEN,REFN,ENT)) Q:ENT<1 D ; loop and get each entry
  1. .Q:'($D(^MCAR(700,IEN,REFN,ENT,0))#10) ; Quit if no entry
  1. .N TYPE
  1. .S TYPE=$P($G(^MCAR(700,IEN,REFN,ENT,0)),U) Q:TYPE=""
  1. .D ACTION ; Fire off the cross reference
  1. .Q
  1. Q
  1. ACTION ;Set the data for the stated cross reference
  1. N MCDD ; Protect DIC varables
  1. I FUNT="SET" S ^MCAR(700,XREF,PAT,TYPE,(9999999.9999-DATE),IEN,ENT)="" Q
  1. I FUNT="KILL" K ^MCAR(700,XREF,PAT,TYPE,(9999999.9999-DATE),IEN,ENT)
  1. Q