- RORP035A ;HIOFO/FT - CCR PRE/POST-INSTALL PATCH 35 (cont.) ;9/16/2019
- ;;1.5;CLINICAL CASE REGISTRIES;**35**;Feb 17, 2006;Build 7
- ;
- ;*****************************************************************************
- ;*****************************************************************************
- ; --- ROUTINE MODIFICATION LOG ---
- ;
- ;PKG/PATCH DATE DEVELOPER MODIFICATION
- ;----------- --------- ----------- ----------------------------------------
- ;ROR*1.5*35 Nov 2019 F TRAXLER Part of post-install process to change
- ; "Pending" status to "Confirmed. Called
- ; from RORP035.
- ;******************************************************************************
- ;******************************************************************************
- ;
- ; SUPPORTED CALLS:
- ; FMADD^XLFDT #10103
- ; BMES^XPDUTL #10141
- ; MES^XPDUTL #10141
- ;
- Q
- ;
- FINDPEND ;Find 'Pending' patients in 'VA HEPC' and 'VA HIV' registries
- N RORIEN,RORHEPCIEN,RORHIVIEN,RORREGISTRY,RORSTATUS
- S RORHEPCIEN=$O(^ROR(798.1,"B","VA HEPC",0))
- S RORHIVIEN=$O(^ROR(798.1,"B","VA HIV",0))
- I 'RORHEPCIEN D BMES^XPDUTL("Cannot find HEP C registry.") Q
- I 'RORHIVIEN D BMES^XPDUTL("Cannot find HIV registry.") Q
- 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"
- F RORREGISTRY=RORHEPCIEN,RORHIVIEN D
- .D ACONFIRM(RORREGISTRY,1) ;set auto-confirm to 'Yes'
- .S RORIEN=0
- .F S RORIEN=$O(^RORDATA(798,"AC",RORREGISTRY,RORIEN)) Q:'RORIEN D
- ..Q:$P($G(^RORDATA(798,RORIEN,0)),U,5)'=4 ;we want PENDING only
- ..S ^XTMP("ROR PENDING RECORDS",RORIEN)=$G(^RORDATA(798,RORIEN,0))
- ..S ^XTMP("ROR PENDING RECORDS",RORIEN,"COMMENT")=$G(^RORDATA(798,RORIEN,3))
- ..S RORSTATUS=$$P2C(RORIEN)
- ..I +RORSTATUS<0 D BMES^XPDUTL(RORSTATUS)
- Q
- P2C(RORDA) ;change patient status (file 798, field 3)
- ;from 'Pending' (4) to 'Confirmed' (0)
- ;Also, remove any 'Pending' comment (file 798, field 12) value
- ; Input: RORDA = FILE 798 ien
- ; Output: flag^message
- ; where: -n^error message text
- ; 1^success
- N RORFDA,RORFLAG,RORMSG
- S RORDA=+$G(RORDA),RORFLAG="1^Success"
- I '$D(^RORDATA(798,RORDA,0)) S RORFLAG="-1^RORDATA(798,"_RORDA_",0) not defined" Q RORFLAG
- S RORFDA(798,RORDA_",",3)=0 ;status=confirmed
- S RORFDA(798,RORDA_",",12)="@" ;remove pending comment
- D FILE^DIE(,"RORFDA","RORMSG")
- I $D(RORMSG) S RORFLAG="-"_RORDA_U_RORMSG("DIERR",1,"TEXT",1)
- Q RORFLAG
- ;
- C2P ;restore status from 'confirmed' to 'pending' and reset pending patient comment field.
- N RORDA,RORFDA,RORMSG
- S RORDA=0
- F S RORDA=$O(^XTMP("ROR PENDING RECORDS",RORDA)) Q:'RORDA D
- .S RORFDA(798,RORDA_",",2)="@" ;date confirmed
- .S RORFDA(798,RORDA_",",2.1)="@" ;confirmed by
- .S RORFDA(798,RORDA_",",3)=4 ;status=Pending
- .S RORFDA(798,RORDA_",",12)=$G(^XTMP("ROR PENDING RECORDS",RORDA,"COMMENT")) ;pending patient comment
- .D FILE^DIE(,"RORFDA","RORMSG")
- .I $D(RORMSG) W !,RORDA_U_RORMSG("DIERR",1,"TEXT",1)
- Q
- ACONFIRM(RORDA,RORVALUE) ;set FILE 798.1, field #31 (AUTO-CONFIRM)
- N RORFDA,RORMSG
- S RORFDA(798.1,RORDA_",",31)=RORVALUE ;0=No, 1=Yes, @=delete existing value (i.e., null)
- D FILE^DIE(,"RORFDA","RORMSG")
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRORP035A 3348 printed Mar 13, 2025@20:47:24 Page 2
- 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
- +2 ;
- +3 ;*****************************************************************************
- +4 ;*****************************************************************************
- +5 ; --- ROUTINE MODIFICATION LOG ---
- +6 ;
- +7 ;PKG/PATCH DATE DEVELOPER MODIFICATION
- +8 ;----------- --------- ----------- ----------------------------------------
- +9 ;ROR*1.5*35 Nov 2019 F TRAXLER Part of post-install process to change
- +10 ; "Pending" status to "Confirmed. Called
- +11 ; from RORP035.
- +12 ;******************************************************************************
- +13 ;******************************************************************************
- +14 ;
- +15 ; SUPPORTED CALLS:
- +16 ; FMADD^XLFDT #10103
- +17 ; BMES^XPDUTL #10141
- +18 ; MES^XPDUTL #10141
- +19 ;
- +20 QUIT
- +21 ;
- FINDPEND ;Find 'Pending' patients in 'VA HEPC' and 'VA HIV' registries
- +1 NEW RORIEN,RORHEPCIEN,RORHIVIEN,RORREGISTRY,RORSTATUS
- +2 SET RORHEPCIEN=$ORDER(^ROR(798.1,"B","VA HEPC",0))
- +3 SET RORHIVIEN=$ORDER(^ROR(798.1,"B","VA HIV",0))
- +4 IF 'RORHEPCIEN
- DO BMES^XPDUTL("Cannot find HEP C registry.")
- QUIT
- +5 IF 'RORHIVIEN
- DO BMES^XPDUTL("Cannot find HIV registry.")
- QUIT
- +6 SET ^XTMP("ROR PENDING RECORDS",0)=$$FMADD^XLFDT(DT,60)_U_DT_U_"ROR*1.5*35: File 798 records before resetting Pending to Confirmed"
- +7 FOR RORREGISTRY=RORHEPCIEN,RORHIVIEN
- Begin DoDot:1
- +8 ;set auto-confirm to 'Yes'
- DO ACONFIRM(RORREGISTRY,1)
- +9 SET RORIEN=0
- +10 FOR
- SET RORIEN=$ORDER(^RORDATA(798,"AC",RORREGISTRY,RORIEN))
- if 'RORIEN
- QUIT
- Begin DoDot:2
- +11 ;we want PENDING only
- if $PIECE($GET(^RORDATA(798,RORIEN,0)),U,5)'=4
- QUIT
- +12 SET ^XTMP("ROR PENDING RECORDS",RORIEN)=$GET(^RORDATA(798,RORIEN,0))
- +13 SET ^XTMP("ROR PENDING RECORDS",RORIEN,"COMMENT")=$GET(^RORDATA(798,RORIEN,3))
- +14 SET RORSTATUS=$$P2C(RORIEN)
- +15 IF +RORSTATUS<0
- DO BMES^XPDUTL(RORSTATUS)
- End DoDot:2
- End DoDot:1
- +16 QUIT
- P2C(RORDA) ;change patient status (file 798, field 3)
- +1 ;from 'Pending' (4) to 'Confirmed' (0)
- +2 ;Also, remove any 'Pending' comment (file 798, field 12) value
- +3 ; Input: RORDA = FILE 798 ien
- +4 ; Output: flag^message
- +5 ; where: -n^error message text
- +6 ; 1^success
- +7 NEW RORFDA,RORFLAG,RORMSG
- +8 SET RORDA=+$GET(RORDA)
- SET RORFLAG="1^Success"
- +9 IF '$DATA(^RORDATA(798,RORDA,0))
- SET RORFLAG="-1^RORDATA(798,"_RORDA_",0) not defined"
- QUIT RORFLAG
- +10 ;status=confirmed
- SET RORFDA(798,RORDA_",",3)=0
- +11 ;remove pending comment
- SET RORFDA(798,RORDA_",",12)="@"
- +12 DO FILE^DIE(,"RORFDA","RORMSG")
- +13 IF $DATA(RORMSG)
- SET RORFLAG="-"_RORDA_U_RORMSG("DIERR",1,"TEXT",1)
- +14 QUIT RORFLAG
- +15 ;
- C2P ;restore status from 'confirmed' to 'pending' and reset pending patient comment field.
- +1 NEW RORDA,RORFDA,RORMSG
- +2 SET RORDA=0
- +3 FOR
- SET RORDA=$ORDER(^XTMP("ROR PENDING RECORDS",RORDA))
- if 'RORDA
- QUIT
- Begin DoDot:1
- +4 ;date confirmed
- SET RORFDA(798,RORDA_",",2)="@"
- +5 ;confirmed by
- SET RORFDA(798,RORDA_",",2.1)="@"
- +6 ;status=Pending
- SET RORFDA(798,RORDA_",",3)=4
- +7 ;pending patient comment
- SET RORFDA(798,RORDA_",",12)=$GET(^XTMP("ROR PENDING RECORDS",RORDA,"COMMENT"))
- +8 DO FILE^DIE(,"RORFDA","RORMSG")
- +9 IF $DATA(RORMSG)
- WRITE !,RORDA_U_RORMSG("DIERR",1,"TEXT",1)
- End DoDot:1
- +10 QUIT
- ACONFIRM(RORDA,RORVALUE) ;set FILE 798.1, field #31 (AUTO-CONFIRM)
- +1 NEW RORFDA,RORMSG
- +2 ;0=No, 1=Yes, @=delete existing value (i.e., null)
- SET RORFDA(798.1,RORDA_",",31)=RORVALUE
- +3 DO FILE^DIE(,"RORFDA","RORMSG")
- +4 QUIT