PXRMETHL ; SLC/PKR/PJH - Reminder Extract Transmissions; 12/09/2003
;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
;
;Main entry point for PXRM EXTRACT TRANSMISSIONS
START(IEN) N VALMBCK,VALMCNT,VALMSG,X,XMZ,XQORM,XQORNOD
;Details of last run
N DATA,NPERIOD,NSDATE,NTASK
S DATA=$G(^PXRM(810.2,IEN,0))
;S NPERIOD=$P(DATA,U,6),NSDATE=$P(DATA,U,7),NTASK=$P(DATA,U,8)
S NPERIOD=$P(DATA,U,6),NSDATE=$P(DATA,U,7)
S VALMCNT=0
D EN^VALM("PXRM EXTRACT TRANSMISSIONS")
Q
;
BLDLIST ;Build workfile
K ^TMP("PXRMETHL",$J)
;List of HL7 transmissions in reverse date order
N ID,SUB,XDATE,XSTATUS
S ID=""
F S ID=$O(^PXRMXT(810.3,IEN,5,"B",ID),-1) Q:ID="" D
.S SUB=$O(^PXRMXT(810.3,IEN,5,"B",ID,"")) Q:'SUB
.S XDATE=$P($G(^PXRMXT(810.3,IEN,5,SUB,0)),U,2)
.S XSTATUS=$$STATUS^PXRM7API(ID)
.I 'XDATE S XDATE="Not Transmitted",XSTATUS=""
.S VALMCNT=VALMCNT+1
.S ^TMP("PXRMETHL",$J,VALMCNT,0)=$$FRE(ID,XDATE,XSTATUS)
Q
;
FRE(ID,DATE,STATUS) ;Format entry number, name, date created
N TDATE,TEMP,TID,TSTATUS
S TID=$E(ID,1,13)
S TEMP=" "_$$LJ^XLFSTR(TID,16," ")
S TDATE=$$FMTE^XLFDT(DATE,"5Z")
S TEMP=TEMP_" "_$$LJ^XLFSTR(TDATE,20," ")
S TSTATUS=$E(STATUS,1,38)
S TEMP=TEMP_" "_$$LJ^XLFSTR(TSTATUS,38," ")
Q TEMP
;
ENTRY ;Entry code
D BLDLIST
Q
;
EXIT ;Exit code
K ^TMP("PXRMETHL",$J)
D CLEAN^VALM10
D FULL^VALM1
S VALMBCK="Q"
Q
;
HDR ; Header code
S VALMHDR(2)=" Extract Summary Name: "_$P($G(^PXRMXT(810.3,IEN,0)),U)
S VALMHDR(3)=" Date Created: "_$$FMTE^XLFDT($P($G(^PXRMXT(810.3,IEN,0)),U,6),"5Z")
S VALMSG="+ Next Screen - Prev Screen ?? More Actions"
Q
;
INIT ;Initialization code
S VALMCNT=0
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRMETHL 1711 printed Sep 15, 2024@21:08:53 Page 2
PXRMETHL ; SLC/PKR/PJH - Reminder Extract Transmissions; 12/09/2003
+1 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
+2 ;
+3 ;Main entry point for PXRM EXTRACT TRANSMISSIONS
START(IEN) NEW VALMBCK,VALMCNT,VALMSG,X,XMZ,XQORM,XQORNOD
+1 ;Details of last run
+2 NEW DATA,NPERIOD,NSDATE,NTASK
+3 SET DATA=$GET(^PXRM(810.2,IEN,0))
+4 ;S NPERIOD=$P(DATA,U,6),NSDATE=$P(DATA,U,7),NTASK=$P(DATA,U,8)
+5 SET NPERIOD=$PIECE(DATA,U,6)
SET NSDATE=$PIECE(DATA,U,7)
+6 SET VALMCNT=0
+7 DO EN^VALM("PXRM EXTRACT TRANSMISSIONS")
+8 QUIT
+9 ;
BLDLIST ;Build workfile
+1 KILL ^TMP("PXRMETHL",$JOB)
+2 ;List of HL7 transmissions in reverse date order
+3 NEW ID,SUB,XDATE,XSTATUS
+4 SET ID=""
+5 FOR
SET ID=$ORDER(^PXRMXT(810.3,IEN,5,"B",ID),-1)
if ID=""
QUIT
Begin DoDot:1
+6 SET SUB=$ORDER(^PXRMXT(810.3,IEN,5,"B",ID,""))
if 'SUB
QUIT
+7 SET XDATE=$PIECE($GET(^PXRMXT(810.3,IEN,5,SUB,0)),U,2)
+8 SET XSTATUS=$$STATUS^PXRM7API(ID)
+9 IF 'XDATE
SET XDATE="Not Transmitted"
SET XSTATUS=""
+10 SET VALMCNT=VALMCNT+1
+11 SET ^TMP("PXRMETHL",$JOB,VALMCNT,0)=$$FRE(ID,XDATE,XSTATUS)
End DoDot:1
+12 QUIT
+13 ;
FRE(ID,DATE,STATUS) ;Format entry number, name, date created
+1 NEW TDATE,TEMP,TID,TSTATUS
+2 SET TID=$EXTRACT(ID,1,13)
+3 SET TEMP=" "_$$LJ^XLFSTR(TID,16," ")
+4 SET TDATE=$$FMTE^XLFDT(DATE,"5Z")
+5 SET TEMP=TEMP_" "_$$LJ^XLFSTR(TDATE,20," ")
+6 SET TSTATUS=$EXTRACT(STATUS,1,38)
+7 SET TEMP=TEMP_" "_$$LJ^XLFSTR(TSTATUS,38," ")
+8 QUIT TEMP
+9 ;
ENTRY ;Entry code
+1 DO BLDLIST
+2 QUIT
+3 ;
EXIT ;Exit code
+1 KILL ^TMP("PXRMETHL",$JOB)
+2 DO CLEAN^VALM10
+3 DO FULL^VALM1
+4 SET VALMBCK="Q"
+5 QUIT
+6 ;
HDR ; Header code
+1 SET VALMHDR(2)=" Extract Summary Name: "_$PIECE($GET(^PXRMXT(810.3,IEN,0)),U)
+2 SET VALMHDR(3)=" Date Created: "_$$FMTE^XLFDT($PIECE($GET(^PXRMXT(810.3,IEN,0)),U,6),"5Z")
+3 SET VALMSG="+ Next Screen - Prev Screen ?? More Actions"
+4 QUIT
+5 ;
INIT ;Initialization code
+1 SET VALMCNT=0
+2 QUIT