RORUTL22 ;HCIOFO/SJA - COLLECT ROR DRUG MATCH ; 07/03/17 2:16pm
;;1.5;CLINICAL CASE REGISTRIES;**32**;Feb 17, 2006;Build 20
;
;*****************************************************************************
;*****************************************************************************
; --- ROUTINE MODIFICATION LOG ---
;
;PKG/PATCH DATE DEVELOPER MODIFICATION
;----------- --------- ----------- ----------------------------------------
;ROR*1.5*32 Oct 2017 S ALSAHHAR collect ROR Drug match
;
;******************************************************************************
;******************************************************************************
;
Q
;
EN(SDA) ; --- local drug match collecting - triggered by AMCH x-ref of the ROR GENERIC DRUG file (#799.51)
N ZTRTN,ZTIO,ZTDESC,ZTDTH,ZTSK
S ZTRTN="MATCH^RORUTL22",ZTIO="",ZTSAVE("SDA")="",ZTDESC="ROR Generic Drug - Drug Match",ZTDTH=$$NOW^XLFDT()
D ^%ZTLOAD K ZTSK
Q
;
MATCH ; --- run daily by nightly task job
N GENIEN,IEN50,REGS
K ^TMP($J)
I IOST["C-" W !!,"Collect existing ROR drug match data...",!
S REGS="",GENIEN=0 F S REGS=$O(^ROR(799.51,"ARDG",REGS)) Q:REGS="" S GENIEN=$S($G(SDA):SDA-1,1:0) F S GENIEN=$O(^ROR(799.51,"ARDG",REGS,GENIEN)) Q:'GENIEN D
. I $G(SDA),(GENIEN'=$G(SDA)) Q
. K ^TMP($J)
. D AND^PSS50(GENIEN,,,"RORARR") I $D(^TMP($J,"RORARR",0)) D
. . S IEN50=0 F S IEN50=$O(^TMP($J,"RORARR",IEN50)) Q:'IEN50 S ^ROR(799.51,"AMCH",REGS,GENIEN,IEN50)=""
K ^TMP($J)
G END
Q
;
XDRG(GENIEN,GROUP) ; --- run by RXADDGEN^RORUTL16 - Rx data search
; GENIEN - VA Generic Durg IEN
; GROUP - Group code
N PSS50
S PSS50=0 F S PSS50=$O(^ROR(799.51,"AMCH",GROUP_"#",GENIEN,PSS50)) Q:'PSS50 D
. I $D(RORTSK("PARAMS","DRUGS","G")) D
. . I '$D(@ROR8DST@(PSS50,GROUP)) S @ROR8DST@(PSS50,GROUP)=""
Q
;
TASK ; --- Entry point to automatic collect drug match
N RORROOT
D OPTSTAT^XUTMOPT("ROR DRUG MATCH",.RORROOT)
I '+$G(RORROOT(1)) D RESCH^XUTMOPT("ROR DRUG MATCH",$$FMADD^XLFDT(DT,1)+.01,"","24H","L")
Q
;
END ;--- exit
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRORUTL22 2152 printed Oct 16, 2024@17:45:04 Page 2
RORUTL22 ;HCIOFO/SJA - COLLECT ROR DRUG MATCH ; 07/03/17 2:16pm
+1 ;;1.5;CLINICAL CASE REGISTRIES;**32**;Feb 17, 2006;Build 20
+2 ;
+3 ;*****************************************************************************
+4 ;*****************************************************************************
+5 ; --- ROUTINE MODIFICATION LOG ---
+6 ;
+7 ;PKG/PATCH DATE DEVELOPER MODIFICATION
+8 ;----------- --------- ----------- ----------------------------------------
+9 ;ROR*1.5*32 Oct 2017 S ALSAHHAR collect ROR Drug match
+10 ;
+11 ;******************************************************************************
+12 ;******************************************************************************
+13 ;
+14 QUIT
+15 ;
EN(SDA) ; --- local drug match collecting - triggered by AMCH x-ref of the ROR GENERIC DRUG file (#799.51)
+1 NEW ZTRTN,ZTIO,ZTDESC,ZTDTH,ZTSK
+2 SET ZTRTN="MATCH^RORUTL22"
SET ZTIO=""
SET ZTSAVE("SDA")=""
SET ZTDESC="ROR Generic Drug - Drug Match"
SET ZTDTH=$$NOW^XLFDT()
+3 DO ^%ZTLOAD
KILL ZTSK
+4 QUIT
+5 ;
MATCH ; --- run daily by nightly task job
+1 NEW GENIEN,IEN50,REGS
+2 KILL ^TMP($JOB)
+3 IF IOST["C-"
WRITE !!,"Collect existing ROR drug match data...",!
+4 SET REGS=""
SET GENIEN=0
FOR
SET REGS=$ORDER(^ROR(799.51,"ARDG",REGS))
if REGS=""
QUIT
SET GENIEN=$SELECT($GET(SDA):SDA-1,1:0)
FOR
SET GENIEN=$ORDER(^ROR(799.51,"ARDG",REGS,GENIEN))
if 'GENIEN
QUIT
Begin DoDot:1
+5 IF $GET(SDA)
IF (GENIEN'=$GET(SDA))
QUIT
+6 KILL ^TMP($JOB)
+7 DO AND^PSS50(GENIEN,,,"RORARR")
IF $DATA(^TMP($JOB,"RORARR",0))
Begin DoDot:2
+8 SET IEN50=0
FOR
SET IEN50=$ORDER(^TMP($JOB,"RORARR",IEN50))
if 'IEN50
QUIT
SET ^ROR(799.51,"AMCH",REGS,GENIEN,IEN50)=""
End DoDot:2
End DoDot:1
+9 KILL ^TMP($JOB)
+10 GOTO END
+11 QUIT
+12 ;
XDRG(GENIEN,GROUP) ; --- run by RXADDGEN^RORUTL16 - Rx data search
+1 ; GENIEN - VA Generic Durg IEN
+2 ; GROUP - Group code
+3 NEW PSS50
+4 SET PSS50=0
FOR
SET PSS50=$ORDER(^ROR(799.51,"AMCH",GROUP_"#",GENIEN,PSS50))
if 'PSS50
QUIT
Begin DoDot:1
+5 IF $DATA(RORTSK("PARAMS","DRUGS","G"))
Begin DoDot:2
+6 IF '$DATA(@ROR8DST@(PSS50,GROUP))
SET @ROR8DST@(PSS50,GROUP)=""
End DoDot:2
End DoDot:1
+7 QUIT
+8 ;
TASK ; --- Entry point to automatic collect drug match
+1 NEW RORROOT
+2 DO OPTSTAT^XUTMOPT("ROR DRUG MATCH",.RORROOT)
+3 IF '+$GET(RORROOT(1))
DO RESCH^XUTMOPT("ROR DRUG MATCH",$$FMADD^XLFDT(DT,1)+.01,"","24H","L")
+4 QUIT
+5 ;
END ;--- exit
+1 QUIT