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

RA94PST.m

Go to the documentation of this file.
  1. RA94PST ;Hines OI/GJC - Post-init Driver, patch 94 ;07/24/08 12:13
  1. ;;5.0;Radiology/Nuclear Medicine;**94**;Mar 16, 1998;Build 9
  1. ;
  1. NEW1AD ;Check to see if the traditional "AD" cross-reference was deleted.
  1. ;If not, delete the traditional "AD" cross-reference. Check to see if
  1. ;the new style "AD" cross-reference exists. If it does, delete it and
  1. ;re-create it while re-indexing the data. If the new style "AD" does not
  1. ;exist, create it while re-indexing the data.
  1. ;
  1. ;Tag^Routine Integration Agreement
  1. ;------------------------------------------------
  1. ;^%ZTLOAD 10063
  1. ;CREIXN/DELIX/DELIXN^DDMOD 2916
  1. ;$$FIND1^DIC 2051
  1. ;$$GET1^DIQ(2056)
  1. ;$$FMADD/$$NOW^XLFDT 10103
  1. ;^XMD 10070
  1. ;$$GOTLOCAL^XMXAPIG 3006
  1. ;MES^XPDUTL 10141
  1. ;$$KSP^XUPARAM(2541)
  1. ;
  1. N DIERR,RAERR,RANODE,RATXT,RAVALUE,RAXIT,RAY
  1. ;
  1. ;In order to create the new style "AD" cross-reference & re-index the data
  1. ;the traditional "AD" cross-reference has to be deleted.
  1. ;
  1. ; -----------------------------------------------------------
  1. ;| Deleting of the "AD" cross-reference from '^DD(70.03,13,' |
  1. ;| will also cause the "AD" cross-reference to be deleted. |
  1. ; -----------------------------------------------------------
  1. ;
  1. ;^DD(70.03,13,1,n,0)=definition ex: 70^AD^MUMPS
  1. ;^DD(70.03,13,1,n,1)=set logic
  1. ;^DD(70.03,13,1,n,2)=kill logic
  1. ;^DD(70.03,13,1,n,3)=no-deletion message
  1. ;^DD(70.03,13,1,n,"%D",x,0)=description of cross-reference
  1. ;Where 'n' is the cross-reference instance
  1. ;Where 'x' is the description line instance
  1. ;
  1. S RANODE=$NA(^DD(70.03,13,1)),(RAXIT,RAY)=0
  1. F S RAY=$O(@RANODE@(RAY)) Q:'RAY Q:$G(@RANODE@(RAY,0))="70^AD^MUMPS"
  1. ;
  1. I RAY>0 D ;there is a traditional "AD" cross-reference to delete
  1. .D DELIX^DDMOD(70.03,13,RAY,"K","","RAERR") ;"K" delete the cross-referenced data
  1. .I $D(RAERR("DIERR"))#2 S RAXIT=1 D
  1. ..S RATXT(1)="Error when attempting to delete the traditional ""AD"" cross-reference."
  1. ..S RATXT(2)="Field name: PRIMARY DIAGNOSTIC CODE, data dictionary: 70.03, field #: 13" Q
  1. .E S RATXT(1)="The traditional ""AD"" cross-reference has been deleted."
  1. .S RATXT($O(RATXT($C(32)),-1)+1)="" D MES^XPDUTL(.RATXT) Q
  1. ;
  1. ;<<< If there was a traditional "AD" cross-reference to delete was it deleted (RAXIT=0)? >>>
  1. ;
  1. I RAXIT K RATXT D Q ;cannot continue until the old "AD" is deleted
  1. .S RATXT(1)="The new style ""AD"" cross-reference cannot be created until"
  1. .S RATXT(2)="the traditional ""AD"" cross-reference is deleted."
  1. .D MES^XPDUTL(.RATXT) Q
  1. ;
  1. ; ------------------------------------------------------------
  1. ;| Check to see if the new style "AD" cross-reference exists. |
  1. ;| If it does delete the new style "AD" cross-reference. |
  1. ;| |
  1. ;| Then re-create the new style "AD" cross-reference while |
  1. ;| cross-referencing the data.
  1. ; ------------------------------------------------------------
  1. ;
  1. S RAVALUE(1)=70,RAVALUE(2)="AD"
  1. ;Note: "BB" (5th subscript) is the FILE & NAME cross-reference index in the INDEX (#.11) file.
  1. ;he third subscript "X"
  1. S RAY=$$FIND1^DIC(.11,"","X",.RAVALUE,"BB","","RAERR")
  1. ;
  1. I RAY K RATXT D ;found a match
  1. .S RATXT(1)="The 'New Style' PRIMARY DIAGNOSTIC CODE (70.03, #13) ""AD"""
  1. .S RATXT(2)="is currently in existence. We will rebuild and re-index the"
  1. .S RATXT(3)="""AD"" cross-reference.",RATXT($O(RATXT($C(32)),-1)+1)=""
  1. .D MES^XPDUTL(.RATXT)
  1. .D DELIXN^DDMOD(70.03,"AD","K") ;delete the prior instance and the data indexed
  1. .Q
  1. ;
  1. ;-----------------------------------------------------
  1. ;
  1. I RAY="" K RATXT D Q ;error on lookup
  1. .S RATXT=$G(RAERR("DIERR","1","TEXT",1))
  1. .S RATXT(1)="Error determining if the new style PRIMARY DIAGNOSTIC CODE (70.03, #13) ""AD"""
  1. .S RATXT(2)="cross-reference exists. This error prohibits us from moving forward."
  1. .S:$G(RAERR("DIERR","1","TEXT",1))'="" RATXT(3)=$G(RAERR("DIERR","1","TEXT",1))
  1. .D MES^XPDUTL(.RATXT) Q
  1. ;
  1. ;-----------------------------------------------------
  1. ;
  1. ;There are two possible realities at this point. One is that the new style "AD"
  1. ;cross-reference did exist (RAY>0) in which case we proceeded to delete that
  1. ;instance of the new style "AD" and now move to rebuilt and re-index the index.
  1. ;
  1. ;Or, the new style "AD" cross-reference never did exist (RAY=0). In this case, we
  1. ;create the new style "AD" cross-reference and rebuild the "AD" cross-reference.
  1. ;
  1. ;In either case, due to the length of time to re-index, the process is tasked off
  1. ;
  1. N ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSK S ZTRTN="CREIXN^RA94PST",ZTIO=""
  1. S ZTDTH=$$FMADD^XLFDT($E($$NOW^XLFDT(),1,12),0,0,1,0) ;start task in one minute...
  1. S ZTDESC="RA94PST, the post-install process for RA*5.0*94, rebuilds the ""AD"" xref on the PRIMARY DIAGNOSTIC CODE (70.03 - 0;13) field."
  1. D ^%ZTLOAD K RATXT S RATXT(1)=""
  1. I $D(ZTSK)#2[0 S RATXT(2)="Task Cancelled"
  1. E S RATXT(2)="Task: "_$G(ZTSK)_" queued..."
  1. D MES^XPDUTL(.RATXT) Q
  1. ;
  1. ;
  1. CREIXN ;rebuilds the ""AD"" xref on the PRIMARY DIAGNOSTIC CODE (70.03 - 0;13) field
  1. ;Note: this is a background process created by ^%ZTLOAD.
  1. N RARSLT,RAXREF K DIERR,RAERR,RATXT
  1. S RAXREF("FILE")=70,RAXREF("TYPE")="MU",RAXREF("NAME")="AD"
  1. S RAXREF("EXECUTION")="F",RAXREF("ROOT FILE")=70.03,RAXREF("USE")="S"
  1. S RAXREF("ACTIVITY")="IR"
  1. S RAXREF("SHORT DESCR")="The 'AD' is used to mark cases eligible for the Abnormal Report option."
  1. S RAXREF("DESCR",1)="If the diagnostic code record in the radiology DIAGNOSTIC CODES (#78.3)"
  1. S RAXREF("DESCR",2)="has the data attribute for field: PRINT ON ABNORMAL REPORT (#3) set to"
  1. S RAXREF("DESCR",3)="'Y' (yes) then the ""AD"" cross-reference will be set for this exam record"
  1. S RAXREF("DESCR",4)="to indicate that this case should be identified on the Abnormal Report."
  1. S RAXREF("DESCR",5)=""
  1. S RAXREF("DESCR",6)="NOTE: When this field is edited the DIAGNOSTIC PRINT DATE (#20) field is"
  1. S RAXREF("DESCR",7)="deleted!",RAXREF("VAL",1)=13
  1. S RAXREF("KILL CONDITION")="S:X1(1)'="""" X=1"
  1. S RAXREF("KILL")="D:($D(X1(1))#2) PRIDXIXK^RADD2(.DA,X1(1))"
  1. S RAXREF("SET CONDITION")="S:X2(1)'="""" X=1"
  1. S RAXREF("SET")="S:$P($G(^RA(78.3,X2(1),0)),U,3)=""Y"" ^RADPT(""AD"",X2(1),DA(2),DA(1),DA)="""""
  1. ;S RAXREF("WHOLE KILL")="K ^RADPT(""AD"")" Note: no re-indexing is to occur.
  1. ;
  1. ;D CREIXN^DDMOD(.RAXREF,"S",.RARSLT,"","RAERR") ;"S" (2nd parameter) means the "AD" is rebuilt
  1. D CREIXN^DDMOD(.RAXREF,"",.RARSLT,"","RAERR") ;the 2nd input param is null; no re-indexing
  1. ;
  1. BLDMSG ;failure: we did not create the cross-reference
  1. I RARSLT=""!($D(RAERR("DIERR"))#2) D
  1. .S RATXT(1)="Facility: "_$$GET1^DIQ(4,+$$KSP^XUPARAM("INST"),.01),RATXT(2)=""
  1. .S RATXT(3)="Error when attempting to delete the new style ""AD"" cross-reference."
  1. .S RATXT(4)="Field name: PRIMARY DIAGNOSTIC CODE, data dictionary: 70.03, field #: 13"
  1. .S RATXT(5)=$G(RAERR("DIERR",1,"TEXT",1))
  1. .N RAIRM S RAIRM="Contact your local IRM support staff."
  1. .I RATXT(5)="" S RATXT(6)=RAIRM
  1. .E S RATXT(6)="",RATXT(7)=RAIRM
  1. .Q
  1. ;
  1. E S ZTREQ="@"
  1. ;
  1. Q:'$O(RATXT(0)) ;no news is good news...
  1. ;
  1. MAIL ; pass the negative results concerning the tasked process
  1. ;(rebuilding the "AD" xref) to the user via VA MailMan
  1. N %,D0,D1,D2,DG,DIC,DICR,DIW,XMDUN,XMDUZ,XMSUB,XMTEXT,XMY
  1. S XMDUZ=.5,XMTEXT="RATXT("
  1. S XMSUB="RA*5.0*94: results of rebuilding the ""AD"" cross-reference"
  1. I '$$GOTLOCAL^XMXAPIG("G.RAD HL7 MESSAGES") D
  1. .S XMY(DUZ)=""
  1. E S XMY("G.RAD HL7 MESSAGES")=""
  1. S XMY("VAOITVHITRadDevIssues@domain.ext")="" ;to me...
  1. D ^XMD Q
  1. ;