RAMAGU14 ;HCIOFO/SG - ORDERS/EXAMS API (RAMISC VALID. #70.2) ; 8/18/08 10:02am
;;5.0;Radiology/Nuclear Medicine;**90**;Mar 16, 1998;Build 20
;
Q
;
;***** VALIDATES RAMISC PARAMETERS RELATED TO THE FILE #70.2
;
; RAIENS IENS of the nuclear medicine data (file #70.2)
;
; RACTION Action (can be combined):
; E Examined (procedure has been performed)
; C Complete
;
; .RAMISC Reference to a local array containing miscellaneous
; request parameters.
;
; .RAFDA( Reference to a local array where field values will
; be prepared for storage (FileMan FDA array).
;
; "RACNT") This is an additional node that stores counter for
; the IENS placeholders. Do not forget to remove this
; node before passing the array into a FileMan API.
;
; "RAIENS") This is an additional node that stores IENS of the
; record being processed. Do not forget to remove this
; node before passing the array into a FileMan API.
;
; [RAFDACNT] New value for the placeholder counter for the RAFDA.
; If this parameter is greater than zero, it replaces
; the value stored in the RAFDA("RACNT").
;
; Input variables:
; RAMSPSDEFS
;
; Return values:
; <0 Error code
; 0 Ok
;
VAL702(RAIENS,RACTION,RAMISC,RAFDA,RAFDACNT) ;
N ERRCNT,RC,TMP
;
;--- Check required parameters and variables
S RC=$$CHKREQ^RAUTL22("RACTION,RAIENS") Q:RC<0 RC
Q:$TR(RACTION,"EC")'="" $$IPVE^RAERR("RACTION")
;
;--- Initialize variables
S RAFDA("RAIENS")=RAIENS
S:$G(RAFDACNT)>0 RAFDA("RACNT")=+RAFDACNT
S (ERRCNT,RC)=0
;
;--- Validate parameters specific to the 'EXAMINED' status
I $TR(RACTION,"EC")'=RACTION D S:TMP<0 ERRCNT=ERRCNT+1
. S TMP=$$VEXAMND(RAIENS,RACTION,.RAMISC,.RAFDA)
;
;--- Error handling and cleanup
Q $S(ERRCNT>0:-11,1:0)
;
;+++++ VALIDATES 'EXAMINED' PARAMETERS
;
; RAIENS IENS of the nuclear medicine data (file #70.2)
;
; RACTION Action (can be combined):
; E Examined (procedure has been performed)
; C Complete
;
; .RAMISC Reference to a local array containing miscellaneous
; request parameters.
;
; .RAFDA Reference to a local array where field values will
; be prepared for storage (FileMan FDA array).
;
; Return values:
; <0 Error code
; 0 Ok
;
VEXAMND(RAIENS,RACTION,RAMISC,RAFDA) ;
N ERRCNT,IENS7021,NAME,NODE,RDPHI,TMP
S ERRCNT=0
;
;=== Check if the nuclear medicine parameter list exists
S TMP=$$VALPRM^RAMAGU09("RDPHARMS")
I TMP'>0 Q $S(TMP<0:-11,1:0)
;
;=== Validate the nuclear medicine parameters
S RDPHI=0
F S RDPHI=$O(RAMISC("RDPHARMS",RDPHI)) Q:RDPHI'>0 D
. S NODE=$NA(RAMISC("RDPHARMS",RDPHI))
. ;--- A new record IENS (with a placeholder) will be assigned to
. ;--- this variable by the next call to $$CHECKFLD^RAMAGU09
. K IENS7021
. ;--- Validate RDPH-* parameters
. S NAME=""
. F S NAME=$O(RAMSPSDEFS("F",70.21,NAME)) Q:NAME="" D
. . S:$$VALPRM^RAMAGU09(NAME,,.IENS7021,NODE)<0 ERRCNT=ERRCNT+1
;
;=== Error handling and cleanup
Q $S(ERRCNT>0:-11,1:0)
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRAMAGU14 3343 printed Oct 16, 2024@18:37:46 Page 2
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
+2 ;
+3 QUIT
+4 ;
+5 ;***** VALIDATES RAMISC PARAMETERS RELATED TO THE FILE #70.2
+6 ;
+7 ; RAIENS IENS of the nuclear medicine data (file #70.2)
+8 ;
+9 ; RACTION Action (can be combined):
+10 ; E Examined (procedure has been performed)
+11 ; C Complete
+12 ;
+13 ; .RAMISC Reference to a local array containing miscellaneous
+14 ; request parameters.
+15 ;
+16 ; .RAFDA( Reference to a local array where field values will
+17 ; be prepared for storage (FileMan FDA array).
+18 ;
+19 ; "RACNT") This is an additional node that stores counter for
+20 ; the IENS placeholders. Do not forget to remove this
+21 ; node before passing the array into a FileMan API.
+22 ;
+23 ; "RAIENS") This is an additional node that stores IENS of the
+24 ; record being processed. Do not forget to remove this
+25 ; node before passing the array into a FileMan API.
+26 ;
+27 ; [RAFDACNT] New value for the placeholder counter for the RAFDA.
+28 ; If this parameter is greater than zero, it replaces
+29 ; the value stored in the RAFDA("RACNT").
+30 ;
+31 ; Input variables:
+32 ; RAMSPSDEFS
+33 ;
+34 ; Return values:
+35 ; <0 Error code
+36 ; 0 Ok
+37 ;
VAL702(RAIENS,RACTION,RAMISC,RAFDA,RAFDACNT) ;
+1 NEW ERRCNT,RC,TMP
+2 ;
+3 ;--- Check required parameters and variables
+4 SET RC=$$CHKREQ^RAUTL22("RACTION,RAIENS")
if RC<0
QUIT RC
+5 if $TRANSLATE(RACTION,"EC")'=""
QUIT $$IPVE^RAERR("RACTION")
+6 ;
+7 ;--- Initialize variables
+8 SET RAFDA("RAIENS")=RAIENS
+9 if $GET(RAFDACNT)>0
SET RAFDA("RACNT")=+RAFDACNT
+10 SET (ERRCNT,RC)=0
+11 ;
+12 ;--- Validate parameters specific to the 'EXAMINED' status
+13 IF $TRANSLATE(RACTION,"EC")'=RACTION
Begin DoDot:1
+14 SET TMP=$$VEXAMND(RAIENS,RACTION,.RAMISC,.RAFDA)
End DoDot:1
if TMP<0
SET ERRCNT=ERRCNT+1
+15 ;
+16 ;--- Error handling and cleanup
+17 QUIT $SELECT(ERRCNT>0:-11,1:0)
+18 ;
+19 ;+++++ VALIDATES 'EXAMINED' PARAMETERS
+20 ;
+21 ; RAIENS IENS of the nuclear medicine data (file #70.2)
+22 ;
+23 ; RACTION Action (can be combined):
+24 ; E Examined (procedure has been performed)
+25 ; C Complete
+26 ;
+27 ; .RAMISC Reference to a local array containing miscellaneous
+28 ; request parameters.
+29 ;
+30 ; .RAFDA Reference to a local array where field values will
+31 ; be prepared for storage (FileMan FDA array).
+32 ;
+33 ; Return values:
+34 ; <0 Error code
+35 ; 0 Ok
+36 ;
VEXAMND(RAIENS,RACTION,RAMISC,RAFDA) ;
+1 NEW ERRCNT,IENS7021,NAME,NODE,RDPHI,TMP
+2 SET ERRCNT=0
+3 ;
+4 ;=== Check if the nuclear medicine parameter list exists
+5 SET TMP=$$VALPRM^RAMAGU09("RDPHARMS")
+6 IF TMP'>0
QUIT $SELECT(TMP<0:-11,1:0)
+7 ;
+8 ;=== Validate the nuclear medicine parameters
+9 SET RDPHI=0
+10 FOR
SET RDPHI=$ORDER(RAMISC("RDPHARMS",RDPHI))
if RDPHI'>0
QUIT
Begin DoDot:1
+11 SET NODE=$NAME(RAMISC("RDPHARMS",RDPHI))
+12 ;--- A new record IENS (with a placeholder) will be assigned to
+13 ;--- this variable by the next call to $$CHECKFLD^RAMAGU09
+14 KILL IENS7021
+15 ;--- Validate RDPH-* parameters
+16 SET NAME=""
+17 FOR
SET NAME=$ORDER(RAMSPSDEFS("F",70.21,NAME))
if NAME=""
QUIT
Begin DoDot:2
+18 if $$VALPRM^RAMAGU09(NAME,,.IENS7021,NODE)<0
SET ERRCNT=ERRCNT+1
End DoDot:2
End DoDot:1
+19 ;
+20 ;=== Error handling and cleanup
+21 QUIT $SELECT(ERRCNT>0:-11,1:0)