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

RAMAG06A.m

Go to the documentation of this file.
  1. RAMAG06A ;HCIOFO/SG - ORDERS/EXAMS API (EXAM EDIT TOOLS) ; 2/6/09 11:14am
  1. ;;5.0;Radiology/Nuclear Medicine;**90**;Mar 16, 1998;Build 20
  1. ;
  1. Q
  1. ;
  1. ;+++++ EXAM EDIT PRE-PROCESSING
  1. ;
  1. ; RACTION Actions (can be combined):
  1. ; E Examined (procedure has been performed)
  1. ; C Complete
  1. ;
  1. ; .RATRKCMB Reference to a local variable where current values
  1. ; of the CONTRAST MEDIA multiple will be saved.
  1. ;
  1. ; .RAPRIEN Reference to a local array where some of current
  1. ; case properties will be saved.
  1. ;
  1. ; Input variables:
  1. ; RACNI, RADFN, RADTI
  1. ;
  1. ; Return values:
  1. ; <0 Error descriptor (see $$ERROR^RAERR)
  1. ; 0 Ok
  1. ;
  1. ; NOTE: This is an internal entry point. Do not call it from outside
  1. ; of exam editing routines.
  1. ;
  1. EDTPRE(RACTION,RATRKCMB,RAPRIEN) ;
  1. N RARC
  1. S RARC=0
  1. ;--- Save 'before' CONTRAST MEDIA data values to compare
  1. ;--- against the possible 'after' values
  1. D TRK70CMB^RAMAINU(RADFN,RADTI,RACNI,.RATRKCMB)
  1. ;--- Save 'before' values (in RAPRIEN) to compare later in RAUTL1
  1. D SVBEFOR^RAO7XX(RADFN,RADTI,RACNI)
  1. ;---
  1. Q $S(RARC<0:RARC,1:0)
  1. ;
  1. ;+++++ EXAM EDIT POST-PROCESSING
  1. ;
  1. ; RACTION Actions (can be combined):
  1. ; E Examined (procedure has been performed)
  1. ; C Complete
  1. ;
  1. ; RATRKCMB Old values from the CONTRAST MEDIA multiple
  1. ;
  1. ; .RAPRIEN Reference to a local array with saved case
  1. ; properties.
  1. ;
  1. ; Input variables:
  1. ; RACASE, RACNI, RADFN, RADTI, RAMISC
  1. ;
  1. ; Return values:
  1. ; <0 Error descriptor (see $$ERROR^RAERR)
  1. ; 0 Ok
  1. ;
  1. ; NOTE: This is an internal entry point. Do not call it from outside
  1. ; of exam editing routines.
  1. ;
  1. EDTPST(RACTION,RATRKCMB,RAPRIEN) ;
  1. N FLAGS,N,RABLNK,RACAT,RAD3,RADELFLG,RAEXM0,RAEXOR,RAIENS,RAILP,RAMIFN,RAMOD,RAMODA,RAMODD,RAOIFN,RAOPT,RAORD0,RAORDB4,RAOREA,RAOSTS,RAPRC,RARC,RARSH,RASFM,RASHA,RATRKCMA,TMP,X,ZTQUEUED
  1. ;--- Compare new values with those saved by the SVBEFOR^RAO7XX and
  1. ;--- send changed order control "XX" to CPRS but do not send alert.
  1. S TMP=$$CMPAFTR^RAO7XX(0)
  1. ;--- Send HL7 messages
  1. S FLAGS=$$TRFLAGS^RAUTL22($G(RAMISC("FLAGS")),"S","S")
  1. I RACTION["E" D Q:RARC<0 RARC
  1. . S RARC=$$EXAMINED^RAMAGHL(RACASE,FLAGS)
  1. I RACTION["C" D Q:RARC<0 RARC
  1. . S RARC=$$REPORT^RAMAGHL(RACASE,FLAGS)
  1. ;--- Update the request/order status
  1. D
  1. . N IORI,IOSTBM ; Otherwise, the code breaks the BROWSER device
  1. . N ZTQUEUED
  1. . S ZTQUEUED=1 ; Suppress the output
  1. . D ^RAORDC
  1. ;--- Compare 'before' and 'after' CONTRAST MEDIA data
  1. ;--- and update the audit log if necessary.
  1. D TRK70CMA^RAMAINU(RADFN,RADTI,RACNI,RATRKCMB)
  1. ;---
  1. Q $S(RARC<0:RARC,1:0)
  1. ;
  1. ;+++++ NUCLEAR MEDICINE CODE
  1. ;
  1. ; RACASE Examination identifiers
  1. ; ^01: IEN of the patient in the file #70 (RADFN)
  1. ; ^02: IEN in the REGISTERED EXAMS multiple (RADTI)
  1. ; ^03: IEN in the EXAMINATIONS multiple (RACNI)
  1. ;
  1. ; RACTION Actions (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. ; Input variables:
  1. ; RACN, RADTE, RAMISC, RAMSPSDEFS, RAPROCIEN
  1. ;
  1. ; Output variables:
  1. ; RALOCK, RAMISC
  1. ;
  1. ; Return Values:
  1. ; <0 Error descriptor (see $$ERROR^RAERR)
  1. ; 0 Nuclear medicine data is not needed
  1. ; >0 IEN of the record of the NUC MED EXAM DATA file (#70.2)
  1. ;
  1. NUCMED(RACASE,RACTION,RAMISC,RAFDA) ;
  1. N RANMDIEN,RARC,TMP
  1. ;--- Create the nuclear medicine stub if necessary
  1. S RANMDIEN=$$NMEDSTUB^RAMAGU13(RACASE,RAPROCIEN,RADTE,RACN)
  1. Q:RANMDIEN<0 RANMDIEN
  1. ;--- Nuclear medicine related
  1. I RANMDIEN>0 D Q:RARC<0 RARC
  1. . ;--- Lock the nuclear medicine data
  1. . K TMP S TMP(70.2,RANMDIEN_",")=""
  1. . S RARC=$$LOCKFM^RALOCK(.TMP)
  1. . I RARC S RARC=$$LOCKERR^RAERR(RARC,"nuc. med. data") Q
  1. . M RALOCK=TMP
  1. . ;--- Validate parameters
  1. . S RARC=$$VAL702^RAMAGU14(RANMDIEN_",",RACTION,.RAMISC,.RAFDA)
  1. . I RARC<0 S RARC=$$ERROR^RAERR(-11) Q
  1. ;--- Success
  1. Q RANMDIEN