RORP017 ;BPOIFO/CLR POST INSTALL PATCH 17 ; 8/29/11 1:26pm
;;1.5;CLINICAL CASE REGISTRIES;**17**;Feb 17, 2006;Build 33
;******************************************************************************
; This routine uses the following IAs:
;
; #10006 ^DIC (supported)
; #2053 FILE^DIE (supported)
; #10013 ^DIK (supported)
; #2054 CLEAN^DILF (supported)
; #2056 GETS^DIQ (supported)
; #2263 ADD^XPAR (supported)
; #2263 DEL^XPAR (supported)
; #10141 BMES^XPDUTL (supported)
;
;******************************************************************************
POST ;
D BMES^XPDUTL("Adding PTSD common template...")
D PTSD
D BMES^XPDUTL("Adding new reports to HepC registry...")
D RPT
D BMES^XPDUTL("Checking VA GENERIC drug file...")
D GENDRG
Q
;******************************************************************************
;Add new ICD9 entry/group "PTSD" to the PARAMETERS file #8989.5
;ADD^XPAR(entity,parameter[,instance],value[,.error])
;DBIA 2263
;******************************************************************************
PTSD ;
N RORVALUE,RORERR,RORENTITY,RORPARAMETER,RORINSTANCE
S RORENTITY="PKG.CLINICAL CASE REGISTRIES"
S RORPARAMETER="ROR REPORT PARAMS TEMPLATE"
S RORINSTANCE="13::PTSD"
;delete it first (in case it already exists)
D DEL^XPAR(RORENTITY,RORPARAMETER,RORINSTANCE,.RORERR)
S RORVALUE="CCR Predefined Report Template"
S RORVALUE(1,0)="<?xml version="_"""1.0"""_" encoding="_"""UTF-8"""_"?>"
S RORVALUE(2,0)="<PARAMS>"
S RORVALUE(3,0)="<ICD9LST>"
S RORVALUE(4,0)="<GROUP ID="_"""PTSD"""_">"
S RORVALUE(5,0)="<ICD9 ID="_"""309.81"""_">POSTTRAUMATIC STRESS DIS</ICD9>"
S RORVALUE(6,0)="</GROUP>"
S RORVALUE(7,0)="</ICD9LST>"
S RORVALUE(8,0)="<PANELS>"
S RORVALUE(9,0)="<PANEL ID="_"""160"""_"/>"
S RORVALUE(10,0)="</PANELS>"
S RORVALUE(11,0)="</PARAMS>"
;add it
D ADD^XPAR(RORENTITY,RORPARAMETER,RORINSTANCE,.RORVALUE,.RORERR)
Q
;
;
;******************************************************************************
;Add reports 21-22 to the list of available reports for the VA HEPC entry in the
; ROR REGISTRY PARAMETERS file. Field #27: AVAILABLE REPORTS
;******************************************************************************
RPT ;
N REGNAME,REGIEN,RORERR,RORDATA,OLDLIST,NEWLIST S REGNAME="VA HEPC"
S REGIEN=$O(^ROR(798.1,"B",REGNAME,0))
Q:$G(REGIEN)=""
K RORDATA,RORERR D GETS^DIQ(798.1,REGIEN_",",27,"I","RORDATA","RORERR")
Q:$D(RORERR("DIERR"))
S OLDLIST=$G(RORDATA(798.1,REGIEN_",",27,"I"))
Q:$G(OLDLIST)=""
I OLDLIST[",18,19,20,21,22" Q
;update AVAILABLE REPORTS with the 3 additional reports
S NEWLIST=OLDLIST_",18,19,20,21,22"
N FLAG,FDA,IENS,FIELD S IENS=REGIEN_",",FIELD=27,FLAG="E"
S FDA(798.1,IENS,FIELD)=NEWLIST
K RORERR D FILE^DIE(FLAG,"FDA","RORERR")
D CLEAN^DILF
Q
;
;*******************************************************************
;
;Delete entry in ROR GENERIC DRUG with unresolved pointers
;
;********************************************************************
;clean up 799.51 if pointers are bad
GENDRG ;
N DIC,X,DIK,DA,RORNAME,Y
S DIC=799.51,DIC(0)="MNZ"
F RORNAME="EMTRICI./RILPIVIRINE/TENOFOVIR" D
.S X=RORNAME D ^DIC Q:+Y<0
.Q:+$P(Y(0),U,4)>0
.S DA=+Y,DIK="^ROR(799.51," D ^DIK
.D BMES^XPDUTL("WARNING*** Missing entry in VA GENERIC file.")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRORP017 3400 printed Dec 13, 2024@01:42:25 Page 2
RORP017 ;BPOIFO/CLR POST INSTALL PATCH 17 ; 8/29/11 1:26pm
+1 ;;1.5;CLINICAL CASE REGISTRIES;**17**;Feb 17, 2006;Build 33
+2 ;******************************************************************************
+3 ; This routine uses the following IAs:
+4 ;
+5 ; #10006 ^DIC (supported)
+6 ; #2053 FILE^DIE (supported)
+7 ; #10013 ^DIK (supported)
+8 ; #2054 CLEAN^DILF (supported)
+9 ; #2056 GETS^DIQ (supported)
+10 ; #2263 ADD^XPAR (supported)
+11 ; #2263 DEL^XPAR (supported)
+12 ; #10141 BMES^XPDUTL (supported)
+13 ;
+14 ;******************************************************************************
POST ;
+1 DO BMES^XPDUTL("Adding PTSD common template...")
+2 DO PTSD
+3 DO BMES^XPDUTL("Adding new reports to HepC registry...")
+4 DO RPT
+5 DO BMES^XPDUTL("Checking VA GENERIC drug file...")
+6 DO GENDRG
+7 QUIT
+8 ;******************************************************************************
+9 ;Add new ICD9 entry/group "PTSD" to the PARAMETERS file #8989.5
+10 ;ADD^XPAR(entity,parameter[,instance],value[,.error])
+11 ;DBIA 2263
+12 ;******************************************************************************
PTSD ;
+1 NEW RORVALUE,RORERR,RORENTITY,RORPARAMETER,RORINSTANCE
+2 SET RORENTITY="PKG.CLINICAL CASE REGISTRIES"
+3 SET RORPARAMETER="ROR REPORT PARAMS TEMPLATE"
+4 SET RORINSTANCE="13::PTSD"
+5 ;delete it first (in case it already exists)
+6 DO DEL^XPAR(RORENTITY,RORPARAMETER,RORINSTANCE,.RORERR)
+7 SET RORVALUE="CCR Predefined Report Template"
+8 SET RORVALUE(1,0)="<?xml version="_"""1.0"""_" encoding="_"""UTF-8"""_"?>"
+9 SET RORVALUE(2,0)="<PARAMS>"
+10 SET RORVALUE(3,0)="<ICD9LST>"
+11 SET RORVALUE(4,0)="<GROUP ID="_"""PTSD"""_">"
+12 SET RORVALUE(5,0)="<ICD9 ID="_"""309.81"""_">POSTTRAUMATIC STRESS DIS</ICD9>"
+13 SET RORVALUE(6,0)="</GROUP>"
+14 SET RORVALUE(7,0)="</ICD9LST>"
+15 SET RORVALUE(8,0)="<PANELS>"
+16 SET RORVALUE(9,0)="<PANEL ID="_"""160"""_"/>"
+17 SET RORVALUE(10,0)="</PANELS>"
+18 SET RORVALUE(11,0)="</PARAMS>"
+19 ;add it
+20 DO ADD^XPAR(RORENTITY,RORPARAMETER,RORINSTANCE,.RORVALUE,.RORERR)
+21 QUIT
+22 ;
+23 ;
+24 ;******************************************************************************
+25 ;Add reports 21-22 to the list of available reports for the VA HEPC entry in the
+26 ; ROR REGISTRY PARAMETERS file. Field #27: AVAILABLE REPORTS
+27 ;******************************************************************************
RPT ;
+1 NEW REGNAME,REGIEN,RORERR,RORDATA,OLDLIST,NEWLIST
SET REGNAME="VA HEPC"
+2 SET REGIEN=$ORDER(^ROR(798.1,"B",REGNAME,0))
+3 if $GET(REGIEN)=""
QUIT
+4 KILL RORDATA,RORERR
DO GETS^DIQ(798.1,REGIEN_",",27,"I","RORDATA","RORERR")
+5 if $DATA(RORERR("DIERR"))
QUIT
+6 SET OLDLIST=$GET(RORDATA(798.1,REGIEN_",",27,"I"))
+7 if $GET(OLDLIST)=""
QUIT
+8 IF OLDLIST[",18,19,20,21,22"
QUIT
+9 ;update AVAILABLE REPORTS with the 3 additional reports
+10 SET NEWLIST=OLDLIST_",18,19,20,21,22"
+11 NEW FLAG,FDA,IENS,FIELD
SET IENS=REGIEN_","
SET FIELD=27
SET FLAG="E"
+12 SET FDA(798.1,IENS,FIELD)=NEWLIST
+13 KILL RORERR
DO FILE^DIE(FLAG,"FDA","RORERR")
+14 DO CLEAN^DILF
+15 QUIT
+16 ;
+17 ;*******************************************************************
+18 ;
+19 ;Delete entry in ROR GENERIC DRUG with unresolved pointers
+20 ;
+21 ;********************************************************************
+22 ;clean up 799.51 if pointers are bad
GENDRG ;
+1 NEW DIC,X,DIK,DA,RORNAME,Y
+2 SET DIC=799.51
SET DIC(0)="MNZ"
+3 FOR RORNAME="EMTRICI./RILPIVIRINE/TENOFOVIR"
Begin DoDot:1
+4 SET X=RORNAME
DO ^DIC
if +Y<0
QUIT
+5 if +$PIECE(Y(0),U,4)>0
QUIT
+6 SET DA=+Y
SET DIK="^ROR(799.51,"
DO ^DIK
+7 DO BMES^XPDUTL("WARNING*** Missing entry in VA GENERIC file.")
End DoDot:1
+8 QUIT