source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURQUTL1.m@ 1604

Last change on this file since 1604 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1NURQUTL1 ;HIRMFO/RM-QI SUMMARY UTILITIES ;1/22/97 15:26
2 ;;4.0;NURSING SERVICE;;Apr 25, 1997
3NLDEM() ; This function returns the IEN of the Demographic Reference (748.2)
4 ; file for the NURS Location (file) entry, or "" if it is not in
5 ; the file.
6 ; Function Value = IEN in 748.2 file, or "".
7 ;
8 N FXN K ^TMP("DILIST",$J)
9 D FIND^DIC(748.2,"","","X","NURS LOCATION",1,"B")
10 S FXN=$G(^TMP("DILIST",$J,2,1)) K ^TMP("DILIST",$J)
11 Q FXN
12SURLOC(NURQSURV) ; This function will determine if this survey tracks
13 ; response data by NURS Location.
14 ; Input Parameter: NURQSURV=ptr to 748 (survey) file
15 ; Function Value = IEN in demographic multiple for NURS Location
16 ; demographic, if responses tracked by NURS Loc.
17 ; 0 Responses not tracked by NURS Location
18 ;
19 N NURQDEM,NURQFXN,NURQX
20 S NURQDEM=$$NLDEM,NURQFXN=0
21 K ^TMP($J,"NURQDEM")
22 D GETS^DIQ(748,NURQSURV_",","3*","","^TMP($J,""NURQDEM"")")
23 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
24 K ^TMP($J,"NURQDEM")
25 Q NURQFXN
26RESLOC(NURQRESP,NURQDEM) ; This function returns the NURS Location
27 ; demographic for a particular set of Response Data.
28 ; Input Parameter: NURQRESP=Ptr to 748.3 (Response Data) file
29 ; NURQDEM=Ien in Demographic Data Item sub-file
30 ; of Survey (748) file for the NURS Location
31 ; demographic.
32 ; Function Value = Ptr to Hospital Location (44) or 0 if this
33 ; entry was not filled in.
34 ;
35 N NURQFXN K ^TMP("DILIST",$J)
36 D FIND^DIC(748.36,","_NURQRESP_",",1,"X",NURQDEM,1)
37 S NURQFXN=$G(^TMP("DILIST",$J,"ID",1,1)) K ^TMP("DILIST",$J)
38 Q NURQFXN
39 ;
40SURGENVR(VRCHK,OPT) ; THIS EXTRINSIC FUNCTION WILL DETERMINE IF THE VERSION
41 ; OF THE SURVEY GENERATOR DETERMINED BY VRCHK IS INSTALLED. IF THE
42 ; IT IS NOT INSTALLED, THE FUNCTION RETURNS FALSE (0) AND PRINTS
43 ; AN ERROR MESSAGE. IF IT IS, IT RETURNS TRUE (1). OPT IS AN OPTIONAL
44 ; INPUT THAT WILL HAVE THE ERROR MESSAGE CALL ^DIR TO STOP SCREEN FROM
45 ; SCROLLING MESSAGE OFF.
46 N FXN,VER S FXN=1,VER=+$$VERSION^XPDUTL("SURVEY GENERATOR")
47 I VRCHK=1,VER'=1 S FXN=0
48 I VRCHK=2,VER<2 S FXN=0
49 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
50 Q FXN
Note: See TracBrowser for help on using the repository browser.