ORWGAPIT ; SLC/STAFF - Graph Item Types ;09-Aug-2012 15:16;PLS
;;3.0;ORDER ENTRY/RESULTS REPORTING;**215,260,243,1010**;Dec 17, 1997;Build 47
;
;Modified - IHS/MSC/MGH - 02/08/2012 - COMPNAME+7,FILENAME+2,GETFILES+4,TYPES+27
; IHS/MSC/PLS - 08/09/2012 - Changed references to NVA to OUTSIDE
COMPTYPE(FILE) ; $$(file) -> hs component abbrv - from ORWGAPID
N COMP,COMPNAME,COMPS,NUM,OK K COMPS
S COMPNAME=$$COMPNAME(FILE)_"]"
D COMP^ORWRP2(.COMPS)
S COMP=""
S OK=0
S NUM=0
D
. F S NUM=$O(COMPS(NUM)) Q:NUM<1 D I OK Q
.. S COMP=COMPS(NUM)
.. I COMP[COMPNAME,COMPNAME=$P($P(COMP,U,2),"[",2) S OK=1
Q COMP
;
COMPNAME(FILE) ; $$(file) -> hs component abbrv
I FILE=63 Q "CH"
I FILE=120.5 Q "VSD"
I FILE=120.8 Q "ADR"
I FILE=52 Q "RXOP"
I FILE=55 Q "RXUD"
I FILE=70 Q "II"
;IHS/MGH/MSC Added V measurements
I FILE=9000010.01 Q "MEA"
I FILE=9000010.11 Q "IM"
I FILE=9000010.12 Q "ST"
I FILE=9000010.13 Q "EXAM"
I FILE=9000010.18 Q "CPT"
I FILE=9000011 Q "PLL"
I FILE=9999911 Q "PLL"
I FILE=9000010.23 Q "HF"
I FILE=9000010.07 Q "OD"
I FILE=9000010.16 Q "ED"
I FILE=601.2 Q "MHPE"
I FILE=100 Q "ORC"
I FILE="45OP" Q "PRC"
I FILE="45DX" Q "DD"
I FILE="63AP" Q "SP"
I FILE="63BB" Q "BT"
I FILE="63MI" Q "MIC"
I FILE=9000010 Q "CVP"
I FILE=405 Q "ADC"
I FILE="55NVA" Q "RXNV"
I FILE=53.79 Q "BCMA"
I FILE=130 Q "SR"
I FILE=8925 Q "CNB"
I FILE=690 Q "MEDF"
Q ""
;
FILENAME(FILE) ; $$(file) -> filename - from ORWGAPIP
I FILE=63 Q "LAB TESTS"
;IHS/MSC/MGH Added lookup for measurements
I FILE=9000010.01 Q "MEASUREMENTS"
I FILE=120.5 Q "VITALS"
I FILE=120.8 Q "ALLERGIES"
I FILE=52 Q "MEDICATION,OUTPATIENT"
I FILE=55 Q "MEDICATION,INPATIENT"
I FILE=70 Q "RADIOLOGY EXAMS"
I FILE=9000010.11 Q "IMMUNIZATIONS"
I FILE=9000010.12 Q "SKIN TESTS"
I FILE=9000010.13 Q "EXAMS"
I FILE=9000010.18 Q "PROCEDURES"
I FILE=9000011 Q "PROBLEMS"
I FILE=9999911 Q "PROBLEMS-DURATION" ;**************
I FILE=9000010.23 Q "HEALTH FACTORS"
I FILE=9000010.07 Q "PURPOSE OF VISIT"
I FILE=9000010.16 Q "PATIENT EDUCATION"
I FILE=601.2 Q "MENTAL HEALTH"
I FILE=100 Q "ORDERS"
I FILE="45OP" Q "REGISTRATION OP/PROC"
I FILE="45DX" Q "REGISTRATION DX"
I FILE="63AP" Q "ANATOMIC PATHOLOGY"
I FILE="63BB" Q "BLOOD PRODUCTS"
I FILE="63MI" Q "MICROBIOLOGY"
I FILE=9000010 Q "VISITS"
I FILE=405 Q "ADMISSIONS"
;IHS/MSC/PLS - 08/09/2012
;I FILE="55NVA" Q "MEDICATION,NON-VA"
I FILE="55NVA" Q "MEDICATION,OUTSIDE"
I FILE=53.79 Q "MEDICATION,BCMA"
I FILE=50.605 Q "DRUG CLASS"
I FILE=68 Q "LAB ACC AREA"
I FILE=8925.1 Q "NOTE TITLE"
I FILE=100.98 Q "ORDER DISPLAY GROUP"
I FILE=811.2 Q "REMINDER TAXONOMY"
I FILE=130 Q "SURGERY"
I FILE=8925 Q "NOTES"
I FILE=690 Q "MEDICINE"
Q ""
;
FILECHK(FILES) ;
; get parameter string of excluded files
N CHECK,NUM,ORSRV,VAL
S ORSRV=$$GET1^DIQ(200,DUZ,29,"I")
S CHECK=$$XGET^ORWGAPIX("USR^SRV.`"_+$G(ORSRV)_"^DIV^SYS^PKG","ORWG GRAPH EXCLUDE DATA TYPE",1,"I")
S CHECK=CHECK_";"
S NUM=0
F S NUM=$O(FILES(NUM)) Q:NUM<1 D
. S VAL=FILES(NUM)
. S VAL=$P(VAL,U)_";"
. I CHECK[VAL K FILES(NUM)
Q
;
GETFILES(FILES) ;
; file #^file name^graph type^lookup file^lookup global^lookup index^prefix^abbrev^hint format
; commenting out a line setting FILES will inactivate that type
S FILES(1)="63^LAB TESTS^1^60^LAB(60,^B^^CH^~ ~units~flag~|"
;IHS/MSC/MGH Added lookup for measurements
I +$$GET^XPAR("ALL","BEHOVM USE VMSR") D
.S FILES(2)="9000010.01^MEASUREMENTS^1^9999999.07^^AUTTMSR(,^B^^VSD^~ ~"
E D
.S FILES(2)="120.5^VITALS^1^120.51^GMRD(120.51,^B^^VSD^~ ~"
S FILES(3)="52^MEDICATION,OUTPATIENT^3^50^PSDRUG(^B^^RXOP^~ ~"
S FILES(4)="55^MEDICATION,INPATIENT^3^50^PSDRUG(^B^^RXUD^~ ~"
S FILES(5)="70^RADIOLOGY EXAMS^2^71^RAMIS(71,^B^rad^II^~ ~"
S FILES(6)="9000010.11^IMMUNIZATIONS^2^9999999.14^AUTTIMM(^B^imm^IM^~ ~"
S FILES(7)="9000010.12^SKIN TESTS^2^9999999.28^AUTTSK(^B^skin^ST^~ ~"
S FILES(8)="9000010.13^EXAMS^2^9999999.15,^AUTTEXAM(^B^exam^EXAM^~ ~"
S FILES(9)="9000010.18^PROCEDURES^2^81^ICPT(^C^proc^CPT^~ ~"
S FILES(10)="9000011^PROBLEMS^2^80^ICD9(^B^prob^PLL^~ ~" ;***
S FILES(11)="9000010.23^HEALTH FACTORS^2^9999999.64^AUTTHF(,^B^hf^HF^~ ~"
S FILES(12)="9000010.07^PURPOSE OF VISIT^2^80^ICD9(^B^pov^OD^"
S FILES(13)="9000010.16^PATIENT EDUCATION^2^9999999.09^AUTTEDT(^B^edu^ED^~ ~"
S FILES(14)="601.2^MENTAL HEALTH^2^601^YTT(601,^B^mh^MHPE^~ ~"
S FILES(15)="100^ORDERS^2^101.43^ORD(101.43,^B^order^ORC^~ ~"
S FILES(16)="45OP^REGISTRATION OP/PROC^2^*^^^op^PRC^~ ~"
S FILES(17)="45DX^REGISTRATION DX^2^*^^^dx^DD^~ ~"
S FILES(18)="63AP^ANATOMIC PATHOLOGY^2^*^^^ap^SP^~ ~"
S FILES(19)="63MI^MICROBIOLOGY^2^*^^^micro^MIC^~ ~"
S FILES(20)="9000010^VISITS^3^44^SC(^B^^CVP^~ ~"
S FILES(21)="405^ADMISSIONS^3^*^^^^ADC^~ ~"
S FILES(23)="53.79^MEDICATION,BCMA^2^50.7^PS(50.7,^B^^BCMA^~ ~"
S FILES(24)="130^SURGERY^2^81^ICPT(^C^surg^SR^~ ~"
S FILES(25)="8925^NOTES^2^*^^^note^CNB^~ ~"
S FILES(27)="120.8^ALLERGIES^2^*^^^allg^ADR^~ ~"
S FILES(28)="63BB^BLOOD BANK^2^66^LAB(66,^B^bb^BT^~ ~"
;S FILES(29)="9999911^PROBLEMS-DURATION^3^80^ICD9(^B^prob^PLL^~ ~" ;***
;IHS/MSC/PLS - 08/09/2012
;S FILES(30)="55NVA^MEDICATION,NON-VA^3^50.7^PS(50.7,^B^^RXNV^~ ~"
S FILES(30)="55NVA^MEDICATION,OUTSIDE^3^50.7^PS(50.7,^B^^RXNV^~ ~"
S FILES(31)="690^MEDICINE^2^*^^^med^MEDF^~ ~"
S FILES(2000)="811.2^Reminder Taxonomy"
S FILES(3000)="50.605^Drug Class"
Q
;
TYPES(TYPES,DFN,SUB,TMP) ; from ORWGAPI
N CNT,FILES,ITEM,MEDARRAY,NUM,OK,SEQ K FILES,MEDARRAY
S TMP=$G(TMP)
D GETFILES(.FILES)
D FILECHK(.FILES)
I SUB D
. I $D(FILES(18)) D
.. S FILES(1801)="63AP;O^AP: Organ"
.. S FILES(1802)="63AP;T^AP: Test"
.. S FILES(1803)="63AP;D^AP: Disease"
.. S FILES(1804)="63AP;I^AP: ICD9"
.. S FILES(1805)="63AP;E^AP: Etiology"
.. S FILES(1806)="63AP;F^AP: Function"
.. S FILES(1807)="63AP;P^AP: Procedure"
.. S FILES(1808)="63AP;M^AP: Morphology"
.. S FILES(1809)="63AP;S^AP: Specimen"
. I $D(FILES(19)) D
.. S FILES(1901)="63MI;A^Microbiology: Antibiotic"
.. S FILES(1902)="63MI;T^Microbiology: Test"
.. S FILES(1903)="63MI;S^Microbiology: Specimen"
.. S FILES(1904)="63MI;O^Microbiology: Organism"
.. ;S FILES(1905)="63MI;M^Microbiology: TB Drug"
I 'SUB D
. K FILES(2000)
. K FILES(3000)
I DFN D
. I '$L($O(^PXRMINDX(63,"PI",DFN,""))) K FILES(1)
. ;IHS/MSC/MGH Branch if IHS or OV for where vitals are
. I +$$GET^XPAR("ALL","BEHOVM USE VMSR") D
. .I '$L($O(^PXRMINDX(9000010.01,"PI",DFN,""))) K FILES(2)
. E D
. .I '$L($O(^PXRMINDX(120.5,"PI",DFN,""))) K FILES(2)
. I '$L($O(^PXRMINDX(52,"PI",DFN,""))) K FILES(3)
. I '$L($O(^PXRMINDX(55,"PI",DFN,""))) K FILES(4)
. I '$L($O(^PXRMINDX(70,"PI",DFN,""))) K FILES(5)
. I '$L($O(^PXRMINDX(9000010.11,"PI",DFN,""))) K FILES(6)
. I '$L($O(^PXRMINDX(9000010.12,"PI",DFN,""))) K FILES(7)
. I '$L($O(^PXRMINDX(9000010.13,"PI",DFN,""))) K FILES(8)
. I '$L($O(^PXRMINDX(9000010.18,"PPI",DFN,""))) K FILES(9)
. I '$L($O(^PXRMINDX(9000011,"PSPI",DFN,""))) K FILES(10),FILES(29)
. I '$L($O(^PXRMINDX(9000010.23,"PI",DFN,""))) K FILES(11)
. I '$L($O(^PXRMINDX(9000010.07,"PPI",DFN,""))) K FILES(12)
. I '$L($O(^PXRMINDX(9000010.16,"PI",DFN,""))) K FILES(13)
. I '$L($O(^PXRMINDX(601.2,"PI",DFN,""))) K FILES(14)
. I '$L($O(^PXRMINDX(100,"PI",DFN,""))) K FILES(15)
. I '$L($O(^PXRMINDX(45,"ICD0","PNI",DFN,0))) K FILES(16)
. I '$L($O(^PXRMINDX(45,"ICD9","PNI",DFN,0))) K FILES(17)
. I $E($O(^PXRMINDX(63,"PI",DFN,"A")))'="A" K FILES(18) D
.. F NUM=1:1:9 K FILES(180+NUM)
. I $E($O(^PXRMINDX(63,"PI",DFN,"M")))'="M" K FILES(19) D
.. F NUM=1:1:5 K FILES(190+NUM)
. I '$$VISITX^ORWGAPIA(DFN) K FILES(20)
. I '$$ADMITX^ORWGAPIA(DFN) K FILES(21)
. I '$$NVAX^ORWGAPIC(DFN) K FILES(22),FILES(30)
. I '$$BCMAX^ORWGAPIC(DFN) K FILES(23)
. I '$$SURGX^ORWGAPIA(DFN) K FILES(24)
. I '$$NOTEX^ORWGAPIA(DFN) K FILES(25)
. I '$$ALLERGYX^ORWGAPIA(DFN) K FILES(27)
. I '$$BBX^ORWGAPIB(DFN) K FILES(28)
. S OK=0
. D MEDICINE^ORWGAPIA(.MEDARRAY,DFN)
. I $O(MEDARRAY(0)) S OK=1
. I 'OK K FILES(31)
S CNT=0,SEQ=0
F S SEQ=$O(FILES(SEQ)) Q:SEQ<1 D
. S CNT=CNT+1
. I TMP S ^TMP(TYPES,$J,CNT)=FILES(SEQ)
. I 'TMP S TYPES(CNT)=FILES(SEQ)
Q
;
ORWGAPIT ; SLC/STAFF - Graph Item Types ;09-Aug-2012 15:16;PLS
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**215,260,243,1010**;Dec 17, 1997;Build 47
+2 ;
+3 ;Modified - IHS/MSC/MGH - 02/08/2012 - COMPNAME+7,FILENAME+2,GETFILES+4,TYPES+27
+4 ; IHS/MSC/PLS - 08/09/2012 - Changed references to NVA to OUTSIDE
COMPTYPE(FILE) ; $$(file) -> hs component abbrv - from ORWGAPID
+1 NEW COMP,COMPNAME,COMPS,NUM,OK
KILL COMPS
+2 SET COMPNAME=$$COMPNAME(FILE)_"]"
+3 DO COMP^ORWRP2(.COMPS)
+4 SET COMP=""
+5 SET OK=0
+6 SET NUM=0
+7 Begin DoDot:1
+8 FOR
SET NUM=$ORDER(COMPS(NUM))
IF NUM<1
QUIT
Begin DoDot:2
+9 SET COMP=COMPS(NUM)
+10 IF COMP[COMPNAME
IF COMPNAME=$PIECE($PIECE(COMP,U,2),"[",2)
SET OK=1
End DoDot:2
IF OK
QUIT
End DoDot:1
+11 QUIT COMP
+12 ;
COMPNAME(FILE) ; $$(file) -> hs component abbrv
+1 IF FILE=63
QUIT "CH"
+2 IF FILE=120.5
QUIT "VSD"
+3 IF FILE=120.8
QUIT "ADR"
+4 IF FILE=52
QUIT "RXOP"
+5 IF FILE=55
QUIT "RXUD"
+6 IF FILE=70
QUIT "II"
+7 ;IHS/MGH/MSC Added V measurements
+8 IF FILE=9000010.01
QUIT "MEA"
+9 IF FILE=9000010.11
QUIT "IM"
+10 IF FILE=9000010.12
QUIT "ST"
+11 IF FILE=9000010.13
QUIT "EXAM"
+12 IF FILE=9000010.18
QUIT "CPT"
+13 IF FILE=9000011
QUIT "PLL"
+14 IF FILE=9999911
QUIT "PLL"
+15 IF FILE=9000010.23
QUIT "HF"
+16 IF FILE=9000010.07
QUIT "OD"
+17 IF FILE=9000010.16
QUIT "ED"
+18 IF FILE=601.2
QUIT "MHPE"
+19 IF FILE=100
QUIT "ORC"
+20 IF FILE="45OP"
QUIT "PRC"
+21 IF FILE="45DX"
QUIT "DD"
+22 IF FILE="63AP"
QUIT "SP"
+23 IF FILE="63BB"
QUIT "BT"
+24 IF FILE="63MI"
QUIT "MIC"
+25 IF FILE=9000010
QUIT "CVP"
+26 IF FILE=405
QUIT "ADC"
+27 IF FILE="55NVA"
QUIT "RXNV"
+28 IF FILE=53.79
QUIT "BCMA"
+29 IF FILE=130
QUIT "SR"
+30 IF FILE=8925
QUIT "CNB"
+31 IF FILE=690
QUIT "MEDF"
+32 QUIT ""
+33 ;
FILENAME(FILE) ; $$(file) -> filename - from ORWGAPIP
+1 IF FILE=63
QUIT "LAB TESTS"
+2 ;IHS/MSC/MGH Added lookup for measurements
+3 IF FILE=9000010.01
QUIT "MEASUREMENTS"
+4 IF FILE=120.5
QUIT "VITALS"
+5 IF FILE=120.8
QUIT "ALLERGIES"
+6 IF FILE=52
QUIT "MEDICATION,OUTPATIENT"
+7 IF FILE=55
QUIT "MEDICATION,INPATIENT"
+8 IF FILE=70
QUIT "RADIOLOGY EXAMS"
+9 IF FILE=9000010.11
QUIT "IMMUNIZATIONS"
+10 IF FILE=9000010.12
QUIT "SKIN TESTS"
+11 IF FILE=9000010.13
QUIT "EXAMS"
+12 IF FILE=9000010.18
QUIT "PROCEDURES"
+13 IF FILE=9000011
QUIT "PROBLEMS"
+14 ;**************
IF FILE=9999911
QUIT "PROBLEMS-DURATION"
+15 IF FILE=9000010.23
QUIT "HEALTH FACTORS"
+16 IF FILE=9000010.07
QUIT "PURPOSE OF VISIT"
+17 IF FILE=9000010.16
QUIT "PATIENT EDUCATION"
+18 IF FILE=601.2
QUIT "MENTAL HEALTH"
+19 IF FILE=100
QUIT "ORDERS"
+20 IF FILE="45OP"
QUIT "REGISTRATION OP/PROC"
+21 IF FILE="45DX"
QUIT "REGISTRATION DX"
+22 IF FILE="63AP"
QUIT "ANATOMIC PATHOLOGY"
+23 IF FILE="63BB"
QUIT "BLOOD PRODUCTS"
+24 IF FILE="63MI"
QUIT "MICROBIOLOGY"
+25 IF FILE=9000010
QUIT "VISITS"
+26 IF FILE=405
QUIT "ADMISSIONS"
+27 ;IHS/MSC/PLS - 08/09/2012
+28 ;I FILE="55NVA" Q "MEDICATION,NON-VA"
+29 IF FILE="55NVA"
QUIT "MEDICATION,OUTSIDE"
+30 IF FILE=53.79
QUIT "MEDICATION,BCMA"
+31 IF FILE=50.605
QUIT "DRUG CLASS"
+32 IF FILE=68
QUIT "LAB ACC AREA"
+33 IF FILE=8925.1
QUIT "NOTE TITLE"
+34 IF FILE=100.98
QUIT "ORDER DISPLAY GROUP"
+35 IF FILE=811.2
QUIT "REMINDER TAXONOMY"
+36 IF FILE=130
QUIT "SURGERY"
+37 IF FILE=8925
QUIT "NOTES"
+38 IF FILE=690
QUIT "MEDICINE"
+39 QUIT ""
+40 ;
FILECHK(FILES) ;
+1 ; get parameter string of excluded files
+2 NEW CHECK,NUM,ORSRV,VAL
+3 SET ORSRV=$$GET1^DIQ(200,DUZ,29,"I")
+4 SET CHECK=$$XGET^ORWGAPIX("USR^SRV.`"_+$GET(ORSRV)_"^DIV^SYS^PKG","ORWG GRAPH EXCLUDE DATA TYPE",1,"I")
+5 SET CHECK=CHECK_";"
+6 SET NUM=0
+7 FOR
SET NUM=$ORDER(FILES(NUM))
IF NUM<1
QUIT
Begin DoDot:1
+8 SET VAL=FILES(NUM)
+9 SET VAL=$PIECE(VAL,U)_";"
+10 IF CHECK[VAL
KILL FILES(NUM)
End DoDot:1
+11 QUIT
+12 ;
GETFILES(FILES) ;
+1 ; file #^file name^graph type^lookup file^lookup global^lookup index^prefix^abbrev^hint format
+2 ; commenting out a line setting FILES will inactivate that type
+3 SET FILES(1)="63^LAB TESTS^1^60^LAB(60,^B^^CH^~ ~units~flag~|"
+4 ;IHS/MSC/MGH Added lookup for measurements
+5 IF +$$GET^XPAR("ALL","BEHOVM USE VMSR")
Begin DoDot:1
+6 SET FILES(2)="9000010.01^MEASUREMENTS^1^9999999.07^^AUTTMSR(,^B^^VSD^~ ~"
End DoDot:1
+7 IF '$TEST
Begin DoDot:1
+8 SET FILES(2)="120.5^VITALS^1^120.51^GMRD(120.51,^B^^VSD^~ ~"
End DoDot:1
+9 SET FILES(3)="52^MEDICATION,OUTPATIENT^3^50^PSDRUG(^B^^RXOP^~ ~"
+10 SET FILES(4)="55^MEDICATION,INPATIENT^3^50^PSDRUG(^B^^RXUD^~ ~"
+11 SET FILES(5)="70^RADIOLOGY EXAMS^2^71^RAMIS(71,^B^rad^II^~ ~"
+12 SET FILES(6)="9000010.11^IMMUNIZATIONS^2^9999999.14^AUTTIMM(^B^imm^IM^~ ~"
+13 SET FILES(7)="9000010.12^SKIN TESTS^2^9999999.28^AUTTSK(^B^skin^ST^~ ~"
+14 SET FILES(8)="9000010.13^EXAMS^2^9999999.15,^AUTTEXAM(^B^exam^EXAM^~ ~"
+15 SET FILES(9)="9000010.18^PROCEDURES^2^81^ICPT(^C^proc^CPT^~ ~"
+16 ;***
SET FILES(10)="9000011^PROBLEMS^2^80^ICD9(^B^prob^PLL^~ ~"
+17 SET FILES(11)="9000010.23^HEALTH FACTORS^2^9999999.64^AUTTHF(,^B^hf^HF^~ ~"
+18 SET FILES(12)="9000010.07^PURPOSE OF VISIT^2^80^ICD9(^B^pov^OD^"
+19 SET FILES(13)="9000010.16^PATIENT EDUCATION^2^9999999.09^AUTTEDT(^B^edu^ED^~ ~"
+20 SET FILES(14)="601.2^MENTAL HEALTH^2^601^YTT(601,^B^mh^MHPE^~ ~"
+21 SET FILES(15)="100^ORDERS^2^101.43^ORD(101.43,^B^order^ORC^~ ~"
+22 SET FILES(16)="45OP^REGISTRATION OP/PROC^2^*^^^op^PRC^~ ~"
+23 SET FILES(17)="45DX^REGISTRATION DX^2^*^^^dx^DD^~ ~"
+24 SET FILES(18)="63AP^ANATOMIC PATHOLOGY^2^*^^^ap^SP^~ ~"
+25 SET FILES(19)="63MI^MICROBIOLOGY^2^*^^^micro^MIC^~ ~"
+26 SET FILES(20)="9000010^VISITS^3^44^SC(^B^^CVP^~ ~"
+27 SET FILES(21)="405^ADMISSIONS^3^*^^^^ADC^~ ~"
+28 SET FILES(23)="53.79^MEDICATION,BCMA^2^50.7^PS(50.7,^B^^BCMA^~ ~"
+29 SET FILES(24)="130^SURGERY^2^81^ICPT(^C^surg^SR^~ ~"
+30 SET FILES(25)="8925^NOTES^2^*^^^note^CNB^~ ~"
+31 SET FILES(27)="120.8^ALLERGIES^2^*^^^allg^ADR^~ ~"
+32 SET FILES(28)="63BB^BLOOD BANK^2^66^LAB(66,^B^bb^BT^~ ~"
+33 ;S FILES(29)="9999911^PROBLEMS-DURATION^3^80^ICD9(^B^prob^PLL^~ ~" ;***
+34 ;IHS/MSC/PLS - 08/09/2012
+35 ;S FILES(30)="55NVA^MEDICATION,NON-VA^3^50.7^PS(50.7,^B^^RXNV^~ ~"
+36 SET FILES(30)="55NVA^MEDICATION,OUTSIDE^3^50.7^PS(50.7,^B^^RXNV^~ ~"
+37 SET FILES(31)="690^MEDICINE^2^*^^^med^MEDF^~ ~"
+38 SET FILES(2000)="811.2^Reminder Taxonomy"
+39 SET FILES(3000)="50.605^Drug Class"
+40 QUIT
+41 ;
TYPES(TYPES,DFN,SUB,TMP) ; from ORWGAPI
+1 NEW CNT,FILES,ITEM,MEDARRAY,NUM,OK,SEQ
KILL FILES,MEDARRAY
+2 SET TMP=$GET(TMP)
+3 DO GETFILES(.FILES)
+4 DO FILECHK(.FILES)
+5 IF SUB
Begin DoDot:1
+6 IF $DATA(FILES(18))
Begin DoDot:2
+7 SET FILES(1801)="63AP;O^AP: Organ"
+8 SET FILES(1802)="63AP;T^AP: Test"
+9 SET FILES(1803)="63AP;D^AP: Disease"
+10 SET FILES(1804)="63AP;I^AP: ICD9"
+11 SET FILES(1805)="63AP;E^AP: Etiology"
+12 SET FILES(1806)="63AP;F^AP: Function"
+13 SET FILES(1807)="63AP;P^AP: Procedure"
+14 SET FILES(1808)="63AP;M^AP: Morphology"
+15 SET FILES(1809)="63AP;S^AP: Specimen"
End DoDot:2
+16 IF $DATA(FILES(19))
Begin DoDot:2
+17 SET FILES(1901)="63MI;A^Microbiology: Antibiotic"
+18 SET FILES(1902)="63MI;T^Microbiology: Test"
+19 SET FILES(1903)="63MI;S^Microbiology: Specimen"
+20 SET FILES(1904)="63MI;O^Microbiology: Organism"
+21 ;S FILES(1905)="63MI;M^Microbiology: TB Drug"
End DoDot:2
End DoDot:1
+22 IF 'SUB
Begin DoDot:1
+23 KILL FILES(2000)
+24 KILL FILES(3000)
End DoDot:1
+25 IF DFN
Begin DoDot:1
+26 IF '$LENGTH($ORDER(^PXRMINDX(63,"PI",DFN,"")))
KILL FILES(1)
+27 ;IHS/MSC/MGH Branch if IHS or OV for where vitals are
+28 IF +$$GET^XPAR("ALL","BEHOVM USE VMSR")
Begin DoDot:2
+29 IF '$LENGTH($ORDER(^PXRMINDX(9000010.01,"PI",DFN,"")))
KILL FILES(2)
End DoDot:2
+30 IF '$TEST
Begin DoDot:2
+31 IF '$LENGTH($ORDER(^PXRMINDX(120.5,"PI",DFN,"")))
KILL FILES(2)
End DoDot:2
+32 IF '$LENGTH($ORDER(^PXRMINDX(52,"PI",DFN,"")))
KILL FILES(3)
+33 IF '$LENGTH($ORDER(^PXRMINDX(55,"PI",DFN,"")))
KILL FILES(4)
+34 IF '$LENGTH($ORDER(^PXRMINDX(70,"PI",DFN,"")))
KILL FILES(5)
+35 IF '$LENGTH($ORDER(^PXRMINDX(9000010.11,"PI",DFN,"")))
KILL FILES(6)
+36 IF '$LENGTH($ORDER(^PXRMINDX(9000010.12,"PI",DFN,"")))
KILL FILES(7)
+37 IF '$LENGTH($ORDER(^PXRMINDX(9000010.13,"PI",DFN,"")))
KILL FILES(8)
+38 IF '$LENGTH($ORDER(^PXRMINDX(9000010.18,"PPI",DFN,"")))
KILL FILES(9)
+39 IF '$LENGTH($ORDER(^PXRMINDX(9000011,"PSPI",DFN,"")))
KILL FILES(10),FILES(29)
+40 IF '$LENGTH($ORDER(^PXRMINDX(9000010.23,"PI",DFN,"")))
KILL FILES(11)
+41 IF '$LENGTH($ORDER(^PXRMINDX(9000010.07,"PPI",DFN,"")))
KILL FILES(12)
+42 IF '$LENGTH($ORDER(^PXRMINDX(9000010.16,"PI",DFN,"")))
KILL FILES(13)
+43 IF '$LENGTH($ORDER(^PXRMINDX(601.2,"PI",DFN,"")))
KILL FILES(14)
+44 IF '$LENGTH($ORDER(^PXRMINDX(100,"PI",DFN,"")))
KILL FILES(15)
+45 IF '$LENGTH($ORDER(^PXRMINDX(45,"ICD0","PNI",DFN,0)))
KILL FILES(16)
+46 IF '$LENGTH($ORDER(^PXRMINDX(45,"ICD9","PNI",DFN,0)))
KILL FILES(17)
+47 IF $EXTRACT($ORDER(^PXRMINDX(63,"PI",DFN,"A")))'="A"
KILL FILES(18)
Begin DoDot:2
+48 FOR NUM=1:1:9
KILL FILES(180+NUM)
End DoDot:2
+49 IF $EXTRACT($ORDER(^PXRMINDX(63,"PI",DFN,"M")))'="M"
KILL FILES(19)
Begin DoDot:2
+50 FOR NUM=1:1:5
KILL FILES(190+NUM)
End DoDot:2
+51 IF '$$VISITX^ORWGAPIA(DFN)
KILL FILES(20)
+52 IF '$$ADMITX^ORWGAPIA(DFN)
KILL FILES(21)
+53 IF '$$NVAX^ORWGAPIC(DFN)
KILL FILES(22),FILES(30)
+54 IF '$$BCMAX^ORWGAPIC(DFN)
KILL FILES(23)
+55 IF '$$SURGX^ORWGAPIA(DFN)
KILL FILES(24)
+56 IF '$$NOTEX^ORWGAPIA(DFN)
KILL FILES(25)
+57 IF '$$ALLERGYX^ORWGAPIA(DFN)
KILL FILES(27)
+58 IF '$$BBX^ORWGAPIB(DFN)
KILL FILES(28)
+59 SET OK=0
+60 DO MEDICINE^ORWGAPIA(.MEDARRAY,DFN)
+61 IF $ORDER(MEDARRAY(0))
SET OK=1
+62 IF 'OK
KILL FILES(31)
End DoDot:1
+63 SET CNT=0
SET SEQ=0
+64 FOR
SET SEQ=$ORDER(FILES(SEQ))
IF SEQ<1
QUIT
Begin DoDot:1
+65 SET CNT=CNT+1
+66 IF TMP
SET ^TMP(TYPES,$JOB,CNT)=FILES(SEQ)
+67 IF 'TMP
SET TYPES(CNT)=FILES(SEQ)
End DoDot:1
+68 QUIT
+69 ;