RORP010 ;BP/ACS CCR POST-INIT PATCH 10 ;08/31/09
;;1.5;CLINICAL CASE REGISTRIES;**10**;Feb 17, 2006;Build 32
;
; This routine uses the following IAs:
;
; #2263 EN^XPAR,ADD^XPAR,DEL^XPAR (supported)
; #2053 UPDATE^DIE (supported)
; #2053 FILE^DIE (supported)
; #2056 GETS^DIQ (supported)
; #2054 CLEAN^DILF (supported)
; #10013 ^DIK (supported)
;
N DA,DIK
;******************************************************************************
;Change DON'T SEND field in ROR REGISTRY RECORD file to null if not a
;test patient in file 2
;******************************************************************************
N RORI,RORDFN
S RORI=0 F S RORI=$O(^RORDATA(798,RORI)) Q:(RORI'>0) D
. I $P($G(^RORDATA(798,RORI,2)),U,4) D
.. S RORDFN=+$G(^RORDATA(798,RORI,0)) I $G(RORDFN) D
... ;change DON'T SEND to null if not a test patient
... I '$$TESTPAT^RORUTL01(RORDFN) S $P(^RORDATA(798,RORI,2),U,4)=""
;
;******************************************************************************
;Add 3 new entries to the ROR REPORT PARAMETERS file (#799.34) for the new reports
;New Reports: BMI, MELD, Renal Function by Range
;******************************************************************************
N RORRPT,RORFDA,RORIEN,RORERR,RORARY1,RORARY2
;*** BMI report ***
S RORRPT="BMI by Range" D
. ;delete first
. S DIK="^ROR(799.34,",DA=18 D ^DIK
. K RORFDA
. S RORIEN(1)=18 ;BMI is report #18
. S RORFDA(799.34,"+1,",.01)=RORRPT ;name
. S RORFDA(799.34,"+1,",.02)=1 ;background processing? = yes
. S RORFDA(799.34,"+1,",.03)=1 ;shared templates = yes
. S RORFDA(799.34,"+1,",.04)="18" ;code
. S RORFDA(799.34,"+1,",.09)=1 ;national = yes
. S RORFDA(799.34,"+1,",1)="14,22,62,201,47,12,180,70,100" ;parameter panels
. S RORFDA(799.34,"+1,",10.01)="$$BMIRANGE^RORX018" ;report builder
. K RORARY1
. S RORARY1(1)="<DATE_RANGE_3 TYPE=""YEAR""/>" ;default parameters
. S RORARY1(2)="<PATIENTS DE_BEFORE=""1"" DE_DURING=""1"" DE_AFTER=""1""/>" ;default parameters
. S RORARY1(3)="<OPTIONS MOST_RECENT=""1"" COMPLETE=""1""/>" ;default parameters
. S RORFDA(799.34,"+1,",11)="RORARY1"
. K RORARY2
. S RORARY2(1)="<SM TABLE=""PATIENTS"" FIELD=""NAME""/>" ;default sorting
. S RORFDA(799.34,"+1,",12)="RORARY2"
. D UPDATE^DIE(,"RORFDA","RORIEN","RORERR")
;***MELD report ***
S RORRPT="MELD Score by Range" D
. ;delete first
. S DIK="^ROR(799.34,",DA=19 D ^DIK
. K RORFDA
. S RORIEN(1)=19 ;MELD is report #19
. S RORFDA(799.34,"+1,",.01)=RORRPT ;name
. S RORFDA(799.34,"+1,",.02)=1 ;background processing? = yes
. S RORFDA(799.34,"+1,",.03)=1 ;shared templates = yes
. S RORFDA(799.34,"+1,",.04)="19" ;code
. S RORFDA(799.34,"+1,",.09)=1 ;national = yes
. S RORFDA(799.34,"+1,",1)="14,22,201,47,12,180,70,100" ;parameter panels
. S RORFDA(799.34,"+1,",10.01)="$$MLDRANGE^RORX019" ;report builder
. K RORARY1
. S RORARY1(1)="<DATE_RANGE_3 TYPE=""YEAR""/>" ;default parameters
. S RORARY1(2)="<PATIENTS DE_BEFORE=""1"" DE_DURING=""1"" DE_AFTER=""1""/>" ;default parameters
. S RORARY1(3)="<OPTIONS MOST_RECENT=""1"" COMPLETE=""1""/>" ;default parameters
. S RORFDA(799.34,"+1,",11)="RORARY1"
. K RORARY2
. S RORARY2(1)="<SM TABLE=""PATIENTS"" FIELD=""NAME""/>" ;default sorting
. S RORFDA(799.34,"+1,",12)="RORARY2"
. D UPDATE^DIE(,"RORFDA","RORIEN","RORERR")
;*** Renal report ***
S RORRPT="Renal Function by Range" D
. ;delete first
. S DIK="^ROR(799.34,",DA=20 D ^DIK
. K RORFDA
. S RORIEN(1)=20 ;Renal is report #20
. S RORFDA(799.34,"+1,",.01)=RORRPT ;name
. S RORFDA(799.34,"+1,",.02)=1 ;background processing? = yes
. S RORFDA(799.34,"+1,",.03)=1 ;shared templates = yes
. S RORFDA(799.34,"+1,",.04)="20" ;code
. S RORFDA(799.34,"+1,",.09)=1 ;national = yes
. S RORFDA(799.34,"+1,",1)="14,22,62,201,47,12,180,70,100" ;parameter panels
. S RORFDA(799.34,"+1,",10.01)="$$RFRANGE^RORX020" ;report builder
. K RORARY1
. S RORARY1(1)="<DATE_RANGE_3 TYPE=""YEAR""/>" ;default parameters
. S RORARY1(2)="<PATIENTS DE_BEFORE=""1"" DE_DURING=""1"" DE_AFTER=""1""/>" ;default parameters
. S RORARY1(3)="<OPTIONS MOST_RECENT=""1"" COMPLETE=""1""/>" ;default parameters
. S RORFDA(799.34,"+1,",11)="RORARY1"
. K RORARY2
. S RORARY2(1)="<SM TABLE=""PATIENTS"" FIELD=""NAME""/>" ;default sorting
. S RORFDA(799.34,"+1,",12)="RORARY2"
. D UPDATE^DIE(,"RORFDA","RORIEN","RORERR")
K RORFDA,RORIEN,RORERR
;
;******************************************************************************
;Add new entries to the ROR LIST ITEM file (#799.1) for the 3 new reports
;New TYPEs are 5=BMI, 6=MELD, and 7=Renal
;******************************************************************************
N RORDATA,RORTAG,RORFDA,I,TEXT,TYPE,REGISTRY,CODE
F I=1:1:10 S RORTAG="LI"_I D
. S RORDATA=$P($T(@RORTAG),";;",2)
. S TEXT=$P(RORDATA,"^",1) ;TEXT to add
. S TYPE=$P(RORDATA,"^",2) ;TYPE to add
. S REGISTRY=$P(RORDATA,"^",3) ;REGISTRY to add
. S CODE=$P(RORDATA,"^",4) ;CODE to add
. ;don't add if it's already in the global
. Q:$D(^ROR(799.1,"KEY",TYPE,REGISTRY,CODE))
. S RORFDA(799.1,"+1,",.01)=TEXT
. S RORFDA(799.1,"+1,",.02)=TYPE
. S RORFDA(799.1,"+1,",.03)=REGISTRY
. S RORFDA(799.1,"+1,",.04)=CODE
. D UPDATE^DIE(,"RORFDA",,"RORERR")
K RORFDA,RORERR
;
;******************************************************************************
;Add new ICD9 entry/group "HCC" to the PARAMETERS file #8989.5
;ADD^XPAR(entity,parameter[,instance],value[,.error])
;DBIA 2263
;*****************************************************************************
N RORPARAMETER,RORENTITY,RORINSTANCE,RORVALUE,RORERR
S RORENTITY="PKG.CLINICAL CASE REGISTRIES"
S RORPARAMETER="ROR REPORT PARAMS TEMPLATE"
S RORINSTANCE="13::HCC"
;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="_"""HCC"""_">"
S RORVALUE(5,0)="<ICD9 ID="_"""155.0"""_">MAL NEO LIVER, PRIMARY</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)
;
;******************************************************************************
;Add new ICD9 entry/group "Esophageal Varices" to the PARAMETERS file #8989.5
;ADD^XPAR(entity,parameter[,instance],value[,.error])
;DBIA 2263
;******************************************************************************
N RORVALUE,RORERR,RORENTITY,RORPARAMETER,RORINSTANCE
S RORENTITY="PKG.CLINICAL CASE REGISTRIES"
S RORPARAMETER="ROR REPORT PARAMS TEMPLATE"
S RORINSTANCE="13::Esophageal Varices"
;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="_"""Esophageal Varices"""_">"
S RORVALUE(5,0)="<ICD9 ID="_"""456.0"""_">ESOPHAG VARICES W BLEED</ICD9>"
S RORVALUE(6,0)="<ICD9 ID="_"""456.1"""_">ESOPH VARICES W/O BLEED</ICD9>"
S RORVALUE(7,0)="<ICD9 ID="_"""456.20"""_">BLEED ESOPH VAR OTH DIS</ICD9>"
S RORVALUE(8,0)="<ICD9 ID="_"""456.21"""_">ESOPH VARICE OTH DIS NOS</ICD9>"
S RORVALUE(9,0)="</GROUP>"
S RORVALUE(10,0)="</ICD9LST>"
S RORVALUE(11,0)="<PANELS>"
S RORVALUE(12,0)="<PANEL ID="_"""160"""_"/>"
S RORVALUE(13,0)="</PANELS>"
S RORVALUE(14,0)="</PARAMS>"
;add it
D ADD^XPAR(RORENTITY,RORPARAMETER,RORINSTANCE,.RORVALUE,.RORERR)
;
;******************************************************************************
;Add new entries to the ROR DATA AREA file (#799.33) for the 2 new data areas
;New Data Areas: V Immunization, V Skin Test
;******************************************************************************
;remove old entries if they exist
S DIK="^ROR(799.33,",DA=$O(^ROR(799.33,"B","Immunization",0)) I $G(DA)>0 D ^DIK
S DIK="^ROR(799.33,",DA=$O(^ROR(799.33,"B","Skin Test",0)) I $G(DA)>0 D ^DIK
N RORDA F RORDA="V Immunization","V Skin Test" D
. Q:$D(^ROR(799.33,"B",RORDA)) ;don't add if it's already in the global
. N RORFDA,RORERR,RORIEN
. S RORFDA(799.33,"+1,",.01)=RORDA
. S RORIEN(1)=$S(RORDA="V Immunization":17,1:18)
. D UPDATE^DIE(,"RORFDA","RORIEN","RORERR")
. K RORFDA,RORERR,RORIEN
;
;******************************************************************************
;Add new entries to the ROR XML ITEM file (#799.31)
;******************************************************************************
N RORXML,RORTAG,RORFDA,RORERR
;--- add codes
F I=1:1:20 S RORTAG="XML"_I D
. S RORXML=$P($T(@RORTAG),";;",2)
. ;don't add if it's already in the global
. Q:$D(^ROR(799.31,"B",RORXML))
. S RORFDA(799.31,"+1,",.01)=RORXML
. D UPDATE^DIE(,"RORFDA",,"RORERR")
K RORFDA,RORERR
;
;******************************************************************************
;Add reports 18-20 to the list of available reports in ROR REGISTRY PARAMETERS
;file. Field #27: AVAILABLE REPORTS
;******************************************************************************
N REGNAME,REGIEN,RORERR,RORDATA,OLDLIST,NEWLIST S (REGNAME,REGIEN)=0
F S REGNAME=$O(^ROR(798.1,"B",REGNAME)) Q:$G(REGNAME)="" D
. 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" Q
. ;update AVAILABLE REPORTS with the 3 additional reports
. S NEWLIST=OLDLIST_",18,19,20"
. 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
;
;******************************************************************************
;Add new LOINC codes to the VA HEPC and VA HIV lab search criterion in the
;ROR LAB SEARCH file #798.9. Don't add them if they already exist. Do not
;add the 'dash' or the number following it
;******************************************************************************
N I,HEPCIEN,HIVIEN,RORDATA,RORLOINC,RORTAG K RORMSG1,RORMSG2
N HEPCNT,HIVCNT S HEPCNT=0,HIVCNT=0
S HIVIEN=$O(^ROR(798.9,"B","VA HIV",0)) ;HIV top level IEN
S HEPCIEN=$O(^ROR(798.9,"B","VA HEPC",0)) ;HEPC top level IEN
;--- add LOINC codes to the VA HIV search criteria
F I=1:1:14 S RORTAG="HIV"_I D
. S RORLOINC=$P($P($T(@RORTAG),";;",2),"-",1)
. ;don't add if it's already in the global
. Q:($D(^ROR(798.9,HIVIEN,1,"B",RORLOINC)))
. S RORDATA(1,798.92,"+2,"_HIVIEN_",",.01)=$G(RORLOINC)
. S RORDATA(1,798.92,"+2,"_HIVIEN_",",1)=6
. D UPDATE^DIE("","RORDATA(1)",,"RORMSG1")
. S HIVCNT=HIVCNT+1
K RORDATA(1)
;--- add LOINC codes to the VA HEPC search criteria
F I=1:1:5 S RORTAG="HEP"_I D
. S RORLOINC=$P($P($T(@RORTAG),";;",2),"-",1)
. ;don't add if it's already in the global
. Q:($D(^ROR(798.9,HEPCIEN,1,"B",RORLOINC)))
. S RORDATA(1,798.92,"+2,"_HEPCIEN_",",.01)=$G(RORLOINC)
. S RORDATA(1,798.92,"+2,"_HEPCIEN_",",1)=6
. D UPDATE^DIE("","RORDATA(1)",,"RORMSG2")
. S HEPCNT=HEPCNT+1
K RORDATA,RORMSG1,RORMSG2
;
Q
;
;******************************************************************************
;New LOINC codes
;******************************************************************************
;HIV LOINC codes
HIV1 ;;34591-8
HIV2 ;;34592-6
HIV3 ;;43009-0
HIV4 ;;43010-8
HIV5 ;;43185-8
HIV6 ;;43599-0
HIV7 ;;44533-8
HIV8 ;;44607-0
HIV9 ;;44873-8
HIV10 ;;49580-4
HIV11 ;;49905-3
HIV12 ;;5221-7
HIV13 ;;53379-4
HIV14 ;;54086-4
;HEPC LOINC codes
HEP1 ;;47365-2
HEP2 ;;47441-1
HEP3 ;;48576-3
HEP4 ;;51655-9
HEP5 ;;51657-5
;
;******************************************************************************
; Data to be added to ROR LIST ITEM file (#799.1)
; TEXT^TYPE^REGIEN^CODE
;******************************************************************************
LI1 ;;BMI^5^1^1
LI2 ;;BMI^5^2^1
LI3 ;;MELD^6^1^1
LI4 ;;MELD-Na^6^1^2
LI5 ;;MELD^6^2^1
LI6 ;;MELD-Na^6^2^2
LI7 ;;Creatinine clearance by Cockcroft-Gault^7^1^1
LI8 ;;eGFR by MDRD^7^1^2
LI9 ;;Creatinine clearance by Cockcroft-Gault^7^2^1
LI10 ;;eGFR by MDRD^7^2^2
;
;******************************************************************************
;new XML tags to be added to ROR XML ITEM file (#799.31)
;******************************************************************************
XML1 ;;PENDCOMM
XML2 ;;ICD9FILT
XML3 ;;FILTER
XML4 ;;DESC
XML5 ;;VALUES
XML6 ;;BMI
XML7 ;;HEIGHT
XML8 ;;WEIGHT
XML9 ;;DATA
XML10 ;;MOST_RECENT
XML11 ;;MAX_DATE
XML12 ;;BMIDATA
XML13 ;;MELDDATA
XML14 ;;MELD
XML15 ;;MELDNA
XML16 ;;TNAME
XML17 ;;RNLDATA
XML18 ;;CRCL
XML19 ;;EGFR
XML20 ;;TEST
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRORP010 13222 printed Nov 22, 2024@16:52:32 Page 2
RORP010 ;BP/ACS CCR POST-INIT PATCH 10 ;08/31/09
+1 ;;1.5;CLINICAL CASE REGISTRIES;**10**;Feb 17, 2006;Build 32
+2 ;
+3 ; This routine uses the following IAs:
+4 ;
+5 ; #2263 EN^XPAR,ADD^XPAR,DEL^XPAR (supported)
+6 ; #2053 UPDATE^DIE (supported)
+7 ; #2053 FILE^DIE (supported)
+8 ; #2056 GETS^DIQ (supported)
+9 ; #2054 CLEAN^DILF (supported)
+10 ; #10013 ^DIK (supported)
+11 ;
+12 NEW DA,DIK
+13 ;******************************************************************************
+14 ;Change DON'T SEND field in ROR REGISTRY RECORD file to null if not a
+15 ;test patient in file 2
+16 ;******************************************************************************
+17 NEW RORI,RORDFN
+18 SET RORI=0
FOR
SET RORI=$ORDER(^RORDATA(798,RORI))
if (RORI'>0)
QUIT
Begin DoDot:1
+19 IF $PIECE($GET(^RORDATA(798,RORI,2)),U,4)
Begin DoDot:2
+20 SET RORDFN=+$GET(^RORDATA(798,RORI,0))
IF $GET(RORDFN)
Begin DoDot:3
+21 ;change DON'T SEND to null if not a test patient
+22 IF '$$TESTPAT^RORUTL01(RORDFN)
SET $PIECE(^RORDATA(798,RORI,2),U,4)=""
End DoDot:3
End DoDot:2
End DoDot:1
+23 ;
+24 ;******************************************************************************
+25 ;Add 3 new entries to the ROR REPORT PARAMETERS file (#799.34) for the new reports
+26 ;New Reports: BMI, MELD, Renal Function by Range
+27 ;******************************************************************************
+28 NEW RORRPT,RORFDA,RORIEN,RORERR,RORARY1,RORARY2
+29 ;*** BMI report ***
+30 SET RORRPT="BMI by Range"
Begin DoDot:1
+31 ;delete first
+32 SET DIK="^ROR(799.34,"
SET DA=18
DO ^DIK
+33 KILL RORFDA
+34 ;BMI is report #18
SET RORIEN(1)=18
+35 ;name
SET RORFDA(799.34,"+1,",.01)=RORRPT
+36 ;background processing? = yes
SET RORFDA(799.34,"+1,",.02)=1
+37 ;shared templates = yes
SET RORFDA(799.34,"+1,",.03)=1
+38 ;code
SET RORFDA(799.34,"+1,",.04)="18"
+39 ;national = yes
SET RORFDA(799.34,"+1,",.09)=1
+40 ;parameter panels
SET RORFDA(799.34,"+1,",1)="14,22,62,201,47,12,180,70,100"
+41 ;report builder
SET RORFDA(799.34,"+1,",10.01)="$$BMIRANGE^RORX018"
+42 KILL RORARY1
+43 ;default parameters
SET RORARY1(1)="<DATE_RANGE_3 TYPE=""YEAR""/>"
+44 ;default parameters
SET RORARY1(2)="<PATIENTS DE_BEFORE=""1"" DE_DURING=""1"" DE_AFTER=""1""/>"
+45 ;default parameters
SET RORARY1(3)="<OPTIONS MOST_RECENT=""1"" COMPLETE=""1""/>"
+46 SET RORFDA(799.34,"+1,",11)="RORARY1"
+47 KILL RORARY2
+48 ;default sorting
SET RORARY2(1)="<SM TABLE=""PATIENTS"" FIELD=""NAME""/>"
+49 SET RORFDA(799.34,"+1,",12)="RORARY2"
+50 DO UPDATE^DIE(,"RORFDA","RORIEN","RORERR")
End DoDot:1
+51 ;***MELD report ***
+52 SET RORRPT="MELD Score by Range"
Begin DoDot:1
+53 ;delete first
+54 SET DIK="^ROR(799.34,"
SET DA=19
DO ^DIK
+55 KILL RORFDA
+56 ;MELD is report #19
SET RORIEN(1)=19
+57 ;name
SET RORFDA(799.34,"+1,",.01)=RORRPT
+58 ;background processing? = yes
SET RORFDA(799.34,"+1,",.02)=1
+59 ;shared templates = yes
SET RORFDA(799.34,"+1,",.03)=1
+60 ;code
SET RORFDA(799.34,"+1,",.04)="19"
+61 ;national = yes
SET RORFDA(799.34,"+1,",.09)=1
+62 ;parameter panels
SET RORFDA(799.34,"+1,",1)="14,22,201,47,12,180,70,100"
+63 ;report builder
SET RORFDA(799.34,"+1,",10.01)="$$MLDRANGE^RORX019"
+64 KILL RORARY1
+65 ;default parameters
SET RORARY1(1)="<DATE_RANGE_3 TYPE=""YEAR""/>"
+66 ;default parameters
SET RORARY1(2)="<PATIENTS DE_BEFORE=""1"" DE_DURING=""1"" DE_AFTER=""1""/>"
+67 ;default parameters
SET RORARY1(3)="<OPTIONS MOST_RECENT=""1"" COMPLETE=""1""/>"
+68 SET RORFDA(799.34,"+1,",11)="RORARY1"
+69 KILL RORARY2
+70 ;default sorting
SET RORARY2(1)="<SM TABLE=""PATIENTS"" FIELD=""NAME""/>"
+71 SET RORFDA(799.34,"+1,",12)="RORARY2"
+72 DO UPDATE^DIE(,"RORFDA","RORIEN","RORERR")
End DoDot:1
+73 ;*** Renal report ***
+74 SET RORRPT="Renal Function by Range"
Begin DoDot:1
+75 ;delete first
+76 SET DIK="^ROR(799.34,"
SET DA=20
DO ^DIK
+77 KILL RORFDA
+78 ;Renal is report #20
SET RORIEN(1)=20
+79 ;name
SET RORFDA(799.34,"+1,",.01)=RORRPT
+80 ;background processing? = yes
SET RORFDA(799.34,"+1,",.02)=1
+81 ;shared templates = yes
SET RORFDA(799.34,"+1,",.03)=1
+82 ;code
SET RORFDA(799.34,"+1,",.04)="20"
+83 ;national = yes
SET RORFDA(799.34,"+1,",.09)=1
+84 ;parameter panels
SET RORFDA(799.34,"+1,",1)="14,22,62,201,47,12,180,70,100"
+85 ;report builder
SET RORFDA(799.34,"+1,",10.01)="$$RFRANGE^RORX020"
+86 KILL RORARY1
+87 ;default parameters
SET RORARY1(1)="<DATE_RANGE_3 TYPE=""YEAR""/>"
+88 ;default parameters
SET RORARY1(2)="<PATIENTS DE_BEFORE=""1"" DE_DURING=""1"" DE_AFTER=""1""/>"
+89 ;default parameters
SET RORARY1(3)="<OPTIONS MOST_RECENT=""1"" COMPLETE=""1""/>"
+90 SET RORFDA(799.34,"+1,",11)="RORARY1"
+91 KILL RORARY2
+92 ;default sorting
SET RORARY2(1)="<SM TABLE=""PATIENTS"" FIELD=""NAME""/>"
+93 SET RORFDA(799.34,"+1,",12)="RORARY2"
+94 DO UPDATE^DIE(,"RORFDA","RORIEN","RORERR")
End DoDot:1
+95 KILL RORFDA,RORIEN,RORERR
+96 ;
+97 ;******************************************************************************
+98 ;Add new entries to the ROR LIST ITEM file (#799.1) for the 3 new reports
+99 ;New TYPEs are 5=BMI, 6=MELD, and 7=Renal
+100 ;******************************************************************************
+101 NEW RORDATA,RORTAG,RORFDA,I,TEXT,TYPE,REGISTRY,CODE
+102 FOR I=1:1:10
SET RORTAG="LI"_I
Begin DoDot:1
+103 SET RORDATA=$PIECE($TEXT(@RORTAG),";;",2)
+104 ;TEXT to add
SET TEXT=$PIECE(RORDATA,"^",1)
+105 ;TYPE to add
SET TYPE=$PIECE(RORDATA,"^",2)
+106 ;REGISTRY to add
SET REGISTRY=$PIECE(RORDATA,"^",3)
+107 ;CODE to add
SET CODE=$PIECE(RORDATA,"^",4)
+108 ;don't add if it's already in the global
+109 if $DATA(^ROR(799.1,"KEY",TYPE,REGISTRY,CODE))
QUIT
+110 SET RORFDA(799.1,"+1,",.01)=TEXT
+111 SET RORFDA(799.1,"+1,",.02)=TYPE
+112 SET RORFDA(799.1,"+1,",.03)=REGISTRY
+113 SET RORFDA(799.1,"+1,",.04)=CODE
+114 DO UPDATE^DIE(,"RORFDA",,"RORERR")
End DoDot:1
+115 KILL RORFDA,RORERR
+116 ;
+117 ;******************************************************************************
+118 ;Add new ICD9 entry/group "HCC" to the PARAMETERS file #8989.5
+119 ;ADD^XPAR(entity,parameter[,instance],value[,.error])
+120 ;DBIA 2263
+121 ;*****************************************************************************
+122 NEW RORPARAMETER,RORENTITY,RORINSTANCE,RORVALUE,RORERR
+123 SET RORENTITY="PKG.CLINICAL CASE REGISTRIES"
+124 SET RORPARAMETER="ROR REPORT PARAMS TEMPLATE"
+125 SET RORINSTANCE="13::HCC"
+126 ;delete it first (in case it already exists)
+127 DO DEL^XPAR(RORENTITY,RORPARAMETER,RORINSTANCE,.RORERR)
+128 SET RORVALUE="CCR Predefined Report Template"
+129 SET RORVALUE(1,0)="<?xml version="_"""1.0"""_" encoding="_"""UTF-8"""_"?>"
+130 SET RORVALUE(2,0)="<PARAMS>"
+131 SET RORVALUE(3,0)="<ICD9LST>"
+132 SET RORVALUE(4,0)="<GROUP ID="_"""HCC"""_">"
+133 SET RORVALUE(5,0)="<ICD9 ID="_"""155.0"""_">MAL NEO LIVER, PRIMARY</ICD9>"
+134 SET RORVALUE(6,0)="</GROUP>"
+135 SET RORVALUE(7,0)="</ICD9LST>"
+136 SET RORVALUE(8,0)="<PANELS>"
+137 SET RORVALUE(9,0)="<PANEL ID="_"""160"""_"/>"
+138 SET RORVALUE(10,0)="</PANELS>"
+139 SET RORVALUE(11,0)="</PARAMS>"
+140 ;add it
+141 DO ADD^XPAR(RORENTITY,RORPARAMETER,RORINSTANCE,.RORVALUE,.RORERR)
+142 ;
+143 ;******************************************************************************
+144 ;Add new ICD9 entry/group "Esophageal Varices" to the PARAMETERS file #8989.5
+145 ;ADD^XPAR(entity,parameter[,instance],value[,.error])
+146 ;DBIA 2263
+147 ;******************************************************************************
+148 NEW RORVALUE,RORERR,RORENTITY,RORPARAMETER,RORINSTANCE
+149 SET RORENTITY="PKG.CLINICAL CASE REGISTRIES"
+150 SET RORPARAMETER="ROR REPORT PARAMS TEMPLATE"
+151 SET RORINSTANCE="13::Esophageal Varices"
+152 ;delete it first (in case it already exists)
+153 DO DEL^XPAR(RORENTITY,RORPARAMETER,RORINSTANCE,.RORERR)
+154 SET RORVALUE="CCR Predefined Report Template"
+155 SET RORVALUE(1,0)="<?xml version="_"""1.0"""_" encoding="_"""UTF-8"""_"?>"
+156 SET RORVALUE(2,0)="<PARAMS>"
+157 SET RORVALUE(3,0)="<ICD9LST>"
+158 SET RORVALUE(4,0)="<GROUP ID="_"""Esophageal Varices"""_">"
+159 SET RORVALUE(5,0)="<ICD9 ID="_"""456.0"""_">ESOPHAG VARICES W BLEED</ICD9>"
+160 SET RORVALUE(6,0)="<ICD9 ID="_"""456.1"""_">ESOPH VARICES W/O BLEED</ICD9>"
+161 SET RORVALUE(7,0)="<ICD9 ID="_"""456.20"""_">BLEED ESOPH VAR OTH DIS</ICD9>"
+162 SET RORVALUE(8,0)="<ICD9 ID="_"""456.21"""_">ESOPH VARICE OTH DIS NOS</ICD9>"
+163 SET RORVALUE(9,0)="</GROUP>"
+164 SET RORVALUE(10,0)="</ICD9LST>"
+165 SET RORVALUE(11,0)="<PANELS>"
+166 SET RORVALUE(12,0)="<PANEL ID="_"""160"""_"/>"
+167 SET RORVALUE(13,0)="</PANELS>"
+168 SET RORVALUE(14,0)="</PARAMS>"
+169 ;add it
+170 DO ADD^XPAR(RORENTITY,RORPARAMETER,RORINSTANCE,.RORVALUE,.RORERR)
+171 ;
+172 ;******************************************************************************
+173 ;Add new entries to the ROR DATA AREA file (#799.33) for the 2 new data areas
+174 ;New Data Areas: V Immunization, V Skin Test
+175 ;******************************************************************************
+176 ;remove old entries if they exist
+177 SET DIK="^ROR(799.33,"
SET DA=$ORDER(^ROR(799.33,"B","Immunization",0))
IF $GET(DA)>0
DO ^DIK
+178 SET DIK="^ROR(799.33,"
SET DA=$ORDER(^ROR(799.33,"B","Skin Test",0))
IF $GET(DA)>0
DO ^DIK
+179 NEW RORDA
FOR RORDA="V Immunization","V Skin Test"
Begin DoDot:1
+180 ;don't add if it's already in the global
if $DATA(^ROR(799.33,"B",RORDA))
QUIT
+181 NEW RORFDA,RORERR,RORIEN
+182 SET RORFDA(799.33,"+1,",.01)=RORDA
+183 SET RORIEN(1)=$SELECT(RORDA="V Immunization":17,1:18)
+184 DO UPDATE^DIE(,"RORFDA","RORIEN","RORERR")
+185 KILL RORFDA,RORERR,RORIEN
End DoDot:1
+186 ;
+187 ;******************************************************************************
+188 ;Add new entries to the ROR XML ITEM file (#799.31)
+189 ;******************************************************************************
+190 NEW RORXML,RORTAG,RORFDA,RORERR
+191 ;--- add codes
+192 FOR I=1:1:20
SET RORTAG="XML"_I
Begin DoDot:1
+193 SET RORXML=$PIECE($TEXT(@RORTAG),";;",2)
+194 ;don't add if it's already in the global
+195 if $DATA(^ROR(799.31,"B",RORXML))
QUIT
+196 SET RORFDA(799.31,"+1,",.01)=RORXML
+197 DO UPDATE^DIE(,"RORFDA",,"RORERR")
End DoDot:1
+198 KILL RORFDA,RORERR
+199 ;
+200 ;******************************************************************************
+201 ;Add reports 18-20 to the list of available reports in ROR REGISTRY PARAMETERS
+202 ;file. Field #27: AVAILABLE REPORTS
+203 ;******************************************************************************
+204 NEW REGNAME,REGIEN,RORERR,RORDATA,OLDLIST,NEWLIST
SET (REGNAME,REGIEN)=0
+205 FOR
SET REGNAME=$ORDER(^ROR(798.1,"B",REGNAME))
if $GET(REGNAME)=""
QUIT
Begin DoDot:1
+206 SET REGIEN=$ORDER(^ROR(798.1,"B",REGNAME,0))
+207 if $GET(REGIEN)=""
QUIT
+208 KILL RORDATA,RORERR
DO GETS^DIQ(798.1,REGIEN_",",27,"I","RORDATA","RORERR")
+209 if $DATA(RORERR("DIERR"))
QUIT
+210 SET OLDLIST=$GET(RORDATA(798.1,REGIEN_",",27,"I"))
+211 if $GET(OLDLIST)=""
QUIT
+212 IF OLDLIST[",18,19,20"
QUIT
+213 ;update AVAILABLE REPORTS with the 3 additional reports
+214 SET NEWLIST=OLDLIST_",18,19,20"
+215 NEW FLAG,FDA,IENS,FIELD
SET IENS=REGIEN_","
SET FIELD=27
SET FLAG="E"
+216 SET FDA(798.1,IENS,FIELD)=NEWLIST
+217 KILL RORERR
DO FILE^DIE(FLAG,"FDA","RORERR")
End DoDot:1
+218 DO CLEAN^DILF
+219 ;
+220 ;******************************************************************************
+221 ;Add new LOINC codes to the VA HEPC and VA HIV lab search criterion in the
+222 ;ROR LAB SEARCH file #798.9. Don't add them if they already exist. Do not
+223 ;add the 'dash' or the number following it
+224 ;******************************************************************************
+225 NEW I,HEPCIEN,HIVIEN,RORDATA,RORLOINC,RORTAG
KILL RORMSG1,RORMSG2
+226 NEW HEPCNT,HIVCNT
SET HEPCNT=0
SET HIVCNT=0
+227 ;HIV top level IEN
SET HIVIEN=$ORDER(^ROR(798.9,"B","VA HIV",0))
+228 ;HEPC top level IEN
SET HEPCIEN=$ORDER(^ROR(798.9,"B","VA HEPC",0))
+229 ;--- add LOINC codes to the VA HIV search criteria
+230 FOR I=1:1:14
SET RORTAG="HIV"_I
Begin DoDot:1
+231 SET RORLOINC=$PIECE($PIECE($TEXT(@RORTAG),";;",2),"-",1)
+232 ;don't add if it's already in the global
+233 if ($DATA(^ROR(798.9,HIVIEN,1,"B",RORLOINC)))
QUIT
+234 SET RORDATA(1,798.92,"+2,"_HIVIEN_",",.01)=$GET(RORLOINC)
+235 SET RORDATA(1,798.92,"+2,"_HIVIEN_",",1)=6
+236 DO UPDATE^DIE("","RORDATA(1)",,"RORMSG1")
+237 SET HIVCNT=HIVCNT+1
End DoDot:1
+238 KILL RORDATA(1)
+239 ;--- add LOINC codes to the VA HEPC search criteria
+240 FOR I=1:1:5
SET RORTAG="HEP"_I
Begin DoDot:1
+241 SET RORLOINC=$PIECE($PIECE($TEXT(@RORTAG),";;",2),"-",1)
+242 ;don't add if it's already in the global
+243 if ($DATA(^ROR(798.9,HEPCIEN,1,"B",RORLOINC)))
QUIT
+244 SET RORDATA(1,798.92,"+2,"_HEPCIEN_",",.01)=$GET(RORLOINC)
+245 SET RORDATA(1,798.92,"+2,"_HEPCIEN_",",1)=6
+246 DO UPDATE^DIE("","RORDATA(1)",,"RORMSG2")
+247 SET HEPCNT=HEPCNT+1
End DoDot:1
+248 KILL RORDATA,RORMSG1,RORMSG2
+249 ;
+250 QUIT
+251 ;
+252 ;******************************************************************************
+253 ;New LOINC codes
+254 ;******************************************************************************
+255 ;HIV LOINC codes
HIV1 ;;34591-8
HIV2 ;;34592-6
HIV3 ;;43009-0
HIV4 ;;43010-8
HIV5 ;;43185-8
HIV6 ;;43599-0
HIV7 ;;44533-8
HIV8 ;;44607-0
HIV9 ;;44873-8
HIV10 ;;49580-4
HIV11 ;;49905-3
HIV12 ;;5221-7
HIV13 ;;53379-4
HIV14 ;;54086-4
+1 ;HEPC LOINC codes
HEP1 ;;47365-2
HEP2 ;;47441-1
HEP3 ;;48576-3
HEP4 ;;51655-9
HEP5 ;;51657-5
+1 ;
+2 ;******************************************************************************
+3 ; Data to be added to ROR LIST ITEM file (#799.1)
+4 ; TEXT^TYPE^REGIEN^CODE
+5 ;******************************************************************************
LI1 ;;BMI^5^1^1
LI2 ;;BMI^5^2^1
LI3 ;;MELD^6^1^1
LI4 ;;MELD-Na^6^1^2
LI5 ;;MELD^6^2^1
LI6 ;;MELD-Na^6^2^2
LI7 ;;Creatinine clearance by Cockcroft-Gault^7^1^1
LI8 ;;eGFR by MDRD^7^1^2
LI9 ;;Creatinine clearance by Cockcroft-Gault^7^2^1
LI10 ;;eGFR by MDRD^7^2^2
+1 ;
+2 ;******************************************************************************
+3 ;new XML tags to be added to ROR XML ITEM file (#799.31)
+4 ;******************************************************************************
XML1 ;;PENDCOMM
XML2 ;;ICD9FILT
XML3 ;;FILTER
XML4 ;;DESC
XML5 ;;VALUES
XML6 ;;BMI
XML7 ;;HEIGHT
XML8 ;;WEIGHT
XML9 ;;DATA
XML10 ;;MOST_RECENT
XML11 ;;MAX_DATE
XML12 ;;BMIDATA
XML13 ;;MELDDATA
XML14 ;;MELD
XML15 ;;MELDNA
XML16 ;;TNAME
XML17 ;;RNLDATA
XML18 ;;CRCL
XML19 ;;EGFR
XML20 ;;TEST