MPIFNQ ;BHM/RGY-Miscellaneous functions for CMOR ;FEB 20, 1998
;;1.0; MASTER PATIENT INDEX VISTA ;**11**;30 Apr 99
;
; Integration Agreements Utilized:
;
; ^RGSITE(991.8, IA #2746
;
;
PAT(IEN) ;Return patient CMOR (Site IEN)
NEW RESULT
S RESULT=$$GETVCCI^MPIF001(IEN)
I RESULT<0 Q ""
Q RESULT
ICN(IEN) ;Return patient ICN
NEW RESULT
S RESULT=$$GETICN^MPIF001(IEN)
I RESULT<0 Q ""
Q +RESULT
IEN(ICN) ;Return patient IEN
NEW RESULT
S RESULT=$$GETDFN^MPIF001(ICN)
I RESULT<0 Q ""
Q RESULT
AUTO() ;
NEW TMX
S TMX=+$P($G(^RGSITE(991.8,1,0)),"^",2)
S:TMX'=1&(TMX'=0) TMX=0
Q TMX
RPT1 ;
; Entry point for option MPIF SENT REQUEST. This option prints
; all outstanding requests for Change of CMOR that this site has sent.
; NO input or output variables.
N X1,X2,Y,USER,AGE,DIC,L,BY,FLDS,FROM,TO,DIR,DTOUT,DUTOUT,DIROUT,DIRUT,X
S USER=""
S DIR("A")="Do you only want to list the requests you entered? ",DIR("B")="YES",DIR(0)="YAO" D ^DIR K DIR Q:$D(DIRUT)
I Y=1 S USER=DUZ
S DIR("A")="Display requests entered on or before date: ",DIR("B")="TODAY",DIR(0)="DAO^::EP" D ^DIR K DIR Q:$D(DIRUT)
S X2=Y,X1=DT D D^%DTC
S AGE=X
S DIC="^MPIF(984.9,",FLDS="[MPIF OUTSTANDING REQUESTS]",L=0
S BY="[MPIF REQUEST SORT]",FR=",,2,"_USER_","_AGE,TO=",,2,"_USER_","
D EN1^DIP
Q
RPT2 ;
; Entry point for option: MPIF RECEIVED REQUESTS to list all change
; of CMOR requests that are still outstanding for review/processing
; NO input or output variables.
N DIC,L,BY,FLDS,FROM,TO,DIR,DTOUT,DUTOUT,DIROUT
S DIC="^MPIF(984.9,",FLDS="[MPIF OUTSTANDING REQUESTS]",L=0
S BY="[MPIF PENDING REQUESTS]",FR="",TO=""
D EN1^DIP
Q
INQ ;View CMOR request
N DIC,FLDS,FR,TO,L,BY,Y
ASK S DIC="^MPIF(984.9,",DIC(0)="QEAM",DIC("A")="Select Request #: " D ^DIC Q:+Y<0
S FR=+Y,TO=+Y,L=0,FLDS="[MPIF REQUEST VIEW]",BY="@NUMBER" D EN1^DIP
G ASK
Q
RPT3 ; entry point for Approved Requests
;No input of output variables
N FR,DIC,L,BY,FLDS,FROM,TO,DIR,DTOUT,DUTOUT,DIROUT,DIRUT,X
S DIR("A")="Display requests APPROVED on or SINCE (date): ",DIR("B")="T-10",DIR(0)="DAO^::EP" D ^DIR K DIR Q:$D(DIRUT)
S FROM=Y
S DIC="^MPIF(984.9,",FLDS=".06,.01,2.02,.04,.07,1.02,.03"
S BY=".06,2.02,.04"
S FR="4,"_FROM_","
S TO="4,,"
D EN1^DIP
Q
RPT4 ; entry point for Disapproved Requests
;No input of output variables
N FR,DIC,L,BY,FLDS,FROM,TO,DIR,DTOUT,DUTOUT,DIROUT,DIRUT,X
S DIR("A")="Display requests DISAPPROVED on or SINCE (date): ",DIR("B")="T-10",DIR(0)="DAO^::EP" D ^DIR K DIR Q:$D(DIRUT)
S FROM=Y
S DIC="^MPIF(984.9,",FLDS=".06,.01,2.02,.04,.07,1.02,.03,3.02"
S BY=".06,2.02,.04"
S FR="5,"_FROM_","
S TO="5,,"
D EN1^DIP
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMPIFNQ 2720 printed Dec 13, 2024@02:11:17 Page 2
MPIFNQ ;BHM/RGY-Miscellaneous functions for CMOR ;FEB 20, 1998
+1 ;;1.0; MASTER PATIENT INDEX VISTA ;**11**;30 Apr 99
+2 ;
+3 ; Integration Agreements Utilized:
+4 ;
+5 ; ^RGSITE(991.8, IA #2746
+6 ;
+7 ;
PAT(IEN) ;Return patient CMOR (Site IEN)
+1 NEW RESULT
+2 SET RESULT=$$GETVCCI^MPIF001(IEN)
+3 IF RESULT<0
QUIT ""
+4 QUIT RESULT
ICN(IEN) ;Return patient ICN
+1 NEW RESULT
+2 SET RESULT=$$GETICN^MPIF001(IEN)
+3 IF RESULT<0
QUIT ""
+4 QUIT +RESULT
IEN(ICN) ;Return patient IEN
+1 NEW RESULT
+2 SET RESULT=$$GETDFN^MPIF001(ICN)
+3 IF RESULT<0
QUIT ""
+4 QUIT RESULT
AUTO() ;
+1 NEW TMX
+2 SET TMX=+$PIECE($GET(^RGSITE(991.8,1,0)),"^",2)
+3 if TMX'=1&(TMX'=0)
SET TMX=0
+4 QUIT TMX
RPT1 ;
+1 ; Entry point for option MPIF SENT REQUEST. This option prints
+2 ; all outstanding requests for Change of CMOR that this site has sent.
+3 ; NO input or output variables.
+4 NEW X1,X2,Y,USER,AGE,DIC,L,BY,FLDS,FROM,TO,DIR,DTOUT,DUTOUT,DIROUT,DIRUT,X
+5 SET USER=""
+6 SET DIR("A")="Do you only want to list the requests you entered? "
SET DIR("B")="YES"
SET DIR(0)="YAO"
DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+7 IF Y=1
SET USER=DUZ
+8 SET DIR("A")="Display requests entered on or before date: "
SET DIR("B")="TODAY"
SET DIR(0)="DAO^::EP"
DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+9 SET X2=Y
SET X1=DT
DO D^%DTC
+10 SET AGE=X
+11 SET DIC="^MPIF(984.9,"
SET FLDS="[MPIF OUTSTANDING REQUESTS]"
SET L=0
+12 SET BY="[MPIF REQUEST SORT]"
SET FR=",,2,"_USER_","_AGE
SET TO=",,2,"_USER_","
+13 DO EN1^DIP
+14 QUIT
RPT2 ;
+1 ; Entry point for option: MPIF RECEIVED REQUESTS to list all change
+2 ; of CMOR requests that are still outstanding for review/processing
+3 ; NO input or output variables.
+4 NEW DIC,L,BY,FLDS,FROM,TO,DIR,DTOUT,DUTOUT,DIROUT
+5 SET DIC="^MPIF(984.9,"
SET FLDS="[MPIF OUTSTANDING REQUESTS]"
SET L=0
+6 SET BY="[MPIF PENDING REQUESTS]"
SET FR=""
SET TO=""
+7 DO EN1^DIP
+8 QUIT
INQ ;View CMOR request
+1 NEW DIC,FLDS,FR,TO,L,BY,Y
ASK SET DIC="^MPIF(984.9,"
SET DIC(0)="QEAM"
SET DIC("A")="Select Request #: "
DO ^DIC
if +Y<0
QUIT
+1 SET FR=+Y
SET TO=+Y
SET L=0
SET FLDS="[MPIF REQUEST VIEW]"
SET BY="@NUMBER"
DO EN1^DIP
+2 GOTO ASK
+3 QUIT
RPT3 ; entry point for Approved Requests
+1 ;No input of output variables
+2 NEW FR,DIC,L,BY,FLDS,FROM,TO,DIR,DTOUT,DUTOUT,DIROUT,DIRUT,X
+3 SET DIR("A")="Display requests APPROVED on or SINCE (date): "
SET DIR("B")="T-10"
SET DIR(0)="DAO^::EP"
DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+4 SET FROM=Y
+5 SET DIC="^MPIF(984.9,"
SET FLDS=".06,.01,2.02,.04,.07,1.02,.03"
+6 SET BY=".06,2.02,.04"
+7 SET FR="4,"_FROM_","
+8 SET TO="4,,"
+9 DO EN1^DIP
+10 QUIT
RPT4 ; entry point for Disapproved Requests
+1 ;No input of output variables
+2 NEW FR,DIC,L,BY,FLDS,FROM,TO,DIR,DTOUT,DUTOUT,DIROUT,DIRUT,X
+3 SET DIR("A")="Display requests DISAPPROVED on or SINCE (date): "
SET DIR("B")="T-10"
SET DIR(0)="DAO^::EP"
DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+4 SET FROM=Y
+5 SET DIC="^MPIF(984.9,"
SET FLDS=".06,.01,2.02,.04,.07,1.02,.03,3.02"
+6 SET BY=".06,2.02,.04"
+7 SET FR="5,"_FROM_","
+8 SET TO="5,,"
+9 DO EN1^DIP
+10 QUIT