RGMTHL2 ;BIR/CML-COMPILE MPI/PD HL7 DATA FOR BI-DIRECTIONAL TCP ;11/15/01
;;1.0;CLINICAL INFO RESOURCE NETWORK;**21,23,28,20**;30 Apr 99
;
;Reference to ^ORD(101 supported by IA #2596
;Reference to ^HL(772 supported by IA #3464
;Reference to ^HL(771.6 supported by IA #2507
;Reference to ^HLMA( supported by IA #3273
;Reference to ^DPT("AICN" supported by IA #2070
;
;Check to see if the ^XTMP global is present and/or complete
W @IOF
W !,"This utility searches the HL7 MESSAGE TEXT (#772) file for a selected"
W !,"date range. Each HL7 message in the date range is examined. If the"
W !,"RELATED EVENT PROTOCOL field contains the MPI/PD protocols (e.g., ""VAF"","
W !,"""RG"", or ""MPI"") data is compiled into the ^XTMP(""RGMT"",""HL"" array."
W !!,"A cross-reference is built on patient ICN and DFN for faster data retrieval"
W !,"for the associated reports."
;
G:'$D(^XTMP("RGMT","HL")) BEGIN
I '$D(^XTMP("RGMT","HL","@@@@","STOPPED")) D
.W !!,$C(7),"The Compile MPI/PD HL7 Data compilation is already running!" G QUIT
S CDT=$$FMTE^XLFDT($E(+^XTMP("RGMT","HL","@@@@","STOPPED"),1,12))
W !!,"=> ""Compile MPI/PD HL7 Data"" last ran to completion on "_CDT_".",!
I $D(^XTMP("RGMT","HL","@@@@","RANGE")) D
.W !,"=> Data has been compiled for ",^XTMP("RGMT","HL","@@@@","RANGE"),"."
W ! K DIR S DIR(0)="SMB^D:DELETE;A:APPEND"
S DIR("A",1)="Do you want to:"
S DIR("A",2)="(D)elete existing data and recompile."
S DIR("A")="(A)ppend new data after last date of existing data"
S DIR("B")="A"
S DIR("?",1)="Enter:",DIR("?",2)="D if you want to delete exiting data and recompile."
S DIR("?",3)="A or <RET> to append new data after last date of existing data."
S DIR("?")="""^"" to HALT."
D ^DIR K DIR G:$D(DIRUT) QUIT S ACT=Y
;
BEGIN ;
S RGNOW=$$NOW^XLFDT()
S:'$D(ACT) ACT="D"
W !!,"Enter date range for data to be compiled."
I ACT="A" D
.S X1=^XTMP("RGMT","HL","@@@@","COMPENDDATE"),X2=1 D C^%DTC
.S RGBDT=X W !,"Beginning Date for Report: ",$$FMTE^XLFDT(X)
I ACT="D" D G:$D(DIRUT) QUIT
.K DIR,DIRUT,DTOUT,DUOUT
.S DIR(0)="DAO^:"_$$NOW^XLFDT()_":EPXT",DIR("A")="Beginning Date for Report: "
.D ^DIR K DIR Q:$D(DIRUT) S RGBDT=Y
K DIR,DIRUT,DTOUT,DUOUT
S DIR(0)="DAO^"_RGBDT_":"_$$NOW^XLFDT()_":EPXT",DIR("A")="Ending Date for Report: "
D ^DIR K DIR G:$D(DIRUT) QUIT S RGEDT=Y
;
QUE ;Queue the task.
S ZTSAVE("RGBDT")="",ZTSAVE("RGEDT")="",ZTSAVE("ACT")=""
S ZTIO="",ZTRTN="START^RGMTHL2",ZTDESC="Compile MPI/PD HL7 Data (bi-directional)" D ^%ZTLOAD
G QUIT
;
START ;
S QFLG=0
K ^XTMP("RGMT","HL","@@@@","STOPPED")
I ACT="D" K ^XTMP("RGMT","HL"),^XTMP("RGMT","HLICN"),^XTMP("RGMT","HLDFN")
S U="^" D NOW^%DTC
S ^XTMP("RGMT","HL","@@@@","STARTED")=%
S ^XTMP("RGMT",0)=$$FMADD^XLFDT(DT,30)_"^"_%_"^MPI/PD Maintenance Data"
S STOPDT=$S($L(RGEDT)=7:RGEDT_.24,1:RGEDT)
S RGDT=$S($L(RGBDT)=7:$$FMADD^XLFDT(RGBDT,-1)_.24,1:RGBDT-.0001)
I ACT="D" S ^XTMP("RGMT","HL","@@@@","COMPBEGINDATE")=RGDT
S ^XTMP("RGMT","HL","@@@@","COMPENDDATE")=STOPDT
S PRGBDT=$$FMTE^XLFDT(RGDT)
S PRGEDT=$$FMTE^XLFDT(STOPDT)
S ^XTMP("RGMT","HL","@@@@","RANGE")=PRGBDT_" to "_PRGEDT
;
LOOP ;Loop on ^HL(772 date xref
F S RGDT=$O(^HL(772,"B",RGDT)) Q:'RGDT Q:RGDT>STOPDT Q:QFLG D
.I $D(^XTMP("RGMT","HL","@@@@","FORCE STOP")) S QFLG=1 Q
.S ^XTMP("RGMT","HL","@@@@","NOW PROCESSING DATE")=RGDT
.S IEN=0
.F S IEN=$O(^HL(772,"B",RGDT,IEN)) Q:'IEN S IEN0=$G(^HL(772,IEN,0)) Q:'IEN0 D
..S REP=$P(IEN0,U,10)
..I REP D
...I '$D(^ORD(101,REP,0)) Q
...S REPNM=$P(^ORD(101,REP,0),U),RPNM=$E(REPNM,1,4)
...I RPNM["VAF"!(RPNM["RG")!(RPNM["MPI") D
....S TYPE=$P(IEN0,U,4),STAT=$P($G(^HL(772,IEN,"P")),U)
....I STAT="" D
.....S HL773=$O(^HLMA("B",IEN,0))
.....S STAT=$P($G(^HLMA(HL773,"P")),"^")
....I STAT S STATNM=$P(^HL(771.6,STAT,0),U)
....I STAT="" S STATNM="NO STATUS"
....S ^XTMP("RGMT","HL",REPNM,$P(RGDT,"."),TYPE,STATNM,IEN)=""
PAT ....S TXT=0 F S TXT=$O(^HL(772,IEN,"IN",TXT)) Q:'TXT D
.....I $P(^HL(772,IEN,"IN",TXT,0),U)="PID" S GOT=0 D Q:GOT
......I $P(^HL(772,IEN,"IN",TXT,0),"^",4)["V" S ICN=+$P(^(0),"^",4) D SET
......I $P(^HL(772,IEN,"IN",TXT,0),"^",3)["V" S ICN=+$P(^(0),"^",3) D SET
.....I $P(^HL(772,IEN,"IN",TXT,0),U)="QAK" S GOT=0 D Q:GOT
......I +$P(^(0),U,2) S DFN=+$P(^(0),U,2) S ^XTMP("RGMT","HLDFN",DFN,RGDT,REPNM,TYPE,STATNM,IEN)="",GOT=1
.....I $P(^HL(772,IEN,"IN",TXT,0),U)="RDT" S ICN=+$P($P(^(0),U,6),"V") I ICN D Q
......S ^XTMP("RGMT","HLICN",ICN,RGDT,REPNM,TYPE,STATNM,IEN)="(Look at ^HL(772,"_IEN_",""IN"","_TXT_",0)",GOT=1
.....I $P(^HL(772,IEN,"IN",TXT,0),U)="VTQ" S GOT=0 D Q:GOT
......S SSN=$P($P(^HL(772,IEN,"IN",TXT,0),"@00122",2),"~",3) I SSN D
.......S DFN=$O(^DPT("SSN",SSN,0)) I DFN D
........S ^XTMP("RGMT","HLDFN",DFN,RGDT,REPNM,TYPE,STATNM,IEN)="(Look at ^HL(772,"_IEN_",""IN"","_TXT_",0)",GOT=1
.....I $P(^HL(772,IEN,"IN",TXT,0),U)="MFE",$P(^(0),U,2)="MAD" S ICN=+$P($P(^(0),U,5),"~",4) D SET Q
.....I $P(^HL(772,IEN,"IN",TXT,0),U)="MFE",$P(^(0),U,2)="MUP" D Q
......S ICN=+$P(^HL(772,IEN,"IN",TXT,0),U,5) I $L(ICN)=3 S ICN=+$P($P(^HL(772,IEN,"IN",TXT,0),U,5),"~",4)
......D SET
;
D NOW^%DTC S ^XTMP("RGMT","HL","@@@@","STOPPED")=%
K ^XTMP("RGMT","HL","@@@@","NOW PROCESSING DATE"),^XTMP("RGMT","HL","@@@@","FORCE STOP")
;
QUIT ;
K %,ACT,CDT,DFN,GOT,HL773,ICN,IEN,IEN0,PRGBDT,PRGEDT,REP,REPNM,RGBDT,RGDT
K RGEDT,RGNOW,RPNM,SSN,STAT,STATNM,STOPDT,TYPE,TXT,X,X1,X2,Y,ZTSK,STOP,FROM,QFLG,RANGE
S:$D(ZTQUEUED) ZTREQ="@"
Q
;
SET ;
S GOT=1
S ^XTMP("RGMT","HLICN",ICN,RGDT,REPNM,TYPE,STATNM,IEN)=""
S DFN=$O(^DPT("AICN",ICN,0)) I +DFN S ^XTMP("RGMT","HLDFN",DFN,RGDT,REPNM,TYPE,STATNM,IEN)=""
Q
;
STOP ;stop the compile
W !!,"Stop HL7 Message Compile."
I '$D(^XTMP("RGMT","HL","@@@@","STARTED")) W !?3,"<< No compile is currently running >>" G QUIT
I $D(^XTMP("RGMT","HL","@@@@","STARTED"))&($D(^XTMP("RGMT","HL","@@@@","STOPPED"))) W !?3,"<< No compile is currently running >>" G QUIT
;
W !!,"A compile is currently running for ",?35,": ",^XTMP("RGMT","HL","@@@@","RANGE"),"."
W ! S DIR(0)="Y",DIR("B")="Yes",DIR("A")="Do you want to stop this compile" D ^DIR K DIR
I +Y D
.S ^XTMP("RGMT","HL","@@@@","FORCE STOP")=""
.S STOP=$$NOW^XLFDT
.S RANGE=^XTMP("RGMT","HL","@@@@","RANGE"),FROM=$P(RANGE," to ",1)
.S ^XTMP("RGMT","HL","@@@@","RANGE")=FROM_" to "_$$FMTE^XLFDT(STOP)
G QUIT
;
SHOW ;show status of compile
W !!,"Show status of HL7 Message Compile."
I '$D(^XTMP("RGMT","HL","@@@@","STARTED")) W !?3,"<< No compile is currently running >>" G QUIT
W !!,"Compile range ",?31,": ",^XTMP("RGMT","HL","@@@@","RANGE")
W !,"The compile was started ",?31,": ",$$FMTE^XLFDT(^XTMP("RGMT","HL","@@@@","STARTED"))
I $D(^XTMP("RGMT","HL","@@@@","NOW PROCESSING DATE")) D
.W !,"The compile is now processing ",?31,": ",$$FMTE^XLFDT(^XTMP("RGMT","HL","@@@@","NOW PROCESSING DATE"))
I $D(^XTMP("RGMT","HL","@@@@","STOPPED")) D
.W !,"The compile was stopped ",?31,": ",$$FMTE^XLFDT(^XTMP("RGMT","HL","@@@@","STOPPED"))
G QUIT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRGMTHL2 7102 printed Dec 13, 2024@01:42:20 Page 2
RGMTHL2 ;BIR/CML-COMPILE MPI/PD HL7 DATA FOR BI-DIRECTIONAL TCP ;11/15/01
+1 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**21,23,28,20**;30 Apr 99
+2 ;
+3 ;Reference to ^ORD(101 supported by IA #2596
+4 ;Reference to ^HL(772 supported by IA #3464
+5 ;Reference to ^HL(771.6 supported by IA #2507
+6 ;Reference to ^HLMA( supported by IA #3273
+7 ;Reference to ^DPT("AICN" supported by IA #2070
+8 ;
+9 ;Check to see if the ^XTMP global is present and/or complete
+10 WRITE @IOF
+11 WRITE !,"This utility searches the HL7 MESSAGE TEXT (#772) file for a selected"
+12 WRITE !,"date range. Each HL7 message in the date range is examined. If the"
+13 WRITE !,"RELATED EVENT PROTOCOL field contains the MPI/PD protocols (e.g., ""VAF"","
+14 WRITE !,"""RG"", or ""MPI"") data is compiled into the ^XTMP(""RGMT"",""HL"" array."
+15 WRITE !!,"A cross-reference is built on patient ICN and DFN for faster data retrieval"
+16 WRITE !,"for the associated reports."
+17 ;
+18 if '$DATA(^XTMP("RGMT","HL"))
GOTO BEGIN
+19 IF '$DATA(^XTMP("RGMT","HL","@@@@","STOPPED"))
Begin DoDot:1
+20 WRITE !!,$CHAR(7),"The Compile MPI/PD HL7 Data compilation is already running!"
GOTO QUIT
End DoDot:1
+21 SET CDT=$$FMTE^XLFDT($EXTRACT(+^XTMP("RGMT","HL","@@@@","STOPPED"),1,12))
+22 WRITE !!,"=> ""Compile MPI/PD HL7 Data"" last ran to completion on "_CDT_".",!
+23 IF $DATA(^XTMP("RGMT","HL","@@@@","RANGE"))
Begin DoDot:1
+24 WRITE !,"=> Data has been compiled for ",^XTMP("RGMT","HL","@@@@","RANGE"),"."
End DoDot:1
+25 WRITE !
KILL DIR
SET DIR(0)="SMB^D:DELETE;A:APPEND"
+26 SET DIR("A",1)="Do you want to:"
+27 SET DIR("A",2)="(D)elete existing data and recompile."
+28 SET DIR("A")="(A)ppend new data after last date of existing data"
+29 SET DIR("B")="A"
+30 SET DIR("?",1)="Enter:"
SET DIR("?",2)="D if you want to delete exiting data and recompile."
+31 SET DIR("?",3)="A or <RET> to append new data after last date of existing data."
+32 SET DIR("?")="""^"" to HALT."
+33 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO QUIT
SET ACT=Y
+34 ;
BEGIN ;
+1 SET RGNOW=$$NOW^XLFDT()
+2 if '$DATA(ACT)
SET ACT="D"
+3 WRITE !!,"Enter date range for data to be compiled."
+4 IF ACT="A"
Begin DoDot:1
+5 SET X1=^XTMP("RGMT","HL","@@@@","COMPENDDATE")
SET X2=1
DO C^%DTC
+6 SET RGBDT=X
WRITE !,"Beginning Date for Report: ",$$FMTE^XLFDT(X)
End DoDot:1
+7 IF ACT="D"
Begin DoDot:1
+8 KILL DIR,DIRUT,DTOUT,DUOUT
+9 SET DIR(0)="DAO^:"_$$NOW^XLFDT()_":EPXT"
SET DIR("A")="Beginning Date for Report: "
+10 DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
SET RGBDT=Y
End DoDot:1
if $DATA(DIRUT)
GOTO QUIT
+11 KILL DIR,DIRUT,DTOUT,DUOUT
+12 SET DIR(0)="DAO^"_RGBDT_":"_$$NOW^XLFDT()_":EPXT"
SET DIR("A")="Ending Date for Report: "
+13 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO QUIT
SET RGEDT=Y
+14 ;
QUE ;Queue the task.
+1 SET ZTSAVE("RGBDT")=""
SET ZTSAVE("RGEDT")=""
SET ZTSAVE("ACT")=""
+2 SET ZTIO=""
SET ZTRTN="START^RGMTHL2"
SET ZTDESC="Compile MPI/PD HL7 Data (bi-directional)"
DO ^%ZTLOAD
+3 GOTO QUIT
+4 ;
START ;
+1 SET QFLG=0
+2 KILL ^XTMP("RGMT","HL","@@@@","STOPPED")
+3 IF ACT="D"
KILL ^XTMP("RGMT","HL"),^XTMP("RGMT","HLICN"),^XTMP("RGMT","HLDFN")
+4 SET U="^"
DO NOW^%DTC
+5 SET ^XTMP("RGMT","HL","@@@@","STARTED")=%
+6 SET ^XTMP("RGMT",0)=$$FMADD^XLFDT(DT,30)_"^"_%_"^MPI/PD Maintenance Data"
+7 SET STOPDT=$SELECT($LENGTH(RGEDT)=7:RGEDT_.24,1:RGEDT)
+8 SET RGDT=$SELECT($LENGTH(RGBDT)=7:$$FMADD^XLFDT(RGBDT,-1)_.24,1:RGBDT-.0001)
+9 IF ACT="D"
SET ^XTMP("RGMT","HL","@@@@","COMPBEGINDATE")=RGDT
+10 SET ^XTMP("RGMT","HL","@@@@","COMPENDDATE")=STOPDT
+11 SET PRGBDT=$$FMTE^XLFDT(RGDT)
+12 SET PRGEDT=$$FMTE^XLFDT(STOPDT)
+13 SET ^XTMP("RGMT","HL","@@@@","RANGE")=PRGBDT_" to "_PRGEDT
+14 ;
LOOP ;Loop on ^HL(772 date xref
+1 FOR
SET RGDT=$ORDER(^HL(772,"B",RGDT))
if 'RGDT
QUIT
if RGDT>STOPDT
QUIT
if QFLG
QUIT
Begin DoDot:1
+2 IF $DATA(^XTMP("RGMT","HL","@@@@","FORCE STOP"))
SET QFLG=1
QUIT
+3 SET ^XTMP("RGMT","HL","@@@@","NOW PROCESSING DATE")=RGDT
+4 SET IEN=0
+5 FOR
SET IEN=$ORDER(^HL(772,"B",RGDT,IEN))
if 'IEN
QUIT
SET IEN0=$GET(^HL(772,IEN,0))
if 'IEN0
QUIT
Begin DoDot:2
+6 SET REP=$PIECE(IEN0,U,10)
+7 IF REP
Begin DoDot:3
+8 IF '$DATA(^ORD(101,REP,0))
QUIT
+9 SET REPNM=$PIECE(^ORD(101,REP,0),U)
SET RPNM=$EXTRACT(REPNM,1,4)
+10 IF RPNM["VAF"!(RPNM["RG")!(RPNM["MPI")
Begin DoDot:4
+11 SET TYPE=$PIECE(IEN0,U,4)
SET STAT=$PIECE($GET(^HL(772,IEN,"P")),U)
+12 IF STAT=""
Begin DoDot:5
+13 SET HL773=$ORDER(^HLMA("B",IEN,0))
+14 SET STAT=$PIECE($GET(^HLMA(HL773,"P")),"^")
End DoDot:5
+15 IF STAT
SET STATNM=$PIECE(^HL(771.6,STAT,0),U)
+16 IF STAT=""
SET STATNM="NO STATUS"
+17 SET ^XTMP("RGMT","HL",REPNM,$PIECE(RGDT,"."),TYPE,STATNM,IEN)=""
PAT SET TXT=0
FOR
SET TXT=$ORDER(^HL(772,IEN,"IN",TXT))
if 'TXT
QUIT
Begin DoDot:5
+1 IF $PIECE(^HL(772,IEN,"IN",TXT,0),U)="PID"
SET GOT=0
Begin DoDot:6
+2 IF $PIECE(^HL(772,IEN,"IN",TXT,0),"^",4)["V"
SET ICN=+$PIECE(^(0),"^",4)
DO SET
+3 IF $PIECE(^HL(772,IEN,"IN",TXT,0),"^",3)["V"
SET ICN=+$PIECE(^(0),"^",3)
DO SET
End DoDot:6
if GOT
QUIT
+4 IF $PIECE(^HL(772,IEN,"IN",TXT,0),U)="QAK"
SET GOT=0
Begin DoDot:6
+5 IF +$PIECE(^(0),U,2)
SET DFN=+$PIECE(^(0),U,2)
SET ^XTMP("RGMT","HLDFN",DFN,RGDT,REPNM,TYPE,STATNM,IEN)=""
SET GOT=1
End DoDot:6
if GOT
QUIT
+6 IF $PIECE(^HL(772,IEN,"IN",TXT,0),U)="RDT"
SET ICN=+$PIECE($PIECE(^(0),U,6),"V")
IF ICN
Begin DoDot:6
+7 SET ^XTMP("RGMT","HLICN",ICN,RGDT,REPNM,TYPE,STATNM,IEN)="(Look at ^HL(772,"_IEN_",""IN"","_TXT_",0)"
SET GOT=1
End DoDot:6
QUIT
+8 IF $PIECE(^HL(772,IEN,"IN",TXT,0),U)="VTQ"
SET GOT=0
Begin DoDot:6
+9 SET SSN=$PIECE($PIECE(^HL(772,IEN,"IN",TXT,0),"@00122",2),"~",3)
IF SSN
Begin DoDot:7
+10 SET DFN=$ORDER(^DPT("SSN",SSN,0))
IF DFN
Begin DoDot:8
+11 SET ^XTMP("RGMT","HLDFN",DFN,RGDT,REPNM,TYPE,STATNM,IEN)="(Look at ^HL(772,"_IEN_",""IN"","_TXT_",0)"
SET GOT=1
End DoDot:8
End DoDot:7
End DoDot:6
if GOT
QUIT
+12 IF $PIECE(^HL(772,IEN,"IN",TXT,0),U)="MFE"
IF $PIECE(^(0),U,2)="MAD"
SET ICN=+$PIECE($PIECE(^(0),U,5),"~",4)
DO SET
QUIT
+13 IF $PIECE(^HL(772,IEN,"IN",TXT,0),U)="MFE"
IF $PIECE(^(0),U,2)="MUP"
Begin DoDot:6
+14 SET ICN=+$PIECE(^HL(772,IEN,"IN",TXT,0),U,5)
IF $LENGTH(ICN)=3
SET ICN=+$PIECE($PIECE(^HL(772,IEN,"IN",TXT,0),U,5),"~",4)
+15 DO SET
End DoDot:6
QUIT
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+16 ;
+17 DO NOW^%DTC
SET ^XTMP("RGMT","HL","@@@@","STOPPED")=%
+18 KILL ^XTMP("RGMT","HL","@@@@","NOW PROCESSING DATE"),^XTMP("RGMT","HL","@@@@","FORCE STOP")
+19 ;
QUIT ;
+1 KILL %,ACT,CDT,DFN,GOT,HL773,ICN,IEN,IEN0,PRGBDT,PRGEDT,REP,REPNM,RGBDT,RGDT
+2 KILL RGEDT,RGNOW,RPNM,SSN,STAT,STATNM,STOPDT,TYPE,TXT,X,X1,X2,Y,ZTSK,STOP,FROM,QFLG,RANGE
+3 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+4 QUIT
+5 ;
SET ;
+1 SET GOT=1
+2 SET ^XTMP("RGMT","HLICN",ICN,RGDT,REPNM,TYPE,STATNM,IEN)=""
+3 SET DFN=$ORDER(^DPT("AICN",ICN,0))
IF +DFN
SET ^XTMP("RGMT","HLDFN",DFN,RGDT,REPNM,TYPE,STATNM,IEN)=""
+4 QUIT
+5 ;
STOP ;stop the compile
+1 WRITE !!,"Stop HL7 Message Compile."
+2 IF '$DATA(^XTMP("RGMT","HL","@@@@","STARTED"))
WRITE !?3,"<< No compile is currently running >>"
GOTO QUIT
+3 IF $DATA(^XTMP("RGMT","HL","@@@@","STARTED"))&($DATA(^XTMP("RGMT","HL","@@@@","STOPPED")))
WRITE !?3,"<< No compile is currently running >>"
GOTO QUIT
+4 ;
+5 WRITE !!,"A compile is currently running for ",?35,": ",^XTMP("RGMT","HL","@@@@","RANGE"),"."
+6 WRITE !
SET DIR(0)="Y"
SET DIR("B")="Yes"
SET DIR("A")="Do you want to stop this compile"
DO ^DIR
KILL DIR
+7 IF +Y
Begin DoDot:1
+8 SET ^XTMP("RGMT","HL","@@@@","FORCE STOP")=""
+9 SET STOP=$$NOW^XLFDT
+10 SET RANGE=^XTMP("RGMT","HL","@@@@","RANGE")
SET FROM=$PIECE(RANGE," to ",1)
+11 SET ^XTMP("RGMT","HL","@@@@","RANGE")=FROM_" to "_$$FMTE^XLFDT(STOP)
End DoDot:1
+12 GOTO QUIT
+13 ;
SHOW ;show status of compile
+1 WRITE !!,"Show status of HL7 Message Compile."
+2 IF '$DATA(^XTMP("RGMT","HL","@@@@","STARTED"))
WRITE !?3,"<< No compile is currently running >>"
GOTO QUIT
+3 WRITE !!,"Compile range ",?31,": ",^XTMP("RGMT","HL","@@@@","RANGE")
+4 WRITE !,"The compile was started ",?31,": ",$$FMTE^XLFDT(^XTMP("RGMT","HL","@@@@","STARTED"))
+5 IF $DATA(^XTMP("RGMT","HL","@@@@","NOW PROCESSING DATE"))
Begin DoDot:1
+6 WRITE !,"The compile is now processing ",?31,": ",$$FMTE^XLFDT(^XTMP("RGMT","HL","@@@@","NOW PROCESSING DATE"))
End DoDot:1
+7 IF $DATA(^XTMP("RGMT","HL","@@@@","STOPPED"))
Begin DoDot:1
+8 WRITE !,"The compile was stopped ",?31,": ",$$FMTE^XLFDT(^XTMP("RGMT","HL","@@@@","STOPPED"))
End DoDot:1
+9 GOTO QUIT