MAGVCLN1 ;WOIFO/DAC - File 2005.6X Duplicate Removal Utility ; Feb 22, 2022@21:12:01
;;3.0;IMAGING;**278**;Mar 19, 2002;Build 138
;; Per VA Directive 6402, 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. |
;; +---------------------------------------------------------------+
;;
Q
;
MSG(DELETE,MAGQ) ; Display intro message
N DIR,DELOPT,IDOPT,Y
S DELOPT="Resolve HDIG Problem Records [MAGV RESOLVE PROBLEMS]"
S IDOPT="Search For HDIG Problem Records [MAGV SEARCH PROBLEMS]"
W !!
S DIR("A",1)="This option will "_$S($G(DELETE):"set as INACCESSIBLE",1:"identify")_" records from 2005.6x Imaging files that"
S DIR("A",2)="meet either of the following conditions:"
S DIR("A",3)=""
S DIR("A",4)=" 1) Duplicate records containing the same key field (.01) value."
S DIR("A",5)=" 2) Records with a missing or invalid pointer to its parent record."
S DIR("A",6)=""
S DIR("A",7)="The "_$S($G(DELETE):"records marked INACCESSIBLE",1:"identified records")_" will be displayed to the selected output device,"
S DIR("A",8)="and also captured in the NEW IMAGING FILE CLEANUP LOG file (#2005.67)."
S DIR("A",9)=""
S DIR("A",10)="To "_$S($G(DELETE):"identify the records without modifying them, please use the option",1:"mark records INACCESSIBLE after they've been identified, please use option")
S DIR("A",11)=$S($G(DELETE):IDOPT,1:DELOPT)_"."
S DIR("A",12)=""
S DIR("A")="Would you like to continue "_$S($G(DELETE):"marking the problem records INACCESSIBLE",1:"identifying the problem records")
S DIR("B")="N",DIR(0)="Y" D ^DIR
S MAGQ=$S($G(Y):0,1:1)
Q
;
DEVICE(DELETE,MAGQUIT,MAGQUE,MAGSCR) ; Request Device Information
N %ZIS,IOP,ZTSK,ZTRTN,ZTIO,ZTDESC,ZTSAVE,POP,RTN,VAR
K IO("Q")
S %ZIS="QM"
S (MAGQUE,MAGQUIT)=0
W ! D ^%ZIS
I POP S MAGQUIT=1 Q
S MAGSCR=$S($E($G(IOST),1,2)="C-":1,1:0)
I $D(IO("Q")) D S MAGQUE=1
. S RTN=$P($T(+1)," ",1)
. S ZTRTN="IDDEL^"_RTN_"(DELETE)"
. S ZTIO=ION
. S ZTSAVE("MAG**")=""
. S ZTSAVE("DELETE")=""
. S ZTDESC="IMAGING DATABASE CLEANUP"
. D ^%ZTLOAD
. W !,$S($D(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
. D HOME^%ZIS
U IO
Q
CONT ; Continue
W ! K DIR("A") S DIR(0)="E" D ^DIR K DIR
Q
;
GETP(FILE,IEN) ; Get Patient Reference from File entry
N PTR1,PTR2
I '$G(FILE)!'$G(IEN) Q ""
I FILE=2005.6 Q $P($G(^MAGV(2005.6,+IEN,0)),"^")
I FILE=2005.61 Q $$GETP61(IEN)
I FILE=2005.62 Q $$GETP62(IEN)
I FILE=2005.63 Q $$GETP63(IEN)
I FILE=2005.64 Q $$GETP64(IEN)
I FILE=2005.65 Q $$GETP65(IEN)
Q ""
;
GETP61(IEN) ; Get Patient Reference from file 2005.61
N PTR6
S PTR6=$P($G(^MAGV(2005.61,+$G(IEN),6)),"^")
Q $P($G(^MAGV(2005.6,+PTR6,0)),"^")
;
GETP62(IEN) ; Get Patient Reference from file 2005.62
N PTR6
S PTR6=$P($G(^MAGV(2005.62,+$G(IEN),6)),"^",3)
Q:PTR6=""!(PTR6'=+PTR6) ""
Q $P($G(^MAGV(2005.6,PTR6,0)),"^")
;
GETP63(IEN) ; Get Patient Reference from file 2005.63
N PTR62
S PTR62=$P($G(^MAGV(2005.63,+$G(IEN),6)),"^")
Q $$GETP62(PTR62)
;
GETP64(IEN) ; Get Patient Reference from file 2005.64
N PTR63
S PTR63=$P($G(^MAGV(2005.64,+$G(IEN),6)),"^")
Q $$GETP63(PTR63)
;
GETP65(IEN) ; Get Patient Reference from file 2005.64
N PTR64
S PTR64=$P($G(^MAGV(2005.65,+$G(IEN),6)),"^")
Q $$GETP64(PTR64)
;
TMPMSG(DELETE) ; Send MailMan LOG REPORT
N XMSUB,XMDUZ,MAGXMD,XMY
S MAGXMD="MAGVCLN"
S XMSUB=$S($G(DELETE):"Resolve",1:"Search")_" Imaging Problem Records "_$$FMTE^XLFDT(DT,"5DZ"),XMDUZ=$S($G(DUZ):DUZ,1:.5)
S XMY(XMDUZ)="",XMY("G.MAG SERVER")=""
N DIFROM S XMTEXT="^TMP("""_MAGXMD_""","_$J_"," D ^XMD K DIFROM
K XMTEXT
Q
;
MSGHDR(MAGLICNT,DELETE) ; Output header for Mailman - when run silently (as in post-install)
S ^TMP("MAGVCLN",$J,+$G(MAGLICNT))=" MAGV "_$S($G(DELETE):"RESOLVE PROBLEM RECORDS",1:"SEARCH FOR PROBLEM RECORDS"),MAGLICNT=MAGLICNT+1
S ^TMP("MAGVCLN",$J,MAGLICNT)=" Problem records in files 2005.6x "_$S($G(DELETE):"resolved ",1:"identified ")_"by the MAG*3.0*278",MAGLICNT=MAGLICNT+1
S ^TMP("MAGVCLN",$J,MAGLICNT)=" post-installation process are displayed below.",MAGLICNT=MAGLICNT+1
S ^TMP("MAGVCLN",$J,MAGLICNT)="",MAGLICNT=MAGLICNT+1
S ^TMP("MAGVCLN",$J,MAGLICNT)="Non-Primary "
Q
;
OUTPUT(TEXT,MAGBLF,MAGALF,MAGPOST) ; Output a line of TEXT
; TEXT= Line of text
; MAGBLF = Number of 'before' line feeds
; MAGALF = Number of 'after' line feeds
; MAGPOST = Called as post-install routine, output mailed to DUZ
;
N MAGMAXLF,MAGDONE,MAGCNT
S MAGDONE=0,MAGCNT=0
S MAGMAXLF=10 ; Max number of line feeds
I $G(MAGBLF)>0 D
. F MAGCNT=1:1:MAGBLF Q:$G(MAGDONE) D
. . I MAGCNT>MAGMAXLF S MAGDONE=1 Q
. . I '$G(MAGPOST) W !
. . I $G(MAGPOST) S ^TMP("MAGVCLN",$J,+$G(MAGLICNT))="",MAGLICNT=$G(MAGLICNT)+1
I '$G(MAGPOST) W !,TEXT
I $G(MAGPOST) S ^TMP("MAGVCLN",$J,+$G(MAGLICNT))=TEXT,MAGLICNT=$G(MAGLICNT)+1
S MAGDONE=0
I $G(MAGALF)>0 D
. F MAGCNT=1:1:MAGBLF Q:$G(MAGDONE) D
. . I MAGCNT>MAGMAXLF S MAGDONE=1 Q
. . I '$G(MAGPOST) W !
. . I $G(MAGPOST) S ^TMP("MAGVCLN",$J,+$G(MAGLICNT))="",MAGLICNT=$G(MAGLICNT)+1
;
Q
AUDIT(KEY,FILE,IEN,ORIGIEN,REASON,ACTION,DELIEN,ORIGAOF,DUPEIEN) ; Audit File for Problem Records?
N MAGFDA,MAGMSG,LOGIEN,LOGFIEN
Q:KEY=""
Q:IEN=""
S ACTION=$S($G(ACTION)="MI":"MI",$G(ACTION)="MC":"MC",$G(ACTION):"SI",1:"I")
;
K MAGFDA,MAGMSG
S MAGFDA(2005.67,"+1,",.01)=IEN
S MAGFDA(2005.67,"+1,",1)=FILE
S MAGFDA(2005.67,"+1,",2)=$G(ORIGIEN)
S MAGFDA(2005.67,"+1,",3)=REASON
S MAGFDA(2005.67,"+1,",4)=ACTION
S MAGFDA(2005.67,"+1,",5)=$$NOW^XLFDT
S MAGFDA(2005.67,"+1,",6)=KEY
I $L($G(DELIEN)) S MAGFDA(2005.67,"+1,",7)=$G(DELIEN)
I $L($G(ORIGAOF)) S MAGFDA(2005.67,"+1,",8)=ORIGAOF
I $L($G(ORIGAOF)) S MAGFDA(2005.67,"+1,",9)=DUPEIEN
;
; Reason Codes:
; 1 - Duplicate
; 2 - No Parent Record Pointer
; 3 - Invalid Parent Record Pointer
; 4 - No Patient Ref Pointer
; 5 - Invalid Patient Ref Pointer
; 6 - Duplicate Parent Reference
;
D UPDATE^DIE("","MAGFDA","","MAGMSG")
K MAGFDA
Q
;
PATNAME(FILE,IEN) ; Get patient name from 2005.6x file
N PATIEN,PATNAME,MAGPATID,MAGPATIEN
I FILE'["2005.6" Q "UNKNOWN"
S MAGPATID=$$GETP^MAGVCLN1(FILE,IEN)
I 'MAGPATID Q "UNKNOWN"
S MAGPATIEN=$O(^MAGV(2005.6,"B",MAGPATID,0))
I 'MAGPATIEN Q "UNKNOWN"
S PATNAME=$$GET1^DIQ(2005.6,MAGPATIEN_",",3)
S:'$L(PATNAME) PATNAME="UNKNOWN"
Q PATNAME
;
PATMAGID(FILE,IEN) ; Get ENTERPRISE PATIENT ID file (#2005.6) ID
N PATIEN,PATNAME,MAGPATID,MAGPATIEN
I FILE'["2005.6" Q "UNKNOWN"
S MAGPATID=$$GETP^MAGVCLN1(FILE,IEN)
I 'MAGPATID Q "UNKNOWN"
Q MAGPATID
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGVCLN1 7487 printed Dec 13, 2024@02:09:33 Page 2
MAGVCLN1 ;WOIFO/DAC - File 2005.6X Duplicate Removal Utility ; Feb 22, 2022@21:12:01
+1 ;;3.0;IMAGING;**278**;Mar 19, 2002;Build 138
+2 ;; Per VA Directive 6402, 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 ;; | The Food and Drug Administration classifies this software as |
+11 ;; | a medical device. As such, it may not be changed in any way. |
+12 ;; | Modifications to this software may result in an adulterated |
+13 ;; | medical device under 21CFR820, the use of which is considered |
+14 ;; | to be a violation of US Federal Statutes. |
+15 ;; +---------------------------------------------------------------+
+16 ;;
+17 QUIT
+18 ;
MSG(DELETE,MAGQ) ; Display intro message
+1 NEW DIR,DELOPT,IDOPT,Y
+2 SET DELOPT="Resolve HDIG Problem Records [MAGV RESOLVE PROBLEMS]"
+3 SET IDOPT="Search For HDIG Problem Records [MAGV SEARCH PROBLEMS]"
+4 WRITE !!
+5 SET DIR("A",1)="This option will "_$SELECT($GET(DELETE):"set as INACCESSIBLE",1:"identify")_" records from 2005.6x Imaging files that"
+6 SET DIR("A",2)="meet either of the following conditions:"
+7 SET DIR("A",3)=""
+8 SET DIR("A",4)=" 1) Duplicate records containing the same key field (.01) value."
+9 SET DIR("A",5)=" 2) Records with a missing or invalid pointer to its parent record."
+10 SET DIR("A",6)=""
+11 SET DIR("A",7)="The "_$SELECT($GET(DELETE):"records marked INACCESSIBLE",1:"identified records")_" will be displayed to the selected output device,"
+12 SET DIR("A",8)="and also captured in the NEW IMAGING FILE CLEANUP LOG file (#2005.67)."
+13 SET DIR("A",9)=""
+14 SET DIR("A",10)="To "_$SELECT($GET(DELETE):"identify the records without modifying them, please use the option",1:"mark records INACCESSIBLE after they've been identified, please use option")
+15 SET DIR("A",11)=$SELECT($GET(DELETE):IDOPT,1:DELOPT)_"."
+16 SET DIR("A",12)=""
+17 SET DIR("A")="Would you like to continue "_$SELECT($GET(DELETE):"marking the problem records INACCESSIBLE",1:"identifying the problem records")
+18 SET DIR("B")="N"
SET DIR(0)="Y"
DO ^DIR
+19 SET MAGQ=$SELECT($GET(Y):0,1:1)
+20 QUIT
+21 ;
DEVICE(DELETE,MAGQUIT,MAGQUE,MAGSCR) ; Request Device Information
+1 NEW %ZIS,IOP,ZTSK,ZTRTN,ZTIO,ZTDESC,ZTSAVE,POP,RTN,VAR
+2 KILL IO("Q")
+3 SET %ZIS="QM"
+4 SET (MAGQUE,MAGQUIT)=0
+5 WRITE !
DO ^%ZIS
+6 IF POP
SET MAGQUIT=1
QUIT
+7 SET MAGSCR=$SELECT($EXTRACT($GET(IOST),1,2)="C-":1,1:0)
+8 IF $DATA(IO("Q"))
Begin DoDot:1
+9 SET RTN=$PIECE($TEXT(+1)," ",1)
+10 SET ZTRTN="IDDEL^"_RTN_"(DELETE)"
+11 SET ZTIO=ION
+12 SET ZTSAVE("MAG**")=""
+13 SET ZTSAVE("DELETE")=""
+14 SET ZTDESC="IMAGING DATABASE CLEANUP"
+15 DO ^%ZTLOAD
+16 WRITE !,$SELECT($DATA(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
+17 DO HOME^%ZIS
End DoDot:1
SET MAGQUE=1
+18 USE IO
+19 QUIT
CONT ; Continue
+1 WRITE !
KILL DIR("A")
SET DIR(0)="E"
DO ^DIR
KILL DIR
+2 QUIT
+3 ;
GETP(FILE,IEN) ; Get Patient Reference from File entry
+1 NEW PTR1,PTR2
+2 IF '$GET(FILE)!'$GET(IEN)
QUIT ""
+3 IF FILE=2005.6
QUIT $PIECE($GET(^MAGV(2005.6,+IEN,0)),"^")
+4 IF FILE=2005.61
QUIT $$GETP61(IEN)
+5 IF FILE=2005.62
QUIT $$GETP62(IEN)
+6 IF FILE=2005.63
QUIT $$GETP63(IEN)
+7 IF FILE=2005.64
QUIT $$GETP64(IEN)
+8 IF FILE=2005.65
QUIT $$GETP65(IEN)
+9 QUIT ""
+10 ;
GETP61(IEN) ; Get Patient Reference from file 2005.61
+1 NEW PTR6
+2 SET PTR6=$PIECE($GET(^MAGV(2005.61,+$GET(IEN),6)),"^")
+3 QUIT $PIECE($GET(^MAGV(2005.6,+PTR6,0)),"^")
+4 ;
GETP62(IEN) ; Get Patient Reference from file 2005.62
+1 NEW PTR6
+2 SET PTR6=$PIECE($GET(^MAGV(2005.62,+$GET(IEN),6)),"^",3)
+3 if PTR6=""!(PTR6'=+PTR6)
QUIT ""
+4 QUIT $PIECE($GET(^MAGV(2005.6,PTR6,0)),"^")
+5 ;
GETP63(IEN) ; Get Patient Reference from file 2005.63
+1 NEW PTR62
+2 SET PTR62=$PIECE($GET(^MAGV(2005.63,+$GET(IEN),6)),"^")
+3 QUIT $$GETP62(PTR62)
+4 ;
GETP64(IEN) ; Get Patient Reference from file 2005.64
+1 NEW PTR63
+2 SET PTR63=$PIECE($GET(^MAGV(2005.64,+$GET(IEN),6)),"^")
+3 QUIT $$GETP63(PTR63)
+4 ;
GETP65(IEN) ; Get Patient Reference from file 2005.64
+1 NEW PTR64
+2 SET PTR64=$PIECE($GET(^MAGV(2005.65,+$GET(IEN),6)),"^")
+3 QUIT $$GETP64(PTR64)
+4 ;
TMPMSG(DELETE) ; Send MailMan LOG REPORT
+1 NEW XMSUB,XMDUZ,MAGXMD,XMY
+2 SET MAGXMD="MAGVCLN"
+3 SET XMSUB=$SELECT($GET(DELETE):"Resolve",1:"Search")_" Imaging Problem Records "_$$FMTE^XLFDT(DT,"5DZ")
SET XMDUZ=$SELECT($GET(DUZ):DUZ,1:.5)
+4 SET XMY(XMDUZ)=""
SET XMY("G.MAG SERVER")=""
+5 NEW DIFROM
SET XMTEXT="^TMP("""_MAGXMD_""","_$JOB_","
DO ^XMD
KILL DIFROM
+6 KILL XMTEXT
+7 QUIT
+8 ;
MSGHDR(MAGLICNT,DELETE) ; Output header for Mailman - when run silently (as in post-install)
+1 SET ^TMP("MAGVCLN",$JOB,+$GET(MAGLICNT))=" MAGV "_$SELECT($GET(DELETE):"RESOLVE PROBLEM RECORDS",1:"SEARCH FOR PROBLEM RECORDS")
SET MAGLICNT=MAGLICNT+1
+2 SET ^TMP("MAGVCLN",$JOB,MAGLICNT)=" Problem records in files 2005.6x "_$SELECT($GET(DELETE):"resolved ",1:"identified ")_"by the MAG*3.0*278"
SET MAGLICNT=MAGLICNT+1
+3 SET ^TMP("MAGVCLN",$JOB,MAGLICNT)=" post-installation process are displayed below."
SET MAGLICNT=MAGLICNT+1
+4 SET ^TMP("MAGVCLN",$JOB,MAGLICNT)=""
SET MAGLICNT=MAGLICNT+1
+5 SET ^TMP("MAGVCLN",$JOB,MAGLICNT)="Non-Primary "
+6 QUIT
+7 ;
OUTPUT(TEXT,MAGBLF,MAGALF,MAGPOST) ; Output a line of TEXT
+1 ; TEXT= Line of text
+2 ; MAGBLF = Number of 'before' line feeds
+3 ; MAGALF = Number of 'after' line feeds
+4 ; MAGPOST = Called as post-install routine, output mailed to DUZ
+5 ;
+6 NEW MAGMAXLF,MAGDONE,MAGCNT
+7 SET MAGDONE=0
SET MAGCNT=0
+8 ; Max number of line feeds
SET MAGMAXLF=10
+9 IF $GET(MAGBLF)>0
Begin DoDot:1
+10 FOR MAGCNT=1:1:MAGBLF
if $GET(MAGDONE)
QUIT
Begin DoDot:2
+11 IF MAGCNT>MAGMAXLF
SET MAGDONE=1
QUIT
+12 IF '$GET(MAGPOST)
WRITE !
+13 IF $GET(MAGPOST)
SET ^TMP("MAGVCLN",$JOB,+$GET(MAGLICNT))=""
SET MAGLICNT=$GET(MAGLICNT)+1
End DoDot:2
End DoDot:1
+14 IF '$GET(MAGPOST)
WRITE !,TEXT
+15 IF $GET(MAGPOST)
SET ^TMP("MAGVCLN",$JOB,+$GET(MAGLICNT))=TEXT
SET MAGLICNT=$GET(MAGLICNT)+1
+16 SET MAGDONE=0
+17 IF $GET(MAGALF)>0
Begin DoDot:1
+18 FOR MAGCNT=1:1:MAGBLF
if $GET(MAGDONE)
QUIT
Begin DoDot:2
+19 IF MAGCNT>MAGMAXLF
SET MAGDONE=1
QUIT
+20 IF '$GET(MAGPOST)
WRITE !
+21 IF $GET(MAGPOST)
SET ^TMP("MAGVCLN",$JOB,+$GET(MAGLICNT))=""
SET MAGLICNT=$GET(MAGLICNT)+1
End DoDot:2
End DoDot:1
+22 ;
+23 QUIT
AUDIT(KEY,FILE,IEN,ORIGIEN,REASON,ACTION,DELIEN,ORIGAOF,DUPEIEN) ; Audit File for Problem Records?
+1 NEW MAGFDA,MAGMSG,LOGIEN,LOGFIEN
+2 if KEY=""
QUIT
+3 if IEN=""
QUIT
+4 SET ACTION=$SELECT($GET(ACTION)="MI":"MI",$GET(ACTION)="MC":"MC",$GET(ACTION):"SI",1:"I")
+5 ;
+6 KILL MAGFDA,MAGMSG
+7 SET MAGFDA(2005.67,"+1,",.01)=IEN
+8 SET MAGFDA(2005.67,"+1,",1)=FILE
+9 SET MAGFDA(2005.67,"+1,",2)=$GET(ORIGIEN)
+10 SET MAGFDA(2005.67,"+1,",3)=REASON
+11 SET MAGFDA(2005.67,"+1,",4)=ACTION
+12 SET MAGFDA(2005.67,"+1,",5)=$$NOW^XLFDT
+13 SET MAGFDA(2005.67,"+1,",6)=KEY
+14 IF $LENGTH($GET(DELIEN))
SET MAGFDA(2005.67,"+1,",7)=$GET(DELIEN)
+15 IF $LENGTH($GET(ORIGAOF))
SET MAGFDA(2005.67,"+1,",8)=ORIGAOF
+16 IF $LENGTH($GET(ORIGAOF))
SET MAGFDA(2005.67,"+1,",9)=DUPEIEN
+17 ;
+18 ; Reason Codes:
+19 ; 1 - Duplicate
+20 ; 2 - No Parent Record Pointer
+21 ; 3 - Invalid Parent Record Pointer
+22 ; 4 - No Patient Ref Pointer
+23 ; 5 - Invalid Patient Ref Pointer
+24 ; 6 - Duplicate Parent Reference
+25 ;
+26 DO UPDATE^DIE("","MAGFDA","","MAGMSG")
+27 KILL MAGFDA
+28 QUIT
+29 ;
PATNAME(FILE,IEN) ; Get patient name from 2005.6x file
+1 NEW PATIEN,PATNAME,MAGPATID,MAGPATIEN
+2 IF FILE'["2005.6"
QUIT "UNKNOWN"
+3 SET MAGPATID=$$GETP^MAGVCLN1(FILE,IEN)
+4 IF 'MAGPATID
QUIT "UNKNOWN"
+5 SET MAGPATIEN=$ORDER(^MAGV(2005.6,"B",MAGPATID,0))
+6 IF 'MAGPATIEN
QUIT "UNKNOWN"
+7 SET PATNAME=$$GET1^DIQ(2005.6,MAGPATIEN_",",3)
+8 if '$LENGTH(PATNAME)
SET PATNAME="UNKNOWN"
+9 QUIT PATNAME
+10 ;
PATMAGID(FILE,IEN) ; Get ENTERPRISE PATIENT ID file (#2005.6) ID
+1 NEW PATIEN,PATNAME,MAGPATID,MAGPATIEN
+2 IF FILE'["2005.6"
QUIT "UNKNOWN"
+3 SET MAGPATID=$$GETP^MAGVCLN1(FILE,IEN)
+4 IF 'MAGPATID
QUIT "UNKNOWN"
+5 QUIT MAGPATID