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

NURQUTL1.m

Go to the documentation of this file.
  1. NURQUTL1 ;HIRMFO/RM-QI SUMMARY UTILITIES ;1/22/97 15:26
  1. ;;4.0;NURSING SERVICE;;Apr 25, 1997
  1. NLDEM() ; This function returns the IEN of the Demographic Reference (748.2)
  1. ; file for the NURS Location (file) entry, or "" if it is not in
  1. ; the file.
  1. ; Function Value = IEN in 748.2 file, or "".
  1. ;
  1. N FXN K ^TMP("DILIST",$J)
  1. D FIND^DIC(748.2,"","","X","NURS LOCATION",1,"B")
  1. S FXN=$G(^TMP("DILIST",$J,2,1)) K ^TMP("DILIST",$J)
  1. Q FXN
  1. SURLOC(NURQSURV) ; This function will determine if this survey tracks
  1. ; response data by NURS Location.
  1. ; Input Parameter: NURQSURV=ptr to 748 (survey) file
  1. ; Function Value = IEN in demographic multiple for NURS Location
  1. ; demographic, if responses tracked by NURS Loc.
  1. ; 0 Responses not tracked by NURS Location
  1. ;
  1. N NURQDEM,NURQFXN,NURQX
  1. S NURQDEM=$$NLDEM,NURQFXN=0
  1. K ^TMP($J,"NURQDEM")
  1. D GETS^DIQ(748,NURQSURV_",","3*","","^TMP($J,""NURQDEM"")")
  1. S NURQX="" F S NURQX=$O(^TMP($J,"NURQDEM",748.03,NURQX)) Q:NURQX="" I $P($G(^TMP($J,"NURQDEM",748.03,NURQX,2)),U)="NURS LOCATION" S NURQFXN=1
  1. K ^TMP($J,"NURQDEM")
  1. Q NURQFXN
  1. RESLOC(NURQRESP,NURQDEM) ; This function returns the NURS Location
  1. ; demographic for a particular set of Response Data.
  1. ; Input Parameter: NURQRESP=Ptr to 748.3 (Response Data) file
  1. ; NURQDEM=Ien in Demographic Data Item sub-file
  1. ; of Survey (748) file for the NURS Location
  1. ; demographic.
  1. ; Function Value = Ptr to Hospital Location (44) or 0 if this
  1. ; entry was not filled in.
  1. ;
  1. N NURQFXN K ^TMP("DILIST",$J)
  1. D FIND^DIC(748.36,","_NURQRESP_",",1,"X",NURQDEM,1)
  1. S NURQFXN=$G(^TMP("DILIST",$J,"ID",1,1)) K ^TMP("DILIST",$J)
  1. Q NURQFXN
  1. ;
  1. SURGENVR(VRCHK,OPT) ; THIS EXTRINSIC FUNCTION WILL DETERMINE IF THE VERSION
  1. ; OF THE SURVEY GENERATOR DETERMINED BY VRCHK IS INSTALLED. IF THE
  1. ; IT IS NOT INSTALLED, THE FUNCTION RETURNS FALSE (0) AND PRINTS
  1. ; AN ERROR MESSAGE. IF IT IS, IT RETURNS TRUE (1). OPT IS AN OPTIONAL
  1. ; INPUT THAT WILL HAVE THE ERROR MESSAGE CALL ^DIR TO STOP SCREEN FROM
  1. ; SCROLLING MESSAGE OFF.
  1. N FXN,VER S FXN=1,VER=+$$VERSION^XPDUTL("SURVEY GENERATOR")
  1. I VRCHK=1,VER'=1 S FXN=0
  1. I VRCHK=2,VER<2 S FXN=0
  1. I 'FXN W !!,"SURVEY GENERATOR V. "_VRCHK_".0 "_$S(VRCHK=2:"OR GREATER ",1:"")_"IS REQUIRED - CANNOT CONTINUE:" I $G(OPT) S DIR(0)="E" D ^DIR K DIR
  1. Q FXN