Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: IVMBULK2

IVMBULK2.m

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