MAGSIXG2 ;WOIFO/SG,NST - LIST OF IMAGES RPCS (PARAMETERS) ; 5/11/18 3:52pm
;;3.0;IMAGING;**93,221**;Dec 02, 2009;Build 163
;;Per VHA Directive 2004-038, this routine should not be modified.
;; +---------------------------------------------------------------+
;; | Property of the US Government. |
;; | No permission to copy or redistribute this software is given. |
;; | Use of unreleased versions of this software requires the user |
;; | to execute a written test agreement with the VistA Imaging |
;; | Development Office of the Department of Veterans Affairs, |
;; | telephone (301) 734-0100. |
;; | |
;; | The Food and Drug Administration classifies this software as |
;; | a medical device. As such, it may not be changed in any way. |
;; | Modifications to this software may result in an adulterated |
;; | medical device under 21CFR820, the use of which is considered |
;; | to be a violation of US Federal Statutes. |
;; +---------------------------------------------------------------+
;;
;
; This routine uses the following ICRs:
;
; #10035 Read file #2 (supported)
;
Q
;
;+++++ RETURNS THE HEADER FOR THE RPC RESULT ARRAY
BLDHDR() ;
N HDR,I,TMP
S HDR=""
F I=3:1 S TMP=$P($T(BLDHDR1+I),";;",2) Q:TMP="" D
. S HDR=HDR_U_$$TRIM^XLFSTR($P(TMP,U,2))
. Q
Q $P(HDR,U,2,9999)
;
BLDHDR1 ;+++++ TEMPLATE OF THE HEADER FOR THE RESULT ARRAY
;; # Header Data Description
;;--- -------------- --------------------------------------
;; 1 ^ Item~S2 ^ Sequential number
;; 2 ^ Site ^
;; 3 ^ Note Title~~W0 ^ *
;; 4 ^ Proc DT~S1 ^ Procedure date
;; 5 ^ Procedure ^ Procedure
;; 6 ^ # Img~S2 ^ Number of images
;; 7 ^ Short Desc ^
;; 8 ^ Pkg ^ PACKAGE INDEX (40) - Internal
;; 9 ^ Class ^ CLASS INDEX (41) - External
;; 10 ^ Type ^ TYPE INDEX (42) - External
;; 11 ^ Specialty ^ SPEC/SUBSPEC INDEX (44) - External
;; 12 ^ Event ^ PROC/EVENT INDEX (43) - External
;; 13 ^ Origin ^ ORIGIN INDEX (45)
;; 14 ^ Cap Dt~S1~W0 ^ Capture date
;; 15 ^ Cap by~~W0 ^ User who captured the image
;; 16 ^ Image ID~S2~W0 ^ Image IEN
;
; Notes
; =====
;
; Only the second "^"-column is used to build the header; everything
; else is provided for documentation purposes.
;
Q
;
;+++++ RETURNS DESCRIPTION OF THE IMAGE SELECTION CRITERIA
;
; .MAGFLT Reference to a local variable that stores the image
; selection criteria
;
; FROMDATE Date range
; TODATE
;
; FLAGS Flags that control the image selection
;
; Return Values
; =============
; Description of the image selection criteria.
;
FLTDESC(MAGFLT,FROMDATE,TODATE,FLAGS) ;
N BUF,DTRANGE,FLT,TMP
S FLT=""
;
;--- Package
S:$G(MAGFLT("PKG"))'="" FLT=FLT_"Pkg: "_MAGFLT("PKG")_" - "
;
;--- Class
I $G(MAGFLT("CLS"))'="" D S FLT=FLT_"Class: "_BUF_" - "
. S BUF=MAGFLT("CLS")
. I BUF="ADMIN^ADMIN/CLIN^CLIN/ADMIN" S BUF="ADMIN" Q
. I BUF="CLIN^CLIN/ADMIN^ADMIN/CLIN" S BUF="CLIN" Q
. Q
;
S:$G(MAGFLT("TYPE"))'="" FLT=FLT_"Type: "_MAGFLT("TYPE")_" - "
S:$G(MAGFLT("SPEC"))'="" FLT=FLT_"Spec: "_MAGFLT("SPEC")_" - "
S:$G(MAGFLT("EVT"))'="" FLT=FLT_"Event: "_MAGFLT("EVT")_" - "
S:$G(MAGFLT("ORIG"))'="" FLT=FLT_"Origin: "_MAGFLT("ORIG")_" - "
S:$G(MAGFLT("GDESC"))'="" FLT=FLT_"Descr: '"_MAGFLT("GDESC")_"' - "
;
;--- Image status
S:$G(MAGFLT("ISTAT"))'="" FLT=FLT_"Status: "_MAGFLT("ISTAT")_" - "
;
;--- Controlled image
S:$G(MAGFLT("SENSIMG"))'="" FLT=FLT_"Controlled: "_MAGFLT("SENSIMG")_" - "
;
;--- Capture application
S:$G(MAGFLT("CAPTAPP"))'="" FLT=FLT_"App: "_MAGFLT("CAPTAPP")_" - "
;
;--- Date Range
S DTRANGE=""
S:FROMDATE'="" DTRANGE=DTRANGE_" from "_FROMDATE
S:TODATE'="" DTRANGE=DTRANGE_" to "_TODATE
;
;--- Percentage of sparse subset
S BUF="",TMP=+$G(MAGFLT("SUBSET%"))
S:TMP>0 BUF=$S(TMP<1:"0"_TMP,1:TMP)_"% of "
;
;--- Control flags
I FLT="",DTRANGE="" S BUF=BUF_"all "
S:FLAGS["E" BUF=BUF_"existing "
S:FLAGS["D" BUF=BUF_$S(FLAGS["E":"and ",1:"")_"deleted "
S FLT=FLT_$$SNTC^MAGUTL05(BUF)_"images"
;
;--- User who captured the images
S BUF=$G(MAGFLT("SAVEDBY"))
S:BUF>0 FLT=FLT_" captured by "_$P(BUF,U,2)
;
;--- Append the date range
S FLT=FLT_DTRANGE
S:FLAGS["C" FLT=FLT_" (capture date range)"
;
;---
Q $TR(FLT,"^",",")
;
MISCDEFS ;+++++ DEFINITIONS OF MISCELLANEOUS PARAMETERS
;;==================================================================
;;| Parameter | File |Field|Type |Flags| Comment |
;;|------------+-------+-----+-----+-----+-------------------------|
;;|CAPTAPP | | 8.1| S | | CAPTURE APPLICATION |
;;|CPTCODE | | | | | CPT CODE |
;;|GDESC | | 10 | | | SHORT DESCRIPTION |
;;|IDFN | | 5 | P | | Patient IEN (DFN) |
;;|ISTAT | |113 | S | | STATUS |
;;|IXCLASS | | | P | | CLASS INDEX |
;;|IXORIGIN | | 45 | S | | ORIGIN INDEX |
;;|IXPKG | | 40 | S | | PACKAGE INDEX |
;;|IXPROC | | 43 | P | | PROC/EVENT INDEX |
;;|IXSPEC | | 44 | P | | SPEC/SUBSPEC INDEX |
;;|IXTYPE | | 42 | P | | TYPE INDEX |
;;|MODALITY | | | | | MODALITY |
;;|SAVEDBY | | 8 | P | | Who captured (DUZ) |
;;|SENSIMG | |112 | S | | CONTROLLED IMAGE |
;;==================================================================
;
; Notes
; =====
;
; File numbers are not included to disable automatic validation.
;
Q
;
;+++++ VALIDATES MISCELLANEOUS PARAMETERS
;
; .MISC Reference to a local variable that stores the tree
; of miscellaneous RPC parameters
;
; .MAGFLT Reference to a local variable where the image
; selection criteria is constructed.
;
; Return Values
; =============
; <0 Error code
; 0 Success
;
VALMISC(MISC,MAGFLT) ;
N ERROR,FLAGS,PNODE,RC,VAL
S ERROR=0
;--- Patient IEN (DFN)
S PNODE=$NA(MISC("IDFN")),VAL=$P($G(@PNODE),U)
I VAL'="" D
. I +VAL'=VAL S ERROR=$$IPVE^MAGUERR("VAL",PNODE) Q
. I '($D(^DPT(VAL,0))#2) S ERROR=$$ERROR^MAGUERR(-5,,VAL) Q
. S MAGFLT("IDFN")=VAL
. Q
E S MAGFLT("IDFN")=""
;--- User IEN (DUZ)
S PNODE=$NA(MISC("SAVEDBY")),VAL=$P($G(@PNODE),U)
I VAL'="" D
. N NAME
. I +VAL'=VAL S ERROR=$$IPVE^MAGUERR("VAL",PNODE) Q
. S NAME=$$NAME^XUSER(VAL,"F")
. I NAME="" S ERROR=$$IPVE^MAGUERR("VAL",PNODE) Q
. S MAGFLT("SAVEDBY")=VAL_U_NAME
. Q
E S MAGFLT("SAVEDBY")=""
;--- Capture application
S VAL=$G(MISC("CAPTAPP"))
S RC=$$VALCNLST^MAGUTL06(VAL,2005,8.1,$NA(MAGFLT("CAPTAPP")))
I RC D:RC>0 ERROR^MAGUERR(-42,,$P(VAL,U,RC)) S ERROR=1
;--- Short description
S VAL=$G(MISC("GDESC"))
S:VAL'="" MAGFLT("GDESC")=$$UP^XLFSTR(VAL)
;--- Status
S VAL=$G(MISC("ISTAT"))
S RC=$$VALCNLST^MAGUTL06(VAL,2005,113,$NA(MAGFLT("ISTAT")),"Z")
I RC D:RC>0 ERROR^MAGUERR(-31,,$P(VAL,U,RC)) S ERROR=1
;--- Controlled image
S VAL=$G(MISC("SENSIMG"))
S RC=$$VALCNLST^MAGUTL06(VAL,2005,112,$NA(MAGFLT("SENSIMG")))
I RC D:RC>0 ERROR^MAGUERR(-32,,$P(VAL,U,RC)) S ERROR=1
;--- Package
S VAL=$G(MISC("IXPKG"))
S RC=$$VALCNLST^MAGUTL06(VAL,2005,40,$NA(MAGFLT("PKG")))
I RC D:RC>0 ERROR^MAGUERR(-11,,$P(VAL,U,RC)) S ERROR=1
;--- Class
S VAL=$G(MISC("IXCLASS"))
S RC=$$VALPNLST^MAGUTL06(VAL,2005.82,$NA(MAGFLT("CLS")),"C")
I RC D:RC>0 ERROR^MAGUERR(-12,,$P(VAL,U,RC)) S ERROR=1
;--- Type
S VAL=$G(MISC("IXTYPE"))
S RC=$$VALPNLST^MAGUTL06(VAL,2005.83,$NA(MAGFLT("TYPE")),"C")
I RC D:RC>0 ERROR^MAGUERR(-13,,$P(VAL,U,RC)) S ERROR=1
;--- Event
S VAL=$G(MISC("IXPROC"))
S RC=$$VALPNLST^MAGUTL06(VAL,2005.85,$NA(MAGFLT("EVT")),"C")
I RC D:RC>0 ERROR^MAGUERR(-14,,$P(VAL,U,RC)) S ERROR=1
;--- Origin
S VAL=$G(MISC("IXORIGIN"))
S RC=$$VALCNLST^MAGUTL06(VAL,2005,45,$NA(MAGFLT("ORIG")))
I RC D:RC>0 ERROR^MAGUERR(-15,,$P(VAL,U,RC)) S ERROR=1
;--- Specialty (patch 59: for capture we don't want subspecialties)
S FLAGS=$S('$D(MAGJOB("CAPTURE")):"S",1:"")
S VAL=$G(MISC("IXSPEC"))
S RC=$$VALSPECS(VAL,$NA(MAGFLT("SPEC")),FLAGS)
I RC D:RC>0 ERROR^MAGUERR(-16,,$P(VAL,U,RC)) S ERROR=1
;--- CPT Code
S VAL=$G(MISC("CPTCODE"))
S RC=$$VALCNLST^MAGUTL06(VAL,71,9,$NA(MAGFLT("CPTCODE")))
I RC D:RC>0 ERROR^MAGUERR(-15,,$P(VAL,U,RC)) S ERROR=1
;--- Modality
S VAL=$G(MISC("MODALITY"))
S RC=$$VALCNLST^MAGUTL06(VAL,2005,6,$NA(MAGFLT("MODALITY")))
I RC D:RC>0 ERROR^MAGUERR(-15,,$P(VAL,U,RC)) S ERROR=1
;---
Q $S(ERROR:-30,1:0)
;
;+++++ VALIDATES THE LIST OF SPECIALTIES
VALSPECS(PTNMLIST,MAG8NODE,FLAGS) ;
N IEN,RC,SPIEN,XREF
S RC=$$VALPNLST^MAGUTL06(PTNMLIST,2005.84,MAG8NODE,"C") Q:RC RC
Q:$G(FLAGS)'["S" 0
;--- Add subspecialties if requested
S XREF=$$ROOT^DILFD(2005.84,,1),XREF=$NA(@XREF@("ASPEC"))
S SPIEN=""
F S SPIEN=$O(@MAG8NODE@(SPIEN)) Q:SPIEN="" D:$D(@XREF@(SPIEN))
. S IEN=""
. F S IEN=$O(@XREF@(SPIEN,IEN)) Q:IEN="" S @MAG8NODE@(IEN)=""
. Q
;--- Success
Q 0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGSIXG2 9710 printed Oct 16, 2024@18:09:04 Page 2
MAGSIXG2 ;WOIFO/SG,NST - LIST OF IMAGES RPCS (PARAMETERS) ; 5/11/18 3:52pm
+1 ;;3.0;IMAGING;**93,221**;Dec 02, 2009;Build 163
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;; +---------------------------------------------------------------+
+4 ;; | Property of the US Government. |
+5 ;; | No permission to copy or redistribute this software is given. |
+6 ;; | Use of unreleased versions of this software requires the user |
+7 ;; | to execute a written test agreement with the VistA Imaging |
+8 ;; | Development Office of the Department of Veterans Affairs, |
+9 ;; | telephone (301) 734-0100. |
+10 ;; | |
+11 ;; | The Food and Drug Administration classifies this software as |
+12 ;; | a medical device. As such, it may not be changed in any way. |
+13 ;; | Modifications to this software may result in an adulterated |
+14 ;; | medical device under 21CFR820, the use of which is considered |
+15 ;; | to be a violation of US Federal Statutes. |
+16 ;; +---------------------------------------------------------------+
+17 ;;
+18 ;
+19 ; This routine uses the following ICRs:
+20 ;
+21 ; #10035 Read file #2 (supported)
+22 ;
+23 QUIT
+24 ;
+25 ;+++++ RETURNS THE HEADER FOR THE RPC RESULT ARRAY
BLDHDR() ;
+1 NEW HDR,I,TMP
+2 SET HDR=""
+3 FOR I=3:1
SET TMP=$PIECE($TEXT(BLDHDR1+I),";;",2)
if TMP=""
QUIT
Begin DoDot:1
+4 SET HDR=HDR_U_$$TRIM^XLFSTR($PIECE(TMP,U,2))
+5 QUIT
End DoDot:1
+6 QUIT $PIECE(HDR,U,2,9999)
+7 ;
BLDHDR1 ;+++++ TEMPLATE OF THE HEADER FOR THE RESULT ARRAY
+1 ;; # Header Data Description
+2 ;;--- -------------- --------------------------------------
+3 ;; 1 ^ Item~S2 ^ Sequential number
+4 ;; 2 ^ Site ^
+5 ;; 3 ^ Note Title~~W0 ^ *
+6 ;; 4 ^ Proc DT~S1 ^ Procedure date
+7 ;; 5 ^ Procedure ^ Procedure
+8 ;; 6 ^ # Img~S2 ^ Number of images
+9 ;; 7 ^ Short Desc ^
+10 ;; 8 ^ Pkg ^ PACKAGE INDEX (40) - Internal
+11 ;; 9 ^ Class ^ CLASS INDEX (41) - External
+12 ;; 10 ^ Type ^ TYPE INDEX (42) - External
+13 ;; 11 ^ Specialty ^ SPEC/SUBSPEC INDEX (44) - External
+14 ;; 12 ^ Event ^ PROC/EVENT INDEX (43) - External
+15 ;; 13 ^ Origin ^ ORIGIN INDEX (45)
+16 ;; 14 ^ Cap Dt~S1~W0 ^ Capture date
+17 ;; 15 ^ Cap by~~W0 ^ User who captured the image
+18 ;; 16 ^ Image ID~S2~W0 ^ Image IEN
+19 ;
+20 ; Notes
+21 ; =====
+22 ;
+23 ; Only the second "^"-column is used to build the header; everything
+24 ; else is provided for documentation purposes.
+25 ;
+26 QUIT
+27 ;
+28 ;+++++ RETURNS DESCRIPTION OF THE IMAGE SELECTION CRITERIA
+29 ;
+30 ; .MAGFLT Reference to a local variable that stores the image
+31 ; selection criteria
+32 ;
+33 ; FROMDATE Date range
+34 ; TODATE
+35 ;
+36 ; FLAGS Flags that control the image selection
+37 ;
+38 ; Return Values
+39 ; =============
+40 ; Description of the image selection criteria.
+41 ;
FLTDESC(MAGFLT,FROMDATE,TODATE,FLAGS) ;
+1 NEW BUF,DTRANGE,FLT,TMP
+2 SET FLT=""
+3 ;
+4 ;--- Package
+5 if $GET(MAGFLT("PKG"))'=""
SET FLT=FLT_"Pkg: "_MAGFLT("PKG")_" - "
+6 ;
+7 ;--- Class
+8 IF $GET(MAGFLT("CLS"))'=""
Begin DoDot:1
+9 SET BUF=MAGFLT("CLS")
+10 IF BUF="ADMIN^ADMIN/CLIN^CLIN/ADMIN"
SET BUF="ADMIN"
QUIT
+11 IF BUF="CLIN^CLIN/ADMIN^ADMIN/CLIN"
SET BUF="CLIN"
QUIT
+12 QUIT
End DoDot:1
SET FLT=FLT_"Class: "_BUF_" - "
+13 ;
+14 if $GET(MAGFLT("TYPE"))'=""
SET FLT=FLT_"Type: "_MAGFLT("TYPE")_" - "
+15 if $GET(MAGFLT("SPEC"))'=""
SET FLT=FLT_"Spec: "_MAGFLT("SPEC")_" - "
+16 if $GET(MAGFLT("EVT"))'=""
SET FLT=FLT_"Event: "_MAGFLT("EVT")_" - "
+17 if $GET(MAGFLT("ORIG"))'=""
SET FLT=FLT_"Origin: "_MAGFLT("ORIG")_" - "
+18 if $GET(MAGFLT("GDESC"))'=""
SET FLT=FLT_"Descr: '"_MAGFLT("GDESC")_"' - "
+19 ;
+20 ;--- Image status
+21 if $GET(MAGFLT("ISTAT"))'=""
SET FLT=FLT_"Status: "_MAGFLT("ISTAT")_" - "
+22 ;
+23 ;--- Controlled image
+24 if $GET(MAGFLT("SENSIMG"))'=""
SET FLT=FLT_"Controlled: "_MAGFLT("SENSIMG")_" - "
+25 ;
+26 ;--- Capture application
+27 if $GET(MAGFLT("CAPTAPP"))'=""
SET FLT=FLT_"App: "_MAGFLT("CAPTAPP")_" - "
+28 ;
+29 ;--- Date Range
+30 SET DTRANGE=""
+31 if FROMDATE'=""
SET DTRANGE=DTRANGE_" from "_FROMDATE
+32 if TODATE'=""
SET DTRANGE=DTRANGE_" to "_TODATE
+33 ;
+34 ;--- Percentage of sparse subset
+35 SET BUF=""
SET TMP=+$GET(MAGFLT("SUBSET%"))
+36 if TMP>0
SET BUF=$SELECT(TMP<1:"0"_TMP,1:TMP)_"% of "
+37 ;
+38 ;--- Control flags
+39 IF FLT=""
IF DTRANGE=""
SET BUF=BUF_"all "
+40 if FLAGS["E"
SET BUF=BUF_"existing "
+41 if FLAGS["D"
SET BUF=BUF_$SELECT(FLAGS["E":"and ",1:"")_"deleted "
+42 SET FLT=FLT_$$SNTC^MAGUTL05(BUF)_"images"
+43 ;
+44 ;--- User who captured the images
+45 SET BUF=$GET(MAGFLT("SAVEDBY"))
+46 if BUF>0
SET FLT=FLT_" captured by "_$PIECE(BUF,U,2)
+47 ;
+48 ;--- Append the date range
+49 SET FLT=FLT_DTRANGE
+50 if FLAGS["C"
SET FLT=FLT_" (capture date range)"
+51 ;
+52 ;---
+53 QUIT $TRANSLATE(FLT,"^",",")
+54 ;
MISCDEFS ;+++++ DEFINITIONS OF MISCELLANEOUS PARAMETERS
+1 ;;==================================================================
+2 ;;| Parameter | File |Field|Type |Flags| Comment |
+3 ;;|------------+-------+-----+-----+-----+-------------------------|
+4 ;;|CAPTAPP | | 8.1| S | | CAPTURE APPLICATION |
+5 ;;|CPTCODE | | | | | CPT CODE |
+6 ;;|GDESC | | 10 | | | SHORT DESCRIPTION |
+7 ;;|IDFN | | 5 | P | | Patient IEN (DFN) |
+8 ;;|ISTAT | |113 | S | | STATUS |
+9 ;;|IXCLASS | | | P | | CLASS INDEX |
+10 ;;|IXORIGIN | | 45 | S | | ORIGIN INDEX |
+11 ;;|IXPKG | | 40 | S | | PACKAGE INDEX |
+12 ;;|IXPROC | | 43 | P | | PROC/EVENT INDEX |
+13 ;;|IXSPEC | | 44 | P | | SPEC/SUBSPEC INDEX |
+14 ;;|IXTYPE | | 42 | P | | TYPE INDEX |
+15 ;;|MODALITY | | | | | MODALITY |
+16 ;;|SAVEDBY | | 8 | P | | Who captured (DUZ) |
+17 ;;|SENSIMG | |112 | S | | CONTROLLED IMAGE |
+18 ;;==================================================================
+19 ;
+20 ; Notes
+21 ; =====
+22 ;
+23 ; File numbers are not included to disable automatic validation.
+24 ;
+25 QUIT
+26 ;
+27 ;+++++ VALIDATES MISCELLANEOUS PARAMETERS
+28 ;
+29 ; .MISC Reference to a local variable that stores the tree
+30 ; of miscellaneous RPC parameters
+31 ;
+32 ; .MAGFLT Reference to a local variable where the image
+33 ; selection criteria is constructed.
+34 ;
+35 ; Return Values
+36 ; =============
+37 ; <0 Error code
+38 ; 0 Success
+39 ;
VALMISC(MISC,MAGFLT) ;
+1 NEW ERROR,FLAGS,PNODE,RC,VAL
+2 SET ERROR=0
+3 ;--- Patient IEN (DFN)
+4 SET PNODE=$NAME(MISC("IDFN"))
SET VAL=$PIECE($GET(@PNODE),U)
+5 IF VAL'=""
Begin DoDot:1
+6 IF +VAL'=VAL
SET ERROR=$$IPVE^MAGUERR("VAL",PNODE)
QUIT
+7 IF '($DATA(^DPT(VAL,0))#2)
SET ERROR=$$ERROR^MAGUERR(-5,,VAL)
QUIT
+8 SET MAGFLT("IDFN")=VAL
+9 QUIT
End DoDot:1
+10 IF '$TEST
SET MAGFLT("IDFN")=""
+11 ;--- User IEN (DUZ)
+12 SET PNODE=$NAME(MISC("SAVEDBY"))
SET VAL=$PIECE($GET(@PNODE),U)
+13 IF VAL'=""
Begin DoDot:1
+14 NEW NAME
+15 IF +VAL'=VAL
SET ERROR=$$IPVE^MAGUERR("VAL",PNODE)
QUIT
+16 SET NAME=$$NAME^XUSER(VAL,"F")
+17 IF NAME=""
SET ERROR=$$IPVE^MAGUERR("VAL",PNODE)
QUIT
+18 SET MAGFLT("SAVEDBY")=VAL_U_NAME
+19 QUIT
End DoDot:1
+20 IF '$TEST
SET MAGFLT("SAVEDBY")=""
+21 ;--- Capture application
+22 SET VAL=$GET(MISC("CAPTAPP"))
+23 SET RC=$$VALCNLST^MAGUTL06(VAL,2005,8.1,$NAME(MAGFLT("CAPTAPP")))
+24 IF RC
if RC>0
DO ERROR^MAGUERR(-42,,$PIECE(VAL,U,RC))
SET ERROR=1
+25 ;--- Short description
+26 SET VAL=$GET(MISC("GDESC"))
+27 if VAL'=""
SET MAGFLT("GDESC")=$$UP^XLFSTR(VAL)
+28 ;--- Status
+29 SET VAL=$GET(MISC("ISTAT"))
+30 SET RC=$$VALCNLST^MAGUTL06(VAL,2005,113,$NAME(MAGFLT("ISTAT")),"Z")
+31 IF RC
if RC>0
DO ERROR^MAGUERR(-31,,$PIECE(VAL,U,RC))
SET ERROR=1
+32 ;--- Controlled image
+33 SET VAL=$GET(MISC("SENSIMG"))
+34 SET RC=$$VALCNLST^MAGUTL06(VAL,2005,112,$NAME(MAGFLT("SENSIMG")))
+35 IF RC
if RC>0
DO ERROR^MAGUERR(-32,,$PIECE(VAL,U,RC))
SET ERROR=1
+36 ;--- Package
+37 SET VAL=$GET(MISC("IXPKG"))
+38 SET RC=$$VALCNLST^MAGUTL06(VAL,2005,40,$NAME(MAGFLT("PKG")))
+39 IF RC
if RC>0
DO ERROR^MAGUERR(-11,,$PIECE(VAL,U,RC))
SET ERROR=1
+40 ;--- Class
+41 SET VAL=$GET(MISC("IXCLASS"))
+42 SET RC=$$VALPNLST^MAGUTL06(VAL,2005.82,$NAME(MAGFLT("CLS")),"C")
+43 IF RC
if RC>0
DO ERROR^MAGUERR(-12,,$PIECE(VAL,U,RC))
SET ERROR=1
+44 ;--- Type
+45 SET VAL=$GET(MISC("IXTYPE"))
+46 SET RC=$$VALPNLST^MAGUTL06(VAL,2005.83,$NAME(MAGFLT("TYPE")),"C")
+47 IF RC
if RC>0
DO ERROR^MAGUERR(-13,,$PIECE(VAL,U,RC))
SET ERROR=1
+48 ;--- Event
+49 SET VAL=$GET(MISC("IXPROC"))
+50 SET RC=$$VALPNLST^MAGUTL06(VAL,2005.85,$NAME(MAGFLT("EVT")),"C")
+51 IF RC
if RC>0
DO ERROR^MAGUERR(-14,,$PIECE(VAL,U,RC))
SET ERROR=1
+52 ;--- Origin
+53 SET VAL=$GET(MISC("IXORIGIN"))
+54 SET RC=$$VALCNLST^MAGUTL06(VAL,2005,45,$NAME(MAGFLT("ORIG")))
+55 IF RC
if RC>0
DO ERROR^MAGUERR(-15,,$PIECE(VAL,U,RC))
SET ERROR=1
+56 ;--- Specialty (patch 59: for capture we don't want subspecialties)
+57 SET FLAGS=$SELECT('$DATA(MAGJOB("CAPTURE")):"S",1:"")
+58 SET VAL=$GET(MISC("IXSPEC"))
+59 SET RC=$$VALSPECS(VAL,$NAME(MAGFLT("SPEC")),FLAGS)
+60 IF RC
if RC>0
DO ERROR^MAGUERR(-16,,$PIECE(VAL,U,RC))
SET ERROR=1
+61 ;--- CPT Code
+62 SET VAL=$GET(MISC("CPTCODE"))
+63 SET RC=$$VALCNLST^MAGUTL06(VAL,71,9,$NAME(MAGFLT("CPTCODE")))
+64 IF RC
if RC>0
DO ERROR^MAGUERR(-15,,$PIECE(VAL,U,RC))
SET ERROR=1
+65 ;--- Modality
+66 SET VAL=$GET(MISC("MODALITY"))
+67 SET RC=$$VALCNLST^MAGUTL06(VAL,2005,6,$NAME(MAGFLT("MODALITY")))
+68 IF RC
if RC>0
DO ERROR^MAGUERR(-15,,$PIECE(VAL,U,RC))
SET ERROR=1
+69 ;---
+70 QUIT $SELECT(ERROR:-30,1:0)
+71 ;
+72 ;+++++ VALIDATES THE LIST OF SPECIALTIES
VALSPECS(PTNMLIST,MAG8NODE,FLAGS) ;
+1 NEW IEN,RC,SPIEN,XREF
+2 SET RC=$$VALPNLST^MAGUTL06(PTNMLIST,2005.84,MAG8NODE,"C")
if RC
QUIT RC
+3 if $GET(FLAGS)'["S"
QUIT 0
+4 ;--- Add subspecialties if requested
+5 SET XREF=$$ROOT^DILFD(2005.84,,1)
SET XREF=$NAME(@XREF@("ASPEC"))
+6 SET SPIEN=""
+7 FOR
SET SPIEN=$ORDER(@MAG8NODE@(SPIEN))
if SPIEN=""
QUIT
if $DATA(@XREF@(SPIEN))
Begin DoDot:1
+8 SET IEN=""
+9 FOR
SET IEN=$ORDER(@XREF@(SPIEN,IEN))
if IEN=""
QUIT
SET @MAG8NODE@(IEN)=""
+10 QUIT
End DoDot:1
+11 ;--- Success
+12 QUIT 0