source: FOIAVistA/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVP59.m@ 767

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

initial load of FOIAVistA 6/30/08 version

File size: 1.2 KB
Line 
1GMRVP59 ;BAY/KAM-Patch GMRV*5*9 Install Utility Routine ; 8/5/05 7:14am
2 ;;5.0;GEN. MED. REC. - VITALS;**9**;Apr 15, 2003
3 ;
4ENV ;Main Entry point for Environment Check
5 S XPDABORT=""
6 D PROGCHK(.XPDABORT) ;checks programmer variables
7 I XPDABORT="" K XPDABORT
8 Q
9PROGCHK(XPDABORT) ; checks for necessary programmer variables
10 ;
11 I '$G(DUZ)!($G(DUZ(0))'="@")!('$G(DT))!($G(U)'="^") D
12 . D BMES^XPDUTL("****")
13 . D MES^XPDUTL("Your programming variables are not set up properly.")
14 . D MES^XPDUTL("Installation aborted.")
15 . D MES^XPDUTL("*****")
16 . S XPDABORT=2
17 Q
18PRE ;Add 1 second to all entries in File 120.5 that do not contain a time
19 ;entry in piece one
20 N GMRIEN,DATETIME,X1,X2
21 K ^XTMP("GMRVP59",$J)
22 I '$G(DT) S DT=$$DT^XLFDT
23 I '$D(^XTMP("GMRVP59")) S X1=DT,X2=+90 D C^%DTC S ^XTMP("GMRVP59",0)=$G(X)_"^"_DT
24 S GMRIEN=""
25 F S GMRIEN=$O(^GMR(120.5,GMRIEN)) Q:GMRIEN=""!(GMRIEN'?1.N) D
26 . S DATETIME=$P($G(^GMR(120.5,GMRIEN,0)),"^")
27 . I +$P(DATETIME,".",2)'>0 D
28 .. S $P(^XTMP("GMRVP59",$J,120.5,GMRIEN),"^")=$G(DATETIME) ; Before
29 .. N GMRFDA
30 .. S DATETIME=$$FMADD^XLFDT(DATETIME,"","","",1)
31 .. S $P(^XTMP("GMRVP59",$J,120.5,GMRIEN),"^",2)=$G(DATETIME) ; After
32 .. S GMRFDA(120.5,GMRIEN_",",.01)=DATETIME
33 .. D UPDATE^DIE("","GMRFDA")
34 Q
Note: See TracBrowser for help on using the repository browser.