GMRVXCH0 ;HIRMFO/RM,YH-CONVERT QUALIFIER/CATEGORY FILES ;4/22/97
;;4.0;Vitals/Measurements;;Apr 25, 1997
EN ; Driver to run both qualifier and Category Conversions
;
; Check to see if Conversion run
Q:+$G(^GMRD(120.57,1,"PHASEI"))>0
D BMES^XPDUTL("Running Qualifier/Category Conversion...")
;
; Build conversion tables (Char. and Cat.).
D ^GMRVXCHT
;
; Move data from 120.53 to 120.52 file.
D MOVE53^GMRVXCH2
;
; Kill off data in 120.53 file.
S GMRVZERO=$P($G(^GMRD(120.53,0)),"^",1,2)
I GMRVZERO="" S GMRVZERO="GMRV VITAL CATEGORY^120.53"
K ^GMRD(120.53) S ^GMRD(120.53,0)=GMRVZERO
;
; Kill of xrefs in 120.52 and 120.53 files.
F GMRVFILE=120.52,120.53 D
. S DA(1)="" F S DA(1)=$O(^GMRD(GMRVFILE,DA(1))) Q:DA(1)="" D
. . I DA(1)>0 S DA="A" F S DA=$O(^GMRD(GMRVFILE,DA(1),1,DA)) Q:DA="" K ^GMRD(GMRVFILE,DA(1),1,DA)
. . I DA(1)'>0,DA(1)'=0 K ^GMRD(GMRVFILE,DA(1))
. . Q
. Q
;
; Build GMRV Vital Category file from ^TMP($J,"GMRVCAT")
D CONV53^GMRVXCH3
;
; Convert GMRV Vital Qualifier entries from ^TMP($J,"GMRVCHAR")
D CONV52^GMRVXCH2
;
; Update Conversion Flag in 120.57 file.
S DIK="^GMRD(120.52," D IXALL^DIK
S DIK="^GMRD(120.53," D IXALL^DIK
S $P(^GMRD(120.57,1,"PHASEI"),"^")=1
;
; Clean up and quit
K ^TMP($J,"GMRVCHAR"),^TMP($J,"GMRVCAT"),DA,GMRVFILE,GMRVZERO
Q
EN1 ; Post-init tasks for Qualifier and Category Conversions
; Add new qualifier/categories and re-index 120.52 and 120.53 files in post-init.
;
Q:+$G(^GMRD(120.57,1,"PHASEII"))>0
D ADDCAT^GMRVXCH1 D BMES^XPDUTL("Re-indexing 120.53 file...")
S DIK="^GMRD(120.53," D IXALL^DIK
D ADDCHAR^GMRVXCH1 D BMES^XPDUTL("Re-indexing 120.52 file...")
S DIK="^GMRD(120.52," D IXALL^DIK
;CONVERT DEFAULT TEXT TO POINTER TO 120.52 IN 120.53 FILE
K DIK D DEFAULT^GMRVXCH3
Q
GMRVXCH0 ;HIRMFO/RM,YH-CONVERT QUALIFIER/CATEGORY FILES ;4/22/97
+1 ;;4.0;Vitals/Measurements;;Apr 25, 1997
EN ; Driver to run both qualifier and Category Conversions
+1 ;
+2 ; Check to see if Conversion run
+3 IF +$GET(^GMRD(120.57,1,"PHASEI"))>0
QUIT
+4 DO BMES^XPDUTL("Running Qualifier/Category Conversion...")
+5 ;
+6 ; Build conversion tables (Char. and Cat.).
+7 DO ^GMRVXCHT
+8 ;
+9 ; Move data from 120.53 to 120.52 file.
+10 DO MOVE53^GMRVXCH2
+11 ;
+12 ; Kill off data in 120.53 file.
+13 SET GMRVZERO=$PIECE($GET(^GMRD(120.53,0)),"^",1,2)
+14 IF GMRVZERO=""
SET GMRVZERO="GMRV VITAL CATEGORY^120.53"
+15 KILL ^GMRD(120.53)
SET ^GMRD(120.53,0)=GMRVZERO
+16 ;
+17 ; Kill of xrefs in 120.52 and 120.53 files.
+18 FOR GMRVFILE=120.52,120.53
Begin DoDot:1
+19 SET DA(1)=""
FOR
SET DA(1)=$ORDER(^GMRD(GMRVFILE,DA(1)))
IF DA(1)=""
QUIT
Begin DoDot:2
+20 IF DA(1)>0
SET DA="A"
FOR
SET DA=$ORDER(^GMRD(GMRVFILE,DA(1),1,DA))
IF DA=""
QUIT
KILL ^GMRD(GMRVFILE,DA(1),1,DA)
+21 IF DA(1)'>0
IF DA(1)'=0
KILL ^GMRD(GMRVFILE,DA(1))
+22 QUIT
End DoDot:2
+23 QUIT
End DoDot:1
+24 ;
+25 ; Build GMRV Vital Category file from ^TMP($J,"GMRVCAT")
+26 DO CONV53^GMRVXCH3
+27 ;
+28 ; Convert GMRV Vital Qualifier entries from ^TMP($J,"GMRVCHAR")
+29 DO CONV52^GMRVXCH2
+30 ;
+31 ; Update Conversion Flag in 120.57 file.
+32 SET DIK="^GMRD(120.52,"
DO IXALL^DIK
+33 SET DIK="^GMRD(120.53,"
DO IXALL^DIK
+34 SET $PIECE(^GMRD(120.57,1,"PHASEI"),"^")=1
+35 ;
+36 ; Clean up and quit
+37 KILL ^TMP($JOB,"GMRVCHAR"),^TMP($JOB,"GMRVCAT"),DA,GMRVFILE,GMRVZERO
+38 QUIT
EN1 ; Post-init tasks for Qualifier and Category Conversions
+1 ; Add new qualifier/categories and re-index 120.52 and 120.53 files in post-init.
+2 ;
+3 IF +$GET(^GMRD(120.57,1,"PHASEII"))>0
QUIT
+4 DO ADDCAT^GMRVXCH1
DO BMES^XPDUTL("Re-indexing 120.53 file...")
+5 SET DIK="^GMRD(120.53,"
DO IXALL^DIK
+6 DO ADDCHAR^GMRVXCH1
DO BMES^XPDUTL("Re-indexing 120.52 file...")
+7 SET DIK="^GMRD(120.52,"
DO IXALL^DIK
+8 ;CONVERT DEFAULT TEXT TO POINTER TO 120.52 IN 120.53 FILE
+9 KILL DIK
DO DEFAULT^GMRVXCH3
+10 QUIT