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

RAIPST2.m

Go to the documentation of this file.
  1. RAIPST2 ;HIRMFO/GJC - Post-init number two ;6/16/97 07:59
  1. VERSION ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
  1. EN2 ; Delete incomplete reports from the Rad/Nuc Med Reports file.
  1. ; These reports are deleted because they are incomplete, i.e,
  1. ; missing Report Text, missing Impression Text, and a Report
  1. ; Status of 'Draft'. These reports must not have a pointer
  1. ; to the Image (2005) file and must not be purged.
  1. ; ('PURGE' node must not exist.)
  1. ;N RA74,RATXT,RAX,RAY
  1. ;S RA74=+$$PARCP^XPDUTL("POST6"),RATXT(1)=" "
  1. ;S RATXT(2)="Checking for invalid skeleton reports in the Rad/Nuc Med Reports file."
  1. ;S RATXT(3)="If any are found they will be deleted along with all pointers to them."
  1. ;S RATXT(4)=" " D MES^XPDUTL(.RATXT)
  1. ;F S RA74=$O(^RARPT(RA74)) Q:RA74'>0 D
  1. ;. Q:$D(^RARPT(RA74,"PURGE")) ; quit if involved in prior purge
  1. ;. S RAX=$$EN3^RAUTL15(RA74)
  1. ;. S RAY=+$$UPCP^XPDUTL("POST61",RA74)
  1. ;. Q
  1. Q
  1. EN3 ; Update the value of the REPORT RIGHT MARGIN of the IMAGING LOCATIONS
  1. ; file.
  1. Q:$$CNVFLG^RAIPST2() ; code has been hit in the past.
  1. N RA791,RAFDA,RAIEN,RALEFT,RANRIT,RARIT,RATXT S RAIEN=0
  1. S RATXT(1)=" "
  1. S RATXT(2)="Correcting values in the REPORT RIGHT MARGIN field of all entries in the"
  1. S RATXT(3)="IMAGING LOCATIONS file."
  1. S RATXT(4)=" " D MES^XPDUTL(.RATXT) K RATXT
  1. F S RAIEN=$O(^RA(79.1,RAIEN)) Q:RAIEN'>0 D
  1. . S RA791=$G(^RA(79.1,RAIEN,0))
  1. . S RALEFT=+$P(RA791,"^",14),RARIT=+$P(RA791,"^",15)
  1. . Q:RALEFT=0!(RARIT=0) ; cannot perform computations without values
  1. . S RANRIT=(RALEFT+RARIT)
  1. . S RAFDA(79.1,RAIEN_",",15)=RANRIT
  1. . D FILE^DIE("E","RAFDA") K RAFDA,RAERR
  1. . Q
  1. Q
  1. EN4 ; Set the 'ASK RADIOPHARMS & DOSAGES?' field (.61) to 'Yes'
  1. ; for for the Examinations Status 'EXAMINED' whose Imaging
  1. ; Type has the 'RADIOPHARMACEUTICALS USED?' field set to 'Yes'.
  1. N I,RAFDA S I=0
  1. F S I=$O(^RA(72,"B","EXAMINED",I)) Q:I'>0 D
  1. . N RAITY S RAITY=+$P($G(^RA(72,I,0)),"^",7)
  1. . I $$UP^XLFSTR($$GET1^DIQ(79.2,RAITY,5,"I"))="Y" S RAFDA(72,I_",",.61)="Y"
  1. . Q
  1. D:$D(RAFDA) FILE^DIE("","RAFDA","")
  1. Q
  1. EN5 ; Add 'Mammography' as a new Imaging Type in file 79.2
  1. ; Populate the following fields: Operating Conditions
  1. ; Abbreviation, Report Cut-Off, Clinical History Cut-Off
  1. ; Tracking Time Cut-Off & Order Data Cut-Off
  1. Q:$D(^RA(79.2,"B","MAMMOGRAPHY"))\10 ; done in the past
  1. N RAFDA K RAERR,RATXT S RATXT(1)=" "
  1. S RATXT(2)="Adding 'MAMMOGRAPHY' as a new entry in the Imaging Type file."
  1. D MES^XPDUTL(.RATXT) K RATXT
  1. S RAFDA(79.2,"+1,",.01)="MAMMOGRAPHY",RAFDA(79.2,"+1,",3)="MAM"
  1. S RAFDA(79.2,"+1,",4)="N",RAFDA(79.2,"+1,",.11)=90
  1. S RAFDA(79.2,"+1,",.12)=90,RAFDA(79.2,"+1,",.13)=90
  1. S RAFDA(79.2,"+1,",.14)=90,RAFDA(79.2,"+1,",.16)=90
  1. D UPDATE^DIE("","RAFDA","","RAERR")
  1. I $D(RAERR("DIERR")) D
  1. . S RATXT(1)=" "
  1. . S RATXT(2)="Error filing 'MAMMOGRAPHY' in the Imaging Type (79.2) file."
  1. . S RATXT(3)="IRM and the Radiology/Nuclear Medicine ADPAC should investigate."
  1. . D MES^XPDUTL(.RATXT)
  1. . Q
  1. K RAERR,RATXT
  1. Q
  1. CLEANUP ; This entry point is called to queue off the RADIOLOGY/NUCLEAR
  1. ; MEDICINE CLEANUP 5.0 build. This build removes obsolete data and
  1. ; fields from the database.
  1. N %,DIC,RAPKG,RASTAT,XPDA,X,Y
  1. S (RAPKG,X)="RADIOLOGY/NUCLEAR MEDICINE CLEANUP "_$P($T(+2),";",3)
  1. S DIC="^XPD(9.7,",DIC(0)="O" D ^DIC Q:+Y'>0 ;cleanup missing
  1. S XPDA=+Y
  1. S RASTAT=$$GET1^DIQ(9.7,XPDA,.02,"I") ; get status of distribution
  1. Q:RASTAT'=0 ; status must be 'loaded from distribution'
  1. Q:'$D(^XTMP("XPDI",XPDA,"BLD")) ; missing from transport global
  1. N ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE S ZTIO=""
  1. S ZTRTN="EN^XPDIJ",ZTDESC="Rad/Nuc Med Cleanup 5.0 task"
  1. S ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT(),0,0,2,0),ZTSAVE("XPDA")=""
  1. D ^%ZTLOAD N RATXT S RATXT(1)=" "
  1. S RATXT(2)=RAPKG_" is running in background."
  1. S:$G(ZTSK)>0 RATXT(3)="Task: "_ZTSK_"." D MES^XPDUTL(.RATXT)
  1. Q
  1. CNVFLG() ; This code checks to see if the Right Margin field for the
  1. ; Imaging Locations file has had its data converted by a prior install
  1. ; of Rad/Nuc Med v5. We check to see if the 'ASK RADIOPHARMS &
  1. ; DOSAGES?' field (.61) is set to 'Yes'. If so, the post-init must
  1. ; have run in the past.
  1. ;
  1. ; Returns: '0' if initial post-init run, '1' if the post-init has run
  1. ; in the past.
  1. ;
  1. N I,RAFLG S (I,RAFLG)=0
  1. F S I=$O(^RA(72,"B","EXAMINED",I)) Q:I'>0 D Q:RAFLG
  1. . S:$$UP^XLFSTR($P($G(^RA(72,I,.6)),"^"))="Y" RAFLG=1
  1. . Q
  1. Q RAFLG