IVMBULK2 ;ALB/KCL - IVM/ENROLLMENT Extract Utilities; 23-SEP-1997
;;2.0;INCOME VERIFICATION MATCH;**9**; 21-OCT-94
;
;
GET(IVMARRY) ; --
; Description: Used to obtain a record from the IVM Extract Management file into the local IVMARRY array.
;
; Input: None
;
; Output:
; Function Value - returns 1 if success, 0 if failure.
; IVMARRY - this is the name of a local array, it should be passed by
; reference. If the function is successful this array will
; contain the record.
;
; Subscript Field Name
; ========== =======================
; "HOST" Host File Name
; "DIR" Directory
; "PROC" # of Patients Processed
; "TASK" Task Number
; "START" Date/Time Job Started
; "STOP" Date/Time Job Stopped
; "TERM" Job Terminated?
; "LASTPAT" Last Patient Processed
; "PROJECT" Projected Completion Date/Time
; "EXTRACT" # of Patients Extracted
; "FILES" Number of Host Files
; "ERROR" Error
;
N NODE,SUCCESS
S SUCCESS=0
;
I '$D(^IVM(301.63,1,0)) G GETQ
;
K IVMARRY S IVMARRY=""
S NODE=$G(^IVM(301.63,1,0))
;
S IVMARRY("HOST")=$P(NODE,"^")
S IVMARRY("DIR")=$P(NODE,"^",2)
S IVMARRY("PROC")=$P(NODE,"^",3)
S IVMARRY("TASK")=$P(NODE,"^",4)
S IVMARRY("START")=$P(NODE,"^",5)
S IVMARRY("STOP")=$P(NODE,"^",6)
S IVMARRY("TERM")=$P(NODE,"^",7)
S IVMARRY("LASTPAT")=$P(NODE,"^",8)
S IVMARRY("PROJECT")=$P(NODE,"^",9)
S IVMARRY("EXTRACT")=$P(NODE,"^",10)
S IVMARRY("FILES")=$P(NODE,"^",11)
S NODE=$G(^IVM(301.63,1,10))
S IVMARRY("ERROR")=$P(NODE,"^")
;
S SUCCESS=1
;
GETQ Q SUCCESS
;
;
STORE(IVMARRY) ; --
; Description: Used to store the processing information for the
; execution of the initial extract in the IVM Extract Management file.
;
; Input:
; IVMARRY - this is the name of a local array, it should be passed by
; reference. This array should contain the processing
; information to be stored. Missing subscripts will cause
; the field to be deleted. "HOST" is required.
;
; Subscript Field Name
; ========== =======================
; "HOST" Host File Name
; "DIR" Directory
; "PROC" # of Patients Processed
; "TASK" Task Number
; "START" Date/Time Job Started
; "STOP" Date/Time Job Stopped
; "TERM" Job Terminated?
; "LASTPAT" Last Patient Processed
; "PROJECT" Projected Completion Date/Time
; "EXTRACT" # of Patients Extracted
; "FILES" Number of Host Files
; "ERROR" Error
;
; Output:
; Function Value - returns 1 if success, 0 if failure.
;
N SUCCESS
S SUCCESS=1
;
I $G(IVMARRY("HOST"))="" S SUCCESS=0 G STOREQ
I '$D(^IVM(301.63,1,0)) D G:('SUCCESS) STOREQ
.S DATA(.01)=IVMARRY("HOST")
.I '$$ADD^DGENDBS(301.63,,.DATA) S SUCCESS=0
;
;
S DATA(.01)=IVMARRY("HOST")
S DATA(.02)=$G(IVMARRY("DIR"))
S DATA(.03)=$G(IVMARRY("PROC"))
S DATA(.04)=$G(IVMARRY("TASK"))
S DATA(.05)=$G(IVMARRY("START"))
S DATA(.06)=$G(IVMARRY("STOP"))
S DATA(.07)=$G(IVMARRY("TERM"))
S DATA(.08)=$G(IVMARRY("LASTPAT"))
S DATA(.09)=$G(IVMARRY("PROJECT"))
S DATA(.1)=$G(IVMARRY("EXTRACT"))
S DATA(.11)=$G(IVMARRY("FILES"))
S DATA(10)=$G(IVMARRY("ERROR"))
I '$$UPD^DGENDBS(301.63,1,.DATA) S SUCCESS=0
;
STOREQ Q SUCCESS
;
;
INIT(IVMARRY) ; --
; Description: Used to initilized IVM Extract Management record in the local IVMARRY array.
;
; Input: None
;
; Output:
; Function Value - returns 1 if success, 0 if failure.
; IVMARRY - this is the name of a local array, it should be passed by
; reference. If the function is successful this array will
; contain the initialized record.
;
; Subscript Field Name
; ========== =======================
; "HOST" Host File Name
; "DIR" Directory
; "PROC" # of Patients Processed
; "TASK" Task Number
; "START" Date/Time Job Started
; "STOP" Date/Time Job Stopped
; "TERM" Job Terminated?
; "LASTPAT" Last Patient Processed
; "PROJECT" Projected Completion Date/Time
; "EXTRACT" # of Patients Extracted
; "FILES" Number of Host Files
; "ERROR" Error
;
K IVMARRY S IVMARRY=""
;
S IVMARRY("HOST")=""
S IVMARRY("DIR")=""
S IVMARRY("PROC")=""
S IVMARRY("TASK")=""
S IVMARRY("START")=""
S IVMARRY("STOP")=""
S IVMARRY("TERM")=""
S IVMARRY("LASTPAT")=""
S IVMARRY("PROJECT")=""
S IVMARRY("EXTRACT")=""
S IVMARRY("FILES")=""
S IVMARRY("ERROR")=""
;
INITQ Q 1
;
;
PATH(IVMARRY) ; --
; Description: Ask user for for valid host file directory.
;
; Input:
; IVMARRY - a local array where the extract input parameters will be
; stored, pass by reference
;
; Output:
; Function Value - returns 1 if successful, 0 otherwise
; IVMARRY("DIR") - directory
;
N DIR,DTOUT,DUOUT,DIROUT,DIRUT,SUCCESS,Y
;
S SUCCESS=0
;
W !!,?15,"* * * * * I M P O R T A N T * * * * *"
W !,?5,"The host files created by this job will be placed in the"
W !,?5,"current working directory. A directory other than the"
W !,?5,"current working directory may also be selected."
W !!,?5,"Please check the following to ensure the extract runs correctly."
W !!,?10,"1) The directory you have chosen the extract to run in"
W !,?13,"is a valid directory."
W !!,?10,"2) In order for TaskMan to have access to the directory, the"
W !,?13,"WORLD file protection must be 'RW' (Read and Write). For"
W !,?13,"NT/OpenM systems, ensure that the directory is not read only.",!
;
; ask directory
S DIR("A")="Select Directory"
S DIR("B")=$$PWD^%ZISH,DIR(0)="F^3:50"
D ^DIR
G:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))!($D(DIROUT)) PATHQ
;
S IVMARRY("DIR")=Y
S SUCCESS=1
;
PATHQ Q SUCCESS
;
;
GETCONST(IVMARRY) ; --
; Description: Places enrollment extract constants into the local IVMARRY array.
;
; Input: None
;
; Output:
; Function Value - returns 1 if success, 0 if failure.
; IVMARRY - this is the name of a local array, it should be passed by
; reference. If the function is successful this array will
; contain the extract constants.
;
; Subscript Description
; ========== =======================
; "BEGDT" as begin date/time for extract search
; "HOST" as name of host file
; "MAILGRP" as HEC mail group for notification msg
; "MSGMAX" as maximum # of HL7 msgs each host file may contain
; "PERCNT" as # of patients expected to be extracted
; "AVG100" as average time to extract 100 patients in seconds
; "SIZE" as average size of single patient record in bytes
;
;
K IVMARRY
S IVMARRY=""
;
S IVMARRY("BEGDT")=2951231.2359
S IVMARRY("HOST")="HECHOST"_$P($$SITE^VASITE,"^",3)
S IVMARRY("MAILGRP")="G.ENROLLMENT EXTRACT@IVM.DOMAIN.EXT"
S IVMARRY("MSGMAX")=10000
S IVMARRY("PERCNT")=31
S IVMARRY("AVG100")=42
S IVMARRY("SIZE")=1050
;
CONSTQ Q 1
;
;
INQUIRE(ROOT,IEN) ; --
; Description: Display data from file entry.
;
; Input:
; ROOT - global root of the file
; IEN - IEN of file entry
;
N DA,DIC
;
S DIC=ROOT,DA=IEN
D EN^DIQ
Q
;
;
LOCK(IEN) ; --
; Description: This lock is used to prevent another process from editing
; IVM Extract Management record.
;
; Input:
; IEN - Internal entry number of IVM EXTRACT MANAGEMENT file
;
; Output:
; Function Value - Returns 1 if the lock was successful, 0 otherwise
;
I $G(IEN) L +^IVM(IEN,301.63):10
Q $T
;
;
UNLOCK(IEN) ; --
; Description: Used to release a lock created by $$LOCK.
; Input:
; IEN - Internal entry number of IVM EXTRACT MANAGEMENT file
;
; Output: None
;
I $G(IEN) L -^IVM(IEN,301.63)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIVMBULK2 8247 printed Oct 16, 2024@18:01:53 Page 2
IVMBULK2 ;ALB/KCL - IVM/ENROLLMENT Extract Utilities; 23-SEP-1997
+1 ;;2.0;INCOME VERIFICATION MATCH;**9**; 21-OCT-94
+2 ;
+3 ;
GET(IVMARRY) ; --
+1 ; Description: Used to obtain a record from the IVM Extract Management file into the local IVMARRY array.
+2 ;
+3 ; Input: None
+4 ;
+5 ; Output:
+6 ; Function Value - returns 1 if success, 0 if failure.
+7 ; IVMARRY - this is the name of a local array, it should be passed by
+8 ; reference. If the function is successful this array will
+9 ; contain the record.
+10 ;
+11 ; Subscript Field Name
+12 ; ========== =======================
+13 ; "HOST" Host File Name
+14 ; "DIR" Directory
+15 ; "PROC" # of Patients Processed
+16 ; "TASK" Task Number
+17 ; "START" Date/Time Job Started
+18 ; "STOP" Date/Time Job Stopped
+19 ; "TERM" Job Terminated?
+20 ; "LASTPAT" Last Patient Processed
+21 ; "PROJECT" Projected Completion Date/Time
+22 ; "EXTRACT" # of Patients Extracted
+23 ; "FILES" Number of Host Files
+24 ; "ERROR" Error
+25 ;
+26 NEW NODE,SUCCESS
+27 SET SUCCESS=0
+28 ;
+29 IF '$DATA(^IVM(301.63,1,0))
GOTO GETQ
+30 ;
+31 KILL IVMARRY
SET IVMARRY=""
+32 SET NODE=$GET(^IVM(301.63,1,0))
+33 ;
+34 SET IVMARRY("HOST")=$PIECE(NODE,"^")
+35 SET IVMARRY("DIR")=$PIECE(NODE,"^",2)
+36 SET IVMARRY("PROC")=$PIECE(NODE,"^",3)
+37 SET IVMARRY("TASK")=$PIECE(NODE,"^",4)
+38 SET IVMARRY("START")=$PIECE(NODE,"^",5)
+39 SET IVMARRY("STOP")=$PIECE(NODE,"^",6)
+40 SET IVMARRY("TERM")=$PIECE(NODE,"^",7)
+41 SET IVMARRY("LASTPAT")=$PIECE(NODE,"^",8)
+42 SET IVMARRY("PROJECT")=$PIECE(NODE,"^",9)
+43 SET IVMARRY("EXTRACT")=$PIECE(NODE,"^",10)
+44 SET IVMARRY("FILES")=$PIECE(NODE,"^",11)
+45 SET NODE=$GET(^IVM(301.63,1,10))
+46 SET IVMARRY("ERROR")=$PIECE(NODE,"^")
+47 ;
+48 SET SUCCESS=1
+49 ;
GETQ QUIT SUCCESS
+1 ;
+2 ;
STORE(IVMARRY) ; --
+1 ; Description: Used to store the processing information for the
+2 ; execution of the initial extract in the IVM Extract Management file.
+3 ;
+4 ; Input:
+5 ; IVMARRY - this is the name of a local array, it should be passed by
+6 ; reference. This array should contain the processing
+7 ; information to be stored. Missing subscripts will cause
+8 ; the field to be deleted. "HOST" is required.
+9 ;
+10 ; Subscript Field Name
+11 ; ========== =======================
+12 ; "HOST" Host File Name
+13 ; "DIR" Directory
+14 ; "PROC" # of Patients Processed
+15 ; "TASK" Task Number
+16 ; "START" Date/Time Job Started
+17 ; "STOP" Date/Time Job Stopped
+18 ; "TERM" Job Terminated?
+19 ; "LASTPAT" Last Patient Processed
+20 ; "PROJECT" Projected Completion Date/Time
+21 ; "EXTRACT" # of Patients Extracted
+22 ; "FILES" Number of Host Files
+23 ; "ERROR" Error
+24 ;
+25 ; Output:
+26 ; Function Value - returns 1 if success, 0 if failure.
+27 ;
+28 NEW SUCCESS
+29 SET SUCCESS=1
+30 ;
+31 IF $GET(IVMARRY("HOST"))=""
SET SUCCESS=0
GOTO STOREQ
+32 IF '$DATA(^IVM(301.63,1,0))
Begin DoDot:1
+33 SET DATA(.01)=IVMARRY("HOST")
+34 IF '$$ADD^DGENDBS(301.63,,.DATA)
SET SUCCESS=0
End DoDot:1
if ('SUCCESS)
GOTO STOREQ
+35 ;
+36 ;
+37 SET DATA(.01)=IVMARRY("HOST")
+38 SET DATA(.02)=$GET(IVMARRY("DIR"))
+39 SET DATA(.03)=$GET(IVMARRY("PROC"))
+40 SET DATA(.04)=$GET(IVMARRY("TASK"))
+41 SET DATA(.05)=$GET(IVMARRY("START"))
+42 SET DATA(.06)=$GET(IVMARRY("STOP"))
+43 SET DATA(.07)=$GET(IVMARRY("TERM"))
+44 SET DATA(.08)=$GET(IVMARRY("LASTPAT"))
+45 SET DATA(.09)=$GET(IVMARRY("PROJECT"))
+46 SET DATA(.1)=$GET(IVMARRY("EXTRACT"))
+47 SET DATA(.11)=$GET(IVMARRY("FILES"))
+48 SET DATA(10)=$GET(IVMARRY("ERROR"))
+49 IF '$$UPD^DGENDBS(301.63,1,.DATA)
SET SUCCESS=0
+50 ;
STOREQ QUIT SUCCESS
+1 ;
+2 ;
INIT(IVMARRY) ; --
+1 ; Description: Used to initilized IVM Extract Management record in the local IVMARRY array.
+2 ;
+3 ; Input: None
+4 ;
+5 ; Output:
+6 ; Function Value - returns 1 if success, 0 if failure.
+7 ; IVMARRY - this is the name of a local array, it should be passed by
+8 ; reference. If the function is successful this array will
+9 ; contain the initialized record.
+10 ;
+11 ; Subscript Field Name
+12 ; ========== =======================
+13 ; "HOST" Host File Name
+14 ; "DIR" Directory
+15 ; "PROC" # of Patients Processed
+16 ; "TASK" Task Number
+17 ; "START" Date/Time Job Started
+18 ; "STOP" Date/Time Job Stopped
+19 ; "TERM" Job Terminated?
+20 ; "LASTPAT" Last Patient Processed
+21 ; "PROJECT" Projected Completion Date/Time
+22 ; "EXTRACT" # of Patients Extracted
+23 ; "FILES" Number of Host Files
+24 ; "ERROR" Error
+25 ;
+26 KILL IVMARRY
SET IVMARRY=""
+27 ;
+28 SET IVMARRY("HOST")=""
+29 SET IVMARRY("DIR")=""
+30 SET IVMARRY("PROC")=""
+31 SET IVMARRY("TASK")=""
+32 SET IVMARRY("START")=""
+33 SET IVMARRY("STOP")=""
+34 SET IVMARRY("TERM")=""
+35 SET IVMARRY("LASTPAT")=""
+36 SET IVMARRY("PROJECT")=""
+37 SET IVMARRY("EXTRACT")=""
+38 SET IVMARRY("FILES")=""
+39 SET IVMARRY("ERROR")=""
+40 ;
INITQ QUIT 1
+1 ;
+2 ;
PATH(IVMARRY) ; --
+1 ; Description: Ask user for for valid host file directory.
+2 ;
+3 ; Input:
+4 ; IVMARRY - a local array where the extract input parameters will be
+5 ; stored, pass by reference
+6 ;
+7 ; Output:
+8 ; Function Value - returns 1 if successful, 0 otherwise
+9 ; IVMARRY("DIR") - directory
+10 ;
+11 NEW DIR,DTOUT,DUOUT,DIROUT,DIRUT,SUCCESS,Y
+12 ;
+13 SET SUCCESS=0
+14 ;
+15 WRITE !!,?15,"* * * * * I M P O R T A N T * * * * *"
+16 WRITE !,?5,"The host files created by this job will be placed in the"
+17 WRITE !,?5,"current working directory. A directory other than the"
+18 WRITE !,?5,"current working directory may also be selected."
+19 WRITE !!,?5,"Please check the following to ensure the extract runs correctly."
+20 WRITE !!,?10,"1) The directory you have chosen the extract to run in"
+21 WRITE !,?13,"is a valid directory."
+22 WRITE !!,?10,"2) In order for TaskMan to have access to the directory, the"
+23 WRITE !,?13,"WORLD file protection must be 'RW' (Read and Write). For"
+24 WRITE !,?13,"NT/OpenM systems, ensure that the directory is not read only.",!
+25 ;
+26 ; ask directory
+27 SET DIR("A")="Select Directory"
+28 SET DIR("B")=$$PWD^%ZISH
SET DIR(0)="F^3:50"
+29 DO ^DIR
+30 if $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))!($DATA(DIROUT))
GOTO PATHQ
+31 ;
+32 SET IVMARRY("DIR")=Y
+33 SET SUCCESS=1
+34 ;
PATHQ QUIT SUCCESS
+1 ;
+2 ;
GETCONST(IVMARRY) ; --
+1 ; Description: Places enrollment extract constants into the local IVMARRY array.
+2 ;
+3 ; Input: None
+4 ;
+5 ; Output:
+6 ; Function Value - returns 1 if success, 0 if failure.
+7 ; IVMARRY - this is the name of a local array, it should be passed by
+8 ; reference. If the function is successful this array will
+9 ; contain the extract constants.
+10 ;
+11 ; Subscript Description
+12 ; ========== =======================
+13 ; "BEGDT" as begin date/time for extract search
+14 ; "HOST" as name of host file
+15 ; "MAILGRP" as HEC mail group for notification msg
+16 ; "MSGMAX" as maximum # of HL7 msgs each host file may contain
+17 ; "PERCNT" as # of patients expected to be extracted
+18 ; "AVG100" as average time to extract 100 patients in seconds
+19 ; "SIZE" as average size of single patient record in bytes
+20 ;
+21 ;
+22 KILL IVMARRY
+23 SET IVMARRY=""
+24 ;
+25 SET IVMARRY("BEGDT")=2951231.2359
+26 SET IVMARRY("HOST")="HECHOST"_$PIECE($$SITE^VASITE,"^",3)
+27 SET IVMARRY("MAILGRP")="G.ENROLLMENT EXTRACT@IVM.DOMAIN.EXT"
+28 SET IVMARRY("MSGMAX")=10000
+29 SET IVMARRY("PERCNT")=31
+30 SET IVMARRY("AVG100")=42
+31 SET IVMARRY("SIZE")=1050
+32 ;
CONSTQ QUIT 1
+1 ;
+2 ;
INQUIRE(ROOT,IEN) ; --
+1 ; Description: Display data from file entry.
+2 ;
+3 ; Input:
+4 ; ROOT - global root of the file
+5 ; IEN - IEN of file entry
+6 ;
+7 NEW DA,DIC
+8 ;
+9 SET DIC=ROOT
SET DA=IEN
+10 DO EN^DIQ
+11 QUIT
+12 ;
+13 ;
LOCK(IEN) ; --
+1 ; Description: This lock is used to prevent another process from editing
+2 ; IVM Extract Management record.
+3 ;
+4 ; Input:
+5 ; IEN - Internal entry number of IVM EXTRACT MANAGEMENT file
+6 ;
+7 ; Output:
+8 ; Function Value - Returns 1 if the lock was successful, 0 otherwise
+9 ;
+10 IF $GET(IEN)
LOCK +^IVM(IEN,301.63):10
+11 QUIT $TEST
+12 ;
+13 ;
UNLOCK(IEN) ; --
+1 ; Description: Used to release a lock created by $$LOCK.
+2 ; Input:
+3 ; IEN - Internal entry number of IVM EXTRACT MANAGEMENT file
+4 ;
+5 ; Output: None
+6 ;
+7 IF $GET(IEN)
LOCK -^IVM(IEN,301.63)
+8 QUIT