- GMV5ENV ;HIOFO/FT-GMRV*5*5 ENVIRONMENT CHECK ROUTINE ;11/23/04 11:21
- ;;5.0;GEN. MED. REC. - VITALS;**5**;Oct 31, 2002
- ;
- ; This routine uses the following IAs:
- ; #10048 - PACKAGE file (9.4) (supported)
- ; #10141 - ^XPDUTL calls (supported)
- ;
- EN ; If FILE 9.4 entry is not "GEN. MED. REC. - VITALS", make it so.
- ; If more than one entry for package in FILE 9.4 and none are
- ; "GEN. MED. REC. - VITALS", then stop installation.
- ;
- N GMVARRAY,GMVCNT,GMVDA,GMVERR,GMVIEN,GMVLOOP,GMVMSG,GMVNAME,GMVNS,GMVOTHER,GMVYES
- S (GMVCNT,GMVOTHER(0),GMVYES)=0,GMVNS="GMRV"
- D FIND^DIC(9.4,"","","X",GMVNS,"","C","","","GMVARRAY","GMVERR")
- S GMVLOOP=0
- F S GMVLOOP=$O(GMVARRAY("DILIST",1,GMVLOOP)) Q:GMVLOOP'>0!(GMVYES>0) D
- .S GMVNAME=$G(GMVARRAY("DILIST",1,GMVLOOP)) Q:GMVNAME=""
- .I GMVNAME="GEN. MED. REC. - VITALS" D Q ;found the right entry
- ..S GMVYES=+$G(GMVARRAY("DILIST",2,GMVLOOP))
- ..Q
- .I GMVNAME'="GEN. MED. REC. - VITALS" D Q ;wrong name
- ..S GMVCNT=GMVCNT+1
- ..S GMVOTHER(0)=GMVCNT
- ..S GMVOTHER(GMVCNT)=+$G(GMVARRAY("DILIST",2,GMVLOOP))
- ..Q
- .Q
- Q:GMVYES ;right entry found in FILE 9.4
- ; If only one entry in FILE 9.4 and it isn't "GEN. MED. REC. - VITALS",
- ; then change it.
- I GMVOTHER(0)=1 D Q
- .S GMVIEN=+$G(GMVOTHER(1))
- .S GMVDA(9.4,GMVIEN_",",.01)="GEN. MED. REC. - VITALS"
- .D FILE^DIE("","GMVDA","GMVERR")
- .I $G(GMVERR) D Q
- ..S GMVMSG="Could not change FILE 9.4 entry #"_GMVIEN_" to 'GEN. MED. REC. - VITALS'. Please log a NOIS."
- ..D BMES^XPDUTL(GMVMSG)
- ..S XPDQUIT=2 ;don't install patch, but leave in XTMP global
- ..Q
- .Q
- I GMVOTHER(0)>1 D
- .D BMES^XPDUTL("None of the FILE 9.4 entries have the correct name for the vitals package. Please log a NOIS.")
- .S XPDQUIT=2 ;don't install patch, but leave in XTMP global
- .Q
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMV5ENV 1812 printed Mar 13, 2025@21:03:02 Page 2
- 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
- +2 ;
- +3 ; This routine uses the following IAs:
- +4 ; #10048 - PACKAGE file (9.4) (supported)
- +5 ; #10141 - ^XPDUTL calls (supported)
- +6 ;
- 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
- +2 ; "GEN. MED. REC. - VITALS", then stop installation.
- +3 ;
- +4 NEW GMVARRAY,GMVCNT,GMVDA,GMVERR,GMVIEN,GMVLOOP,GMVMSG,GMVNAME,GMVNS,GMVOTHER,GMVYES
- +5 SET (GMVCNT,GMVOTHER(0),GMVYES)=0
- SET GMVNS="GMRV"
- +6 DO FIND^DIC(9.4,"","","X",GMVNS,"","C","","","GMVARRAY","GMVERR")
- +7 SET GMVLOOP=0
- +8 FOR
- SET GMVLOOP=$ORDER(GMVARRAY("DILIST",1,GMVLOOP))
- if GMVLOOP'>0!(GMVYES>0)
- QUIT
- Begin DoDot:1
- +9 SET GMVNAME=$GET(GMVARRAY("DILIST",1,GMVLOOP))
- if GMVNAME=""
- QUIT
- +10 ;found the right entry
- IF GMVNAME="GEN. MED. REC. - VITALS"
- Begin DoDot:2
- +11 SET GMVYES=+$GET(GMVARRAY("DILIST",2,GMVLOOP))
- +12 QUIT
- End DoDot:2
- QUIT
- +13 ;wrong name
- IF GMVNAME'="GEN. MED. REC. - VITALS"
- Begin DoDot:2
- +14 SET GMVCNT=GMVCNT+1
- +15 SET GMVOTHER(0)=GMVCNT
- +16 SET GMVOTHER(GMVCNT)=+$GET(GMVARRAY("DILIST",2,GMVLOOP))
- +17 QUIT
- End DoDot:2
- QUIT
- +18 QUIT
- End DoDot:1
- +19 ;right entry found in FILE 9.4
- if GMVYES
- QUIT
- +20 ; If only one entry in FILE 9.4 and it isn't "GEN. MED. REC. - VITALS",
- +21 ; then change it.
- +22 IF GMVOTHER(0)=1
- Begin DoDot:1
- +23 SET GMVIEN=+$GET(GMVOTHER(1))
- +24 SET GMVDA(9.4,GMVIEN_",",.01)="GEN. MED. REC. - VITALS"
- +25 DO FILE^DIE("","GMVDA","GMVERR")
- +26 IF $GET(GMVERR)
- Begin DoDot:2
- +27 SET GMVMSG="Could not change FILE 9.4 entry #"_GMVIEN_" to 'GEN. MED. REC. - VITALS'. Please log a NOIS."
- +28 DO BMES^XPDUTL(GMVMSG)
- +29 ;don't install patch, but leave in XTMP global
- SET XPDQUIT=2
- +30 QUIT
- End DoDot:2
- QUIT
- +31 QUIT
- End DoDot:1
- QUIT
- +32 IF GMVOTHER(0)>1
- Begin DoDot:1
- +33 DO BMES^XPDUTL("None of the FILE 9.4 entries have the correct name for the vitals package. Please log a NOIS.")
- +34 ;don't install patch, but leave in XTMP global
- SET XPDQUIT=2
- +35 QUIT
- End DoDot:1
- +36 QUIT