ORWGAPIU ; SLC/STAFF - Graph API Utilities ;29-Jun-2015 09:58;PLS
;;3.0;ORDER ENTRY/RESULTS REPORTING;**215,260,243,1010,1014**;Dec 17, 1997;Build 47
;
;Modified - IHS/MSC/MGH - 02/08/2012 - FILE+31
; IHS/MSC/MGH - 05/19/2015
; IHS/MSC/MGH - 06/29/2015 - Added calls to BEHOGMEA
EVALUE(VAL,FILE,FIELD) ; $$(internal value,file,field) -> external value or ""
; from ORWGAPI1, ORWGAPI2, ORWGAPI3, ORWGAPI4, ORWGAPIP, ORWGAPIR
I VAL="" Q ""
S FIELD=$G(FIELD,.01)
I $E(FILE,1,2)=63 Q $$LABNAME^ORWGAPIC(VAL)
I FILE="63AP;I" Q $$ICD9^ORWGAPIA(VAL)
I FILE="45DX" Q $$ICD9^ORWGAPIA(VAL)
I FILE="45OP" Q $$ICD0^ORWGAPIA(VAL)
I FILE="45;ICD9" Q $$ICD9^ORWGAPIA(VAL)
I FILE="45;ICD0" Q $$ICD0^ORWGAPIA(VAL)
I FIELD=.01,'$L(VAL) Q ""
I FILE=9000010.07 Q $$ICD9^ORWGAPIA(VAL)
I FILE=9000010.18 Q $$ICPT^ORWGAPIA(VAL)
I FILE=9000011 Q $$ICD9^ORWGAPIA(VAL)
I FILE=9999911 Q $$ICD9^ORWGAPIA(VAL)
I FILE=130 Q $$ICPT^ORWGAPIA(VAL)
I FILE=120.8 Q $$ALLG^ORWGAPIA(VAL)
I FILE=50.605 Q $$DC^ORWGAPIC(VAL)
I FILE=68 Q $$AA^ORWGAPIC(VAL)
I FILE=811.2 Q $$TAX^ORWGAPIA(VAL)
;IHS/MSC/MGH Modified for vital graphing
I FILE=9000010.01 Q $$VAL^BEHOGMEA(VAL)
D
. I FILE=52 S FIELD=6 Q
. I FILE=53.79 S FIELD=.08 Q
. I FILE=55 S FILE=55.07 Q
. I FILE="55NVA" S FILE=55.05 Q
. I FILE=70 S FILE=70.03,FIELD=2 Q
. I FILE=100 S FILE=100.001 Q
. I FILE=120.5 S FIELD=.03 Q
. I FILE=601.2 S FILE=601.21 Q
Q $$EXT^ORWGAPIX(VAL,FILE,FIELD)
;
FILE(FILE,REF,XREF,SCREEN) ; from ORWGAPI
S REF="",SCREEN="I 1",XREF="B"
I FILE="" Q
D
. I FILE="45DX" S REF=$$GBLREF(80),XREF="AB" Q
. I FILE="45OP" S REF=$$GBLREF(80.1),XREF="AB" Q
. I FILE=50.605 S REF=$$GBLREF(50.605),XREF="C" Q
. I FILE=52 S REF=$$GBLREF(50) Q
. I FILE=53.79 S REF=$$GBLREF(50.7),SCREEN="I $P(ZERO,U,10)'=1" Q
. I FILE=55 S REF=$$GBLREF(50) Q
. I FILE="55NVA" S REF=$$GBLREF(50.7),SCREEN="I $P(ZERO,U,10)=1" Q
. I FILE=63 S REF=$$GBLREF(60),SCREEN="I $L($P(ZERO,U,5)),""BO""[$P(ZERO,U,3),$P(ZERO,U,4)=""CH""" Q
. I FILE="63AP" S REF=$$GBLREF(60),SCREEN="I 0" Q
. I FILE="63AP;D" S REF=$$GBLREF(61.4) Q
. I FILE="63AP;E" S REF=$$GBLREF(61.2) Q
. I FILE="63AP;F" S REF=$$GBLREF(61.3) Q
. I FILE="63AP;I" S REF=$$GBLREF(80),XREF="AB" Q
. I FILE="63AP;M" S REF=$$GBLREF(61.1) Q
. I FILE="63AP;O" S REF=$$GBLREF(61) Q
. I FILE="63AP;P" S REF=$$GBLREF(61.5) Q
. I FILE="63AP;T" S REF=$$GBLREF(60),SCREEN="I ""BO""[$P(ZERO,U,3),(($P(ZERO,U,4)=""CY"")!($P(ZERO,U,4)=""SP"")!($P(ZERO,U,4)=""EM"")!($P(ZERO,U,4)=""AU""))" Q
. I FILE="63BB" S REF=$$GBLREF(66),SCREEN="I $P(ZERO,U,15)=1" Q
. I FILE="63MI" S REF=$$GBLREF(60),SCREEN="I 0" Q
. I FILE="63MI;A" S REF=$$GBLREF(62.06) Q
. I FILE="63MI;M" S REF=$$GBLREF(60) Q ; mycobacteria not currently used
. I FILE="63MI;O" S REF=$$GBLREF(61.2),SCREEN="I $L($P(ZERO,U,5)),""BFPMV""[$P(ZERO,U,5)" Q
. I FILE="63MI;S" S REF=$$GBLREF(61) Q
. I FILE="63MI;T" S REF=$$GBLREF(60),SCREEN="I ""BO""[$P(ZERO,U,3),$P(ZERO,U,4)=""MI""" Q
. I FILE=70 S REF=$$GBLREF(71) Q
. I FILE=100 S REF=$$GBLREF(101.43) Q
. I FILE=120.5 S REF=$$GBLREF(120.51),SCREEN="I ""BP^P^T^R^P^HT^WT^CVP^CG^PO2^PN""[$P(ZERO,U,2)" Q
. ;IHS/MSC/MGH Added lookup for V measurements and measurment types
. I FILE=9000010.01 S REF=$$GBLREF(9999999.07) Q
. ;I FILE=120.8 S REF=$$GBLREF(120.83) Q
. I FILE=130 S REF=$$GBLREF(81),SCREEN="I '$P(ZERO,U,4)" Q
. I FILE=405 S REF=$$GBLREF(44),SCREEN="I 0" Q
. I FILE=601.2 S REF=$$GBLREF(601) Q
. I FILE=690 S REF=$$GBLREF(697.2),XREF="BA" Q
. I FILE=811.2 S REF=$$GBLREF(811.2),SCREEN="I $P(ZERO,U,6)'=1" Q
. I FILE=8925 S REF=$$GBLREF(8925.1),SCREEN="I $P(ZERO,U,4)=""DOC""" Q
. I FILE=9000010 S REF=$$GBLREF(44) Q
. I FILE=9000010.07 S REF=$$GBLREF(80),XREF="AB" Q
. I FILE=9000010.11 S REF=$$GBLREF(9999999.14),SCREEN="I $P(ZERO,U,7)'=1" Q
. I FILE=9000010.12 S REF=$$GBLREF(9999999.28),SCREEN="I $P(ZERO,U,3)'=1" Q
. I FILE=9000010.13 S REF=$$GBLREF(9999999.15),SCREEN="I $P(ZERO,U,4)'=1" Q
. I FILE=9000010.16 S REF=$$GBLREF(9999999.09),SCREEN="I $P(ZERO,U,3)'=1" Q
. I FILE=9000010.18 S REF=$$GBLREF(81),XREF="BA",SCREEN="I '$P(ZERO,U,4)" Q
. I FILE=9000010.23 S REF=$$GBLREF(9999999.64),SCREEN="I $P(ZERO,U,10)=""F"",$P(ZERO,U,11)'=1" Q
. I FILE=9000011 S REF=$$GBLREF(80),XREF="AB",SCREEN="I $E(ZERO)'=""E"",'$L($P(ZERO,U,9))" Q
. I FILE=9999911 S REF=$$GBLREF(80),XREF="AB",SCREEN="I $E(ZERO)'=""E"",'$L($P(ZERO,U,9))" Q
I $E(REF)'="^" S REF=""
S REF=REF ;_""""_XREF_""")"
Q
;
GBLREF(FN) ; $$(file#) -> global reference
Q $$GBLREF^ORWGAPIX($G(FN))
;
INISET ; postinit, set initial public graph setting - from ORY215, ORY243
D INISET^ORWGAPIP
D RESOURCE^ORWGTASK
Q
;
ITEMPRFX(ITEM) ; $$(item) -> item prefix - from ORWGAPI1
N ABBREV,PREFIX
S PREFIX=""
S ABBREV=$P(ITEM,";",2)
I $E(ITEM)="A" D Q PREFIX
. I ABBREV="T" S PREFIX="TEST" Q
. I ABBREV="S" S PREFIX="SPECIMEN" Q
. I ABBREV="O" S PREFIX="ORGAN" Q
. I ABBREV="M" S PREFIX="MORPHOLOGY" Q
. I ABBREV="E" S PREFIX="ETIOLOGY" Q
. I ABBREV="D" S PREFIX="DISEASE" Q
. I ABBREV="P" S PREFIX="PROCEDURE" Q
. I ABBREV="F" S PREFIX="FUNCTION" Q
. I ABBREV="I" S PREFIX="ICD9" Q
I $E(ITEM)="B" Q "BLOOD COMPONENT"
I $E(ITEM)="M" D Q PREFIX
. I ABBREV="T" S PREFIX="TEST" Q
. I ABBREV="S" S PREFIX="SPECIMEN" Q
. I ABBREV="O" S PREFIX="ORGANISM" Q
. I ABBREV="A" S PREFIX="ANTIBIOTIC" Q
. I ABBREV="M" S PREFIX="TB ANTIBIOTIC" Q
Q PREFIX
;
ORWGAPIU ; SLC/STAFF - Graph API Utilities ;29-Jun-2015 09:58;PLS
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**215,260,243,1010,1014**;Dec 17, 1997;Build 47
+2 ;
+3 ;Modified - IHS/MSC/MGH - 02/08/2012 - FILE+31
+4 ; IHS/MSC/MGH - 05/19/2015
+5 ; IHS/MSC/MGH - 06/29/2015 - Added calls to BEHOGMEA
EVALUE(VAL,FILE,FIELD) ; $$(internal value,file,field) -> external value or ""
+1 ; from ORWGAPI1, ORWGAPI2, ORWGAPI3, ORWGAPI4, ORWGAPIP, ORWGAPIR
+2 IF VAL=""
QUIT ""
+3 SET FIELD=$GET(FIELD,.01)
+4 IF $EXTRACT(FILE,1,2)=63
QUIT $$LABNAME^ORWGAPIC(VAL)
+5 IF FILE="63AP;I"
QUIT $$ICD9^ORWGAPIA(VAL)
+6 IF FILE="45DX"
QUIT $$ICD9^ORWGAPIA(VAL)
+7 IF FILE="45OP"
QUIT $$ICD0^ORWGAPIA(VAL)
+8 IF FILE="45;ICD9"
QUIT $$ICD9^ORWGAPIA(VAL)
+9 IF FILE="45;ICD0"
QUIT $$ICD0^ORWGAPIA(VAL)
+10 IF FIELD=.01
IF '$LENGTH(VAL)
QUIT ""
+11 IF FILE=9000010.07
QUIT $$ICD9^ORWGAPIA(VAL)
+12 IF FILE=9000010.18
QUIT $$ICPT^ORWGAPIA(VAL)
+13 IF FILE=9000011
QUIT $$ICD9^ORWGAPIA(VAL)
+14 IF FILE=9999911
QUIT $$ICD9^ORWGAPIA(VAL)
+15 IF FILE=130
QUIT $$ICPT^ORWGAPIA(VAL)
+16 IF FILE=120.8
QUIT $$ALLG^ORWGAPIA(VAL)
+17 IF FILE=50.605
QUIT $$DC^ORWGAPIC(VAL)
+18 IF FILE=68
QUIT $$AA^ORWGAPIC(VAL)
+19 IF FILE=811.2
QUIT $$TAX^ORWGAPIA(VAL)
+20 ;IHS/MSC/MGH Modified for vital graphing
+21 IF FILE=9000010.01
QUIT $$VAL^BEHOGMEA(VAL)
+22 Begin DoDot:1
+23 IF FILE=52
SET FIELD=6
QUIT
+24 IF FILE=53.79
SET FIELD=.08
QUIT
+25 IF FILE=55
SET FILE=55.07
QUIT
+26 IF FILE="55NVA"
SET FILE=55.05
QUIT
+27 IF FILE=70
SET FILE=70.03
SET FIELD=2
QUIT
+28 IF FILE=100
SET FILE=100.001
QUIT
+29 IF FILE=120.5
SET FIELD=.03
QUIT
+30 IF FILE=601.2
SET FILE=601.21
QUIT
End DoDot:1
+31 QUIT $$EXT^ORWGAPIX(VAL,FILE,FIELD)
+32 ;
FILE(FILE,REF,XREF,SCREEN) ; from ORWGAPI
+1 SET REF=""
SET SCREEN="I 1"
SET XREF="B"
+2 IF FILE=""
QUIT
+3 Begin DoDot:1
+4 IF FILE="45DX"
SET REF=$$GBLREF(80)
SET XREF="AB"
QUIT
+5 IF FILE="45OP"
SET REF=$$GBLREF(80.1)
SET XREF="AB"
QUIT
+6 IF FILE=50.605
SET REF=$$GBLREF(50.605)
SET XREF="C"
QUIT
+7 IF FILE=52
SET REF=$$GBLREF(50)
QUIT
+8 IF FILE=53.79
SET REF=$$GBLREF(50.7)
SET SCREEN="I $P(ZERO,U,10)'=1"
QUIT
+9 IF FILE=55
SET REF=$$GBLREF(50)
QUIT
+10 IF FILE="55NVA"
SET REF=$$GBLREF(50.7)
SET SCREEN="I $P(ZERO,U,10)=1"
QUIT
+11 IF FILE=63
SET REF=$$GBLREF(60)
SET SCREEN="I $L($P(ZERO,U,5)),""BO""[$P(ZERO,U,3),$P(ZERO,U,4)=""CH"""
QUIT
+12 IF FILE="63AP"
SET REF=$$GBLREF(60)
SET SCREEN="I 0"
QUIT
+13 IF FILE="63AP;D"
SET REF=$$GBLREF(61.4)
QUIT
+14 IF FILE="63AP;E"
SET REF=$$GBLREF(61.2)
QUIT
+15 IF FILE="63AP;F"
SET REF=$$GBLREF(61.3)
QUIT
+16 IF FILE="63AP;I"
SET REF=$$GBLREF(80)
SET XREF="AB"
QUIT
+17 IF FILE="63AP;M"
SET REF=$$GBLREF(61.1)
QUIT
+18 IF FILE="63AP;O"
SET REF=$$GBLREF(61)
QUIT
+19 IF FILE="63AP;P"
SET REF=$$GBLREF(61.5)
QUIT
+20 IF FILE="63AP;T"
SET REF=$$GBLREF(60)
SET SCREEN="I ""BO""[$P(ZERO,U,3),(($P(ZERO,U,4)=""CY"")!($P(ZERO,U,4)=""SP"")!($P(ZERO,U,4)=""EM"")!($P(ZERO,U,4)=""AU""))"
QUIT
+21 IF FILE="63BB"
SET REF=$$GBLREF(66)
SET SCREEN="I $P(ZERO,U,15)=1"
QUIT
+22 IF FILE="63MI"
SET REF=$$GBLREF(60)
SET SCREEN="I 0"
QUIT
+23 IF FILE="63MI;A"
SET REF=$$GBLREF(62.06)
QUIT
+24 ; mycobacteria not currently used
IF FILE="63MI;M"
SET REF=$$GBLREF(60)
QUIT
+25 IF FILE="63MI;O"
SET REF=$$GBLREF(61.2)
SET SCREEN="I $L($P(ZERO,U,5)),""BFPMV""[$P(ZERO,U,5)"
QUIT
+26 IF FILE="63MI;S"
SET REF=$$GBLREF(61)
QUIT
+27 IF FILE="63MI;T"
SET REF=$$GBLREF(60)
SET SCREEN="I ""BO""[$P(ZERO,U,3),$P(ZERO,U,4)=""MI"""
QUIT
+28 IF FILE=70
SET REF=$$GBLREF(71)
QUIT
+29 IF FILE=100
SET REF=$$GBLREF(101.43)
QUIT
+30 IF FILE=120.5
SET REF=$$GBLREF(120.51)
SET SCREEN="I ""BP^P^T^R^P^HT^WT^CVP^CG^PO2^PN""[$P(ZERO,U,2)"
QUIT
+31 ;IHS/MSC/MGH Added lookup for V measurements and measurment types
+32 IF FILE=9000010.01
SET REF=$$GBLREF(9999999.07)
QUIT
+33 ;I FILE=120.8 S REF=$$GBLREF(120.83) Q
+34 IF FILE=130
SET REF=$$GBLREF(81)
SET SCREEN="I '$P(ZERO,U,4)"
QUIT
+35 IF FILE=405
SET REF=$$GBLREF(44)
SET SCREEN="I 0"
QUIT
+36 IF FILE=601.2
SET REF=$$GBLREF(601)
QUIT
+37 IF FILE=690
SET REF=$$GBLREF(697.2)
SET XREF="BA"
QUIT
+38 IF FILE=811.2
SET REF=$$GBLREF(811.2)
SET SCREEN="I $P(ZERO,U,6)'=1"
QUIT
+39 IF FILE=8925
SET REF=$$GBLREF(8925.1)
SET SCREEN="I $P(ZERO,U,4)=""DOC"""
QUIT
+40 IF FILE=9000010
SET REF=$$GBLREF(44)
QUIT
+41 IF FILE=9000010.07
SET REF=$$GBLREF(80)
SET XREF="AB"
QUIT
+42 IF FILE=9000010.11
SET REF=$$GBLREF(9999999.14)
SET SCREEN="I $P(ZERO,U,7)'=1"
QUIT
+43 IF FILE=9000010.12
SET REF=$$GBLREF(9999999.28)
SET SCREEN="I $P(ZERO,U,3)'=1"
QUIT
+44 IF FILE=9000010.13
SET REF=$$GBLREF(9999999.15)
SET SCREEN="I $P(ZERO,U,4)'=1"
QUIT
+45 IF FILE=9000010.16
SET REF=$$GBLREF(9999999.09)
SET SCREEN="I $P(ZERO,U,3)'=1"
QUIT
+46 IF FILE=9000010.18
SET REF=$$GBLREF(81)
SET XREF="BA"
SET SCREEN="I '$P(ZERO,U,4)"
QUIT
+47 IF FILE=9000010.23
SET REF=$$GBLREF(9999999.64)
SET SCREEN="I $P(ZERO,U,10)=""F"",$P(ZERO,U,11)'=1"
QUIT
+48 IF FILE=9000011
SET REF=$$GBLREF(80)
SET XREF="AB"
SET SCREEN="I $E(ZERO)'=""E"",'$L($P(ZERO,U,9))"
QUIT
+49 IF FILE=9999911
SET REF=$$GBLREF(80)
SET XREF="AB"
SET SCREEN="I $E(ZERO)'=""E"",'$L($P(ZERO,U,9))"
QUIT
End DoDot:1
+50 IF $EXTRACT(REF)'="^"
SET REF=""
+51 ;_""""_XREF_""")"
SET REF=REF
+52 QUIT
+53 ;
GBLREF(FN) ; $$(file#) -> global reference
+1 QUIT $$GBLREF^ORWGAPIX($GET(FN))
+2 ;
INISET ; postinit, set initial public graph setting - from ORY215, ORY243
+1 DO INISET^ORWGAPIP
+2 DO RESOURCE^ORWGTASK
+3 QUIT
+4 ;
ITEMPRFX(ITEM) ; $$(item) -> item prefix - from ORWGAPI1
+1 NEW ABBREV,PREFIX
+2 SET PREFIX=""
+3 SET ABBREV=$PIECE(ITEM,";",2)
+4 IF $EXTRACT(ITEM)="A"
Begin DoDot:1
+5 IF ABBREV="T"
SET PREFIX="TEST"
QUIT
+6 IF ABBREV="S"
SET PREFIX="SPECIMEN"
QUIT
+7 IF ABBREV="O"
SET PREFIX="ORGAN"
QUIT
+8 IF ABBREV="M"
SET PREFIX="MORPHOLOGY"
QUIT
+9 IF ABBREV="E"
SET PREFIX="ETIOLOGY"
QUIT
+10 IF ABBREV="D"
SET PREFIX="DISEASE"
QUIT
+11 IF ABBREV="P"
SET PREFIX="PROCEDURE"
QUIT
+12 IF ABBREV="F"
SET PREFIX="FUNCTION"
QUIT
+13 IF ABBREV="I"
SET PREFIX="ICD9"
QUIT
End DoDot:1
QUIT PREFIX
+14 IF $EXTRACT(ITEM)="B"
QUIT "BLOOD COMPONENT"
+15 IF $EXTRACT(ITEM)="M"
Begin DoDot:1
+16 IF ABBREV="T"
SET PREFIX="TEST"
QUIT
+17 IF ABBREV="S"
SET PREFIX="SPECIMEN"
QUIT
+18 IF ABBREV="O"
SET PREFIX="ORGANISM"
QUIT
+19 IF ABBREV="A"
SET PREFIX="ANTIBIOTIC"
QUIT
+20 IF ABBREV="M"
SET PREFIX="TB ANTIBIOTIC"
QUIT
End DoDot:1
QUIT PREFIX
+21 QUIT PREFIX
+22 ;