MPIFNAMC ;OAKLAND OIFO/MKO-NAME COMPONENTS UPDATE FLAG ;21 Nov 2018 12:28 PM
;;1.0;MASTER PATIENT INDEX VISTA;**69**;;Build 1
;**69,Story 841921 (mko): New routine for the Name Components Update Flag
Q
;
UPDFLAG(RETURN,FLAG,VALUE) ;Remote Procedure MPIF UPDATE NAME COMP FLAG
;Update the flag for entry THREE in File #984.8
; FLAG : "G" - "GET" mode, the flag should be returned, not updated
; Otherwise, flag is updated with the value passed
; VALUE : If FLAG'["G", VALUE is what the flag should be set to, 0 or 1.
N DIERR,DIHELP,DIMSG,FDA,VAL,IEN,MSG,X,Y
K RETURN
;
I $G(FLAG)["G" S RETURN="1^"_$$GETFLAG Q
;
S VAL=+$G(VALUE)'=0
S FDA(984.8,"?+1,",.01)="THREE"
S FDA(984.8,"?+1,",3)=VAL
S IEN(1)=3
D UPDATE^DIE("E","FDA","IEN","MSG")
I $G(DIERR) S RETURN="-1^"_$$BLDERR("MSG") Q
S RETURN="1^Successfully "_$S($G(IEN(1,0))="+":"added entry THREE and ",1:"")_"updated flag to "_VAL_" in File #984.8"
Q
;
GETFLAG() ;Get the value of the flag
Q $P($G(^MPIF(984.8,3,0)),"^",4)
;
DELTHREE(RETURN) ;Delete entry THREE in File #984.8
N DA,DIK,X,Y
I $D(^MPIF(984.8,3,0))[0 S RETURN="-1^Entry 3 doesn't exist." Q
S DIK="^MPIF(984.8,",DA=3 D ^DIK
S RETURN="1^Entry 3 deleted."
Q
;
BLDERR(MSGROOT) ;Build an error from the error message array
N ERRARR,ERRMSG,I
D MSG^DIALOG("AE",.ERRARR,"","",MSGROOT)
S ERRMSG="",I=0 F S I=$O(ERRARR(I)) Q:'I S ERRMSG=ERRMSG_$S(ERRMSG]"":" ",1:"")_$G(ERRARR(I))
Q ERRMSG
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMPIFNAMC 1478 printed Dec 13, 2024@02:11:15 Page 2
MPIFNAMC ;OAKLAND OIFO/MKO-NAME COMPONENTS UPDATE FLAG ;21 Nov 2018 12:28 PM
+1 ;;1.0;MASTER PATIENT INDEX VISTA;**69**;;Build 1
+2 ;**69,Story 841921 (mko): New routine for the Name Components Update Flag
+3 QUIT
+4 ;
UPDFLAG(RETURN,FLAG,VALUE) ;Remote Procedure MPIF UPDATE NAME COMP FLAG
+1 ;Update the flag for entry THREE in File #984.8
+2 ; FLAG : "G" - "GET" mode, the flag should be returned, not updated
+3 ; Otherwise, flag is updated with the value passed
+4 ; VALUE : If FLAG'["G", VALUE is what the flag should be set to, 0 or 1.
+5 NEW DIERR,DIHELP,DIMSG,FDA,VAL,IEN,MSG,X,Y
+6 KILL RETURN
+7 ;
+8 IF $GET(FLAG)["G"
SET RETURN="1^"_$$GETFLAG
QUIT
+9 ;
+10 SET VAL=+$GET(VALUE)'=0
+11 SET FDA(984.8,"?+1,",.01)="THREE"
+12 SET FDA(984.8,"?+1,",3)=VAL
+13 SET IEN(1)=3
+14 DO UPDATE^DIE("E","FDA","IEN","MSG")
+15 IF $GET(DIERR)
SET RETURN="-1^"_$$BLDERR("MSG")
QUIT
+16 SET RETURN="1^Successfully "_$SELECT($GET(IEN(1,0))="+":"added entry THREE and ",1:"")_"updated flag to "_VAL_" in File #984.8"
+17 QUIT
+18 ;
GETFLAG() ;Get the value of the flag
+1 QUIT $PIECE($GET(^MPIF(984.8,3,0)),"^",4)
+2 ;
DELTHREE(RETURN) ;Delete entry THREE in File #984.8
+1 NEW DA,DIK,X,Y
+2 IF $DATA(^MPIF(984.8,3,0))[0
SET RETURN="-1^Entry 3 doesn't exist."
QUIT
+3 SET DIK="^MPIF(984.8,"
SET DA=3
DO ^DIK
+4 SET RETURN="1^Entry 3 deleted."
+5 QUIT
+6 ;
BLDERR(MSGROOT) ;Build an error from the error message array
+1 NEW ERRARR,ERRMSG,I
+2 DO MSG^DIALOG("AE",.ERRARR,"","",MSGROOT)
+3 SET ERRMSG=""
SET I=0
FOR
SET I=$ORDER(ERRARR(I))
if 'I
QUIT
SET ERRMSG=ERRMSG_$SELECT(ERRMSG]"":" ",1:"")_$GET(ERRARR(I))
+4 QUIT ERRMSG