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

MAGDTRLU.m

Go to the documentation of this file.
  1. MAGDTRLU ;WOIFO/OHH/PMK - Report discrepancies between files #2006.5849 & #123 and correct them ; 10/11/2006 08:53
  1. ;;3.0;IMAGING;**46**;16-February-2007;;Build 1023
  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. ; This routine automatically checks the data in file telereader
  1. ; read/unread list (file 2006.5849)and compares it with the
  1. ; request/consultation (file #123). If a telereader study is locked
  1. ; or unread and in the request/consult file it is completed or
  1. ; cancelled, then it updates the status of the study in the telereader
  1. ; read/unread list file, the "D" cross reference, and the reading
  1. ; start field is updated.
  1. Q
  1. ;
  1. REPORT ; report problems with the Unread List
  1. D PASS("REPORT")
  1. Q
  1. ;
  1. REPAIR ; repair problems with the Unread List
  1. D PASS("REPAIR")
  1. Q
  1. ;
  1. PASS(MODE) ; report/repair problems for LOCKED and UNREAD studies
  1. N MSG
  1. S (MSG(1),MSG(3))=""
  1. ;
  1. ; PASS 1 - search for LOCKED cases that are completed/cancelled.
  1. S MSG(2)="Check for completed studies that have LOCKED status"
  1. I MODE="REPAIR" S MSG(2)=MSG(2)_" and correct them"
  1. W !! D HEADING^MAGDTRDX(.MSG)
  1. D SEARCH("LOCKED",MODE)
  1. ;
  1. ; PASS 2 - search for UNREAD cases that are completed/cancelled.
  1. S MSG(2)="Now check for completed studies that have UNREAD status"
  1. I MODE="REPAIR" S MSG(2)=MSG(2)_" and correct them"
  1. W !! D HEADING^MAGDTRDX(.MSG)
  1. D SEARCH("UNREAD",MODE)
  1. Q
  1. ;
  1. N ACQSITE ; -- acquisition division number
  1. N ISPECIDX ; - image index for specialty
  1. N IPROCIDX ; - image index for procedure
  1. N UNREAD ; --- IEN of file telereader read/undread file #2006.5849
  1. N XREF ; ----- "D" cross reference: "L" for locked, "U" for unread
  1. N I
  1. ;
  1. S XREF=$E(STATUS)
  1. S ACQSITE=""
  1. F S ACQSITE=$O(^MAG(2006.5849,"D",ACQSITE)) Q:ACQSITE="" D
  1. . W !!,$$W("Acquisition Site:"),$$GET1^DIQ(4,ACQSITE,.01)
  1. . S ISPECIDX=""
  1. . F S ISPECIDX=$O(^MAG(2006.5849,"D",ACQSITE,ISPECIDX)) Q:ISPECIDX="" D
  1. . . W !,$$W("Specialty:"),$$GET1^DIQ(2005.84,ISPECIDX,.01)
  1. . . S IPROCIDX=""
  1. . . F S IPROCIDX=$O(^MAG(2006.5849,"D",ACQSITE,ISPECIDX,IPROCIDX)) Q:IPROCIDX="" D
  1. . . . N COUNT ; -- array of counts of problems
  1. . . . W !,$$W("Procedure:"),$$GET1^DIQ(2005.85,IPROCIDX,.01) D
  1. . . . S UNREAD=""
  1. . . . F S UNREAD=$O(^MAG(2006.5849,"D",ACQSITE,ISPECIDX,IPROCIDX,XREF,UNREAD)) Q:UNREAD="" D CHECK
  1. . . . I '$D(COUNT) D Q
  1. . . . . W !,$$W(""),"No inconsistencies were found.",!
  1. . . . . Q
  1. . . . S I="" F S I=$O(COUNT(I)) Q:I="" D
  1. . . . . W !,$$W($S(MODE="REPORT":"Problem:",1:"Repaired:"))
  1. . . . . W "Number of consults that have ",I," status in CPRS: ",COUNT(I)
  1. . . . . W !
  1. . . . . Q
  1. . . . Q
  1. . . Q
  1. . Q
  1. Q
  1. ;
  1. CHECK ;check Unread List entry against that in CPRS Consult Requst Tracking
  1. N GMRCIEN ; -- IEN of file request/consultation (file #123)
  1. N GMRCSTS ; -- status of consult request - from ^ORD(100.01)
  1. ;
  1. S GMRCIEN=$P(^MAG(2006.5849,UNREAD,0),"^",1)
  1. S GMRCSTS=$$GET1^DIQ(123,GMRCIEN,8) ; cprs status
  1. I "^COMPLETE^CANCELLED^DISCONTINUED^DISCONTINUED/EDIT^EXPIRED^"[("^"_GMRCSTS_"^") D
  1. . S COUNT(GMRCSTS)=$G(COUNT(GMRCSTS))+1
  1. . I MODE="REPORT" D
  1. . . W !,$$W(""),"Consult # ",GMRCIEN," has the status of ",GMRCSTS," in CPRS"
  1. . . Q
  1. . E I MODE="REPAIR" D ; correct the entry
  1. . . W !,$$W("Fix:"),"Consult # ",GMRCIEN," which has the status of ",GMRCSTS," in CPRS"
  1. . . ; Note: The variable & value MODE="REPAIR" are used in ^MAGDTR03
  1. . . I GMRCSTS="COMPLETE" D
  1. . . . D COMPLETE^MAGDTR03
  1. . . . Q
  1. . . E D CANCEL^MAGDTR03
  1. . . Q
  1. . Q
  1. Q
  1. ;
  1. W(PROMPT) ; output prompt
  1. Q $J(PROMPT,16)_" "