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

RAPERR1.m

Go to the documentation of this file.
  1. RAPERR1 ;HIRMFO/GJC,CAH-Prt Img Locs missing/invalid Stop codes ;10/30/96 09:20
  1. ;;5.0;Radiology/Nuclear Medicine;**13**;Mar 16, 1998
  1. BSTP(X) ; Check for bad stop codes (DSS ID) per Imaging Location
  1. ; Make sure each imaging location points to an entry in the
  1. ; Hospital Location file #44 that is a 'COUNT' clinic, with
  1. ; no appointment patterns allowed, Stop Code on file 44 entry
  1. ; should match DSS ID on Imaging loc, division for imaging loc
  1. ; should match the Institution of the file 44 entry
  1. N RAERR,RASTOP,RAY S RAERR="Invalid Stop Code: ",RAY=X_","
  1. D GETS^DIQ(40.7,RAY,".01;1;2","","RASTOP")
  1. S RAERR=RAERR_" ("_RASTOP(40.7,RAY,1)_") "_RASTOP(40.7,RAY,.01)
  1. I $G(RASTOP(40.7,RAY,2))]"" S RAERR=RAERR_" (Inactive)"
  1. Q RAERR
  1. CK700(X) ;Check for a 700-level stop code as a DSS ID
  1. N RAERR,RASTOP,RAY S RAERR="",RAY=X_","
  1. D GETS^DIQ(40.7,RAY,"1","","RASTOP")
  1. I $G(RASTOP(40.7,RAY,1))?1"7"2N D
  1. . S RAERR="700-series noncredit Stop Code being used"
  1. . Q
  1. Q RAERR
  1. ISTOP ; Check the validity of the stop code on the Imaging Locations file.
  1. N RACNT K ^TMP($J,"RAPERR") S (RACNT,RAILOC,RAISTP,RAOUT)=0
  1. F S RAILOC=$O(^RA(79.1,RAILOC)) Q:RAILOC'>0 D
  1. . K RAMSG S RA791(0)=$G(^RA(79.1,RAILOC,0))
  1. . Q:$P(RA791(0),"^",21)=2 ; no credit method for this location
  1. . S X=+$P(RA791(0),"^",22),RA44=+$P(RA791(0),U) ;RA44 = ptr to file 44
  1. . I '$D(^SC(RA44)) D
  1. .. S RAMSG="Broken pointer - Hospital Location file 44 entry missing",RACNT=RACNT+1
  1. .. S ^TMP($J,"RAPERR",RAILOC,RACNT)=RAMSG
  1. .. Q
  1. . S RA44(0)=$G(^SC(RA44,0)) D ;get 0th node of file 44
  1. .. I $P(RA44(0),U,3)'="C" D
  1. ... S RAMSG="Hospital Location file 44 entry not CLINIC type",RACNT=RACNT+1
  1. ... S ^TMP($J,"RAPERR",RAILOC,RACNT)=RAMSG
  1. ... Q
  1. .. I X,($P(RA44(0),U,7)'=X) D
  1. ... S RAMSG="Hospital Location Stop Code doesn't match Imaging Loc's DSS ID",RACNT=RACNT+1
  1. ... S ^TMP($J,"RAPERR",RAILOC,RACNT)=RAMSG
  1. ... Q
  1. .. I $P(RA44(0),U,17)="Y" D
  1. ... S RAMSG="Hospital Location is a NON-COUNT clinic",RACNT=RACNT+1
  1. ... S ^TMP($J,"RAPERR",RAILOC,RACNT)=RAMSG
  1. ... Q
  1. .. I $G(^RA(79.1,RAILOC,"DIV"))="" D
  1. ... S RAMSG="No Rad/Nuc Med Division assigned to this imaging location",RACNT=RACNT+1
  1. ... S ^TMP($J,"RAPERR",RAILOC,RACNT)=RAMSG
  1. .. E I +$G(^RA(79.1,RAILOC,"DIV"))'=$P(RA44(0),U,4) D
  1. ... S RAMSG="Institution on Hosp Loc entry doesn't match Rad/NM Div of Imaging Loc",RACNT=RACNT+1
  1. ... S ^TMP($J,"RAPERR",RAILOC,RACNT)=RAMSG
  1. ... Q
  1. .. Q
  1. . I 'X D Q
  1. .. S RAMSG="Missing DSS ID",RACNT=RACNT+1
  1. .. S ^TMP($J,"RAPERR",RAILOC,RACNT)=RAMSG
  1. .. Q
  1. . S RAMSG=$$CK700(X) I RAMSG]"" D
  1. .. S RACNT=RACNT+1,^TMP($J,"RAPERR",RAILOC,RACNT)=RAMSG
  1. .. Q
  1. . I '$D(^RAMIS(71.5,"B",+X))!($P(^DIC(40.7,+X,0),U,3)) D
  1. .. S RAMSG=$$BSTP(X),RACNT=RACNT+1,^TMP($J,"RAPERR",RAILOC,RACNT)=RAMSG
  1. .. Q
  1. . Q
  1. I $D(^TMP($J,"RAPERR")) D
  1. . S (RAILOC,RAOUT)=0
  1. . F S RAILOC=$O(^TMP($J,"RAPERR",RAILOC)) Q:RAILOC'>0 D Q:RAOUT
  1. .. I $Y>(IOSL-4) D HDG^RAPERR Q:RAOUT
  1. .. W !!,"Imaging Location: ",$$GET1^DIQ(44,+$P(^RA(79.1,RAILOC,0),"^"),.01) S RACNT=0
  1. .. F S RACNT=$O(^TMP($J,"RAPERR",RAILOC,RACNT)) Q:RACNT'>0 D Q:RAOUT
  1. ... I $Y>(IOSL-4) D HDG^RAPERR W:'RAOUT !
  1. ... Q:RAOUT W !?3,$G(^TMP($J,"RAPERR",RAILOC,RACNT))
  1. ... Q
  1. .. Q
  1. . K ^TMP($J,"RAPERR")
  1. . Q
  1. E D
  1. . I $Y>(IOSL-4) D HDG^RAPERR Q:RAOUT
  1. . W !!,"All Imaging Location crediting data is valid."
  1. . Q
  1. Q