TIU341P ;SPFO/AJB - Environment Check & Post Install ;Jul 14, 2021@07:11:36
;;1.0;TEXT INTEGRATION UTILITIES;**341**;Jun 20, 1997;Build 23
;
Q
;
POST ; clean up object(s) from previous installs & create new objects
; clean & rename object(s) if necessary
N OBJECT,RES,X,Y F OBJECT="PULSE OXIMETRY","VA-WH EXPECTED DUE DATE" D
. N IEN,METHOD
. S IEN=0 F S IEN=$O(^TIU(8925.1,"B",OBJECT,IEN)) Q:'+IEN D
. . I $P(^TIU(8925.1,IEN,0),U,4)'="O" Q ; not an object
. . S METHOD=$S(OBJECT="PULSE OXIMETRY":"S X=$$PO2^TIULO(+$G(DFN))",1:"S X=$$GETEDD^WVRPCPT(DFN)")
. . N NODE9 S NODE9=$G(^TIU(8925.1,IEN,9))
. . I METHOD=NODE9 D Q
. . . N DA,DIK S DA=IEN,DIK="^TIU(8925.1," D ^DIK ; remove object with same method
. . ; different method, make a copy then remove
. . N NODE0 S NODE0=$G(^TIU(8925.1,IEN,0)) I +$P(NODE0,U,5) N POWNER S POWNER=$P(NODE0,U,5)
. . ; create a copy, increment copy until successful
. . N COPY F COPY=1:1 S RES=$$CROBJ^TIUCROBJ($P(NODE0,U)_" COPY ("_COPY_")","","",NODE9,$G(POWNER)) Q:+RES
. . N DA,DIK S DA=IEN,DIK="^TIU(8925.1," D ^DIK ; remove original
; install objects
F X=1:1 S Y=$P($T(OBJECTS+X),";;",2) Q:Y="" D
. S RES=$$CROBJ^TIUCROBJ($P(Y,U),$P(Y,U,2),$P(Y,U,3),$P(Y,";",2))
. I '+RES D BMES^XPDUTL(RES) S XPDABORT=2 Q
. D BMES^XPDUTL($P(Y,U)_" object created successfully.")
Q
;
LU(FILE,NAME,FLAGS,SCREEN,INDEXES) ;
Q $$FIND1^DIC(FILE,"",$G(FLAGS),NAME,$G(INDEXES),$G(SCREEN))
;
OBJECTS ;
;;PULSE OXIMETRY^POX^^;S X=$$PO2^TIULO(+$G(DFN))
;;VA-WH EXPECTED DUE DATE^EDD^EXPECTED DUE DATE^;S X=$$GETEDD^WVRPCPT(DFN)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HTIU341P 1611 printed Dec 13, 2024@02:38:36 Page 2
TIU341P ;SPFO/AJB - Environment Check & Post Install ;Jul 14, 2021@07:11:36
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**341**;Jun 20, 1997;Build 23
+2 ;
+3 QUIT
+4 ;
POST ; clean up object(s) from previous installs & create new objects
+1 ; clean & rename object(s) if necessary
+2 NEW OBJECT,RES,X,Y
FOR OBJECT="PULSE OXIMETRY","VA-WH EXPECTED DUE DATE"
Begin DoDot:1
+3 NEW IEN,METHOD
+4 SET IEN=0
FOR
SET IEN=$ORDER(^TIU(8925.1,"B",OBJECT,IEN))
if '+IEN
QUIT
Begin DoDot:2
+5 ; not an object
IF $PIECE(^TIU(8925.1,IEN,0),U,4)'="O"
QUIT
+6 SET METHOD=$SELECT(OBJECT="PULSE OXIMETRY":"S X=$$PO2^TIULO(+$G(DFN))",1:"S X=$$GETEDD^WVRPCPT(DFN)")
+7 NEW NODE9
SET NODE9=$GET(^TIU(8925.1,IEN,9))
+8 IF METHOD=NODE9
Begin DoDot:3
+9 ; remove object with same method
NEW DA,DIK
SET DA=IEN
SET DIK="^TIU(8925.1,"
DO ^DIK
End DoDot:3
QUIT
+10 ; different method, make a copy then remove
+11 NEW NODE0
SET NODE0=$GET(^TIU(8925.1,IEN,0))
IF +$PIECE(NODE0,U,5)
NEW POWNER
SET POWNER=$PIECE(NODE0,U,5)
+12 ; create a copy, increment copy until successful
+13 NEW COPY
FOR COPY=1:1
SET RES=$$CROBJ^TIUCROBJ($PIECE(NODE0,U)_" COPY ("_COPY_")","","",NODE9,$GET(POWNER))
if +RES
QUIT
+14 ; remove original
NEW DA,DIK
SET DA=IEN
SET DIK="^TIU(8925.1,"
DO ^DIK
End DoDot:2
End DoDot:1
+15 ; install objects
+16 FOR X=1:1
SET Y=$PIECE($TEXT(OBJECTS+X),";;",2)
if Y=""
QUIT
Begin DoDot:1
+17 SET RES=$$CROBJ^TIUCROBJ($PIECE(Y,U),$PIECE(Y,U,2),$PIECE(Y,U,3),$PIECE(Y,";",2))
+18 IF '+RES
DO BMES^XPDUTL(RES)
SET XPDABORT=2
QUIT
+19 DO BMES^XPDUTL($PIECE(Y,U)_" object created successfully.")
End DoDot:1
+20 QUIT
+21 ;
LU(FILE,NAME,FLAGS,SCREEN,INDEXES) ;
+1 QUIT $$FIND1^DIC(FILE,"",$GET(FLAGS),NAME,$GET(INDEXES),$GET(SCREEN))
+2 ;
OBJECTS ;
+1 ;;PULSE OXIMETRY^POX^^;S X=$$PO2^TIULO(+$G(DFN))
+2 ;;VA-WH EXPECTED DUE DATE^EDD^EXPECTED DUE DATE^;S X=$$GETEDD^WVRPCPT(DFN)
+3 QUIT