BKMIXX2 ;PRXM/HC/BWF - TAXONOMY ACCESS UTILITIES ; 13 Apr 2005 4:53 PM
;;2.2;HIV MANAGEMENT SYSTEM;;Apr 01, 2015;Build 40
; Generic Taxonomy Utilities
; Checks V-Files for patients that meet a Taxonomy's criteria, within
; a specific date range.
;
;**************NOTE***********************
; Input for all entry points are the same
;*****************************************
;
; Input:
; DFN = IEN from Patient file (#90000001)
; (required)
; TAX = Name of Taxonomy (From Lab Taxonomy ^ATXLAB or ICD Taxonomy ^ATXAX)
; (required)
; EDATE = End date of the report. The default is "Today"
; (optional)
; SDATE = Start date of the report.
; (optional)
; TARGET = Target root (global or local) for collection of data
; (optional)
; Example: ^TMP("RTN NAME",$J,"DESC",DFN,VSTDT,VISIT) or TEMP(VSTDT,VISIT)
; Output:
; LDATE = Last date found in the selected date range
; (optional - pass by reference)
; LIEN = Last IEN found in the selected date range
; (optional - pass by reference)
; CNT = Count of number of records found in selected date range
; (optional - pass by reference)
;
Q
;
; For this entry point only:
;
; Input:
; REFILE = FILE# to which the Refusal refers
; (required)
;
REFUSAL(DFN,REFILE,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
;Refusal Taxonomy Check (by File)
;
N TXIEN,TEST,VISIT,VSTDT,RESULT,REFLAG
N QFLAG,REFVAL,REFVAL1,REFVAL2,REFILE1,REFTYPE,IENS,EXIST
I DFN="" Q
I TAX="" Q
S TXIEN=$O(^ATXAX("B",TAX,"")),REFLAG=1
;Lab codes can be found in a different Taxonomy global
I TXIEN="",REFILE=60 S TXIEN=$O(^ATXLAB("B",TAX,"")),REFLAG=0 I TXIEN="" Q
;Exam codes do not use a Taxonomy, but the same variables are used.
I TXIEN="",REFILE=9999999.15 S TXIEN=$O(^AUTTEXAM("C",TAX,"")),REFLAG=2 I TXIEN="" Q
;Skin Test codes also do not use a Taxonomy, but the same variables are used.
I TXIEN="",REFILE=9999999.28 S TXIEN=$O(^AUTTSK("C",TAX,"")),REFLAG=2 I TXIEN="" Q
;Most Patient Education Codes do not use a Taxonomy. Some need to be calculated separately.
I TXIEN="" Q:REFILE'=9999999.09 D BLDTAX1^BKMIXX5(TAX,"TXIEN") S REFLAG=3 I $D(TXIEN)=0 Q
S TEST="",CNT=0,LDATE=$G(LDATE,""),LIEN=$G(LIEN,"")
F S TEST=$O(^AUPNPREF("AC",DFN,TEST)) Q:TEST="" D
.S REFVAL="",REFVAL1=""
.S REFILE1=$$GET1^DIQ(9000022,TEST,.05,"I")
.;Skip NULL references as they are checked later.
.I REFILE1]"",REFILE1'=REFILE Q
.S REFVAL=$$GET1^DIQ(9000022,TEST,.06,"I")
.;Exam Codes are checked differently because they do not use Taxonomies.
.I REFLAG=2,REFVAL'=TXIEN Q
.;^ATXLAB stores the LAB code IEN directly.
.I REFLAG=0 D Q:QFLAG=1
..S QFLAG=1
..I REFVAL]"" S:$D(^ATXLAB(TXIEN,21,"B",REFVAL)) QFLAG=0 Q
..;Currently LAB/PAP SMEAR tests do not have REFVAL set.
..;Setting this so calling program will know 'some' LAB was refused.
..I REFVAL="" S QFLAG=0 Q
.I REFLAG=1 D Q:QFLAG=1
..S QFLAG=1 ; Quit if REFILE not listed or REFVAL not found.
..I REFILE=71 D Q ;Radiology and Mammogram
...I REFVAL]"" S REFVAL1=$$GET1^DIQ(71,REFVAL,9,"I")
...;I REFVAL1]"" S:$$ICD^BKMIXX5(REFVAL1,TXIEN,1)'=0 QFLAG=0 Q
...I REFVAL1]"" D
....I $$PATCH^XPDUTL("ATX*5.1*11") S EXIST=$$ICD^ATXAPI(REFVAL1,TXIEN,1)
....E S EXIST=$$ICD^BKMIXX5(REFVAL1,TXIEN,1)
....I EXIST'=0 S QFLAG=0
..I REFILE=9999999.14 D Q ;Immunizations
...I REFVAL]"" S REFVAL1=$$GET1^DIQ(9999999.14,REFVAL,.03,"E")
...I REFVAL1]"" S:$D(^ATXAX(TXIEN,21,"B",REFVAL1)) QFLAG=0 Q
..I REFILE=9999999.15 D Q ;Exams
...I REFVAL]"" S REFVAL1=$$GET1^DIQ(9999999.15,REFVAL,.01,"E")
...I REFVAL1]"" S:$D(^ATXAX(TXIEN,21,"B",REFVAL1)) QFLAG=0 Q
..I REFILE=9999999.09 D Q ;Patient Education
...I REFVAL]"" S REFVAL1=$$GET1^DIQ(9999999.09,REFVAL,.01,"E")
...I REFVAL1]"",REFLAG=1 S:$D(^ATXAX(TXIEN,21,"B",REFVAL1)) QFLAG=0 Q
...I REFVAL1]"",REFLAG=3 S REFVAL2=$$GET1^DIQ(9999999.09,REFVAL,.01,"I") S:$D(TXIEN(REFVAL2)) QFLAG=0 Q
..I REFILE=50 D Q ;NDC codes or MED IENS
...;Use Taxonomy to build a list of DRUG code IENs.
...D BLDTAX^BKMIXX5(TAX,"IENS")
...I REFVAL]"" S:$D(IENS(REFVAL)) QFLAG=0 Q
..I REFILE=81 D Q ;CPT Codes
...;Use Taxonomy to build a list of CPTs
...D BLDTAX^BKMIXX5(TAX,"IENS")
...I REFVAL]"" S:$D(IENS(REFVAL)) QFLAG=0 Q
..I REFILE=60 D Q ;LOINC codes
...;Use LOINC Taxonomy to build a list of LAB code IENs.
...D BLDTAX^BKMIXX5(TAX,"IENS")
...I REFVAL]"" S:$D(IENS(REFVAL)) QFLAG=0 Q
...;Currently LAB/PAP SMEAR tests do not have REFVAL set.
...;Setting this so calling program will know 'some' LAB was refused.
...I REFVAL="" S QFLAG=0 Q
.; Not related to Visit File (#9000010)
.S VISIT="N/A"
.; VSTDT is the Date of Patient Refusal
.S VSTDT=$$GET1^DIQ(9000022,TEST,.03,"I")
.I VSTDT="" S VSTDT="Unknown"
.I $G(SDATE)'="",(VSTDT<SDATE) Q
.I $G(EDATE)'="",(VSTDT\1>EDATE) Q
.I VSTDT>LDATE S LDATE=VSTDT,LIEN=TEST
.I VSTDT=LDATE,TEST>LIEN S LDATE=VSTDT,LIEN=TEST
.S RESULT=$$GET1^DIQ(9000022,TEST,.07,"E")
.I RESULT="" S RESULT="Not Specified"
.I REFVAL="" S REFVAL="Not Specified"
.S REFTYPE=$$GET1^DIQ(9000022,TEST,.01,"E")
.S CNT=CNT+1
.I $G(TARGET)]"" S @TARGET=RESULT_U_REFTYPE
Q
;
; For this entry point only:
;
; Input:
; TAX = PROVIDER CLASS (external) to search for
; (required)
;
; Taxonomies not available for this type of data.
; Variables are still named the same for consistency with other functions.
;
PRVTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
; Provider Check (using Provider Class)
;
N TXIEN,TEST,VISIT,VSTDT,RESULT,PRV,PRVCLS
I DFN="" Q
I TAX="" Q
S TXIEN=$O(^DIC(7,"D",TAX,""))
I TXIEN="" Q
S TEST="",CNT=0,LDATE=$G(LDATE,""),LIEN=$G(LIEN,"")
F S TEST=$O(^AUPNVPRV("AC",DFN,TEST)) Q:TEST="" D
.S PRV=$$GET1^DIQ(9000010.06,TEST,.01,"I")
.I PRV="" Q
.S PRVCLS=$$GET1^DIQ(200,PRV,53.5,"I")
.I PRVCLS'=TXIEN Q
.S VISIT=$$GET1^DIQ(9000010.06,TEST,.03,"I")
.S VSTDT=$$GET1^DIQ(9000010,VISIT_",",.01,"I")
.I $G(SDATE)'="",(VSTDT<SDATE) Q
.I $G(EDATE)'="",(VSTDT\1>EDATE) Q
.I VSTDT>LDATE S LDATE=VSTDT,LIEN=TEST
.I VSTDT=LDATE,TEST>LIEN S LDATE=VSTDT,LIEN=TEST
.;Nothing identified in file as a 'RESULT'. Using "N/A" for now for consistency with other functions.
.;S RESULT=$$GET1^DIQ(9000010.06,TEST,.04,"I")
.S RESULT="N/A"
.S CNT=CNT+1
.I $G(TARGET)]"" S @TARGET=RESULT
Q
;
; For this entry point only:
;
; Input:
; TAX = CODE/CLINIC STOP (external) to search for
; (required)
;
; Taxonomies not available for this type of data.
; Variables are still named the same for consistency with other functions.
;
CLNTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
; Clinic Check (using Code/Clinic Stop)
;
N TXIEN,TEST,VISIT,VSTDT,RESULT,CLN,CLNSCD
I DFN="" Q
I TAX="" Q
;Not really needed, but set to maintain same variable list as other functions.
S TXIEN=TAX
I TXIEN="" Q
S TEST="",CNT=0,LDATE=$G(LDATE,""),LIEN=$G(LIEN,"")
F S TEST=$O(^AUPNVSIT("AC",DFN,TEST)) Q:TEST="" D
.S CLN=$$GET1^DIQ(9000010,TEST,.08,"I")
.I CLN="" Q
.S CLNSCD=$$GET1^DIQ(40.7,CLN,1,"E")
.I CLNSCD'=TXIEN Q
.S VISIT=TEST
.S VSTDT=$$GET1^DIQ(9000010,VISIT_",",.01,"I")
.I $G(SDATE)'="",(VSTDT<SDATE) Q
.I $G(EDATE)'="",(VSTDT\1>EDATE) Q
.I VSTDT>LDATE S LDATE=VSTDT,LIEN=TEST
.I VSTDT=LDATE,TEST>LIEN S LDATE=VSTDT,LIEN=TEST
.;Nothing identified in file as a 'RESULT'. Using "N/A" for now for consistency with other functions.
.;S RESULT=$$GET1^DIQ(9000010,TEST,.04,"I")
.S RESULT="N/A"
.S CNT=CNT+1
.I $G(TARGET)]"" S @TARGET=RESULT
Q
;
; For this entry point only:
;
; Input:
; TAX = WOMEN'S HEALTH PROCEDURE TYPE (external) to search for
; (required)
;
; Taxonomies not available for this type of data.
; Variables are still named the same for consistency with other functions.
;
WHTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
; Women's Health (using Women's Health Procedure Type)
;
N TXIEN,TEST,VISIT,VSTDT,RESULT,WH
I DFN="" Q
I TAX="" Q
S TXIEN=$O(^BWPN("B",TAX,""))
I TXIEN="" Q
S TEST="",CNT=0,LDATE=$G(LDATE,""),LIEN=$G(LIEN,"")
F S TEST=$O(^BWPCD("C",DFN,TEST)) Q:TEST="" D
.S WH=$$GET1^DIQ(9002086.1,TEST,.04,"I")
.I WH="" Q
.I WH'=TXIEN Q
.S VISIT=TEST
.; Using 'Date of Procedure' as 'Visit Date'
.S VSTDT=$$GET1^DIQ(9002086.1,VISIT_",",.12,"I")
.I $G(SDATE)'="",(VSTDT<SDATE) Q
.I $G(EDATE)'="",(VSTDT\1>EDATE) Q
.I VSTDT>LDATE S LDATE=VSTDT,LIEN=TEST
.I VSTDT=LDATE,TEST>LIEN S LDATE=VSTDT,LIEN=TEST
.S RESULT=$$GET1^DIQ(9002086.1,TEST,.05,"E")
.S CNT=CNT+1
.I $G(TARGET)]"" S @TARGET=RESULT
Q
;
; For this entry point only:
;
; Input:
; TAX = ICD OPERATION/PROCEDURE CODE NUMBER (external) to search for
; (required)
;
; Taxonomies have not been created for this data.
; Variables are still named the same for consistency with other functions.
;
PROCTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
; Procedure Check (using Procedure Code number)
;
N TXIEN,TEST,VISIT,VSTDT,RESULT,PRC
I DFN="" Q
I TAX="" Q
;Not really needed, but set to maintain same variable list as other functions.
S TXIEN=TAX
I TXIEN="" Q
S TEST="",CNT=0,LDATE=$G(LDATE,""),LIEN=$G(LIEN,"")
F S TEST=$O(^AUPNVPRC("AC",DFN,TEST)) Q:TEST="" D
.S PRC=$$GET1^DIQ(9000010.08,TEST,.01,"E")
.I PRC'=TXIEN Q
.S VISIT=$$GET1^DIQ(9000010.08,TEST,.03,"I")
.S VSTDT=$$GET1^DIQ(9000010,VISIT_",",.01,"I")
.I $G(SDATE)'="",(VSTDT<SDATE) Q
.I $G(EDATE)'="",(VSTDT\1>EDATE) Q
.I VSTDT>LDATE S LDATE=VSTDT,LIEN=TEST
.I VSTDT=LDATE,TEST>LIEN S LDATE=VSTDT,LIEN=TEST
.S RESULT=$$GET1^DIQ(9000010.08,TEST,.04,"E")
.S CNT=CNT+1
.I $G(TARGET)]"" S @TARGET=RESULT
Q
;
; For this entry point only:
;
; Input:
; TAX = ICD DIAGNOSIS CODE NUMBER (external) to search for
; (required)
;
; Taxonomies have not been created for this data.
; Variables are still named the same for consistency with other functions.
;
POVTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
; V POV Check (using the POV code)
;
N TXIEN,TEST,VISIT,VSTDT,RESULT,POV
I DFN="" Q
I TAX="" Q
;Not really needed, but set to maintain same variable list as other functions.
S TXIEN=TAX
I TXIEN="" Q
S TEST="",CNT=0,LDATE=$G(LDATE,""),LIEN=$G(LIEN,"")
F S TEST=$O(^AUPNVPOV("AC",DFN,TEST)) Q:TEST="" D
.S POV=$$GET1^DIQ(9000010.07,TEST,.01,"E")
.I POV'=TXIEN Q
.S VISIT=$$GET1^DIQ(9000010.07,TEST,.03,"I")
.S VSTDT=$$GET1^DIQ(9000010,VISIT_",",.01,"I")
.I $G(SDATE)'="",(VSTDT<SDATE) Q
.I $G(EDATE)'="",(VSTDT\1>EDATE) Q
.I VSTDT>LDATE S LDATE=VSTDT,LIEN=TEST
.I VSTDT=LDATE,TEST>LIEN S LDATE=VSTDT,LIEN=TEST
.S RESULT=$$GET1^DIQ(9000010.07,TEST,.04,"E")
.S CNT=CNT+1
.I $G(TARGET)]"" S @TARGET="N/A"_U_RESULT
Q
;
; For this entry point only:
;
; Input:
; TAX = Array of MHSS PROBLEM/DSM IV POV CODES (external) to search for
; (required)
;
; Taxonomies have not been created for this data.
; Variables are still named the same for consistency with other functions.
;
BHPTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
; Behavioral Health Problem/POV Check (using Problem/POV code)
;
N TXIEN,TEST,VCIEN,VCODE,RIEN,DATE,VSTDT,RESULT
I DFN="" Q
I $O(TAX(""))="" Q
; Set up the visit codes
S TXIEN=""
F S TXIEN=$O(TAX(TXIEN)) Q:TXIEN="" D
. S VCIEN=$O(^AMHPROB("B",TXIEN,"")) Q:VCIEN=""
. S VCODE(VCIEN)=TXIEN
;
; Check in the MHSS files
S RIEN="",TEST="",CNT=0,LDATE=$G(LDATE,""),LIEN=$G(LIEN,"")
F S RIEN=$O(^AMHREC("C",DFN,RIEN)) Q:RIEN="" D
. S DATE=$P($G(^AMHREC(RIEN,0)),U,1)
. Q:DATE<SDATE&(SDATE'="")!(DATE>EDATE&(EDATE'=""))
. S TEST=""
. F S TEST=$O(^AMHRPRO("AD",RIEN,TEST),-1) Q:TEST="" D
.. S VCIEN=$P(^AMHRPRO(TEST,0),U,1) Q:VCIEN=""
.. I '$D(VCODE(VCIEN)) Q
.. S RESULT=VCODE(VCIEN)
.. S VSTDT=DATE
.. I DATE>LDATE S LDATE=DATE,LIEN=TEST
.. I DATE=LDATE,TEST>LIEN S LIEN=TEST
.. ;S RESULT="N/A"
.. S CNT=CNT+1
.. I $G(TARGET)]"" S @TARGET="N/A"_U_RESULT
Q
;
; For this entry point only:
;
; Input:
; TAX = Array of MHSS PROBLEM CODES (external) to search for
; (required)
;
; Taxonomies have not been created for this data.
; Variables are still named the same for consistency with other functions.
;
BHPRBTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; EP
; Behavioral Health Problem Check (using Problem code)
;
N TXIEN,TEST,VCIEN,VCODE,RIEN,DATE,VSTDT,RESULT,DTENT,DTONS
I DFN="" Q
I $O(TAX(""))="" Q
; Set up the visit codes
S TXIEN=""
F S TXIEN=$O(TAX(TXIEN)) Q:TXIEN="" D
. S VCIEN=$O(^AMHPROB("B",TXIEN,"")) Q:VCIEN=""
. S VCODE(VCIEN)=TXIEN
;
; Check in the MHSS files
S TEST="",CNT=0,LDATE=$G(LDATE,""),LIEN=$G(LIEN,"")
F S TEST=$O(^AMHPPROB("AC",DFN,TEST)) Q:TEST="" D
. Q:'$D(^AMHPPROB(TEST,0))
. S VCIEN=$P(^AMHPPROB(TEST,0),U,1) Q:VCIEN=""
. I '$D(VCODE(VCIEN)) Q
. S RESULT=VCODE(VCIEN)
. S DTENT=$P($G(^AMHPPROB(TEST,0)),U,8),DTONS=$P($G(^AMHREC(TEST,0)),U,13)
. S DATE=$S(DTONS'="":DTONS,1:DTENT)
. Q:DATE<SDATE&(SDATE'="")!(DATE>EDATE&(EDATE'=""))
. S VSTDT=DATE
. I DATE>LDATE S LDATE=DATE,LIEN=TEST
. I DATE=LDATE,TEST>LIEN S LIEN=TEST
. ;S RESULT="N/A"
. S CNT=CNT+1
. I $G(TARGET)]"" S @TARGET="N/A"_U_RESULT
Q
;
; For this entry point only:
;
; Input:
; TAX = Array of MEASUREMENT TYPES (external) to search for
; (required)
;
; Taxonomies have not been created for this data.
; Variables are still named the same for consistency with other functions.
;
MSRTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
; V MEASUREMENT Check (using the Measurement type)
;
N TXIEN,TEST,VCIEN,VCODE,MSR,CNT,VISIT,VSTDT,RIEN,DATE,RESULT
I DFN="" Q
I $O(TAX(""))="" Q
S TEST="",CNT=0,LDATE=$G(LDATE,""),LIEN=$G(LIEN,"")
F S TEST=$O(^AUPNVMSR("AC",DFN,TEST)) Q:TEST="" D
.S MSR=$$GET1^DIQ(9000010.01,TEST,.01,"E")
.I $P($G(^AUPNVMSR(TEST,2)),"^",1)=1 Q
.Q:MSR="" I '$D(TAX(MSR)) Q
.S VISIT=$$GET1^DIQ(9000010.01,TEST,.03,"I")
.S VSTDT=$$GET1^DIQ(9000010,VISIT_",",.01,"I")
.I $G(SDATE)'="",(VSTDT<SDATE) Q
.I $G(EDATE)'="",(VSTDT\1>EDATE) Q
.I VSTDT>LDATE S LDATE=VSTDT,LIEN=TEST
.I VSTDT=LDATE,TEST>LIEN S LDATE=VSTDT,LIEN=TEST
.S RESULT=$$GET1^DIQ(9000010.01,TEST,.04,"E")
.S CNT=CNT+1
.I $G(TARGET)]"" S @TARGET="N/A"_U_RESULT
Q
BKMIXX2 ;PRXM/HC/BWF - TAXONOMY ACCESS UTILITIES ; 13 Apr 2005 4:53 PM
+1 ;;2.2;HIV MANAGEMENT SYSTEM;;Apr 01, 2015;Build 40
+2 ; Generic Taxonomy Utilities
+3 ; Checks V-Files for patients that meet a Taxonomy's criteria, within
+4 ; a specific date range.
+5 ;
+6 ;**************NOTE***********************
+7 ; Input for all entry points are the same
+8 ;*****************************************
+9 ;
+10 ; Input:
+11 ; DFN = IEN from Patient file (#90000001)
+12 ; (required)
+13 ; TAX = Name of Taxonomy (From Lab Taxonomy ^ATXLAB or ICD Taxonomy ^ATXAX)
+14 ; (required)
+15 ; EDATE = End date of the report. The default is "Today"
+16 ; (optional)
+17 ; SDATE = Start date of the report.
+18 ; (optional)
+19 ; TARGET = Target root (global or local) for collection of data
+20 ; (optional)
+21 ; Example: ^TMP("RTN NAME",$J,"DESC",DFN,VSTDT,VISIT) or TEMP(VSTDT,VISIT)
+22 ; Output:
+23 ; LDATE = Last date found in the selected date range
+24 ; (optional - pass by reference)
+25 ; LIEN = Last IEN found in the selected date range
+26 ; (optional - pass by reference)
+27 ; CNT = Count of number of records found in selected date range
+28 ; (optional - pass by reference)
+29 ;
+30 QUIT
+31 ;
+32 ; For this entry point only:
+33 ;
+34 ; Input:
+35 ; REFILE = FILE# to which the Refusal refers
+36 ; (required)
+37 ;
REFUSAL(DFN,REFILE,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
+1 ;Refusal Taxonomy Check (by File)
+2 ;
+3 NEW TXIEN,TEST,VISIT,VSTDT,RESULT,REFLAG
+4 NEW QFLAG,REFVAL,REFVAL1,REFVAL2,REFILE1,REFTYPE,IENS,EXIST
+5 IF DFN=""
QUIT
+6 IF TAX=""
QUIT
+7 SET TXIEN=$ORDER(^ATXAX("B",TAX,""))
SET REFLAG=1
+8 ;Lab codes can be found in a different Taxonomy global
+9 IF TXIEN=""
IF REFILE=60
SET TXIEN=$ORDER(^ATXLAB("B",TAX,""))
SET REFLAG=0
IF TXIEN=""
QUIT
+10 ;Exam codes do not use a Taxonomy, but the same variables are used.
+11 IF TXIEN=""
IF REFILE=9999999.15
SET TXIEN=$ORDER(^AUTTEXAM("C",TAX,""))
SET REFLAG=2
IF TXIEN=""
QUIT
+12 ;Skin Test codes also do not use a Taxonomy, but the same variables are used.
+13 IF TXIEN=""
IF REFILE=9999999.28
SET TXIEN=$ORDER(^AUTTSK("C",TAX,""))
SET REFLAG=2
IF TXIEN=""
QUIT
+14 ;Most Patient Education Codes do not use a Taxonomy. Some need to be calculated separately.
+15 IF TXIEN=""
IF REFILE'=9999999.09
QUIT
DO BLDTAX1^BKMIXX5(TAX,"TXIEN")
SET REFLAG=3
IF $DATA(TXIEN)=0
QUIT
+16 SET TEST=""
SET CNT=0
SET LDATE=$GET(LDATE,"")
SET LIEN=$GET(LIEN,"")
+17 FOR
SET TEST=$ORDER(^AUPNPREF("AC",DFN,TEST))
IF TEST=""
QUIT
Begin DoDot:1
+18 SET REFVAL=""
SET REFVAL1=""
+19 SET REFILE1=$$GET1^DIQ(9000022,TEST,.05,"I")
+20 ;Skip NULL references as they are checked later.
+21 IF REFILE1]""
IF REFILE1'=REFILE
QUIT
+22 SET REFVAL=$$GET1^DIQ(9000022,TEST,.06,"I")
+23 ;Exam Codes are checked differently because they do not use Taxonomies.
+24 IF REFLAG=2
IF REFVAL'=TXIEN
QUIT
+25 ;^ATXLAB stores the LAB code IEN directly.
+26 IF REFLAG=0
Begin DoDot:2
+27 SET QFLAG=1
+28 IF REFVAL]""
IF $DATA(^ATXLAB(TXIEN,21,"B",REFVAL))
SET QFLAG=0
QUIT
+29 ;Currently LAB/PAP SMEAR tests do not have REFVAL set.
+30 ;Setting this so calling program will know 'some' LAB was refused.
+31 IF REFVAL=""
SET QFLAG=0
QUIT
End DoDot:2
IF QFLAG=1
QUIT
+32 IF REFLAG=1
Begin DoDot:2
+33 ; Quit if REFILE not listed or REFVAL not found.
SET QFLAG=1
+34 ;Radiology and Mammogram
IF REFILE=71
Begin DoDot:3
+35 IF REFVAL]""
SET REFVAL1=$$GET1^DIQ(71,REFVAL,9,"I")
+36 ;I REFVAL1]"" S:$$ICD^BKMIXX5(REFVAL1,TXIEN,1)'=0 QFLAG=0 Q
+37 IF REFVAL1]""
Begin DoDot:4
+38 IF $$PATCH^XPDUTL("ATX*5.1*11")
SET EXIST=$$ICD^ATXAPI(REFVAL1,TXIEN,1)
+39 IF '$TEST
SET EXIST=$$ICD^BKMIXX5(REFVAL1,TXIEN,1)
+40 IF EXIST'=0
SET QFLAG=0
End DoDot:4
End DoDot:3
QUIT
+41 ;Immunizations
IF REFILE=9999999.14
Begin DoDot:3
+42 IF REFVAL]""
SET REFVAL1=$$GET1^DIQ(9999999.14,REFVAL,.03,"E")
+43 IF REFVAL1]""
IF $DATA(^ATXAX(TXIEN,21,"B",REFVAL1))
SET QFLAG=0
QUIT
End DoDot:3
QUIT
+44 ;Exams
IF REFILE=9999999.15
Begin DoDot:3
+45 IF REFVAL]""
SET REFVAL1=$$GET1^DIQ(9999999.15,REFVAL,.01,"E")
+46 IF REFVAL1]""
IF $DATA(^ATXAX(TXIEN,21,"B",REFVAL1))
SET QFLAG=0
QUIT
End DoDot:3
QUIT
+47 ;Patient Education
IF REFILE=9999999.09
Begin DoDot:3
+48 IF REFVAL]""
SET REFVAL1=$$GET1^DIQ(9999999.09,REFVAL,.01,"E")
+49 IF REFVAL1]""
IF REFLAG=1
IF $DATA(^ATXAX(TXIEN,21,"B",REFVAL1))
SET QFLAG=0
QUIT
+50 IF REFVAL1]""
IF REFLAG=3
SET REFVAL2=$$GET1^DIQ(9999999.09,REFVAL,.01,"I")
IF $DATA(TXIEN(REFVAL2))
SET QFLAG=0
QUIT
End DoDot:3
QUIT
+51 ;NDC codes or MED IENS
IF REFILE=50
Begin DoDot:3
+52 ;Use Taxonomy to build a list of DRUG code IENs.
+53 DO BLDTAX^BKMIXX5(TAX,"IENS")
+54 IF REFVAL]""
IF $DATA(IENS(REFVAL))
SET QFLAG=0
QUIT
End DoDot:3
QUIT
+55 ;CPT Codes
IF REFILE=81
Begin DoDot:3
+56 ;Use Taxonomy to build a list of CPTs
+57 DO BLDTAX^BKMIXX5(TAX,"IENS")
+58 IF REFVAL]""
IF $DATA(IENS(REFVAL))
SET QFLAG=0
QUIT
End DoDot:3
QUIT
+59 ;LOINC codes
IF REFILE=60
Begin DoDot:3
+60 ;Use LOINC Taxonomy to build a list of LAB code IENs.
+61 DO BLDTAX^BKMIXX5(TAX,"IENS")
+62 IF REFVAL]""
IF $DATA(IENS(REFVAL))
SET QFLAG=0
QUIT
+63 ;Currently LAB/PAP SMEAR tests do not have REFVAL set.
+64 ;Setting this so calling program will know 'some' LAB was refused.
+65 IF REFVAL=""
SET QFLAG=0
QUIT
End DoDot:3
QUIT
End DoDot:2
IF QFLAG=1
QUIT
+66 ; Not related to Visit File (#9000010)
+67 SET VISIT="N/A"
+68 ; VSTDT is the Date of Patient Refusal
+69 SET VSTDT=$$GET1^DIQ(9000022,TEST,.03,"I")
+70 IF VSTDT=""
SET VSTDT="Unknown"
+71 IF $GET(SDATE)'=""
IF (VSTDT<SDATE)
QUIT
+72 IF $GET(EDATE)'=""
IF (VSTDT\1>EDATE)
QUIT
+73 IF VSTDT>LDATE
SET LDATE=VSTDT
SET LIEN=TEST
+74 IF VSTDT=LDATE
IF TEST>LIEN
SET LDATE=VSTDT
SET LIEN=TEST
+75 SET RESULT=$$GET1^DIQ(9000022,TEST,.07,"E")
+76 IF RESULT=""
SET RESULT="Not Specified"
+77 IF REFVAL=""
SET REFVAL="Not Specified"
+78 SET REFTYPE=$$GET1^DIQ(9000022,TEST,.01,"E")
+79 SET CNT=CNT+1
+80 IF $GET(TARGET)]""
SET @TARGET=RESULT_U_REFTYPE
End DoDot:1
+81 QUIT
+82 ;
+83 ; For this entry point only:
+84 ;
+85 ; Input:
+86 ; TAX = PROVIDER CLASS (external) to search for
+87 ; (required)
+88 ;
+89 ; Taxonomies not available for this type of data.
+90 ; Variables are still named the same for consistency with other functions.
+91 ;
PRVTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
+1 ; Provider Check (using Provider Class)
+2 ;
+3 NEW TXIEN,TEST,VISIT,VSTDT,RESULT,PRV,PRVCLS
+4 IF DFN=""
QUIT
+5 IF TAX=""
QUIT
+6 SET TXIEN=$ORDER(^DIC(7,"D",TAX,""))
+7 IF TXIEN=""
QUIT
+8 SET TEST=""
SET CNT=0
SET LDATE=$GET(LDATE,"")
SET LIEN=$GET(LIEN,"")
+9 FOR
SET TEST=$ORDER(^AUPNVPRV("AC",DFN,TEST))
IF TEST=""
QUIT
Begin DoDot:1
+10 SET PRV=$$GET1^DIQ(9000010.06,TEST,.01,"I")
+11 IF PRV=""
QUIT
+12 SET PRVCLS=$$GET1^DIQ(200,PRV,53.5,"I")
+13 IF PRVCLS'=TXIEN
QUIT
+14 SET VISIT=$$GET1^DIQ(9000010.06,TEST,.03,"I")
+15 SET VSTDT=$$GET1^DIQ(9000010,VISIT_",",.01,"I")
+16 IF $GET(SDATE)'=""
IF (VSTDT<SDATE)
QUIT
+17 IF $GET(EDATE)'=""
IF (VSTDT\1>EDATE)
QUIT
+18 IF VSTDT>LDATE
SET LDATE=VSTDT
SET LIEN=TEST
+19 IF VSTDT=LDATE
IF TEST>LIEN
SET LDATE=VSTDT
SET LIEN=TEST
+20 ;Nothing identified in file as a 'RESULT'. Using "N/A" for now for consistency with other functions.
+21 ;S RESULT=$$GET1^DIQ(9000010.06,TEST,.04,"I")
+22 SET RESULT="N/A"
+23 SET CNT=CNT+1
+24 IF $GET(TARGET)]""
SET @TARGET=RESULT
End DoDot:1
+25 QUIT
+26 ;
+27 ; For this entry point only:
+28 ;
+29 ; Input:
+30 ; TAX = CODE/CLINIC STOP (external) to search for
+31 ; (required)
+32 ;
+33 ; Taxonomies not available for this type of data.
+34 ; Variables are still named the same for consistency with other functions.
+35 ;
CLNTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
+1 ; Clinic Check (using Code/Clinic Stop)
+2 ;
+3 NEW TXIEN,TEST,VISIT,VSTDT,RESULT,CLN,CLNSCD
+4 IF DFN=""
QUIT
+5 IF TAX=""
QUIT
+6 ;Not really needed, but set to maintain same variable list as other functions.
+7 SET TXIEN=TAX
+8 IF TXIEN=""
QUIT
+9 SET TEST=""
SET CNT=0
SET LDATE=$GET(LDATE,"")
SET LIEN=$GET(LIEN,"")
+10 FOR
SET TEST=$ORDER(^AUPNVSIT("AC",DFN,TEST))
IF TEST=""
QUIT
Begin DoDot:1
+11 SET CLN=$$GET1^DIQ(9000010,TEST,.08,"I")
+12 IF CLN=""
QUIT
+13 SET CLNSCD=$$GET1^DIQ(40.7,CLN,1,"E")
+14 IF CLNSCD'=TXIEN
QUIT
+15 SET VISIT=TEST
+16 SET VSTDT=$$GET1^DIQ(9000010,VISIT_",",.01,"I")
+17 IF $GET(SDATE)'=""
IF (VSTDT<SDATE)
QUIT
+18 IF $GET(EDATE)'=""
IF (VSTDT\1>EDATE)
QUIT
+19 IF VSTDT>LDATE
SET LDATE=VSTDT
SET LIEN=TEST
+20 IF VSTDT=LDATE
IF TEST>LIEN
SET LDATE=VSTDT
SET LIEN=TEST
+21 ;Nothing identified in file as a 'RESULT'. Using "N/A" for now for consistency with other functions.
+22 ;S RESULT=$$GET1^DIQ(9000010,TEST,.04,"I")
+23 SET RESULT="N/A"
+24 SET CNT=CNT+1
+25 IF $GET(TARGET)]""
SET @TARGET=RESULT
End DoDot:1
+26 QUIT
+27 ;
+28 ; For this entry point only:
+29 ;
+30 ; Input:
+31 ; TAX = WOMEN'S HEALTH PROCEDURE TYPE (external) to search for
+32 ; (required)
+33 ;
+34 ; Taxonomies not available for this type of data.
+35 ; Variables are still named the same for consistency with other functions.
+36 ;
WHTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
+1 ; Women's Health (using Women's Health Procedure Type)
+2 ;
+3 NEW TXIEN,TEST,VISIT,VSTDT,RESULT,WH
+4 IF DFN=""
QUIT
+5 IF TAX=""
QUIT
+6 SET TXIEN=$ORDER(^BWPN("B",TAX,""))
+7 IF TXIEN=""
QUIT
+8 SET TEST=""
SET CNT=0
SET LDATE=$GET(LDATE,"")
SET LIEN=$GET(LIEN,"")
+9 FOR
SET TEST=$ORDER(^BWPCD("C",DFN,TEST))
IF TEST=""
QUIT
Begin DoDot:1
+10 SET WH=$$GET1^DIQ(9002086.1,TEST,.04,"I")
+11 IF WH=""
QUIT
+12 IF WH'=TXIEN
QUIT
+13 SET VISIT=TEST
+14 ; Using 'Date of Procedure' as 'Visit Date'
+15 SET VSTDT=$$GET1^DIQ(9002086.1,VISIT_",",.12,"I")
+16 IF $GET(SDATE)'=""
IF (VSTDT<SDATE)
QUIT
+17 IF $GET(EDATE)'=""
IF (VSTDT\1>EDATE)
QUIT
+18 IF VSTDT>LDATE
SET LDATE=VSTDT
SET LIEN=TEST
+19 IF VSTDT=LDATE
IF TEST>LIEN
SET LDATE=VSTDT
SET LIEN=TEST
+20 SET RESULT=$$GET1^DIQ(9002086.1,TEST,.05,"E")
+21 SET CNT=CNT+1
+22 IF $GET(TARGET)]""
SET @TARGET=RESULT
End DoDot:1
+23 QUIT
+24 ;
+25 ; For this entry point only:
+26 ;
+27 ; Input:
+28 ; TAX = ICD OPERATION/PROCEDURE CODE NUMBER (external) to search for
+29 ; (required)
+30 ;
+31 ; Taxonomies have not been created for this data.
+32 ; Variables are still named the same for consistency with other functions.
+33 ;
PROCTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
+1 ; Procedure Check (using Procedure Code number)
+2 ;
+3 NEW TXIEN,TEST,VISIT,VSTDT,RESULT,PRC
+4 IF DFN=""
QUIT
+5 IF TAX=""
QUIT
+6 ;Not really needed, but set to maintain same variable list as other functions.
+7 SET TXIEN=TAX
+8 IF TXIEN=""
QUIT
+9 SET TEST=""
SET CNT=0
SET LDATE=$GET(LDATE,"")
SET LIEN=$GET(LIEN,"")
+10 FOR
SET TEST=$ORDER(^AUPNVPRC("AC",DFN,TEST))
IF TEST=""
QUIT
Begin DoDot:1
+11 SET PRC=$$GET1^DIQ(9000010.08,TEST,.01,"E")
+12 IF PRC'=TXIEN
QUIT
+13 SET VISIT=$$GET1^DIQ(9000010.08,TEST,.03,"I")
+14 SET VSTDT=$$GET1^DIQ(9000010,VISIT_",",.01,"I")
+15 IF $GET(SDATE)'=""
IF (VSTDT<SDATE)
QUIT
+16 IF $GET(EDATE)'=""
IF (VSTDT\1>EDATE)
QUIT
+17 IF VSTDT>LDATE
SET LDATE=VSTDT
SET LIEN=TEST
+18 IF VSTDT=LDATE
IF TEST>LIEN
SET LDATE=VSTDT
SET LIEN=TEST
+19 SET RESULT=$$GET1^DIQ(9000010.08,TEST,.04,"E")
+20 SET CNT=CNT+1
+21 IF $GET(TARGET)]""
SET @TARGET=RESULT
End DoDot:1
+22 QUIT
+23 ;
+24 ; For this entry point only:
+25 ;
+26 ; Input:
+27 ; TAX = ICD DIAGNOSIS CODE NUMBER (external) to search for
+28 ; (required)
+29 ;
+30 ; Taxonomies have not been created for this data.
+31 ; Variables are still named the same for consistency with other functions.
+32 ;
POVTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
+1 ; V POV Check (using the POV code)
+2 ;
+3 NEW TXIEN,TEST,VISIT,VSTDT,RESULT,POV
+4 IF DFN=""
QUIT
+5 IF TAX=""
QUIT
+6 ;Not really needed, but set to maintain same variable list as other functions.
+7 SET TXIEN=TAX
+8 IF TXIEN=""
QUIT
+9 SET TEST=""
SET CNT=0
SET LDATE=$GET(LDATE,"")
SET LIEN=$GET(LIEN,"")
+10 FOR
SET TEST=$ORDER(^AUPNVPOV("AC",DFN,TEST))
IF TEST=""
QUIT
Begin DoDot:1
+11 SET POV=$$GET1^DIQ(9000010.07,TEST,.01,"E")
+12 IF POV'=TXIEN
QUIT
+13 SET VISIT=$$GET1^DIQ(9000010.07,TEST,.03,"I")
+14 SET VSTDT=$$GET1^DIQ(9000010,VISIT_",",.01,"I")
+15 IF $GET(SDATE)'=""
IF (VSTDT<SDATE)
QUIT
+16 IF $GET(EDATE)'=""
IF (VSTDT\1>EDATE)
QUIT
+17 IF VSTDT>LDATE
SET LDATE=VSTDT
SET LIEN=TEST
+18 IF VSTDT=LDATE
IF TEST>LIEN
SET LDATE=VSTDT
SET LIEN=TEST
+19 SET RESULT=$$GET1^DIQ(9000010.07,TEST,.04,"E")
+20 SET CNT=CNT+1
+21 IF $GET(TARGET)]""
SET @TARGET="N/A"_U_RESULT
End DoDot:1
+22 QUIT
+23 ;
+24 ; For this entry point only:
+25 ;
+26 ; Input:
+27 ; TAX = Array of MHSS PROBLEM/DSM IV POV CODES (external) to search for
+28 ; (required)
+29 ;
+30 ; Taxonomies have not been created for this data.
+31 ; Variables are still named the same for consistency with other functions.
+32 ;
BHPTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
+1 ; Behavioral Health Problem/POV Check (using Problem/POV code)
+2 ;
+3 NEW TXIEN,TEST,VCIEN,VCODE,RIEN,DATE,VSTDT,RESULT
+4 IF DFN=""
QUIT
+5 IF $ORDER(TAX(""))=""
QUIT
+6 ; Set up the visit codes
+7 SET TXIEN=""
+8 FOR
SET TXIEN=$ORDER(TAX(TXIEN))
IF TXIEN=""
QUIT
Begin DoDot:1
+9 SET VCIEN=$ORDER(^AMHPROB("B",TXIEN,""))
IF VCIEN=""
QUIT
+10 SET VCODE(VCIEN)=TXIEN
End DoDot:1
+11 ;
+12 ; Check in the MHSS files
+13 SET RIEN=""
SET TEST=""
SET CNT=0
SET LDATE=$GET(LDATE,"")
SET LIEN=$GET(LIEN,"")
+14 FOR
SET RIEN=$ORDER(^AMHREC("C",DFN,RIEN))
IF RIEN=""
QUIT
Begin DoDot:1
+15 SET DATE=$PIECE($GET(^AMHREC(RIEN,0)),U,1)
+16 IF DATE<SDATE&(SDATE'="")!(DATE>EDATE&(EDATE'=""))
QUIT
+17 SET TEST=""
+18 FOR
SET TEST=$ORDER(^AMHRPRO("AD",RIEN,TEST),-1)
IF TEST=""
QUIT
Begin DoDot:2
+19 SET VCIEN=$PIECE(^AMHRPRO(TEST,0),U,1)
IF VCIEN=""
QUIT
+20 IF '$DATA(VCODE(VCIEN))
QUIT
+21 SET RESULT=VCODE(VCIEN)
+22 SET VSTDT=DATE
+23 IF DATE>LDATE
SET LDATE=DATE
SET LIEN=TEST
+24 IF DATE=LDATE
IF TEST>LIEN
SET LIEN=TEST
+25 ;S RESULT="N/A"
+26 SET CNT=CNT+1
+27 IF $GET(TARGET)]""
SET @TARGET="N/A"_U_RESULT
End DoDot:2
End DoDot:1
+28 QUIT
+29 ;
+30 ; For this entry point only:
+31 ;
+32 ; Input:
+33 ; TAX = Array of MHSS PROBLEM CODES (external) to search for
+34 ; (required)
+35 ;
+36 ; Taxonomies have not been created for this data.
+37 ; Variables are still named the same for consistency with other functions.
+38 ;
BHPRBTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; EP
+1 ; Behavioral Health Problem Check (using Problem code)
+2 ;
+3 NEW TXIEN,TEST,VCIEN,VCODE,RIEN,DATE,VSTDT,RESULT,DTENT,DTONS
+4 IF DFN=""
QUIT
+5 IF $ORDER(TAX(""))=""
QUIT
+6 ; Set up the visit codes
+7 SET TXIEN=""
+8 FOR
SET TXIEN=$ORDER(TAX(TXIEN))
IF TXIEN=""
QUIT
Begin DoDot:1
+9 SET VCIEN=$ORDER(^AMHPROB("B",TXIEN,""))
IF VCIEN=""
QUIT
+10 SET VCODE(VCIEN)=TXIEN
End DoDot:1
+11 ;
+12 ; Check in the MHSS files
+13 SET TEST=""
SET CNT=0
SET LDATE=$GET(LDATE,"")
SET LIEN=$GET(LIEN,"")
+14 FOR
SET TEST=$ORDER(^AMHPPROB("AC",DFN,TEST))
IF TEST=""
QUIT
Begin DoDot:1
+15 IF '$DATA(^AMHPPROB(TEST,0))
QUIT
+16 SET VCIEN=$PIECE(^AMHPPROB(TEST,0),U,1)
IF VCIEN=""
QUIT
+17 IF '$DATA(VCODE(VCIEN))
QUIT
+18 SET RESULT=VCODE(VCIEN)
+19 SET DTENT=$PIECE($GET(^AMHPPROB(TEST,0)),U,8)
SET DTONS=$PIECE($GET(^AMHREC(TEST,0)),U,13)
+20 SET DATE=$SELECT(DTONS'="":DTONS,1:DTENT)
+21 IF DATE<SDATE&(SDATE'="")!(DATE>EDATE&(EDATE'=""))
QUIT
+22 SET VSTDT=DATE
+23 IF DATE>LDATE
SET LDATE=DATE
SET LIEN=TEST
+24 IF DATE=LDATE
IF TEST>LIEN
SET LIEN=TEST
+25 ;S RESULT="N/A"
+26 SET CNT=CNT+1
+27 IF $GET(TARGET)]""
SET @TARGET="N/A"_U_RESULT
End DoDot:1
+28 QUIT
+29 ;
+30 ; For this entry point only:
+31 ;
+32 ; Input:
+33 ; TAX = Array of MEASUREMENT TYPES (external) to search for
+34 ; (required)
+35 ;
+36 ; Taxonomies have not been created for this data.
+37 ; Variables are still named the same for consistency with other functions.
+38 ;
MSRTAX(DFN,TAX,EDATE,SDATE,TARGET,LDATE,LIEN,CNT) ; PEP
+1 ; V MEASUREMENT Check (using the Measurement type)
+2 ;
+3 NEW TXIEN,TEST,VCIEN,VCODE,MSR,CNT,VISIT,VSTDT,RIEN,DATE,RESULT
+4 IF DFN=""
QUIT
+5 IF $ORDER(TAX(""))=""
QUIT
+6 SET TEST=""
SET CNT=0
SET LDATE=$GET(LDATE,"")
SET LIEN=$GET(LIEN,"")
+7 FOR
SET TEST=$ORDER(^AUPNVMSR("AC",DFN,TEST))
IF TEST=""
QUIT
Begin DoDot:1
+8 SET MSR=$$GET1^DIQ(9000010.01,TEST,.01,"E")
+9 IF $PIECE($GET(^AUPNVMSR(TEST,2)),"^",1)=1
QUIT
+10 IF MSR=""
QUIT
IF '$DATA(TAX(MSR))
QUIT
+11 SET VISIT=$$GET1^DIQ(9000010.01,TEST,.03,"I")
+12 SET VSTDT=$$GET1^DIQ(9000010,VISIT_",",.01,"I")
+13 IF $GET(SDATE)'=""
IF (VSTDT<SDATE)
QUIT
+14 IF $GET(EDATE)'=""
IF (VSTDT\1>EDATE)
QUIT
+15 IF VSTDT>LDATE
SET LDATE=VSTDT
SET LIEN=TEST
+16 IF VSTDT=LDATE
IF TEST>LIEN
SET LDATE=VSTDT
SET LIEN=TEST
+17 SET RESULT=$$GET1^DIQ(9000010.01,TEST,.04,"E")
+18 SET CNT=CNT+1
+19 IF $GET(TARGET)]""
SET @TARGET="N/A"_U_RESULT
End DoDot:1
+20 QUIT