MPIFNEW ;BHM/RGY-Create new request for patient demographic change ;FEB 20, 1998
;;1.0; MASTER PATIENT INDEX VISTA **11**;;30 Apr 99
ADD(RNO) ;
;This function allows the addition of new CMOR Change requests to be
;added to the 984.9 file
; RNO - is the site making the request, optional
;Returned: is the IEN of the new entry in 984.9
; OR 0 if no entry is added.
;
N DIC,D0,DIE,DA,X,DLAYGO,DR,RGOK,EVN,DINUM
S RNO=$G(RNO)
F EVN=+$P(^MPIF(984.9,0),"^",3)+1:1 L +^MPIF(984.9,EVN):0 I $T S RGOK=0 D L -^MPIF(984.9,EVN) Q:RGOK
.I $D(^MPIF(984.9,EVN)) Q
.S DINUM=EVN,DIC="^MPIF(984.9,",DIC(0)="L",DLAYGO=984.9,X=$S(RNO="":$P($$SITE^VASITE(),"^",3)_"-"_EVN,1:RNO) K DD,D0 D FILE^DICN K DIC,DLAYGO,D0
.S DIE="^MPIF(984.9,",DR="[MPIF OPEN REQUEST]",DA=EVN D ^DIE
.S RGOK=1
.Q
Q Q EVN
;
EDIT ; edit existing Requests that have a status of OPEN
;select a patient to edit request
;
N ERR,PT,Y
S DIC="^MPIF(984.9,",DIC(0)="AEMQZ",DIC("A")="Select Patient's Request you would like to edit (Must have a Status of Open): ",DIC("S")="I $D(^MPIF(984.9,""AC"",1,Y))"
D ^DIC
Q:+Y<0
S PT=$P(^MPIF(984.9,+Y,0),"^",4)
I +PT<0 W !,"No Patient associated with this Request." Q
S DA=+Y
D EDIT^MPIFEDIT
K DA,ERR
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMPIFNEW 1252 printed Oct 16, 2024@18:11:59 Page 2
MPIFNEW ;BHM/RGY-Create new request for patient demographic change ;FEB 20, 1998
+1 ;;1.0; MASTER PATIENT INDEX VISTA **11**;;30 Apr 99
ADD(RNO) ;
+1 ;This function allows the addition of new CMOR Change requests to be
+2 ;added to the 984.9 file
+3 ; RNO - is the site making the request, optional
+4 ;Returned: is the IEN of the new entry in 984.9
+5 ; OR 0 if no entry is added.
+6 ;
+7 NEW DIC,D0,DIE,DA,X,DLAYGO,DR,RGOK,EVN,DINUM
+8 SET RNO=$GET(RNO)
+9 FOR EVN=+$PIECE(^MPIF(984.9,0),"^",3)+1:1
LOCK +^MPIF(984.9,EVN):0
IF $TEST
SET RGOK=0
Begin DoDot:1
+10 IF $DATA(^MPIF(984.9,EVN))
QUIT
+11 SET DINUM=EVN
SET DIC="^MPIF(984.9,"
SET DIC(0)="L"
SET DLAYGO=984.9
SET X=$SELECT(RNO="":$PIECE($$SITE^VASITE(),"^",3)_"-"_EVN,1:RNO)
KILL DD,D0
DO FILE^DICN
KILL DIC,DLAYGO,D0
+12 SET DIE="^MPIF(984.9,"
SET DR="[MPIF OPEN REQUEST]"
SET DA=EVN
DO ^DIE
+13 SET RGOK=1
+14 QUIT
End DoDot:1
LOCK -^MPIF(984.9,EVN)
if RGOK
QUIT
Q QUIT EVN
+1 ;
EDIT ; edit existing Requests that have a status of OPEN
+1 ;select a patient to edit request
+2 ;
+3 NEW ERR,PT,Y
+4 SET DIC="^MPIF(984.9,"
SET DIC(0)="AEMQZ"
SET DIC("A")="Select Patient's Request you would like to edit (Must have a Status of Open): "
SET DIC("S")="I $D(^MPIF(984.9,""AC"",1,Y))"
+5 DO ^DIC
+6 if +Y<0
QUIT
+7 SET PT=$PIECE(^MPIF(984.9,+Y,0),"^",4)
+8 IF +PT<0
WRITE !,"No Patient associated with this Request."
QUIT
+9 SET DA=+Y
+10 DO EDIT^MPIFEDIT
+11 KILL DA,ERR
+12 QUIT