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

MAGVIM02.m

Go to the documentation of this file.
  1. MAGVIM02 ;WOIFO/MAT,PMK - Utilities for RPC calls for DICOM file processing ; Feb 15, 2022@09:33:55
  1. ;;3.0;IMAGING;**118,138,305**;Mar 19, 2002;Build 3
  1. ;; Per VHA Directive 2004-038, this routine should not be modified.
  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. ;; | 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. ;
  1. ; +++++ Wrap calls to___ To retrieve____________
  1. ;
  1. ; OER^GMRCSLM1 ..... consult/procedure list (IA #2740).
  1. ; ORDERS^MAGDRPCB .. Radiology Exam List.
  1. ;
  1. ; RPC: MAGV GET PAT ORDERS
  1. ;
  1. ; INPUTS
  1. ; ======
  1. ;
  1. ; MAGVRY ........... Name of output array, passed by reference.
  1. ; PIDENT ........... EnterprisePatientID
  1. ; PIDTYPE .......... EnterprisePatientIDType
  1. ; PIDAUTHN ......... AssigningAuthority
  1. ; PIDCR8OR ......... CreatingEntity
  1. ; ORDRTYPE ......... OrderType
  1. ; ORDTSTRT ......... DateStart
  1. ; ORDTSTOP ......... DateEnd
  1. ;
  1. ; OUTPUTS
  1. ; =======
  1. ;
  1. ; Array of radiology or consult orders as f(OrderType). Descriptions of each
  1. ; appear before their respective tags, GETORCON & GETORAD.
  1. ;
  1. ; NOTES
  1. ; =====
  1. ;
  1. GETORD(MAGVRY,PIDENT,PIDTYPE,PIDAUTHN,PIDCR8OR,ORDRTYPE,ORDTSTRT,ORDTSTOP) ;
  1. ;
  1. ;--- Initialize.
  1. K RETURN
  1. ;
  1. ;--- Set output array separators per MAG*3.0*34 convention.
  1. N SEPOUTP,SEPSTAT D ZRUSEPIN
  1. ;
  1. ;--- Validate inputs exist. External calls validate further.
  1. N MAGVERR S MAGVERR=0
  1. D
  1. . I '$D(ORDRTYPE)!(ORDRTYPE'?3U) S MAGVERR="Undefined or mis-formatted Order Type." Q
  1. . I "CON/RAD/LAB"'[ORDRTYPE S MAGVERR="Unsupported Order Type "_ORDRTYPE_"." Q
  1. . I '$D(ORDTSTRT) S MAGVERR="Undefined Order Start Date." Q
  1. . I '$D(ORDTSTOP) S MAGVERR="Undefined Order Stop Date." Q
  1. . I ORDTSTRT'?8N S MAGVERR="Unexpected Order Start Date format." Q
  1. . I ORDTSTOP'?8N S MAGVERR="Unexpected Order Stop Date format." Q
  1. . Q
  1. ;
  1. I MAGVERR'=0 S MAGVRY(0)="-1"_SEPSTAT_MAGVERR Q
  1. ;
  1. ;--- Convert incoming MMDDYYYY dates to FileMan format.
  1. D DT^DILF(,ORDTSTRT,.ORDTSTRT)
  1. D DT^DILF(,ORDTSTOP,.ORDTSTOP)
  1. ;
  1. ;--- Set defaults for incoming undefined.
  1. S:PIDTYPE="" PIDTYPE="D"
  1. S:PIDAUTHN="" PIDAUTHN="V"
  1. S:PIDCR8OR="" PIDCR8OR="Unknown." ;???_Lookup_in_^MAGV(2005.62,_Field_#.03
  1. ;
  1. ;--- Filter consults by ORDER STATUS file (#100.01) IEN's.
  1. N ORDRSTAT S ORDRSTAT="2,3,4,5,6,8,9,10,15,16" ; P305 PMK 8/19/2021
  1. ;
  1. ;--- Branch to processor.
  1. D:ORDRTYPE["CON" GETORCON(PIDENT,"",ORDTSTRT,ORDTSTOP,ORDRSTAT,ORDRTYPE)
  1. D:ORDRTYPE["RAD" GETORRAD(PIDENT,ORDRTYPE)
  1. D:ORDRTYPE["LAB" GETORLAB(PIDENT,ORDTSTRT,ORDTSTOP)
  1. M MAGVRY=RETURN K RETURN
  1. Q
  1. ;
  1. ;+++++ Wrap call to OER^GMRCSLM1 (IA #2740).
  1. ;
  1. ;
  1. GETORCON(MAGVPDFN,MAGVNULL,STARTDT,STOPDT,STATUS,OTYPE) ;
  1. ;
  1. S MAGVNULL=""
  1. ;
  1. ;--- IA #2740.
  1. D OER^GMRCSLM1(MAGVPDFN,MAGVNULL,STARTDT,STOPDT,STATUS,1)
  1. ;
  1. ;--- Re-format output w/o trailing "0" subscript.
  1. N MAGVGBL S MAGVGBL=$NA(^TMP("GMRCR",$J,"CS",1,0))
  1. ;
  1. ;--- Process if none found, or error, & QUIT.
  1. I $E($G(@MAGVGBL))="<" D Q
  1. . ;
  1. . I $G(@MAGVGBL)["PATIENT DOES NOT HAVE ANY" D
  1. . . S RETURN(0)="0"_SEPSTAT_"0"
  1. . . Q
  1. . E S RETURN(0)="-1"_SEPSTAT_$G(@MAGVGBL)
  1. . K @MAGVGBL
  1. . Q
  1. ;
  1. S MAGVGBL=$NA(^TMP("GMRCR",$J,"CS",0))
  1. ;
  1. ;--- Process expected output.
  1. E D
  1. . N LINETOT S LINETOT=$P($G(@MAGVGBL),U,4)
  1. . S RETURN(0)="0"_SEPSTAT_LINETOT
  1. . N CT F CT=1:1:LINETOT S MAGVGBL=$Q(@MAGVGBL) D
  1. . . N DATA S DATA=$G(@MAGVGBL)
  1. . . K MAGV
  1. . . ;
  1. . . ;--- Parse incoming data.
  1. . . S MAGV("GMRCIEN")=$P(DATA,U,1)
  1. . . S MAGV("REQSTDT")=$$FMTE^XLFDT($P(DATA,U,2),1)
  1. . . S MAGV("ORDRSTAT")=$P(DATA,U,3)
  1. . . S MAGV("SERVTO")=$P(DATA,U,4)
  1. . . S MAGV("NMPROCON")=$P(DATA,U,5)
  1. . . S MAGV("SERVFROM")=$P(DATA,U,6)
  1. . . S MAGV("CONTITLE")=$P(DATA,U,7)
  1. . . S MAGV("OERRDFN")=$P(DATA,U,8)
  1. . . ;
  1. . . ;--- record type for proper GUI icon
  1. . . ;--- "C"=reg cons, "P"=reg proc, "M"=clin proc, "I"=IF cons, "R"=IF proc
  1. . . S MAGV("CONTYPE")=$P(DATA,U,9)
  1. . . ;
  1. . . ;--- First line of Reason for Request (#123.01,.01).
  1. . . S MAGV("ORDREASN")=$$GET1^DIQ(123.01,"1,"_MAGV("GMRCIEN")_",",.01)
  1. . . ;
  1. . . S MAGV("CLINPROC")=$$GET1^DIQ(123,MAGV("GMRCIEN"),1.01)
  1. . . ;
  1. . . ;--- Re-format output.
  1. . . N LINEOUT S LINEOUT=$QS(MAGVGBL,4)
  1. . . S $P(RETURN(LINEOUT),U,1)=OTYPE
  1. . . S $P(RETURN(LINEOUT),U,2)=MAGVPDFN
  1. . . S $P(RETURN(LINEOUT),U,3)=MAGV("REQSTDT")
  1. . . S $P(RETURN(LINEOUT),U,4)=MAGV("ORDREASN")
  1. . . S $P(RETURN(LINEOUT),U,5)=MAGV("SERVTO")
  1. . . S $P(RETURN(LINEOUT),U,7)=$$GMRCACN^MAGDFCNV(MAGV("GMRCIEN"))
  1. . . S $P(RETURN(LINEOUT),U,8)=MAGV("ORDRSTAT")
  1. . . S $P(RETURN(LINEOUT),U,9)=MAGV("GMRCIEN")
  1. . . S $P(RETURN(LINEOUT),U,10)=MAGV("CONTITLE")
  1. . . S $P(RETURN(LINEOUT),U,11)=$G(MAGV("CLINPROC"))
  1. . . S $P(RETURN(LINEOUT),U,12)=$G(MAGV("EXAMIEN"))
  1. . . S $P(RETURN(LINEOUT),U,13)=$G(MAGV("RAOIEN"))
  1. . . S $P(RETURN(LINEOUT),U,14)=$G(MAGV("EXAMIEN2"))
  1. . . S $P(RETURN(LINEOUT),U,15)=$G(MAGV("ORDRPHYS"))
  1. . . S $P(RETURN(LINEOUT),U,16)=$G(MAGV("ORDRLOCIEN"))
  1. . . S $P(RETURN(LINEOUT),U,17)=$G(MAGV("PROCMOD"))
  1. . . ;
  1. . . S RETURN($QS(MAGVGBL,4))=$TR(RETURN(LINEOUT),U,SEPOUTP)
  1. . . Q
  1. . K MAGV
  1. . Q
  1. K @MAGVGBL
  1. Q
  1. ;
  1. ;+++++ Wrap call to modified code from ORDERS^MAGDRPCB (RPC: MAG DICOM GET RAD ORDERS)
  1. ;
  1. ; NOTES
  1. ; =====
  1. ; Filters on REQUEST STATUS field (#5) of the RAD/NUC MED ORDERS file (#75.1)
  1. ; ,QUITting if status is DISCONTINUED, UNRELEASED or is null.
  1. ;
  1. ; Procedure Modifiers are multiple, concatenated as "Name1|1~Name2|2~...",
  1. ; and get re-formatted as "NAME1~NAME2~..."
  1. ;
  1. ; Possible errors:
  1. ;
  1. ; . S ARRAY(1)="-1,Invalid or missing patient identifier: """_DFN_"""."
  1. ; . S ARRAY(1)="-2,DFN_" undefined in the RAD/NUC MED PATIENT file (#70).
  1. ;
  1. GETORRAD(PATDFN,OTYPE) ;
  1. ;
  1. K RETURN
  1. D ORDERS^MAGVIM07(.RETURN,PATDFN) ;MAGDRPCB(.RETURN,PATDFN)
  1. ;
  1. ;--- Process error output & QUIT.
  1. I $P(RETURN(1),",")<0 D Q
  1. . S $P(MAGTMP(0),SEPSTAT,2)=$P(RETURN(1),",",2)
  1. . K RETURN S RETURN(0)="-1"_MAGTMP(0)
  1. . K MAGTMP
  1. . Q
  1. ;
  1. ;--- Re-subscript.
  1. N CTIN S CTIN=0
  1. F S CTIN=$O(RETURN(CTIN)) Q:CTIN="" S RETURN(CTIN-1)=RETURN(CTIN)
  1. S CTIN=$O(RETURN(""),-1) K RETURN(CTIN)
  1. ;
  1. N LINECUR S LINECUR=0
  1. N LINETOT S LINETOT=RETURN(0)
  1. N LINEOUT S LINEOUT=0
  1. ;
  1. F LINECUR=1:1:LINETOT D
  1. . ;
  1. . K MAGV
  1. . ;
  1. . ;--- Array "^" pieces & re-write line.
  1. . S MAGV("RAOIEN")=$P(RETURN(LINECUR),U,1)
  1. . S MAGV("PROCIEN")=$P(RETURN(LINECUR),U,2)
  1. . S MAGV("PROCMOD")=$P(RETURN(LINECUR),U,3)
  1. . ;--- Re-format Procedure Modifiers
  1. . I $G(MAGV("PROCMOD"))'="" N PCES S PCES="" D S MAGV("PROCMOD")=PCES
  1. . . N CT F CT=1:1:$L(MAGV("PROCMOD"),"~") D
  1. . . . N PCE S PCE=$P($P(MAGV("PROCMOD"),"~",CT),"|",1),$P(PCES,"~",CT)=PCE
  1. . . . Q
  1. . . Q
  1. . . ;
  1. . ; S MAGV("ORDRSTAT")=$P(RETURN(LINECUR),U,4)
  1. . S MAGV("ORDERDT")=$$FMTE^XLFDT($P(RETURN(LINECUR),U,5),1)
  1. . S MAGV("ORDREASN")=$P(RETURN(LINECUR),U,6)
  1. . S MAGV("EXAMACN")=$P(RETURN(LINECUR),U,9)
  1. . N SS
  1. . F SS="EXAMADC","EXAMCASE","EXAMIEN","EXAMIEN2","EXAMSTAT","CREDMETH","UIDSTUDY" S MAGV(SS)=""
  1. . D:MAGV("EXAMACN")'=""
  1. . . ;
  1. . . ;--- Resolve DAY-CASE, CASE from (Site-)Access'n Number [###-]MMDDYY-#####
  1. . . N ACNL S ACNL=$L(MAGV("EXAMACN"),"-")
  1. . . I ACNL>1 D
  1. . . . S MAGV("EXAMADC")=$P(MAGV("EXAMACN"),"-",ACNL-1,ACNL)
  1. . . E D
  1. . . . S MAGV("EXAMADC")=MAGV("EXAMACN")
  1. . . S MAGV("EXAMCASE")=$P(MAGV("EXAMACN"),"-",ACNL)
  1. . . ;
  1. . . ;--- Resolve examination IEN from DAY-CASE/ACN.
  1. . . N ROOT S ROOT=$NA(^RADPT("ADC",MAGV("EXAMADC"),PATDFN)),ROOT=$Q(@ROOT)
  1. . . Q:$QS(ROOT,1)'="ADC"
  1. . . S MAGV("EXAMIEN")=$QS(ROOT,4)
  1. . . S MAGV("EXAMIEN2")=$QS(ROOT,5)
  1. . . ;
  1. . . ;--- Resolve Examination Status and Credit Method.
  1. . . N EXSTP
  1. . . S EXSTP=$P($G(^RADPT(PATDFN,"DT",MAGV("EXAMIEN"),"P",MAGV("EXAMIEN2"),0)),U,3)
  1. . . S MAGV("EXAMSTAT")=$$GET1^DIQ(72,EXSTP,.01,"E")
  1. . . ;
  1. . . N IENS S IENS=MAGV("EXAMIEN2")_","_MAGV("EXAMIEN")_","_PATDFN_","
  1. . . S MAGV("CREDMETH")=$$GET1^DIQ(70.03,IENS,26,"E")
  1. . . ;
  1. . . ;--- Resolve Study Instance UID
  1. . . S MAGV("UIDSTUDY")=$$GET1^DIQ(70.03,IENS,81)
  1. . . Q
  1. . ;--- IA #10103 (Supported).
  1. . S MAGV("EXAMDATE")=$$FMTE^XLFDT($P(RETURN(LINECUR),U,10),1)
  1. . ;--- IA #2056 (Supported).
  1. . S MAGV("PROCNAME")=$$GET1^DIQ(71,MAGV("PROCIEN"),.01) ; procedure name
  1. . S MAGV("ORDRLOCN")=$$GET1^DIQ(75.1,MAGV("RAOIEN"),22) D
  1. . . ;
  1. . . I MAGV("ORDRLOCN")="" S MAGV("ORDRLOCIEN")="" Q
  1. . . S MAGV("ORDRLOCIEN")=$$GET1^DIQ(75.1,MAGV("RAOIEN"),22,"I")
  1. . . Q
  1. . S LINEOUT=LINEOUT+1
  1. . ;
  1. . S MAGV("ORDRPHYS")=$$GET1^DIQ(75.1,MAGV("RAOIEN"),14,"I") ; Requesting Phys.
  1. . ;
  1. . ;--- Re-order for output.
  1. . S $P(RETURN(LINEOUT),SEPOUTP,1)=OTYPE
  1. . S $P(RETURN(LINEOUT),SEPOUTP,2)=PATDFN
  1. . S $P(RETURN(LINEOUT),SEPOUTP,3)=MAGV("ORDERDT")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,4)=MAGV("ORDREASN")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,5)=MAGV("ORDRLOCN")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,6)=MAGV("EXAMDATE")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,7)=MAGV("EXAMACN")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,8)=MAGV("EXAMSTAT")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,9)=MAGV("PROCIEN")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,10)=MAGV("PROCNAME")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,11)=MAGV("EXAMCASE")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,12)=MAGV("EXAMIEN")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,13)=MAGV("RAOIEN")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,14)=MAGV("EXAMIEN2")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,15)=MAGV("ORDRPHYS")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,16)=MAGV("ORDRLOCIEN")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,17)=MAGV("PROCMOD")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,18)=MAGV("CREDMETH")
  1. . S $P(RETURN(LINEOUT),SEPOUTP,19)=MAGV("UIDSTUDY")
  1. . Q
  1. . ;
  1. S RETURN(0)="0"_SEPSTAT_LINEOUT
  1. Q
  1. ;
  1. ;
  1. ; NOTES
  1. ; =====
  1. ; The case in the LAB DATA file (#63) is defined by three fields:
  1. ; 1) LRDFN - this is the patient ien in the file. It is stored
  1. ; in the PATIENT file (#2) in file 63 (^DPT(DFN,"LR")=LRDFN
  1. ; 2) LRSS -- lab section ("CY", "EM", or "SP"), each has its own subfile
  1. ; See $$GETFILE^MAGT7MA(LRSS) for details
  1. ; 3) LRI --- the is the inverse date/time of the study. The cases are
  1. ; stored in reverse chronological order.
  1. ;
  1. ; There are only two return variables to define the case in the LAB DATA file.
  1. ; 1) EXAMIEN -- this is the subfile number for the corresponding lab section
  1. ; 2) EXAMIEN2 - this is the LRI value, the inverse date/time subsript
  1. ;
  1. ; It is assumed that LRDFN can be obtained from the following code:
  1. ; S LRDFN=$$GET1^DIQ(2,DFN,63,"I")
  1. ;
  1. GETORLAB(PATDFN,ORDRSTRT,ORDRSTOP) ;
  1. ;
  1. N ERROR
  1. N FILE ; ------ LAB DATA file (#63) subfile numbers
  1. N IORDRSTRT ;-- inverted order start date/time
  1. N IORDRSTOP ;-- inverted order stop date/time
  1. N LRDFN ; ----- ien for patient in LAB DATA file (#63)
  1. N LRI ; ------- inverted date/time for LAB DATA file (#63)
  1. N LRSS ; ------ lab section (EM, CY, and SP)
  1. N LRSSIX ;----- index for lab section
  1. N MAGVGBL ; --- pointer to temporary lab data
  1. N A,B,L,L1 ;--- scratch variables from GETS^DIQ
  1. ;
  1. N LINEOUT S LINEOUT=0
  1. K RETURN
  1. ;
  1. S IORDRSTRT=9999999.9999-ORDRSTRT
  1. S IORDRSTOP=9999999.9999-ORDRSTOP-2 ; fudge for $O-ing
  1. ;
  1. S LRDFN=$$GET1^DIQ(2,PATDFN,63)
  1. I 'LRDFN S RETURN(0)=0_SEPSTAT_0 Q
  1. ;
  1. S MAGVGBL=$NA(^TMP("MAG",$J,"MAGVIM02")) K @MAGVGBL
  1. F LRSS="EM","CY","SP" D
  1. . N IENS,LRILIST
  1. . ; get FILE information
  1. . S ERROR=$$GETFILE^MAGT7MA(LRSS)
  1. . K @MAGVGBL
  1. . D GETS^DIQ(63,LRDFN,FILE("FIELD")_"*","I",MAGVGBL,"ERROR")
  1. . S IENS="" F S IENS=$O(@MAGVGBL@(FILE(0),IENS)) Q:IENS="" D
  1. . . S LRILIST($P(IENS,",",1))=""
  1. . . Q
  1. . S LRI=IORDRSTOP ; file 63 is in reverse chronological order
  1. . F S LRI=$O(LRILIST(LRI)) Q:LRI="" Q:(LRI)>IORDRSTRT D
  1. . . D GETLCASE(MAGVGBL,.FILE,LRDFN,LRSS,LRI)
  1. . . Q
  1. . Q
  1. S RETURN(0)="0"_SEPSTAT_LINEOUT
  1. K @MAGVGBL
  1. Q
  1. ;
  1. GETLCASE(MAGVGBL,FILE,LRDFN,LRSS,LRI) ; get the data for one lab case
  1. N ACNUMB,LABTEST,IENS,MAGV,X
  1. S IENS=LRI_","_LRDFN_","
  1. K @MAGVGBL
  1. D GETS^DIQ(FILE(0),IENS,"**","I",MAGVGBL,"ERROR")
  1. S X=$G(@MAGVGBL@(FILE(0),IENS,.01,"I")) ; date/time specimen taken
  1. S MAGV("ORDERDT")=$$FMTE^XLFDT(X)
  1. S MAGV("ORDREASN")="Perform pathology exam on specimen(s)."
  1. S MAGV("ORDRLOCN")=@MAGVGBL@(FILE(0),IENS,.08,"I") ; patient location at order time
  1. S X=$G(@MAGVGBL@(FILE(0),IENS,.1,"I")) ; date/time specimen received in lab
  1. S MAGV("EXAMDATE")=$$FMTE^XLFDT(X)
  1. S (ACNUMB,MAGV("EXAMACN"))=$G(@MAGVGBL@(FILE(0),IENS,.06,"I"))
  1. S X=$G(@MAGVGBL@(FILE(0),IENS,.03,"I")) ; date report completed
  1. S MAGV("EXAMSTAT")=$S(X:"Completed",1:"Active")
  1. D TESTLKUP^MAGT7SB(MAGVGBL,.LABTEST)
  1. S MAGV("PROCIEN")=LABTEST("ID")
  1. S MAGV("PROCNAME")=LABTEST("TEXT")
  1. S MAGV("EXAMCASE")=$P(ACNUMB," ",3)
  1. S MAGV("EXAMIEN")=FILE(0)
  1. S MAGV("RAOIEN")=""
  1. S MAGV("EXAMIEN2")=LRI
  1. S MAGV("ORDRPHYS")=$G(@MAGVGBL@(FILE(0),IENS,.07,"I")) ; surgeon/physician
  1. S MAGV("ORDRLOCIEN")=""
  1. S MAGV("PROCMOD")=""
  1. ;
  1. S LINEOUT=LINEOUT+1
  1. S $P(RETURN(LINEOUT),SEPOUTP,1)="LAB"
  1. S $P(RETURN(LINEOUT),SEPOUTP,2)=PATDFN
  1. S $P(RETURN(LINEOUT),SEPOUTP,3)=MAGV("ORDERDT")
  1. S $P(RETURN(LINEOUT),SEPOUTP,4)=MAGV("ORDREASN")
  1. S $P(RETURN(LINEOUT),SEPOUTP,5)=MAGV("ORDRLOCN")
  1. S $P(RETURN(LINEOUT),SEPOUTP,6)=MAGV("EXAMDATE")
  1. S $P(RETURN(LINEOUT),SEPOUTP,7)=MAGV("EXAMACN")
  1. S $P(RETURN(LINEOUT),SEPOUTP,8)=MAGV("EXAMSTAT")
  1. S $P(RETURN(LINEOUT),SEPOUTP,9)=MAGV("PROCIEN")
  1. S $P(RETURN(LINEOUT),SEPOUTP,10)=MAGV("PROCNAME")
  1. S $P(RETURN(LINEOUT),SEPOUTP,11)=MAGV("EXAMCASE")
  1. S $P(RETURN(LINEOUT),SEPOUTP,12)=MAGV("EXAMIEN")
  1. S $P(RETURN(LINEOUT),SEPOUTP,13)=MAGV("RAOIEN")
  1. S $P(RETURN(LINEOUT),SEPOUTP,14)=MAGV("EXAMIEN2")
  1. S $P(RETURN(LINEOUT),SEPOUTP,15)=MAGV("ORDRPHYS")
  1. S $P(RETURN(LINEOUT),SEPOUTP,16)=MAGV("ORDRLOCIEN")
  1. S $P(RETURN(LINEOUT),SEPOUTP,17)=MAGV("PROCMOD")
  1. Q
  1. ;
  1. ;+++ Routine Utility: Initialize Separators
  1. ZRUSEPIN ;
  1. S SEPOUTP=$$OUTSEP^MAGVIM01
  1. S SEPSTAT=$$STATSEP^MAGVIM01
  1. Q
  1. ;
  1. ; MAGVIM02