RORHDT01 ;HCIOFO/SG - HISTORICAL DATA EXTRACTION STATUS ; 12/21/05 3:41pm
;;1.5;CLINICAL CASE REGISTRIES;;Feb 17, 2006
;
Q
;
;***** DISPLAYS THE LATEST TASK LOG
;
; HDEIEN Data Extract IEN
; TASKIEN Task IEN
;
; Return Values:
; <0 Error code
; 0 Ok
;
LOG(HDEIEN,TASKIEN) ;
N BY,FIC,FR,IENS,INFO,IOP,L,LOGIEN,RC,TASK,TO
;--- Get the task number
S TASK=$$TASKNUM^RORHDTUT(HDEIEN,TASKIEN)
Q:TASK<0 TASK
I 'TASK D Q 0
. W !!,"Sorry. It appears that this task has not been run."
;--- Get the task info (Log IEN, in particular)
S RC=$$TASKINFO^RORTSK02(TASK,.INFO,"E") Q:RC<0 RC
S LOGIEN=+$G(INFO(12))
;--- Print the log
I LOGIEN>0,$D(^RORDATA(798.7,LOGIEN)) D
. S L=0,DIC=798.7
. S BY="NUMBER;@,4,.01;@",FLDS="[ROR LOG]"
. S (FR,TO)=LOGIEN
. W ! D EN1^DIP
E W !!,"Sorry. The log is not available."
Q 0
;
;***** DISPLAYS DATA EXTRACTION STATUS
;
; HDEIEN Data Extract IEN
;
; Return Values:
; <0 Error code
; 0 Ok
;
STATUS(HDEIEN) ;
N I,IENS,REGLST,RORBUF,RORMSG,TMP
;--- Get values from the main record
S IENS=(+HDEIEN)_","
D GETS^DIQ(799.6,IENS,".01;.03;.04;2;3*","EI","RORBUF","RORMSG")
Q:$G(DIERR) $$DBS^RORERR("RORMSG",-9,,,799.6,IENS)
;--- Compile the list of registries
S (I,REGLST)=""
F S I=$O(RORBUF(799.63,I)) Q:I="" D
. S TMP=$G(RORBUF(799.63,I,.01,"E"))
. S:TMP'="" REGLST=REGLST_", "_TMP
;--- Display the data extraction information
W !
W !,"Name: ",RORBUF(799.6,IENS,.01,"E")
W !,"Registries: ",$P(REGLST,", ",2,999)
W !,"Date Range: ",$G(RORBUF(799.6,IENS,.03,"E"))
W " -- ",$G(RORBUF(799.6,IENS,.04,"E"))
W !,"Output Dir: ",$G(RORBUF(799.6,IENS,2,"E")),!
;--- Display the task list
Q $$TASKLIST^RORHDTUT(HDEIEN)
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRORHDT01 1807 printed Dec 13, 2024@01:41:34 Page 2
RORHDT01 ;HCIOFO/SG - HISTORICAL DATA EXTRACTION STATUS ; 12/21/05 3:41pm
+1 ;;1.5;CLINICAL CASE REGISTRIES;;Feb 17, 2006
+2 ;
+3 QUIT
+4 ;
+5 ;***** DISPLAYS THE LATEST TASK LOG
+6 ;
+7 ; HDEIEN Data Extract IEN
+8 ; TASKIEN Task IEN
+9 ;
+10 ; Return Values:
+11 ; <0 Error code
+12 ; 0 Ok
+13 ;
LOG(HDEIEN,TASKIEN) ;
+1 NEW BY,FIC,FR,IENS,INFO,IOP,L,LOGIEN,RC,TASK,TO
+2 ;--- Get the task number
+3 SET TASK=$$TASKNUM^RORHDTUT(HDEIEN,TASKIEN)
+4 if TASK<0
QUIT TASK
+5 IF 'TASK
Begin DoDot:1
+6 WRITE !!,"Sorry. It appears that this task has not been run."
End DoDot:1
QUIT 0
+7 ;--- Get the task info (Log IEN, in particular)
+8 SET RC=$$TASKINFO^RORTSK02(TASK,.INFO,"E")
if RC<0
QUIT RC
+9 SET LOGIEN=+$GET(INFO(12))
+10 ;--- Print the log
+11 IF LOGIEN>0
IF $DATA(^RORDATA(798.7,LOGIEN))
Begin DoDot:1
+12 SET L=0
SET DIC=798.7
+13 SET BY="NUMBER;@,4,.01;@"
SET FLDS="[ROR LOG]"
+14 SET (FR,TO)=LOGIEN
+15 WRITE !
DO EN1^DIP
End DoDot:1
+16 IF '$TEST
WRITE !!,"Sorry. The log is not available."
+17 QUIT 0
+18 ;
+19 ;***** DISPLAYS DATA EXTRACTION STATUS
+20 ;
+21 ; HDEIEN Data Extract IEN
+22 ;
+23 ; Return Values:
+24 ; <0 Error code
+25 ; 0 Ok
+26 ;
STATUS(HDEIEN) ;
+1 NEW I,IENS,REGLST,RORBUF,RORMSG,TMP
+2 ;--- Get values from the main record
+3 SET IENS=(+HDEIEN)_","
+4 DO GETS^DIQ(799.6,IENS,".01;.03;.04;2;3*","EI","RORBUF","RORMSG")
+5 if $GET(DIERR)
QUIT $$DBS^RORERR("RORMSG",-9,,,799.6,IENS)
+6 ;--- Compile the list of registries
+7 SET (I,REGLST)=""
+8 FOR
SET I=$ORDER(RORBUF(799.63,I))
if I=""
QUIT
Begin DoDot:1
+9 SET TMP=$GET(RORBUF(799.63,I,.01,"E"))
+10 if TMP'=""
SET REGLST=REGLST_", "_TMP
End DoDot:1
+11 ;--- Display the data extraction information
+12 WRITE !
+13 WRITE !,"Name: ",RORBUF(799.6,IENS,.01,"E")
+14 WRITE !,"Registries: ",$PIECE(REGLST,", ",2,999)
+15 WRITE !,"Date Range: ",$GET(RORBUF(799.6,IENS,.03,"E"))
+16 WRITE " -- ",$GET(RORBUF(799.6,IENS,.04,"E"))
+17 WRITE !,"Output Dir: ",$GET(RORBUF(799.6,IENS,2,"E")),!
+18 ;--- Display the task list
+19 QUIT $$TASKLIST^RORHDTUT(HDEIEN)