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

RORP035A.m

Go to the documentation of this file.
  1. RORP035A ;HIOFO/FT - CCR PRE/POST-INSTALL PATCH 35 (cont.) ;9/16/2019
  1. ;;1.5;CLINICAL CASE REGISTRIES;**35**;Feb 17, 2006;Build 7
  1. ;
  1. ;*****************************************************************************
  1. ;*****************************************************************************
  1. ; --- ROUTINE MODIFICATION LOG ---
  1. ;
  1. ;PKG/PATCH DATE DEVELOPER MODIFICATION
  1. ;----------- --------- ----------- ----------------------------------------
  1. ;ROR*1.5*35 Nov 2019 F TRAXLER Part of post-install process to change
  1. ; "Pending" status to "Confirmed. Called
  1. ; from RORP035.
  1. ;******************************************************************************
  1. ;******************************************************************************
  1. ;
  1. ; SUPPORTED CALLS:
  1. ; FMADD^XLFDT #10103
  1. ; BMES^XPDUTL #10141
  1. ; MES^XPDUTL #10141
  1. ;
  1. Q
  1. ;
  1. FINDPEND ;Find 'Pending' patients in 'VA HEPC' and 'VA HIV' registries
  1. N RORIEN,RORHEPCIEN,RORHIVIEN,RORREGISTRY,RORSTATUS
  1. S RORHEPCIEN=$O(^ROR(798.1,"B","VA HEPC",0))
  1. S RORHIVIEN=$O(^ROR(798.1,"B","VA HIV",0))
  1. I 'RORHEPCIEN D BMES^XPDUTL("Cannot find HEP C registry.") Q
  1. I 'RORHIVIEN D BMES^XPDUTL("Cannot find HIV registry.") Q
  1. S ^XTMP("ROR PENDING RECORDS",0)=$$FMADD^XLFDT(DT,60)_U_DT_U_"ROR*1.5*35: File 798 records before resetting Pending to Confirmed"
  1. F RORREGISTRY=RORHEPCIEN,RORHIVIEN D
  1. .D ACONFIRM(RORREGISTRY,1) ;set auto-confirm to 'Yes'
  1. .S RORIEN=0
  1. .F S RORIEN=$O(^RORDATA(798,"AC",RORREGISTRY,RORIEN)) Q:'RORIEN D
  1. ..Q:$P($G(^RORDATA(798,RORIEN,0)),U,5)'=4 ;we want PENDING only
  1. ..S ^XTMP("ROR PENDING RECORDS",RORIEN)=$G(^RORDATA(798,RORIEN,0))
  1. ..S ^XTMP("ROR PENDING RECORDS",RORIEN,"COMMENT")=$G(^RORDATA(798,RORIEN,3))
  1. ..S RORSTATUS=$$P2C(RORIEN)
  1. ..I +RORSTATUS<0 D BMES^XPDUTL(RORSTATUS)
  1. Q
  1. P2C(RORDA) ;change patient status (file 798, field 3)
  1. ;from 'Pending' (4) to 'Confirmed' (0)
  1. ;Also, remove any 'Pending' comment (file 798, field 12) value
  1. ; Input: RORDA = FILE 798 ien
  1. ; Output: flag^message
  1. ; where: -n^error message text
  1. ; 1^success
  1. N RORFDA,RORFLAG,RORMSG
  1. S RORDA=+$G(RORDA),RORFLAG="1^Success"
  1. I '$D(^RORDATA(798,RORDA,0)) S RORFLAG="-1^RORDATA(798,"_RORDA_",0) not defined" Q RORFLAG
  1. S RORFDA(798,RORDA_",",3)=0 ;status=confirmed
  1. S RORFDA(798,RORDA_",",12)="@" ;remove pending comment
  1. D FILE^DIE(,"RORFDA","RORMSG")
  1. I $D(RORMSG) S RORFLAG="-"_RORDA_U_RORMSG("DIERR",1,"TEXT",1)
  1. Q RORFLAG
  1. ;
  1. C2P ;restore status from 'confirmed' to 'pending' and reset pending patient comment field.
  1. N RORDA,RORFDA,RORMSG
  1. S RORDA=0
  1. F S RORDA=$O(^XTMP("ROR PENDING RECORDS",RORDA)) Q:'RORDA D
  1. .S RORFDA(798,RORDA_",",2)="@" ;date confirmed
  1. .S RORFDA(798,RORDA_",",2.1)="@" ;confirmed by
  1. .S RORFDA(798,RORDA_",",3)=4 ;status=Pending
  1. .S RORFDA(798,RORDA_",",12)=$G(^XTMP("ROR PENDING RECORDS",RORDA,"COMMENT")) ;pending patient comment
  1. .D FILE^DIE(,"RORFDA","RORMSG")
  1. .I $D(RORMSG) W !,RORDA_U_RORMSG("DIERR",1,"TEXT",1)
  1. Q
  1. ACONFIRM(RORDA,RORVALUE) ;set FILE 798.1, field #31 (AUTO-CONFIRM)
  1. N RORFDA,RORMSG
  1. S RORFDA(798.1,RORDA_",",31)=RORVALUE ;0=No, 1=Yes, @=delete existing value (i.e., null)
  1. D FILE^DIE(,"RORFDA","RORMSG")
  1. Q