Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: MPIFNEW

MPIFNEW.m

Go to the documentation of this file.
  1. MPIFNEW ;BHM/RGY-Create new request for patient demographic change ;FEB 20, 1998
  1. ;;1.0; MASTER PATIENT INDEX VISTA **11**;;30 Apr 99
  1. ADD(RNO) ;
  1. ;This function allows the addition of new CMOR Change requests to be
  1. ;added to the 984.9 file
  1. ; RNO - is the site making the request, optional
  1. ;Returned: is the IEN of the new entry in 984.9
  1. ; OR 0 if no entry is added.
  1. ;
  1. N DIC,D0,DIE,DA,X,DLAYGO,DR,RGOK,EVN,DINUM
  1. S RNO=$G(RNO)
  1. 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
  1. .I $D(^MPIF(984.9,EVN)) Q
  1. .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
  1. .S DIE="^MPIF(984.9,",DR="[MPIF OPEN REQUEST]",DA=EVN D ^DIE
  1. .S RGOK=1
  1. .Q
  1. Q Q EVN
  1. ;
  1. EDIT ; edit existing Requests that have a status of OPEN
  1. ;select a patient to edit request
  1. ;
  1. N ERR,PT,Y
  1. 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))"
  1. D ^DIC
  1. Q:+Y<0
  1. S PT=$P(^MPIF(984.9,+Y,0),"^",4)
  1. I +PT<0 W !,"No Patient associated with this Request." Q
  1. S DA=+Y
  1. D EDIT^MPIFEDIT
  1. K DA,ERR
  1. Q