- ONC2PR20 ;HINES OIFO/RTK - Pre-Install Routine for Patch ONC*2.2*20 ;05/01/24
- ;;2.2;ONCOLOGY;**20**;Jul 31, 2013;Build 5
- ;
- ; ICRs:
- ; #1157 XPDMENU
- ; #10141 XPDUTL
- ; #10060 FILE 200 fields
- Q
- START ;start pre-init changes
- K ^ONCO(160.16) ;delete 160.16 and bring back in patch 20 build
- K ^ONCO(164.33) ;delete 164.33 and bring back in patch 20 build
- K ^ONCO(164.44) ;delete 164.44 and bring back in patch 20 build
- K ^ONCO(165.8) ;delete 165.8 and bring back in patch 20 build
- K ^ONCO(165.9) ;delete 165.9 and bring back in patch 20 build
- D CASEFIND
- D INITIALS
- D ABSTATUS
- D GEOCODE
- D REMOPT1,REMOPT2,REMOPT3
- D USERV
- Q
- ;
- GEOCODE ;fix NEW ENGLAND AND NEW JERSEY entry in File #165.2
- ;FILE 165.2 - GEOCODES
- Q:+$$PATCH^XPDUTL("ONC*2.2*20") ;already done
- N ONCDA,ONCIEN,ONCIEN1,ONCIENS
- S (ONCDA,ONCIEN,ONCIEN1)=0
- D BMES^XPDUTL("Fixing the 'New England and New Jersey' entry in GEOCODES file (#165.2)")
- F S ONCDA=$O(^ONCO(165.2,ONCDA)) Q:'ONCDA!(ONCIEN>0) D
- .I $P(^ONCO(165.2,ONCDA,0),U,1)="New England and New Jersey" S ONCIEN=ONCDA
- I ONCIEN'>0 D Q
- .D BMES^XPDUTL("Cannot find the entry in FILE #165.2.")
- .D BMES^XPDUTL("Please log a ticket.")
- K ONCFDA,ONCMSG
- S ONCIENS=ONCIEN_","
- S ONCFDA(165.2,ONCIENS,1.1)="US" ;edit USPS STATE CODE
- D FILE^DIE(,"ONCFDA","ONCMSG")
- S ONCDA=0
- F S ONCDA=$O(^ONCO(165.2,ONCIEN,1,ONCDA)) Q:'ONCDA!(ONCIEN1>0) D
- .I $P(^ONCO(165.2,ONCIEN,1,ONCDA,0),U,1)="NEW JERSEY" S ONCIEN1=ONCDA
- K ONCIENS,ONCFDA,ONCMSG
- S ONCIENS=ONCIEN1_","_ONCIEN_","
- S ONCFDA(165.21,ONCIENS,.01)="@" ;delete XREF field value
- D FILE^DIE(,"ONCFDA","ONCMSG")
- D BMES^XPDUTL("GEOCODES FILE (#165.2) entry changed.")
- Q
- REMOPT1 ;Remove ONCO UTIL-DELETE PATIENT option from it's menu
- Q:+$$PATCH^XPDUTL("ONC*2.2*20") ;already done
- N ONCY
- S ONCY=$$DELETE^XPDMENU("ONCO UTIL MENU","ONCO UTIL-DELETE PATIENT")
- I ONCY'=1 D Q
- .D BMES^XPDUTL("Could not remove the 'ONCO UTIL-DELETE PATIENT' option from it's menu.")
- .D BMES^XPDUTL("Please log a ticket.")
- Q
- REMOPT2 ;Remove ONCO RQRS EXTRACT option from it's menu
- Q:+$$PATCH^XPDUTL("ONC*2.2*20") ;already done
- N ONCY
- S ONCY=$$DELETE^XPDMENU("ONCO UTIL MENU","ONCO RQRS EXTRACT")
- I ONCY'=1 D Q
- .D BMES^XPDUTL("Could not remove the 'ONCO RQRS EXTRACT' option from it's menu.")
- .D BMES^XPDUTL("Please log a ticket.")
- Q
- REMOPT3 ;Remove ONCO FOLL-PAT FOLLOWUP REPORT option from it's menu
- Q:+$$PATCH^XPDUTL("ONC*2.2*20") ;already done
- N ONCY
- S ONCY=$$DELETE^XPDMENU("ONCO FOLL PROCEDURE MENU","ONCO FOLL-PAT FOLLOWUP REPORT")
- I ONCY'=1 D Q
- .D BMES^XPDUTL("Could not remove the 'ONCO FOLL-PAT FOLLOWUP REPORT' option from it's menu.")
- .D BMES^XPDUTL("Please log a ticket.")
- Q
- ABSTATUS ;Check ABSTRACT STATUS (#91) field for all 2023 cases and later.
- ;If value=3 (Complete), then change to 2 (Partial).
- ;FILE 165.5 - ONCOLOGY PRIMARY
- ;ADX x-ref on DATE DX (#3) field
- D BMES^XPDUTL("Checking ABSTATUS (#91) values in ONCOLOGY SITE PARAMETERS file (#165.2)")
- N ONCDATE,ONCIEN,ONCNODE,ONCFDA,ONCMSG,ONCIENS
- S ONCDATE=3221231.999999
- F S ONCDATE=$O(^ONCO(165.5,"ADX",ONCDATE)) Q:'ONCDATE D
- .S ONCIEN=0
- .F S ONCIEN=$O(^ONCO(165.5,"ADX",ONCDATE,ONCIEN)) Q:'ONCIEN D
- ..S ONCNODE=$G(^ONCO(165.5,ONCIEN,7))
- ..Q:$P(ONCNODE,U,2)'=3 ;quit if ABSTRACT STATUS (#91) is not "Complete"
- ..K ONCFDA,ONCMSG
- ..S ONCIENS=ONCIEN_","
- ..S ONCFDA(165.5,ONCIENS,91)=2 ;set to "Partial"
- ..D FILE^DIE(,"ONCFDA","ONCMSG")
- .. D BMES^XPDUTL("Changed ABSTRACT STATUS value for entry "_ONCIEN_".")
- Q
- INITIALS ;Check if Oncology Registrar has initials in FILE 200
- ;FILE 165.5 - ONCOLOGY PRIMARY
- ;FILE 200 - NEW PERSON
- D BMES^XPDUTL("Checking if Oncology Registrar has INITIALS in the NEW PERSON file (#200)")
- N ONCDUZ,ONCIEN,ONCINITIALS,ONCNODE,ONCUSER,ONCWARNING
- S ONCIEN=0
- F S ONCIEN=$O(^ONCO(165.5,ONCIEN)) Q:'ONCIEN D
- .S ONCNODE=$G(^ONCO(165.5,ONCIEN,7))
- .S ONCDUZ=$P(ONCNODE,U,3) ;(#92) ABSTRACTED BY - pointer to FILE 200
- .Q:ONCDUZ="" ;field can be null if the case is not "Completed"
- .S ONCINITIALS=$$GET1^DIQ(200,ONCDUZ_",",1,,,"ONCMSG")
- .Q:ONCINITIALS'="" ;there are user initials
- .S ONCUSER=$$GET1^DIQ(200,ONCDUZ_",",.01,,,"ONCMSG")
- .S ONCWARNING=ONCUSER_" does not have INITIALS (#1) in the NEW PERSON (#200) file"
- .D BMES^XPDUTL(ONCWARNING)
- Q
- CASEFIND ;Changes to CASEFINDING SOURCE (#166) file
- ;change DEFINITION (#1) value for codes 20, 24 and 26
- Q:+$$PATCH^XPDUTL("ONC*2.2*20") ;already done
- N ONCIEN,ONCFDA,ONCMSG
- S ONCIEN=$O(^ONCO(166,"B",20,0))
- S ONCFDA(166,ONCIEN_",",1)="Pathology Department Review (surgical pathology reports, autopsies, or cytology reports)"
- D FILE^DIE(,"ONCFDA","ONCMSG")
- K ONCFDA,ONCMSG
- S ONCIEN=$O(^ONCO(166,"B",24,0))
- S ONCFDA(166,ONCIEN_",",1)="Laboratory Reports (other than pathology reports, code 20)"
- D FILE^DIE(,"ONCFDA","ONCMSG")
- K ONCFDA,ONCMSG
- S ONCIEN=$O(^ONCO(166,"B",26,0))
- S ONCFDA(166,ONCIEN_",",1)="Diagnostic Imaging/Radiology (other than radiation therapy, codes 23; includes nuclear medicine)"
- D FILE^DIE(,"ONCFDA","ONCMSG")
- K ONCFDA,ONCMSG
- S ONCIEN=$O(^ONCO(166,"B",28,0)) ;this change merely corrects a misspelling that existed
- S ONCFDA(166,ONCIEN_",",1)="Hospital Rehabilitation Service or Clinic"
- D FILE^DIE(,"ONCFDA","ONCMSG")
- Q
- USERV ;Update url to Production or Development server
- N ONCSYS
- S ONCSYS=$$PROD^XUPROD()
- S DA=$O(^XOB(18.12,"B","ONCO WEB SERVER",""))
- ;production url
- I ONCSYS D
- .S DIE="^XOB(18.12,",DR=".04///^S X=""va-reg-prod-apim.reg.vaec.domain.ext""" D ^DIE
- .W !,"Oncology Web Server is updated to Production url...",!
- ;development url
- I 'ONCSYS D
- .S DIE="^XOB(18.12,",DR=".04///^S X=""va-reg-preprod-apim.reg.vaec.domain.ext""" D ^DIE
- .W !,"Oncology Web Server is updated to Development url...",!
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONC2PR20 5865 printed Mar 13, 2025@21:26:30 Page 2
- ONC2PR20 ;HINES OIFO/RTK - Pre-Install Routine for Patch ONC*2.2*20 ;05/01/24
- +1 ;;2.2;ONCOLOGY;**20**;Jul 31, 2013;Build 5
- +2 ;
- +3 ; ICRs:
- +4 ; #1157 XPDMENU
- +5 ; #10141 XPDUTL
- +6 ; #10060 FILE 200 fields
- +7 QUIT
- START ;start pre-init changes
- +1 ;delete 160.16 and bring back in patch 20 build
- KILL ^ONCO(160.16)
- +2 ;delete 164.33 and bring back in patch 20 build
- KILL ^ONCO(164.33)
- +3 ;delete 164.44 and bring back in patch 20 build
- KILL ^ONCO(164.44)
- +4 ;delete 165.8 and bring back in patch 20 build
- KILL ^ONCO(165.8)
- +5 ;delete 165.9 and bring back in patch 20 build
- KILL ^ONCO(165.9)
- +6 DO CASEFIND
- +7 DO INITIALS
- +8 DO ABSTATUS
- +9 DO GEOCODE
- +10 DO REMOPT1
- DO REMOPT2
- DO REMOPT3
- +11 DO USERV
- +12 QUIT
- +13 ;
- GEOCODE ;fix NEW ENGLAND AND NEW JERSEY entry in File #165.2
- +1 ;FILE 165.2 - GEOCODES
- +2 ;already done
- if +$$PATCH^XPDUTL("ONC*2.2*20")
- QUIT
- +3 NEW ONCDA,ONCIEN,ONCIEN1,ONCIENS
- +4 SET (ONCDA,ONCIEN,ONCIEN1)=0
- +5 DO BMES^XPDUTL("Fixing the 'New England and New Jersey' entry in GEOCODES file (#165.2)")
- +6 FOR
- SET ONCDA=$ORDER(^ONCO(165.2,ONCDA))
- if 'ONCDA!(ONCIEN>0)
- QUIT
- Begin DoDot:1
- +7 IF $PIECE(^ONCO(165.2,ONCDA,0),U,1)="New England and New Jersey"
- SET ONCIEN=ONCDA
- End DoDot:1
- +8 IF ONCIEN'>0
- Begin DoDot:1
- +9 DO BMES^XPDUTL("Cannot find the entry in FILE #165.2.")
- +10 DO BMES^XPDUTL("Please log a ticket.")
- End DoDot:1
- QUIT
- +11 KILL ONCFDA,ONCMSG
- +12 SET ONCIENS=ONCIEN_","
- +13 ;edit USPS STATE CODE
- SET ONCFDA(165.2,ONCIENS,1.1)="US"
- +14 DO FILE^DIE(,"ONCFDA","ONCMSG")
- +15 SET ONCDA=0
- +16 FOR
- SET ONCDA=$ORDER(^ONCO(165.2,ONCIEN,1,ONCDA))
- if 'ONCDA!(ONCIEN1>0)
- QUIT
- Begin DoDot:1
- +17 IF $PIECE(^ONCO(165.2,ONCIEN,1,ONCDA,0),U,1)="NEW JERSEY"
- SET ONCIEN1=ONCDA
- End DoDot:1
- +18 KILL ONCIENS,ONCFDA,ONCMSG
- +19 SET ONCIENS=ONCIEN1_","_ONCIEN_","
- +20 ;delete XREF field value
- SET ONCFDA(165.21,ONCIENS,.01)="@"
- +21 DO FILE^DIE(,"ONCFDA","ONCMSG")
- +22 DO BMES^XPDUTL("GEOCODES FILE (#165.2) entry changed.")
- +23 QUIT
- REMOPT1 ;Remove ONCO UTIL-DELETE PATIENT option from it's menu
- +1 ;already done
- if +$$PATCH^XPDUTL("ONC*2.2*20")
- QUIT
- +2 NEW ONCY
- +3 SET ONCY=$$DELETE^XPDMENU("ONCO UTIL MENU","ONCO UTIL-DELETE PATIENT")
- +4 IF ONCY'=1
- Begin DoDot:1
- +5 DO BMES^XPDUTL("Could not remove the 'ONCO UTIL-DELETE PATIENT' option from it's menu.")
- +6 DO BMES^XPDUTL("Please log a ticket.")
- End DoDot:1
- QUIT
- +7 QUIT
- REMOPT2 ;Remove ONCO RQRS EXTRACT option from it's menu
- +1 ;already done
- if +$$PATCH^XPDUTL("ONC*2.2*20")
- QUIT
- +2 NEW ONCY
- +3 SET ONCY=$$DELETE^XPDMENU("ONCO UTIL MENU","ONCO RQRS EXTRACT")
- +4 IF ONCY'=1
- Begin DoDot:1
- +5 DO BMES^XPDUTL("Could not remove the 'ONCO RQRS EXTRACT' option from it's menu.")
- +6 DO BMES^XPDUTL("Please log a ticket.")
- End DoDot:1
- QUIT
- +7 QUIT
- REMOPT3 ;Remove ONCO FOLL-PAT FOLLOWUP REPORT option from it's menu
- +1 ;already done
- if +$$PATCH^XPDUTL("ONC*2.2*20")
- QUIT
- +2 NEW ONCY
- +3 SET ONCY=$$DELETE^XPDMENU("ONCO FOLL PROCEDURE MENU","ONCO FOLL-PAT FOLLOWUP REPORT")
- +4 IF ONCY'=1
- Begin DoDot:1
- +5 DO BMES^XPDUTL("Could not remove the 'ONCO FOLL-PAT FOLLOWUP REPORT' option from it's menu.")
- +6 DO BMES^XPDUTL("Please log a ticket.")
- End DoDot:1
- QUIT
- +7 QUIT
- ABSTATUS ;Check ABSTRACT STATUS (#91) field for all 2023 cases and later.
- +1 ;If value=3 (Complete), then change to 2 (Partial).
- +2 ;FILE 165.5 - ONCOLOGY PRIMARY
- +3 ;ADX x-ref on DATE DX (#3) field
- +4 DO BMES^XPDUTL("Checking ABSTATUS (#91) values in ONCOLOGY SITE PARAMETERS file (#165.2)")
- +5 NEW ONCDATE,ONCIEN,ONCNODE,ONCFDA,ONCMSG,ONCIENS
- +6 SET ONCDATE=3221231.999999
- +7 FOR
- SET ONCDATE=$ORDER(^ONCO(165.5,"ADX",ONCDATE))
- if 'ONCDATE
- QUIT
- Begin DoDot:1
- +8 SET ONCIEN=0
- +9 FOR
- SET ONCIEN=$ORDER(^ONCO(165.5,"ADX",ONCDATE,ONCIEN))
- if 'ONCIEN
- QUIT
- Begin DoDot:2
- +10 SET ONCNODE=$GET(^ONCO(165.5,ONCIEN,7))
- +11 ;quit if ABSTRACT STATUS (#91) is not "Complete"
- if $PIECE(ONCNODE,U,2)'=3
- QUIT
- +12 KILL ONCFDA,ONCMSG
- +13 SET ONCIENS=ONCIEN_","
- +14 ;set to "Partial"
- SET ONCFDA(165.5,ONCIENS,91)=2
- +15 DO FILE^DIE(,"ONCFDA","ONCMSG")
- +16 DO BMES^XPDUTL("Changed ABSTRACT STATUS value for entry "_ONCIEN_".")
- End DoDot:2
- End DoDot:1
- +17 QUIT
- INITIALS ;Check if Oncology Registrar has initials in FILE 200
- +1 ;FILE 165.5 - ONCOLOGY PRIMARY
- +2 ;FILE 200 - NEW PERSON
- +3 DO BMES^XPDUTL("Checking if Oncology Registrar has INITIALS in the NEW PERSON file (#200)")
- +4 NEW ONCDUZ,ONCIEN,ONCINITIALS,ONCNODE,ONCUSER,ONCWARNING
- +5 SET ONCIEN=0
- +6 FOR
- SET ONCIEN=$ORDER(^ONCO(165.5,ONCIEN))
- if 'ONCIEN
- QUIT
- Begin DoDot:1
- +7 SET ONCNODE=$GET(^ONCO(165.5,ONCIEN,7))
- +8 ;(#92) ABSTRACTED BY - pointer to FILE 200
- SET ONCDUZ=$PIECE(ONCNODE,U,3)
- +9 ;field can be null if the case is not "Completed"
- if ONCDUZ=""
- QUIT
- +10 SET ONCINITIALS=$$GET1^DIQ(200,ONCDUZ_",",1,,,"ONCMSG")
- +11 ;there are user initials
- if ONCINITIALS'=""
- QUIT
- +12 SET ONCUSER=$$GET1^DIQ(200,ONCDUZ_",",.01,,,"ONCMSG")
- +13 SET ONCWARNING=ONCUSER_" does not have INITIALS (#1) in the NEW PERSON (#200) file"
- +14 DO BMES^XPDUTL(ONCWARNING)
- End DoDot:1
- +15 QUIT
- CASEFIND ;Changes to CASEFINDING SOURCE (#166) file
- +1 ;change DEFINITION (#1) value for codes 20, 24 and 26
- +2 ;already done
- if +$$PATCH^XPDUTL("ONC*2.2*20")
- QUIT
- +3 NEW ONCIEN,ONCFDA,ONCMSG
- +4 SET ONCIEN=$ORDER(^ONCO(166,"B",20,0))
- +5 SET ONCFDA(166,ONCIEN_",",1)="Pathology Department Review (surgical pathology reports, autopsies, or cytology reports)"
- +6 DO FILE^DIE(,"ONCFDA","ONCMSG")
- +7 KILL ONCFDA,ONCMSG
- +8 SET ONCIEN=$ORDER(^ONCO(166,"B",24,0))
- +9 SET ONCFDA(166,ONCIEN_",",1)="Laboratory Reports (other than pathology reports, code 20)"
- +10 DO FILE^DIE(,"ONCFDA","ONCMSG")
- +11 KILL ONCFDA,ONCMSG
- +12 SET ONCIEN=$ORDER(^ONCO(166,"B",26,0))
- +13 SET ONCFDA(166,ONCIEN_",",1)="Diagnostic Imaging/Radiology (other than radiation therapy, codes 23; includes nuclear medicine)"
- +14 DO FILE^DIE(,"ONCFDA","ONCMSG")
- +15 KILL ONCFDA,ONCMSG
- +16 ;this change merely corrects a misspelling that existed
- SET ONCIEN=$ORDER(^ONCO(166,"B",28,0))
- +17 SET ONCFDA(166,ONCIEN_",",1)="Hospital Rehabilitation Service or Clinic"
- +18 DO FILE^DIE(,"ONCFDA","ONCMSG")
- +19 QUIT
- USERV ;Update url to Production or Development server
- +1 NEW ONCSYS
- +2 SET ONCSYS=$$PROD^XUPROD()
- +3 SET DA=$ORDER(^XOB(18.12,"B","ONCO WEB SERVER",""))
- +4 ;production url
- +5 IF ONCSYS
- Begin DoDot:1
- +6 SET DIE="^XOB(18.12,"
- SET DR=".04///^S X=""va-reg-prod-apim.reg.vaec.domain.ext"""
- DO ^DIE
- +7 WRITE !,"Oncology Web Server is updated to Production url...",!
- End DoDot:1
- +8 ;development url
- +9 IF 'ONCSYS
- Begin DoDot:1
- +10 SET DIE="^XOB(18.12,"
- SET DR=".04///^S X=""va-reg-preprod-apim.reg.vaec.domain.ext"""
- DO ^DIE
- +11 WRITE !,"Oncology Web Server is updated to Development url...",!
- End DoDot:1
- +12 QUIT