GMRVP514 ;BAY/KAM-Patch GMRV*5*14 Install Utility Routine ;8/29/05 3:24pm
;;5.0;GEN. MED. REC. - VITALS;**14**;Oct 31, 2002
;
PREINIT ; Remove a Data Dictionary Field
N VIEN,USED,VTIEN,X1,X2
K ^XTMP("GMRVP514")
I '$G(DT) S DT=$$DT^XLFDT
I '$D(^XTMP("GMRVP514")) S X1=DT,X2=+90 D C^%DTC S ^XTMP("GMRVP514",0)=$G(X)_"^"_DT
S (VIEN,USED)=0
F S VIEN=$O(^GMRD(120.51,VIEN)) Q:VIEN'?1.N!(USED=1) D
. I $P(^GMRD(120.51,VIEN,0),"^",7)?1.N S USED=1
I USED D Q
. W !,"^GMRD(120.51,"_VIEN_",0) CONTAINS A NUMERIC"
; delete the field "ORDERABLE"
I $D(^DD(120.51,"B","ORDERABLE")) D
. S VTIEN=$O(^DD(120.51,"B","ORDERABLE",""))
. S ^XTMP("GMRVP514",$J,120.51,VTIEN)="^DD(120.51,"_VTIEN_" HAS BEEN DELETED" ; Deletion
. K DIK S DA=VTIEN,DA(1)=120.51,DIK="^DD(120.51," D ^DIK K DIK,DA
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRVP514 812 printed Nov 22, 2024@17:07:29 Page 2
GMRVP514 ;BAY/KAM-Patch GMRV*5*14 Install Utility Routine ;8/29/05 3:24pm
+1 ;;5.0;GEN. MED. REC. - VITALS;**14**;Oct 31, 2002
+2 ;
PREINIT ; Remove a Data Dictionary Field
+1 NEW VIEN,USED,VTIEN,X1,X2
+2 KILL ^XTMP("GMRVP514")
+3 IF '$GET(DT)
SET DT=$$DT^XLFDT
+4 IF '$DATA(^XTMP("GMRVP514"))
SET X1=DT
SET X2=+90
DO C^%DTC
SET ^XTMP("GMRVP514",0)=$GET(X)_"^"_DT
+5 SET (VIEN,USED)=0
+6 FOR
SET VIEN=$ORDER(^GMRD(120.51,VIEN))
if VIEN'?1.N!(USED=1)
QUIT
Begin DoDot:1
+7 IF $PIECE(^GMRD(120.51,VIEN,0),"^",7)?1.N
SET USED=1
End DoDot:1
+8 IF USED
Begin DoDot:1
+9 WRITE !,"^GMRD(120.51,"_VIEN_",0) CONTAINS A NUMERIC"
End DoDot:1
QUIT
+10 ; delete the field "ORDERABLE"
+11 IF $DATA(^DD(120.51,"B","ORDERABLE"))
Begin DoDot:1
+12 SET VTIEN=$ORDER(^DD(120.51,"B","ORDERABLE",""))
+13 ; Deletion
SET ^XTMP("GMRVP514",$JOB,120.51,VTIEN)="^DD(120.51,"_VTIEN_" HAS BEEN DELETED"
+14 KILL DIK
SET DA=VTIEN
SET DA(1)=120.51
SET DIK="^DD(120.51,"
DO ^DIK
KILL DIK,DA
End DoDot:1
+15 QUIT