Skip to content

Commit

Permalink
Install: IVM*2.0*174, EAS*1.0*172
Browse files Browse the repository at this point in the history
Patch Subject:  CLEANUP OF SOCIAL SECURITY NUMBERS IN INCOME PERSON (#408.13) FILE
Description:

============
 This patch addresses Your IT Services incident INC1928289 to fix a
 critical defect introduced by Enrollment System (ES) 5.3 and corrected
 by 5.3.0.070001, where the dependent Social Security Number (SSN) data at
 the Veterans Health Information System and Technology Architecture
 (VistA) facilities was corrupted and requires a VistA patch to clean up
 the database corruption.
 Please refer to the 'Defect Tracking System Ticket(s) & Overview'
 section of this patch for a description of the problem and its resolution.
 This patch is a follow-up patch to DG*5.3*970 and it is required to
 install this patch. Patch DG*5.3*970 created global ^XTMP("DG53970P")
 which lists the dependent records' Internal Entry Numbers (IENs) in the
 INCOME PERSON file (#408.13) that need to have the SOCIAL SECURITY NUMBER
 (#.09) field updated. It also lists the record number (DFN) in PATIENT
 (#2) file for the patient associated with the dependent record.
 Patch IVM*2.0*174 uses this global when processing the Health Level 7
 (HL7) ORU-Z10 message from ES to update the SOCIAL SECURITY NUMBER (#.09)
 field of dependent records in the INCOME PERSON file (#408.13) and to
 clean them out of the ^XTMP("DG53970P") global. Additionally, a
 post-install routine extends the expiration date of the
 ^XTMP("DG53970P") global by an additional 120 days from the patch
 install date and submits a background job to send a MailMan message
 every 2 days to report the status of IENs and DFNs remaining in the ^XTMP
 global. The message is sent to FORUM MailMan group
 [email protected]. The members of the mail group consist of
 developers, Software Quality Assurance (SQA), and Health Product
 Support.  A copy of the mail message will be sent to the installer of
 patch IVM*2.0*174.
 Once all dependent records identified in the ^XTMP("DG53970P") global
 have had the SOCIAL SECURITY NUMBER (#.09) field of the INCOME PERSON file
 (#408.13) successfully updated, the background job will no longer be
 automatically queued to check the global and send a status message.
 Listing of Updates:
 ===================
 Patch IVM*2.0*174 modifies the processing of the HL7 ORU-Z10 message from
 ES as follows:
 1. If the Patient record from the ORU-Z10 PID segment is found in the
    ^XTMP("DG53970P") global, only the ZDP segments in the message are
    processed as follows:
    a. The dependent record (Internal Entry Number) from the INCOME PERSON
       file (#408.13) is derived from the ZDP segment. If that record is
       found in the ^XTMP("DG53970P") global, the SSN from the ZDP segment
       is filed into the INCOME PERSON file (#408.13) for that dependent.
    b. The SSN will be validated prior to filing and will not be filed if
       it is invalid. The SSN must be 9 numbers.
    c. If the ZDP segment includes a PSEUDO SSN REASON and it is a valid
       value of "S", "N", or "R", it is stored in the INCOME PERSON file
       (#408.13) in the PSEUDO SSN REASON field (#.1) and a "P" is appended
       to the SSN prior to being filed.
    d. Prior to the SSN being updated, the SSN field in the INCOME PERSON
       file (#408.13) is checked and will be corrected if the field is
       corrupted.
    e. If the filing of the SSN fails, the error message is placed in the
       ^XTMP("DG53970P") global.
    f. If the filing of the SSN is successful, the associated
       ^XTMP("DG53970P") entry is removed.
 2. If the DFN in the PID segment is not found in ^XTMP("DG53970P")
    global, the ORU-Z10 message is processed normally.
 3. A post-install routine is run that submits the background task
    IVM*2.0*174 STATUS UPDATE JOB that produces a MailMan message that
    lists the patient records and associated dependent records from the
    ^XTMP("DG53970P") global. If there are entries in the ^XTMP("DG53970P")
    global, this job is submitted to run again in 2 days. The MailMan
    message lists the following information:
    a. The total number of patient records and associated dependent
       records that need to have the SSN field updated.
    b. Each DFN and the associated dependent IENs in the ^XTMP("DG53970P")
       that need to have the SSN updated. If an ORU-Z10 message failed
       to update an SSN for a dependent record, the error is shown with the
       record.
 An example of the MailMan message is shown below.
 Example: Post-Install MailMan Message
 -------------------------------------
 Subj: IVM*2.0*174-#500-VHA/ES CLEANUP OF SSNs IN (#408.13) FILE
 From: <POSTMASTER>                              In 'IN' basket.   Page 1
 -------------------------------------------------------------------------
 The job completed to check if patient records still exist in the
 ^XTMP("DG53970P" global and require a push of corrected SSN data from ES
 via an HL7(ORU-Z10) message.
 Job Results:
 ------------
  Facility Name: ZZALBANY.DOMAIN.EXT
 Station Number: 500
 Total patients (ICN/DFN) with dependents not updated: 6
                   Total dependent (IENs) not updated: 7
 Patient ICN/DFN: 5000000001V324625/7171998
  Dependent IENs: 2
 Patient ICN/DFN: 5000000105V037465/7171999
  Dependent IENs: 1
 Patient ICN/DFN: 5000000040V317188/7171864
  Dependent IENs: 3
                  4
 Patient ICN/DFN: 5000000077V373245/7171902
  Dependent IENs: 5
 Patient ICN/DFN: 5000000101V983844/7171926
  Dependent IENs: 14
 Patient ICN/DFN: 5000000111V198302/7171934
  Dependent IENs: 13
 Patch Components:
 =================
 Files & Fields Associated:
 File Name (Number)      Field Name (Number)     New/Modified/Deleted
 ------------------      -------------------     --------------------
 N/A
 Forms Associated:
 Form Name       File #  New/Modified/Deleted
 ---------       ------  --------------------
 N/A
 Mail Groups Associated:
 Mail Group Name New/Modified/Deleted
 --------------- --------------------
 N/A
 Options Associated:
 Option Name     Type    New/Modified/Deleted
 -----------     ----    --------------------
 N/A
 Protocols Associated:
 Protocol Name   New/Modified/Deleted
 -------------   --------------------
 N/A
 Security Keys Associated:
 Security Key Name
 -----------------
 N/A
 Templates Associated:
 Template Name   Type    File Name (Number)  New/Modified/Deleted
 -------------   ----    ------------------  --------------------
 N/A
 Additional Information:
 N/A
 New Service Requests (NSRs):
 ----------------------------
 N/A
 Patient Safety Issues (PSIs):
 -----------------------------
 N/A
 Defect Tracking System Ticket(s) & Overview:
 --------------------------------------------
 1. Incident: INC1928289
    Short Description: <SUBSCRIPT>IX+1^DIE1 ^DGPR(408.13 - Error Seen At
    Multiple Sites
 Problem:
 --------
 Critical defect #810016 was logged against Enrollment System (ES) 5.3
 build. A new build was created to address the defect.  Emergency
 Release ES 5.3.0.07001 implemented code changes to remove a method and
 method calls that were removing the SSN from the ZDP segment and setting
 it to a single "space" character. Dependent Social Security Number (SSN)
 data at the VistA facilities was corrupted and requires a VistA patch to
 clean up the database corruption.  Upon follow-up with the facilities who
 reported the original error, additional instances of a slightly different
 error were being seen after the deployment of the code fix.  The expected
 outcome is that no errors would be seen after the deployment of ES
 5.3.0.07001.  The error logged in the VistA instances is as follows:
   $ZE= <SUBSCRIPT>IX^DIE1 ^DGPR(408.13,"BS","")
   K ^DGPR(408.13,"BS",$E(X,6,9),DA)
 The error is occurring on the second instance of an inbound financial HL7
 transmission (ORU-Z10) for a patient.  The root cause was determined to
 be the data (in this case an empty space) which was filed into the SOCIAL
 SECURITY NUMBER field (#.09) of the INCOME PERSON file (#408.13). The SSN
 data in that file was potentially degraded by the initial issue. ES was
 remediated, the second transmission files the correct data; however,
 still errors due to the previous value.  A third or higher transmission
 should file without error.
 Resolution:
 -----------
 The processing of the ORU-Z10 message is modified:
 1. If the DFN is found in the global ^XTMP("DG53970P"), which was created
    by patch DG*5.3*970 to capture the records that need to be corrected,
    then process only the ZDP segments to retrieve and store the dependent
    SSNs. No other segments or data are processed.
 2. If the SSN update was successful, remove the associated entries from
    the ^XTMP("DG53970P") global.
 3. If the SSN update was not successful, store the error in the
    ^XTMP("DG53970P") global.
 Once all facilities have installed this emergency patch IVM*2.0*174 by
 the Compliance date, ES will be sending ORU-Z10 HL7 messages for all
 veterans that have dependents that needed the SSN updated during non-
 peak hours.
 The post-install routine EP^IVM2174P queues the background task
 IVM*2.0*174 STATUS UPDATE JOB that gathers the DFNs and IENs that are in
 the ^XTMP("DG53970P") global. These values are listed in an email sent to
 FORUM MailMan group [email protected]. Members of this mail
 group will monitor messages received from facilities and coordinate
 with ES about retransmission of corrected SSN data from ES via an HL7
 (ORU-Z10) message. The members of the mail group consist of developers,
 Software Quality Assurance (SQA), and Health Product Support.  A copy of
 the mail message will be sent to the installer of patch IVM*2.0*174. If
 there are still entries in the global, this task will automatically be
 resubmitted to run in the background in 2 days.
 Once all dependent records identified in the ^XTMP("DG53970P") global
 have had the SOCIAL SECURITY NUMBER (#.09) field of the INCOME PERSON file
 (#408.13) successfully updated, the background job will no longer be
 automatically queued to check the global and send a status message.
 Test Sites:
 -----------
 * Erie VA Medical Center
 * Lebanon, PA (Lebanon VA Medical Center)
 * VA Western New York Healthcare System
 Software and Documentation Retrieval Instructions:
 ----------------------------------------------------
 Patches for this installation are combined in the following Host File for
 distribution: IVM_20_P174.KID.
 The Host File was created to simplify installation at Veterans Health
 Administration (VHA) facilities. This file can be obtained from one of
 the anonymous Secure File Transfer Protocol (SFTP) directories.
 File Name                           Contents           Retrieval Format
 ---------                           --------           ----------------
 IVM_20_P174.KID                     IVM*2.0*174        ASCII
                                     EAS*1.0*172
 Updated documentation describing the new functionality introduced by this
 patch is available.
 The preferred method is to retrieve files from download.vista.domain.ext.
 This transmits the files from the first available server. Sites may also
 elect to retrieve files directly from a specific server.
 Sites may retrieve the documentation directly using Secure File Transfer
 Protocol (SFTP) from the ANONYMOUS.SOFTWARE directory at the following OI
 Field Offices:
 Hines:                  domain.ext
 Salt Lake City:         domain.ext
 Documentation can also be found on the VA Software Documentation Library
 at: http://www.domain.ext/vdl/
 Title                           File Name                    SFTP Mode
 --------------------------------------------------------------------------
 Release Notes                   IVM_2_P174_RN.PDF            (binary)
 Patch Installation:
 Pre/Post Installation Overview:
 -------------------------------
 The post install process will run routine IVM2174P. This routine queues
 a background job.
 Upon completion of the job, a MailMan message is sent to FORUM MailMan
 group [email protected] and the Patch installer.
 See an example of the message in the 'Listing of Updates' section above.

Use default answers for KIDS load/install questions.

Multi-Build: http://code.osehra.org/VistA.git/blob/master/Packages/MultiBuilds/IVM_20_P174.KID
Patch-Files: http://code.osehra.org/VistA.git/tree/master/Packages/Enrollment+Application+System/Patches/EAS_1.0_172
  • Loading branch information
josephsnyder committed Mar 15, 2019
1 parent 26b56d5 commit 56217d6
Show file tree
Hide file tree
Showing 10 changed files with 572 additions and 20 deletions.
9 changes: 7 additions & 2 deletions Packages/Enrollment Application System/Routines/EASCM.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
EASCM ;ALB/PJH - PROCESS INCOME TEST (Z10) TRANSMISSIONS ; 7/1/09 3:36pm
;;1.0;ENROLLMENT APPLICATION SYSTEM;**71,96,152**; 15-MAR-01;Build 5
EASCM ;ALB/PJH,JAM - PROCESS INCOME TEST (Z10) TRANSMISSIONS ;7/1/09 3:36pm
;;1.0;ENROLLMENT APPLICATION SYSTEM;**71,96,152,172**;15-MAR-01;Build 3
;
;CLONED FROM IVMCM (ESR EVENT DRIVER)
;
Expand Down Expand Up @@ -111,7 +111,12 @@
;
; - check HL7 msg structure for errors
K HLERR,^TMP($J,"IVMCM")
; jam; EAS*1.0*172 - set IVMSSNFLAG=0 and quit processing if the flag is set upon return from ^IVMCMC
; (see ^IVMCMC for what sets this flag)
N IVMSSNFLAG
S IVMSSNFLAG=0
D ^IVMCMC I $D(HLERR) K:HLERR="" HLERR Q
I IVMSSNFLAG Q
;
; Determine type of test/transmission
S IVMTYPE=0
Expand Down
151 changes: 151 additions & 0 deletions Packages/Income Verification Match/Routines/IVM2174F.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
IVM2174F ;ALB/JAM - IVM*2.0*174 - FIX BLANK SSN IN PERSON INCOME FILE ;9/26/2018 3:21pm
;;2.0;INCOME VERIFICATION MATCH;**174**;21-OCT-94;Build 15
;
Q
EP ; Entry Point
Q
IVMFSSN(DFN,IVMJOB) ; Process only ZDP segments to store SSNs into 408.13 file if IEN is in ^XTMP("DG53970P")
; Called by: ^IVMCM if DFN is defined in ^XTMP("DG53970P") when processing ORU-Z10 message
;
; Input: DFN - Patient DFN from the ORU-Z10 PID
; IVMJOB - job number in ^XTMP("DG53970P",JOB)
;
N IVMCTR,IVMSEG,IVMVAL,IEN,IVMIEN,IVMFOUND,IVMIENCNT
; spouse segment
S IVMSEG=$G(^TMP($J,"IVMCM","ZDPS"))
I IVMSEG'="" D FILESSN(DFN,IVMJOB,IVMSEG)
; inactive spouse segments
S IVMCTR=0
F S IVMCTR=$O(^TMP($J,"IVMCM","ZDPIS",IVMCTR)) Q:(IVMCTR="") D
. S IVMSEG=$G(^TMP($J,"IVMCM","ZDPIS",IVMCTR)) Q:IVMSEG=""
. D FILESSN(DFN,IVMJOB,IVMSEG)
; dependent segments
S IVMCTR=0
F S IVMCTR=$O(^TMP($J,"IVMCM","ZDPC",IVMCTR)) Q:(IVMCTR="") D
. S IVMSEG=$G(^TMP($J,"IVMCM","ZDPC",IVMCTR)) Q:IVMSEG=""
. D FILESSN(DFN,IVMJOB,IVMSEG)
; inactive dependent segments
S IVMCTR=0
F S IVMCTR=$O(^TMP($J,"IVMCM","ZDPIC",IVMCTR)) Q:(IVMCTR="") D
. S IVMSEG=$G(^TMP($J,"IVMCM","ZDPIC",IVMCTR)) Q:IVMSEG=""
. D FILESSN(DFN,IVMJOB,IVMSEG)
; All ZDP segments processed
; If all IENs related to the DFN are gone from ^XTMP, remove the DFN from ^XTMP
S IVMFOUND=0
; For the DFN, loop over ALL the dependent IENs in the 408.12 file "B" index
S IEN="" F S IEN=$O(^DGPR(408.12,"B",DFN,IEN)) Q:'IEN D Q:IVMFOUND
. ; get the related 408.13 IEN
. S IVMVAL=$P(^DGPR(408.12,IEN,0),"^",3)
. I $P(IVMVAL,";",2)'="DGPR(408.13," Q
. S IVMIEN=$P(IVMVAL,";",1)
. S IVMIENCNT=0
. ; If IVMIEN is in ^XTMP("DG53970P",IVMJOB,"SSN",count)=IVMIEN set flag
. F S IVMIENCNT=$O(^XTMP("DG53970P",IVMJOB,"SSN",IVMIENCNT)) Q:'IVMIENCNT I ^XTMP("DG53970P",IVMJOB,"SSN",IVMIENCNT)=IVMIEN S IVMFOUND=1 Q
; If no IENs found, clear the DFN out of the ^XTMP global
I 'IVMFOUND K ^XTMP("DG53970P",IVMJOB,"DFN",DFN)
Q
FILESSN(DFN,IVMJOB,IVMSEG) ; Check segment and store SSN in 408.13 if criteria met
; Input: DFN - DFN from PID segment
; IVMJOB - job number in ^XTMP("DG53970P",JOB)
; IVMSEG - the ZDPS or ZDPC segment
N IVMPRI,IVMVAL,IVMIEN,IVMFOUND,IVMIENCNT,IVMSSN,IVMPSSNR,IVMFLG1,IVMERR
N IVMSEX,IVMSEX13,IVMDOB,IVMDOB13,IVMRELN,IVMRELO
N FDA,IVMERRORS,DIERR
S IVMRELN=$P(IVMSEG,"^",6)
; skip segment if RELATIONSHIP is SELF
Q:IVMRELN=1
S IVMPRI=$P(IVMSEG,"^",7) ; ien of patient relation file 408.12
; if IEN not supplied, derive it by looping over dependents in 408.12 file
I IVMPRI="" D
. ; get Sex and DOB from segment
. S IVMSEX=$P(IVMSEG,"^",3),IVMDOB=$$FMDATE^HLFNC($P(IVMSEG,"^",4))
. S IVMFLG1=0
. ; loop over dependents for this DFN in the 408.12 file
. S IVMPRI=0 F S IVMPRI=$O(^DGPR(408.12,"B",DFN,IVMPRI)) Q:'IVMPRI D Q:IVMFLG1
. . ; Get Relationship, DOB, and Sex from income person file 408.13
. . D GETIP(IVMPRI,.IVMRELO,.IVMDOB13,.IVMSEX13)
. . Q:(IVMRELO=1) ; quit if RELATIONSHIP is SELF
. . ; match sex, dob and relationship from segment with values from 408.13 file
. . I (IVMSEX=IVMSEX13)&(IVMDOB=IVMDOB13)&(IVMRELN=IVMRELO) S IVMFLG1=1 ; Match - found dependent in 408.13.
; If dependent IEN from 408.12 file not defined - Quit
Q:IVMPRI=""
; get the related 408.13 IEN
S IVMVAL=$P(^DGPR(408.12,IVMPRI,0),"^",3)
I $P(IVMVAL,";",2)'="DGPR(408.13," Q
S IVMIEN=$P(IVMVAL,";",1) ; ien of income person file 408.13
S IVMFOUND=0,IVMIENCNT=0
; loop over IENs in ^XTMP to see if IVMIEN is there
F S IVMIENCNT=$O(^XTMP("DG53970P",IVMJOB,"SSN",IVMIENCNT)) Q:'IVMIENCNT I ^XTMP("DG53970P",IVMJOB,"SSN",IVMIENCNT)=IVMIEN S IVMFOUND=1 Q
Q:'IVMFOUND
; IVMIEN is the IEN that needs the SSN updated in 408.13 - ^DGPR(408.13,IEN,0) piece 9
S IVMSSN=$P(IVMSEG,"^",5) ;SSN
; Validate the SSN and if not valid, place the error in the ^XTMP global and quit
S IVMERR=""
I '$$VALSSN(IVMSSN,.IVMERR) S ^XTMP("DG53970P",IVMJOB,"SSNERR",IVMIEN)=$G(IVMERR) Q
; strip dashes
S IVMSSN=$TR(IVMSSN,"-")
; check for Pseudo SSN
S IVMPSSNR=$P(IVMSEG,"^",10) ;Pseudo SSN Reason
; If not valid value, set it to null
I IVMPSSNR]"",IVMPSSNR'="R",IVMPSSNR'="S",IVMPSSNR'="N" S IVMPSSNR=""
; If there is a valid Pseudo SSN Reason, then append a "P" to the end
; of the SSN so that it can be recognized on VistA as a pseudo
I IVMPSSNR'="" S IVMSSN=$G(IVMSSN)_"P"
; Recheck the SSN field in 408.13 file and if corrupted, clean it up
D CHKSSN(IVMIEN)
; Update the SSN - if not successful, place the error in the ^XTMP global and quit
S FDA(408.13,IVMIEN_",",.09)=IVMSSN
S FDA(408.13,IVMIEN_",",.1)=IVMPSSNR
D FILE^DIE("K","FDA","IVMERRORS(1)")
I +$G(DIERR) D Q
. S IVMERR=$G(IVMERRORS(1,"DIERR",1,"TEXT",1))
. S ^XTMP("DG53970P",IVMJOB,"SSNERR",IVMIEN)=IVMERR
; update was successful, clean the IEN out of the ^XTMP global
K ^XTMP("DG53970P",IVMJOB,"SSN",IVMIENCNT),^XTMP("DG53970P",IVMJOB,"SSNERR",IVMIEN)
Q
VALSSN(X,ERROR) ; Validate the SSN format
; Input: X - SSN to validate
; ERROR - pass by reference, returns error text if validation fails
; Output: 1 if valid, 0 if invalid
N CNT
I X'?9N&(X'?3N1"-"2N1"-"4N) S ERROR="SSN must be either nine numbers, or be in the format nnn-nn-nnnn." Q 0
; strip dashes
I X'?.AN F CNT=1:1:$L(X) I $E(X,CNT)?1P S X=$E(X,0,CNT-1)_$E(X,CNT+1,999),CNT=CNT-1
I X'?9N S ERROR="Invalid format for SSN." Q 0
I $E(X,1)=9 S ERROR="The SSN must not begin with 9." Q 0
I $E(X,1,3)="000" S ERROR="First three digits of SSN cannot be zeros." Q 0
Q 1
GETIP(IVMPRI,IVMRELO,IVMDOB13,IVMSEX13) ; Return 408.13 Sex,DOB,Relationship via 408.12 record
; Input: IVMPRI - IEN of 408.12 entry
; IVMRELO - Relationship from 408.12 piece 2 (pass by ref)
; IVMDOB13 - Date of Birth from 408.13 piece 3 (pass by ref)
; IVMSEX13 - Sex from 408.13 piece 2 (pass by ref)
N IVMPRN
S IVMPRN=$G(^DGPR(408.12,+IVMPRI,0))
S IVMRELO=$P(IVMPRN,"^",2)
I IVMPRN']"" Q
; Quit if RELATIONSHIP is SELF
Q:IVMRELO=1
N IVMSEG13
; ivmseg13 is 0 node of income person file 408.13
S IVMSEG13=$$DEM^DGMTU1(IVMPRI)
I IVMSEG13']"" Q ; Can't find 408.13 record
; get Sex and DOB from 408.13 file
S IVMSEX13=$P(IVMSEG13,"^",2),IVMDOB13=$P(IVMSEG13,"^",3)
Q
CHKSSN(IEN) ; Check to see if SSN IN 408.13 is corrupted and clean up if it is
; Input: IEN - 408.13 ien
N IVMSSN
S IVMSSN=$P(^DGPR(408.13,IEN,0),"^",9)
I IVMSSN=" "!(IVMSSN=" P") D
. S $P(^DGPR(408.13,IEN,0),"^",9)=""
. ; we have to assume the xrefs are bad and need to be cleaned up
. D XREF(IEN)
Q
XREF(IEN) ; clean "SSN", "BS" and "BS5" xrefs for this INCOME PERSON file (#408.13) record
N VAL,XREF
F XREF="SSN","BS","BS5" D
. S VAL=""
. F S VAL=$O(^DGPR(408.13,XREF,VAL)) Q:VAL="" D
. . I $D(^DGPR(408.13,XREF,VAL,IEN)) K ^DGPR(408.13,XREF,VAL,IEN)
Q
95 changes: 95 additions & 0 deletions Packages/Income Verification Match/Routines/IVM2174P.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
IVM2174P ;ALB/JAM - IVM*2.0*174 POST-INSTALL TO FIX DEPENDENT SSN IN (#408.13) FILE ;9/26/2018 3:21pm
;;2.0;INCOME VERIFICATION MATCH;**174**;21-OCT-94;Build 15
;
Q
EP ; Entry Point
; Extend the expiration date of the ^XTMP("DG53970P") global to +120 days
S $P(^XTMP("DG53970P",0),"^",1)=$$FMADD^XLFDT(DT,120)
;
N ZTRTN,ZTDESC,ZTDTH,IVMTEXT,ZTIO,ZTSK
S IVMTEXT(1)=" >>> Tasking job to gather list of ICNs/DFNs in ^XTMP(""DG53970P"" global"
S IVMTEXT(2)=" that need an update of dependent SSNs..."
D BMES^XPDUTL(.IVMTEXT)
; Quit if already installed
I $$PATCH^XPDUTL("IVM*2.0*174") D MES^XPDUTL(" Job does not need to be run since patch has been installed previously.") Q
;queue off job
S ZTRTN="TASK^IVM2174P"
S ZTDESC="IVM*2.0*174 Gather list of ICNs/DFNs in ^XTMP(""DG53970P"") that need update of dependent SSNs."
S ZTDTH=$$NOW^XLFDT
S ZTIO=""
D ^%ZTLOAD
K IVMTEXT
S IVMTEXT(1)=" The task number is "_$G(ZTSK)_"."
D MES^XPDUTL(.IVMTEXT)
Q
TASK ;Build and send MailMan message with list of patient records needing SSN updates
N JOB,DFN,IEN,PCNT,ICN,I,DCNT,IENCNT,VAL,XIEN,FOUND,LINE
S (PCNT,JOB,DCNT)=0
K ^TMP("IVM2174P")
S JOB=$O(^XTMP("DG53970P",JOB))
I JOB D GETDATA
D MSG
K ^TMP("IVM2174P")
Q
GETDATA ; loop over DFNs in ^XTMP("DG53970P",JOB,"DFN") - store all data in ^TMP global
S DFN=0
F I=1:1 S DFN=$O(^XTMP("DG53970P",JOB,"DFN",DFN)) Q:'DFN D
. S PCNT=PCNT+1
. ; get the ICN and store the ICN/DFN
. S ICN=$$GETICN^MPIF001(DFN)
. S ^TMP("IVM2174P",$J,"DFN",I)=ICN_"/"_DFN
. ; for this DFN, loop over the associated IENs in the 408.12 file "B" index
. S IEN="" F S IEN=$O(^DGPR(408.12,"B",DFN,IEN)) Q:'IEN D
. . ; get the related 408.13 IEN
. . S VAL=$P(^DGPR(408.12,IEN,0),"^",3)
. . I $P(VAL,";",2)'="DGPR(408.13," Q
. . S XIEN=$P(VAL,";",1)
. . ; If this IEN is in ^XTMP("DG53970P",JOB,"SSN",count)=IEN, it still needs SSN update - so store the info
. . ; If there is an error logged when the SSN was unsuccessfully updated, include that error in ^TMP global
. . S FOUND=0
. . S IENCNT=0 F S IENCNT=$O(^XTMP("DG53970P",JOB,"SSN",IENCNT)) Q:'IENCNT D Q:FOUND
. . . I ^XTMP("DG53970P",JOB,"SSN",IENCNT)=XIEN S DCNT=DCNT+1,FOUND=1,^TMP("IVM2174P",$J,"DFN",I,XIEN)=$G(^XTMP("DG53970P",JOB,"SSNERR",XIEN))
Q
MSG ; All data is collected in ^TMP("IVM2174P") - put together email message
N XMSUB,XMDUZ,XMY,XMTEXT,MSG,LN,IVMSITE,ERRMSG
S IVMSITE=$$SITE^VASITE
S XMY("[email protected]")=""
S XMY(DUZ)=""
S XMTEXT="MSG("
S XMDUZ=.5,XMSUB="IVM*2.0*174-#"_$P(IVMSITE,"^",3)_"-VHA/ES CLEANUP OF SSNs IN (#408.13) FILE"
S MSG($$LN)=""
S MSG($$LN)="The job completed to check if patient records still exist in the"
S MSG($$LN)="^XTMP(""DG53970P"" global and require a push of corrected SSN data from ES"
S MSG($$LN)="via an HL7(ORU-Z10) message."
S MSG($$LN)=""
S MSG($$LN)="Job Results:"
S MSG($$LN)="------------"
S MSG($$LN)=" Facility Name: "_$P(IVMSITE,"^",2)
S MSG($$LN)="Station Number: "_$P(IVMSITE,"^",3)
S MSG($$LN)=""
S MSG($$LN)="Total patients (ICN/DFN) with dependents not updated: "_PCNT
S MSG($$LN)=" Total dependent (IENs) not updated: "_DCNT
F I=1:1:PCNT D
. SET DFN=^TMP("IVM2174P",$J,"DFN",I)
. S MSG($$LN)=""
. S MSG($$LN)="Patient ICN/DFN: "_DFN
. ; loop over IENs - include the error message if there is one.
. S IEN="",LINE=0 F S IEN=$O(^TMP("IVM2174P",$J,"DFN",I,IEN)) Q:'IEN D
. . S ERRMSG=^TMP("IVM2174P",$J,"DFN",I,IEN)
. . I ERRMSG'="" S ERRMSG=" ("_ERRMSG_")"
. . I LINE=0 S MSG($$LN)=" Dependent IENs: "_IEN_ERRMSG,LINE=1
. . E S MSG($$LN)=" "_IEN_ERRMSG
; send mail message with results
D ^XMD
; if we have data in the ^XTMP global, requeue this job to run in 2 days
I PCNT D
. N ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSK
. S ZTRTN="TASK^IVM2174P"
. S ZTDESC="IVM*2.0*174 Gather list of ICNs/DFNs in ^XTMP(""DG53970P"") that need update of dependent SSNs."
. S ZTDTH=$$SCH^XLFDT("2D",$$NOW^XLFDT)
. S ZTIO=""
. D ^%ZTLOAD
Q
LN() ;Increment line counter
S LN=$G(LN)+1
Q LN
5 changes: 3 additions & 2 deletions Packages/Income Verification Match/Routines/IVMCM2.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
IVMCM2 ;ALB/SEK,CKN,TDM - ADD NEW DCD DEPENDENT TO INCOME PERSON FILE ; 3/18/10 2:07pm
;;2.0;INCOME VERIFICATION MATCH;**17,105,115,139,121**;21-OCT-94;Build 45
IVMCM2 ;ALB/SEK,CKN,TDM,JAM - ADD NEW DCD DEPENDENT TO INCOME PERSON FILE ;3/18/10 2:07pm
;;2.0;INCOME VERIFICATION MATCH;**17,105,115,139,121,174**;21-OCT-94;Build 15
;;Per VHA Directive 10-93-142, this routine should not be modified.
;
EN ; this routine will add entries to INCOME PERSON file (408.13) for
Expand Down Expand Up @@ -27,6 +27,7 @@
S DGPRI=$P(IVMSEG,"^",7) ; ien of patient relation file
;
S IVMNM=$$FMNAME^HLFNC($P(IVMSEG,"^",2)),IVMSEX=$P(IVMSEG,"^",3),IVMDOB=$$FMDATE^HLFNC($P(IVMSEG,"^",4)),IVMSSN=$P(IVMSEG,"^",5)
I IVMSSN=" " S IVMFERR="" Q ; IVM*2.0*174 ;jam; Set error variable IVMFERR so the ZDP will not be processed if IVMSSN=blank
S IVMPSSNR=$P(IVMSEG,"^",10) ;Pseudo SSN Reason IVM*2*105
;if there is a valid Pseudo SSN Reason, then append a "P" to the end
;of the SSN so that it cam be recognized on VistA as a pseudo - IVM*2*115
Expand Down
17 changes: 15 additions & 2 deletions Packages/Income Verification Match/Routines/IVMCMC.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
IVMCMC ;ALB/SEK,BRM,GN,TDM - CHECK INCOME TEST TRANSMISSION SEGMENTS ; 8/15/08 10:20am
;;2.0;INCOME VERIFICATION MATCH;**17,34,49,51,90,115**;21-OCT-94;Build 28
IVMCMC ;ALB/SEK,BRM,GN,TDM,JAM - CHECK INCOME TEST TRANSMISSION SEGMENTS ;8/15/08 10:20am
;;2.0;INCOME VERIFICATION MATCH;**17,34,49,51,90,115,174**;21-OCT-94;Build 15
;
;IVM*2*90 - stop upload of LTC type 4 test when staus code not valid
;
Expand Down Expand Up @@ -65,6 +65,19 @@ D GET("ZIRS") I IVMSEG1'="ZIR" D PROB("Missing spouse's ZIR segment") G ENQ
;
I $D(HLERR) G ENQ
;
; Patch IVM*2.0*174 - jam - For ORU-Z10, process SSN for IENs in ^XTMP("DG53970P")
; -----------------
; Do this for ORU message only
; The caller routine ^EASCM sets IVMSSNFLAG=0, quit if this var gets set to 1
I $G(IVMORF)'=1 D I $G(IVMSSNFLAG)=1 G ENQ
. ; Check if there is a job number in ^XTMP("DG53970P")
. N IVMJOB
. S IVMJOB=0
. S IVMJOB=$O(^XTMP("DG53970P",IVMJOB))
. I 'IVMJOB Q
. ; If this DFN is in the ^XTMP global, process the SSNs in the ZDP, and set IVMSSNFLAG=1 to have caller quit further processing
. I $D(^XTMP("DG53970P",IVMJOB,"DFN",DFN)) D IVMFSSN^IVM2174F(DFN,IVMJOB) S IVMSSNFLAG=1
; ------------------
; - check for remaining ZMT and ZBT segments
D GET("ZMT2") I IVMSEG1'="ZMT" D PROB("Missing Copay Test ZMT segment") G ENQ
;
Expand Down
65 changes: 63 additions & 2 deletions Packages/Kernel/Globals/14.4+TASKS.zwr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
OSEHRA ZGO Export: TASKS
15-MAR-2019 07:53:53 ZWR
^%ZTSK(-1)=4329
15-MAR-2019 08:41:41 ZWR
^%ZTSK(-1)=4334
^%ZTSK(0)="TASKS^14.4^4237"
^%ZTSK(1001,0)="TASK^XMXBULL^16^^63957,36927^63957,36927^R^^^PATCH,USER^PLA^PLA^ZTDESC^^"
^%ZTSK(1001,.02)="^PLA^^"
Expand Down Expand Up @@ -39337,6 +39337,67 @@ OSEHRA ZGO Export: TASKS
^%ZTSK(4329,.3,"DUZ(",0)="@"
^%ZTSK(4329,.3,"XQSCH")=8
^%ZTSK(4329,.3,"XQY")=9891
^%ZTSK(4330,0)="HOUR^XUTMHR^.5^^65087,31023^65087,31023^R^^^POSTMASTER^VISTA^VISTA^ZTDESC^^"
^%ZTSK(4330,.02)="^VISTA^^"
^%ZTSK(4330,.03)="Taskman Hourly Job"
^%ZTSK(4330,.04)=5623547823
^%ZTSK(4330,.1)="B^65087,31083^Task's volume set not listed in index.^^^^^^"
^%ZTSK(4330,.2)=""
^%ZTSK(4330,.21)=""
^%ZTSK(4330,.25)=""
^%ZTSK(4331,0)="ZTSK^XQ1^.5^VISTA^65087,31083^65087,31083^O^8853^HL AUTOSTART LINK MANAGER^POSTMASTER^VISTA^VISTA^ZTDESC^VISTA^"
^%ZTSK(4331,.02)="^VISTA^^"
^%ZTSK(4331,.03)="No Description (%ZTLOAD)"
^%ZTSK(4331,.04)=5623547883
^%ZTSK(4331,.1)="B^65087,31085^Task's volume set not listed in index.^^^^^^"
^%ZTSK(4331,.2)=""
^%ZTSK(4331,.21)=""
^%ZTSK(4331,.25)=""
^%ZTSK(4331,.3,"DUZ(",0)="@"
^%ZTSK(4331,.3,"XQSCH")=10
^%ZTSK(4331,.3,"XQY")=8853
^%ZTSK(4332,0)="ZTSK^XQ1^.5^VISTA^65087,31083^65087,31083^O^8412^HL TASK RESTART^POSTMASTER^VISTA^VISTA^ZTDESC^VISTA^"
^%ZTSK(4332,.02)="^VISTA^^"
^%ZTSK(4332,.03)="No Description (%ZTLOAD)"
^%ZTSK(4332,.04)=5623547883
^%ZTSK(4332,.1)="B^65087,31087^Task's volume set not listed in index.^^^^^^"
^%ZTSK(4332,.2)=""
^%ZTSK(4332,.21)=""
^%ZTSK(4332,.25)=""
^%ZTSK(4332,.3,"DUZ(",0)="@"
^%ZTSK(4332,.3,"XQSCH")=11
^%ZTSK(4332,.3,"XQY")=8412
^%ZTSK(4333,0)="ZTSK^XQ1^.5^VISTA^65087,31083^65087,31083^O^9891^XOBV LISTENER STARTUP^POSTMASTER^VISTA^VISTA^ZTDESC^VISTA^"
^%ZTSK(4333,.02)="^VISTA^^"
^%ZTSK(4333,.03)="No Description (%ZTLOAD)"
^%ZTSK(4333,.04)=5623547883
^%ZTSK(4333,.1)="B^65087,31089^Task's volume set not listed in index.^^^^^^"
^%ZTSK(4333,.2)=""
^%ZTSK(4333,.21)=""
^%ZTSK(4333,.25)=""
^%ZTSK(4333,.3,"DUZ(",0)="@"
^%ZTSK(4333,.3,"XQSCH")=8
^%ZTSK(4333,.3,"XQY")=9891
^%ZTSK(4334,0)="TASK^IVM2174P^17^^65087,31093^65087,31093^R^245^XPD INSTALL BUILD^USER,SEVENTEEN^VISTA^VISTA^ZTDESC^^"
^%ZTSK(4334,.02)="^VISTA^^"
^%ZTSK(4334,.03)="IVM*2.0*174 Gather list of ICNs/DFNs in ^XTMP(""DG53970P"") that need update of dependent SSNs."
^%ZTSK(4334,.04)=5623547893
^%ZTSK(4334,.1)="B^65087,31096^Task's volume set not listed in index.^^^^^^"
^%ZTSK(4334,.2)=""
^%ZTSK(4334,.21)=""
^%ZTSK(4334,.25)=""
^%ZTSK(4334,.3,"DUZ(",0)="@"
^%ZTSK(4334,.3,"DUZ(",1)=""
^%ZTSK(4334,.3,"DUZ(",2)=1214
^%ZTSK(4334,.3,"DUZ(","AG")="V"
^%ZTSK(4334,.3,"DUZ(","AUTHENTICATION")="XUP"
^%ZTSK(4334,.3,"DUZ(","AUTO")=1
^%ZTSK(4334,.3,"DUZ(","BUF")=1
^%ZTSK(4334,.3,"DUZ(","LANG")=""
^%ZTSK(4334,.3,"DUZ(","LOA")=2
^%ZTSK(4334,.3,"DUZ(","TEST")=" <TEST ACCOUNT>"
^%ZTSK(4334,.3,"XQY")=245
^%ZTSK(4334,.3,"XQY0")="XPD INSTALL BUILD^Install Package(s)^^R^^^^^^^^2"
^%ZTSK(1082462,.1)="E^64013,39495^Interrupted While Running"
^%ZTSK(1082463,.1)="E^64013,39495^Interrupted While Running"
^%ZTSK(1082464,.1)="E^64013,39495^Interrupted While Running"
Expand Down
Loading

0 comments on commit 56217d6

Please sign in to comment.