OOPSV221 ;WIOFO/LLH-POST INIT ROUTINE, FILL FIELD 331 ;09/15/09
;;2.0;ASISTS;**21**;Jun 03, 2002;Build 7
;
; Patch 21 Pre Init Routine to clean up data in the Patient Source
; field (#34) and Contamination field (#35)
; and update 2263.3 T8 code
;
Q ; prevents excuting from top of routine
;
ENT ;
D BMES^XPDUTL("Starting Pre-install....") H 1
D CLEAN,UPDATE
D BMES^XPDUTL("Pre-install Complete!!!") H 1
Q
CLEAN ;CLEAN UP 2260 ENTRIES
N OOPSCN,DA,DIC,DIE,DR,OOPSIEN,OOPSFILE,OOPSTYP,OOPSCONTAM,OOPSPAT,DR
S OOPSFILE=2260,OOPSIEN=0
D BMES^XPDUTL("Starting data clean up of PATIENT SOURCE (#34) and CONTAMINATION (#35) fields") H 1
D MES^XPDUTL(" ")
S DIE="^OOPS(2260,",DR=""
F S OOPSIEN=$O(^OOPS(OOPSFILE,OOPSIEN)) Q:OOPSIEN'>0 D
.S OOPSTYP=$$GET1^DIQ(OOPSFILE,OOPSIEN,3,"I")
.I OOPSTYP>10&(OOPSTYP<15) Q ; these are blood borne incidents and should have data
.; check to see if data in #34 or #35 - if so, kill then go on
.S OOPSPAT=$$GET1^DIQ(OOPSFILE,OOPSIEN,34,"I"),OOPSCONTAM=$$GET1^DIQ(OOPSFILE,OOPSIEN,35,"I")
.S OOPSCN=0,DR=""
.I $G(OOPSPAT)'="" S OOPSCN=OOPSCN+1,DR(1,2260,OOPSCN)="34///@"
.I $G(OOPSCONTAM)'="" S OOPSCN=OOPSCN+1,DR(1,2260,OOPSCN)="35///@"
.I $D(DR)>1 S DA=OOPSIEN D ^DIE K DR
D BMES^XPDUTL("Data Cleanup Complete") H 1
D MES^XPDUTL(" ")
Q
UPDATE ;UPDATE 2263.3 IEN 59
N OOPSIEN1,DA,DIE,DIK
D BMES^XPDUTL("Starting update of the ASISTS DOL NATURE OF INJURY CODES file") H 1
S OOPSIEN1=""
S OOPSIEN1=$O(^OOPS(2263.3,"B","TRAUMATIC INJURY - UNCLASS. (EXCEPT DISEASE, ILLNESS)",0))
I OOPSIEN1="" D BMES^XPDUTL("TRAUMATIC INJURY (T8) does not exist....quitting update") Q
S DIK="^OOPS(2263.3,"
S DA=OOPSIEN1,DIK(1)=.01
D EN2^DIK
S $P(^OOPS(2263.3,DA,0),"^")="TRAUMATIC INJURY- UNCLASS. (EXCEPT DISEASE, ILLNESS)"
D EN1^DIK
D BMES^XPDUTL("Update Complete") H 1
K DA,DIE,DIK
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOOPSV221 1888 printed Dec 13, 2024@01:39:51 Page 2
OOPSV221 ;WIOFO/LLH-POST INIT ROUTINE, FILL FIELD 331 ;09/15/09
+1 ;;2.0;ASISTS;**21**;Jun 03, 2002;Build 7
+2 ;
+3 ; Patch 21 Pre Init Routine to clean up data in the Patient Source
+4 ; field (#34) and Contamination field (#35)
+5 ; and update 2263.3 T8 code
+6 ;
+7 ; prevents excuting from top of routine
QUIT
+8 ;
ENT ;
+1 DO BMES^XPDUTL("Starting Pre-install....")
HANG 1
+2 DO CLEAN
DO UPDATE
+3 DO BMES^XPDUTL("Pre-install Complete!!!")
HANG 1
+4 QUIT
CLEAN ;CLEAN UP 2260 ENTRIES
+1 NEW OOPSCN,DA,DIC,DIE,DR,OOPSIEN,OOPSFILE,OOPSTYP,OOPSCONTAM,OOPSPAT,DR
+2 SET OOPSFILE=2260
SET OOPSIEN=0
+3 DO BMES^XPDUTL("Starting data clean up of PATIENT SOURCE (#34) and CONTAMINATION (#35) fields")
HANG 1
+4 DO MES^XPDUTL(" ")
+5 SET DIE="^OOPS(2260,"
SET DR=""
+6 FOR
SET OOPSIEN=$ORDER(^OOPS(OOPSFILE,OOPSIEN))
if OOPSIEN'>0
QUIT
Begin DoDot:1
+7 SET OOPSTYP=$$GET1^DIQ(OOPSFILE,OOPSIEN,3,"I")
+8 ; these are blood borne incidents and should have data
IF OOPSTYP>10&(OOPSTYP<15)
QUIT
+9 ; check to see if data in #34 or #35 - if so, kill then go on
+10 SET OOPSPAT=$$GET1^DIQ(OOPSFILE,OOPSIEN,34,"I")
SET OOPSCONTAM=$$GET1^DIQ(OOPSFILE,OOPSIEN,35,"I")
+11 SET OOPSCN=0
SET DR=""
+12 IF $GET(OOPSPAT)'=""
SET OOPSCN=OOPSCN+1
SET DR(1,2260,OOPSCN)="34///@"
+13 IF $GET(OOPSCONTAM)'=""
SET OOPSCN=OOPSCN+1
SET DR(1,2260,OOPSCN)="35///@"
+14 IF $DATA(DR)>1
SET DA=OOPSIEN
DO ^DIE
KILL DR
End DoDot:1
+15 DO BMES^XPDUTL("Data Cleanup Complete")
HANG 1
+16 DO MES^XPDUTL(" ")
+17 QUIT
UPDATE ;UPDATE 2263.3 IEN 59
+1 NEW OOPSIEN1,DA,DIE,DIK
+2 DO BMES^XPDUTL("Starting update of the ASISTS DOL NATURE OF INJURY CODES file")
HANG 1
+3 SET OOPSIEN1=""
+4 SET OOPSIEN1=$ORDER(^OOPS(2263.3,"B","TRAUMATIC INJURY - UNCLASS. (EXCEPT DISEASE, ILLNESS)",0))
+5 IF OOPSIEN1=""
DO BMES^XPDUTL("TRAUMATIC INJURY (T8) does not exist....quitting update")
QUIT
+6 SET DIK="^OOPS(2263.3,"
+7 SET DA=OOPSIEN1
SET DIK(1)=.01
+8 DO EN2^DIK
+9 SET $PIECE(^OOPS(2263.3,DA,0),"^")="TRAUMATIC INJURY- UNCLASS. (EXCEPT DISEASE, ILLNESS)"
+10 DO EN1^DIK
+11 DO BMES^XPDUTL("Update Complete")
HANG 1
+12 KILL DA,DIE,DIK
+13 QUIT