Print Page as PDF
Use of Routine MPIHLO2 ICR (5251)

Use of Routine MPIHLO2    ICR (5251)

Name Value
NUMBER 5251
IA # 5251
DATE CREATED 2008/08/05
CUSTODIAL PACKAGE HEALTH LEVEL SEVEN
USAGE Private
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE MPIHLO2
NAME Use of Routine MPIHLO2
GENERAL DESCRIPTION

Master Patient Index (Austin) is requesting permission from the
HL7 developers to establish a private, temporary IA to use routine
MPIHLO2.  This HL7 routine was provided by the HL7 developers, to
be installed as MPIHLO2 on the Master Patient Index (Austin).
The routine will be directly removing entries from an existing
sequence queue (^HLB("QUEUE","SEQUEUNCE","MPI LKMV") global and
placing them on an existing out queue (^HLB("QUEUE","OUT") with
the use of the OUTQUE^HLOQUE API (for more details see the routine
below).  The code also resets the ^HLC status global as well.

The need for this request came from the System-of-System (SoS)
group to help address the critical backlog of messages on the
MPI HLO MPI LKMV sequence queue to PSIM.  The ESR project is
scheduled to go live on 8/15/08.  In order to accomplish this,
it would require that the MPI HLO queues not have a backlog of
messages.  However the current backlog of messages on the MPI
will not be finished at the current rate with the current
software until 9/20/08.

The use of routine MPIHLO2 is a temporary measure that will take
all of the ADD events that are currently stacked up on one outbound
queue (Adds/Links/Moves queue) to PSIM and move them directly to the
outbound queue which will allow them to be processed simultaneously
in PSIM rather than one at a time.  The implementation will guarantee
that the two databases (MPI and ADR) will stay synchronized by
shutting down the EVENT sequence queue (Add/Link/Move) until all of
the ADD events are sent and successfully processed by PSIM.  Then
and only then will we resume normal processing.

This routine will only be used a few times (at most for only a few
months).  After that we plan to retire it for a more permanent
solution to address the MPI to PSIM synchronization throughput issue.

NOTE:  Although routine MPIHLO2 was provided/reviewed by the HL7
developers, testing and SQA is the sole responsibility of the
Master Patient Index development team.
STATUS Active
DURATION Till Otherwise Agreed
ID MPIHLO2
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION
MPIHLO2

MPIHLO2 ;IRMFO-ALB/CJM -one time conversion of MPI's sequence
queues; 03/24/2004 14:43 ;07/29/2008
;;1.0;MASTER PATIENT INDEX AUSTIN;**73**;30 Apr 99
;
;pull record off of MPI LKMV out queue first
;example ^HLB("QUEUE","OUT","VAPSIM:5027","MPI
LKMV",586)=""
;example ^HLB("QUEUE","SEQUENCE","MPI LKMV")=586
<-- msg=586 has already been moved to the outque,
it is the msg that the sequence queue is waiting on
;example ^HLB("QUEUE","SEQUENCE","MPI LKMV",587)=""
<-- msg=588 is the next message ont he sequence queue
that needs to be moved to the out queue whenthe app
ack for msg 587 is received
;
;
N CNT,MPIQ,IEN
S CNT=0
S MPIQ="MPI LKMV"
S IEN=""
;
F  S IEN=$O(^HLB("QUEUE","SEQUENCE",MPIQ,IEN)) Q:'IEN  D
.I $$MOVE(IEN) S CNT=CNT+1
;
;decrement the counter for the sequence queues
I $$INC^HLOSITE($NA(^HLC("QUEUECOUNT","SEQUENCE")),-CNT)
W !,"MOVE COMPLETED. Count of records moved:",CNT
Q
;
MOVE(IEN) ;returns 1 if the msg was moved, 0 if it was not
N MOVED,BODY,ICN1,ICN2
S MOVED=0
;
S BODY=$P(^HLB(IEN,0),"^",2)
Q:'BODY 0
;
S ICN1=+$P($G(^HLA(BODY,1,3,0)),"^",4)
S ICN2=+$P($G(^HLA(BODY,1,6,0)),"^",4)
S:ICN2=0 ICN2=+$P($G(^HLA(BODY,1,7,0)),"^",4)
;add event
I ICN1=ICN2 D
.N MSG,OLDSEQ,OLDOUT,LINK,PORT,NEWQUE,FS,CS,EVENT
.Q:'$$GETMSG^HLOMSG(IEN,.MSG)
.S FS=$E(MSG("HDR",1),4)
.S CS=$E(MSG("HDR",1),5)
.S EVENT=$P($P(MSG("HDR",2),FS,4),CS,2)
.S OLDSEQ=$G(MSG("STATUS","SEQUENCE QUEUE"))
.;
.Q:EVENT'="A24"
.;
.S OLDOUT=$G(MSG("STATUS","QUEUE"))
.S LINK=$G(MSG("STATUS","LINK NAME"))
.S PORT=$G(MSG("STATUS","PORT"))
.S NEWQUE="MPI UPD"_$E(+ICN1,$L(+ICN1)-2,$L(+ICN1))
.Q:'$L(NEWQUE)
.I NEWQUE'=OLDOUT D
..;update the message to show the new outgoing queue
..S $P(^HLB(IEN,0),"^",6)=NEWQUE
.;
.;remove the msg from the sequence queue
.K ^HLB("QUEUE","SEQUENCE",OLDSEQ,IEN)
.;
.;put the msg on the outgoing queue
.D OUTQUE^HLOQUE(LINK,PORT,NEWQUE,IEN)
.;
.;node 5 can be killed - it makes it as if a sequence
queue was never involved
.K ^HLB(IEN,5)
.S MOVED=1
Q MOVED
SUBSCRIBING PACKAGE MASTER PATIENT INDEX
DATE ACTIVATED 2009/03/16
REMINDER 2009/04/01