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

RAMAGU14.m

Go to the documentation of this file.
  1. RAMAGU14 ;HCIOFO/SG - ORDERS/EXAMS API (RAMISC VALID. #70.2) ; 8/18/08 10:02am
  1. ;;5.0;Radiology/Nuclear Medicine;**90**;Mar 16, 1998;Build 20
  1. ;
  1. Q
  1. ;
  1. ;***** VALIDATES RAMISC PARAMETERS RELATED TO THE FILE #70.2
  1. ;
  1. ; RAIENS IENS of the nuclear medicine data (file #70.2)
  1. ;
  1. ; RACTION Action (can be combined):
  1. ; E Examined (procedure has been performed)
  1. ; C Complete
  1. ;
  1. ; .RAMISC Reference to a local array containing miscellaneous
  1. ; request parameters.
  1. ;
  1. ; .RAFDA( Reference to a local array where field values will
  1. ; be prepared for storage (FileMan FDA array).
  1. ;
  1. ; "RACNT") This is an additional node that stores counter for
  1. ; the IENS placeholders. Do not forget to remove this
  1. ; node before passing the array into a FileMan API.
  1. ;
  1. ; "RAIENS") This is an additional node that stores IENS of the
  1. ; record being processed. Do not forget to remove this
  1. ; node before passing the array into a FileMan API.
  1. ;
  1. ; [RAFDACNT] New value for the placeholder counter for the RAFDA.
  1. ; If this parameter is greater than zero, it replaces
  1. ; the value stored in the RAFDA("RACNT").
  1. ;
  1. ; Input variables:
  1. ; RAMSPSDEFS
  1. ;
  1. ; Return values:
  1. ; <0 Error code
  1. ; 0 Ok
  1. ;
  1. VAL702(RAIENS,RACTION,RAMISC,RAFDA,RAFDACNT) ;
  1. N ERRCNT,RC,TMP
  1. ;
  1. ;--- Check required parameters and variables
  1. S RC=$$CHKREQ^RAUTL22("RACTION,RAIENS") Q:RC<0 RC
  1. Q:$TR(RACTION,"EC")'="" $$IPVE^RAERR("RACTION")
  1. ;
  1. ;--- Initialize variables
  1. S RAFDA("RAIENS")=RAIENS
  1. S:$G(RAFDACNT)>0 RAFDA("RACNT")=+RAFDACNT
  1. S (ERRCNT,RC)=0
  1. ;
  1. ;--- Validate parameters specific to the 'EXAMINED' status
  1. I $TR(RACTION,"EC")'=RACTION D S:TMP<0 ERRCNT=ERRCNT+1
  1. . S TMP=$$VEXAMND(RAIENS,RACTION,.RAMISC,.RAFDA)
  1. ;
  1. ;--- Error handling and cleanup
  1. Q $S(ERRCNT>0:-11,1:0)
  1. ;
  1. ;+++++ VALIDATES 'EXAMINED' PARAMETERS
  1. ;
  1. ; RAIENS IENS of the nuclear medicine data (file #70.2)
  1. ;
  1. ; RACTION Action (can be combined):
  1. ; E Examined (procedure has been performed)
  1. ; C Complete
  1. ;
  1. ; .RAMISC Reference to a local array containing miscellaneous
  1. ; request parameters.
  1. ;
  1. ; .RAFDA Reference to a local array where field values will
  1. ; be prepared for storage (FileMan FDA array).
  1. ;
  1. ; Return values:
  1. ; <0 Error code
  1. ; 0 Ok
  1. ;
  1. VEXAMND(RAIENS,RACTION,RAMISC,RAFDA) ;
  1. N ERRCNT,IENS7021,NAME,NODE,RDPHI,TMP
  1. S ERRCNT=0
  1. ;
  1. ;=== Check if the nuclear medicine parameter list exists
  1. S TMP=$$VALPRM^RAMAGU09("RDPHARMS")
  1. I TMP'>0 Q $S(TMP<0:-11,1:0)
  1. ;
  1. ;=== Validate the nuclear medicine parameters
  1. S RDPHI=0
  1. F S RDPHI=$O(RAMISC("RDPHARMS",RDPHI)) Q:RDPHI'>0 D
  1. . S NODE=$NA(RAMISC("RDPHARMS",RDPHI))
  1. . ;--- A new record IENS (with a placeholder) will be assigned to
  1. . ;--- this variable by the next call to $$CHECKFLD^RAMAGU09
  1. . K IENS7021
  1. . ;--- Validate RDPH-* parameters
  1. . S NAME=""
  1. . F S NAME=$O(RAMSPSDEFS("F",70.21,NAME)) Q:NAME="" D
  1. . . S:$$VALPRM^RAMAGU09(NAME,,.IENS7021,NODE)<0 ERRCNT=ERRCNT+1
  1. ;
  1. ;=== Error handling and cleanup
  1. Q $S(ERRCNT>0:-11,1:0)