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

GMV5ENV.m

Go to the documentation of this file.
  1. GMV5ENV ;HIOFO/FT-GMRV*5*5 ENVIRONMENT CHECK ROUTINE ;11/23/04 11:21
  1. ;;5.0;GEN. MED. REC. - VITALS;**5**;Oct 31, 2002
  1. ;
  1. ; This routine uses the following IAs:
  1. ; #10048 - PACKAGE file (9.4) (supported)
  1. ; #10141 - ^XPDUTL calls (supported)
  1. ;
  1. EN ; If FILE 9.4 entry is not "GEN. MED. REC. - VITALS", make it so.
  1. ; If more than one entry for package in FILE 9.4 and none are
  1. ; "GEN. MED. REC. - VITALS", then stop installation.
  1. ;
  1. N GMVARRAY,GMVCNT,GMVDA,GMVERR,GMVIEN,GMVLOOP,GMVMSG,GMVNAME,GMVNS,GMVOTHER,GMVYES
  1. S (GMVCNT,GMVOTHER(0),GMVYES)=0,GMVNS="GMRV"
  1. D FIND^DIC(9.4,"","","X",GMVNS,"","C","","","GMVARRAY","GMVERR")
  1. S GMVLOOP=0
  1. F S GMVLOOP=$O(GMVARRAY("DILIST",1,GMVLOOP)) Q:GMVLOOP'>0!(GMVYES>0) D
  1. .S GMVNAME=$G(GMVARRAY("DILIST",1,GMVLOOP)) Q:GMVNAME=""
  1. .I GMVNAME="GEN. MED. REC. - VITALS" D Q ;found the right entry
  1. ..S GMVYES=+$G(GMVARRAY("DILIST",2,GMVLOOP))
  1. ..Q
  1. .I GMVNAME'="GEN. MED. REC. - VITALS" D Q ;wrong name
  1. ..S GMVCNT=GMVCNT+1
  1. ..S GMVOTHER(0)=GMVCNT
  1. ..S GMVOTHER(GMVCNT)=+$G(GMVARRAY("DILIST",2,GMVLOOP))
  1. ..Q
  1. .Q
  1. Q:GMVYES ;right entry found in FILE 9.4
  1. ; If only one entry in FILE 9.4 and it isn't "GEN. MED. REC. - VITALS",
  1. ; then change it.
  1. I GMVOTHER(0)=1 D Q
  1. .S GMVIEN=+$G(GMVOTHER(1))
  1. .S GMVDA(9.4,GMVIEN_",",.01)="GEN. MED. REC. - VITALS"
  1. .D FILE^DIE("","GMVDA","GMVERR")
  1. .I $G(GMVERR) D Q
  1. ..S GMVMSG="Could not change FILE 9.4 entry #"_GMVIEN_" to 'GEN. MED. REC. - VITALS'. Please log a NOIS."
  1. ..D BMES^XPDUTL(GMVMSG)
  1. ..S XPDQUIT=2 ;don't install patch, but leave in XTMP global
  1. ..Q
  1. .Q
  1. I GMVOTHER(0)>1 D
  1. .D BMES^XPDUTL("None of the FILE 9.4 entries have the correct name for the vitals package. Please log a NOIS.")
  1. .S XPDQUIT=2 ;don't install patch, but leave in XTMP global
  1. .Q
  1. Q