Index: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOZ0E.m
===================================================================
--- WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOZ0E.m	(revision 613)
+++ WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOZ0E.m	(revision 623)
@@ -1,177 +1,214 @@
-OCXOZ0E	;SLC/RJS,CLA - Order Check Scan ;NOV 8,2009 at 18:44
-	;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,221,243**;Dec 17,1997;Build 242
-	;;  ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
-	;
-	; ***************************************************************
-	; ** Warning: This routine is automatically generated by the   **
-	; ** Rule Compiler (^OCXOCMP) and ANY changes to this routine  **
-	; ** will be lost the next time the rule compiler executes.    **
-	; ***************************************************************
-	;
-	Q
-	;
-CHK403	; Look through the current environment for valid Event/Elements for this patient.
-	;  Called from CHK398+14^OCXOZ0D.
-	;
-	Q:$G(OCXOERR)
-	;
-	;    Local CHK403 Variables
-	; OCXDF(142) --> Data Field: CHLORPROPAMIDE TEXT (FREE TEXT)
-	; OCXDF(144) --> Data Field: DIPYRIDAMOLE TEXT (FREE TEXT)
-	;
-	;      Local Extrinsic Functions
-	; FILE(DFN,122, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: AMITRIPTYLINE ORDER)
-	; MSGTEXT( ---------> MESSAGE TEXT
-	;
-	S OCXDF(142)=$$MSGTEXT("CHLORPROPAMIDE"),OCXDF(144)=$$MSGTEXT("DIPYRIDAMOLE"),OCXOERR=$$FILE(DFN,122,"62,141,142,144") Q:OCXOERR 
-	Q
-	;
-CHK410	; Look through the current environment for valid Event/Elements for this patient.
-	;  Called from CHK398+15^OCXOZ0D.
-	;
-	Q:$G(OCXOERR)
-	;
-	;    Local CHK410 Variables
-	; OCXDF(142) --> Data Field: CHLORPROPAMIDE TEXT (FREE TEXT)
-	; OCXDF(144) --> Data Field: DIPYRIDAMOLE TEXT (FREE TEXT)
-	;
-	;      Local Extrinsic Functions
-	; FILE(DFN,123, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: CHLORPROPAMIDE ORDER)
-	; MSGTEXT( ---------> MESSAGE TEXT
-	;
-	S OCXDF(142)=$$MSGTEXT("CHLORPROPAMIDE"),OCXDF(144)=$$MSGTEXT("DIPYRIDAMOLE"),OCXOERR=$$FILE(DFN,123,"62,141,142,144") Q:OCXOERR 
-	Q
-	;
-CHK417	; Look through the current environment for valid Event/Elements for this patient.
-	;  Called from CHK398+16^OCXOZ0D.
-	;
-	Q:$G(OCXOERR)
-	;
-	;    Local CHK417 Variables
-	; OCXDF(142) --> Data Field: CHLORPROPAMIDE TEXT (FREE TEXT)
-	; OCXDF(144) --> Data Field: DIPYRIDAMOLE TEXT (FREE TEXT)
-	;
-	;      Local Extrinsic Functions
-	; FILE(DFN,124, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: DIPYRIDAMOLE ORDER)
-	; MSGTEXT( ---------> MESSAGE TEXT
-	;
-	S OCXDF(142)=$$MSGTEXT("CHLORPROPAMIDE"),OCXDF(144)=$$MSGTEXT("DIPYRIDAMOLE"),OCXOERR=$$FILE(DFN,124,"62,141,142,144") Q:OCXOERR 
-	Q
-	;
-CHK426	; Look through the current environment for valid Event/Elements for this patient.
-	;  Called from CHK164+16^OCXOZ08.
-	;
-	Q:$G(OCXOERR)
-	;
-	;    Local CHK426 Variables
-	; OCXDF(62) ---> Data Field: PATIENT AGE (NUMERIC)
-	; OCXDF(141) --> Data Field: AMITRIPTYLINE TEXT (FREE TEXT)
-	; OCXDF(142) --> Data Field: CHLORPROPAMIDE TEXT (FREE TEXT)
-	; OCXDF(144) --> Data Field: DIPYRIDAMOLE TEXT (FREE TEXT)
-	;
-	;      Local Extrinsic Functions
-	; MSGTEXT( ---------> MESSAGE TEXT
-	;
-	I (OCXDF(62)>64) S OCXDF(141)=$$MSGTEXT("AMITRIPTYLINE"),OCXDF(142)=$$MSGTEXT("CHLORPROPAMIDE"),OCXDF(144)=$$MSGTEXT("DIPYRIDAMOLE") D CHK430
-	Q
-	;
-CHK430	; Look through the current environment for valid Event/Elements for this patient.
-	;  Called from CHK426+14.
-	;
-	Q:$G(OCXOERR)
-	;
-	;      Local Extrinsic Functions
-	; FILE(DFN,125, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: MED ORDER FOR PT > 64)
-	;
-	S OCXOERR=$$FILE(DFN,125,"62,141,142,144") Q:OCXOERR 
-	Q
-	;
-CHK436	; Look through the current environment for valid Event/Elements for this patient.
-	;  Called from CHK1+33^OCXOZ02.
-	;
-	Q:$G(OCXOERR)
-	;
-	;    Local CHK436 Variables
-	; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
-	; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
-	; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
-	; OCXDF(146) --> Data Field: INPT/OUTPT (FREE TEXT)
-	; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
-	;
-	;      Local Extrinsic Functions
-	; FILE(DFN,127, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: INPATIENT)
-	; FILE(DFN,128, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: OUTPATIENT)
-	; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
-	; PATLOC( ----------> PATIENT LOCATION
-	;
-	I (OCXDF(146)="I"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXDF(147)=$P($$PATLOC(OCXDF(37)),"^",2),OCXOERR=$$FILE(DFN,127,"9,96,147") Q:OCXOERR 
-	I (OCXDF(146)="O"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXDF(147)=$P($$PATLOC(OCXDF(37)),"^",2),OCXOERR=$$FILE(DFN,128,"9,96,147") Q:OCXOERR 
-	Q
-	;
-FILE(DFN,OCXELE,OCXDFL)	;     This Local Extrinsic Function logs a validated event/element.
-	;
-	N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
-	S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
-	;
-	Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
-	;
-	S OCXDATA(DFN,OCXELE)=1
-	F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
-	.S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
-	;
-	M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
-	;
-	Q 0
-	;
-MSGTEXT(ID)	   ;  Compiler Function: MESSAGE TEXT
-	;
-	N MSG
-	S MSG=""
-	;
-	I ID="AMITRIPTYLINE" D
-	.S MSG="Amitriptyline can cause cognitive impairment and loss of"
-	.S MSG=MSG_" balance in older patients. Consider other antidepressant"
-	.S MSG=MSG_" medications on formulary."
-	;
-	I ID="CHLORPROPAMIDE" D
-	.S MSG="Older patients may experience hypoglycemia with"
-	.S MSG=MSG_" Chlorpropamide due to its long duration and variable"
-	.S MSG=MSG_" renal secretion. They may also be at increased risk for"
-	.S MSG=MSG_" Chlorpropamide-induced SIADH."
-	;
-	I ID="DIPYRIDAMOLE" D
-	.S MSG="Older patients can experience adverse reactions at high doses"
-	.S MSG=MSG_" of Dipyridamole (e.g., headache, dizziness, syncope, GI"
-	.S MSG=MSG_" intolerance.) There is also questionable efficacy at"
-	.S MSG=MSG_" lower doses."
-	;
-	I ID="CLOZWBC30_35" D
-	.S MSG="WBC between 3.0 and 3.5 with no ANC - pharmacy cannot fill"
-	.S MSG=MSG_" clozapine order. Please order CBC/Diff with WBC and ANC"
-	.S MSG=MSG_" immediately."
-	;
-	Q MSG
-	;
-ORDITEM(OIEN)	;  Compiler Function: GET ORDERABLE ITEM FROM ORDER NUMBER
-	Q:'$G(OIEN) ""
-	;
-	N OITXT,X S OITXT=$$OI^ORQOR2(OIEN) Q:'OITXT "No orderable item found."
-	S X=$G(^ORD(101.43,+OITXT,0)) Q:'$L(X) "No orderable item found."
-	Q $P(X,U,1)
-	;
-PATLOC(DFN)	;  Compiler Function: PATIENT LOCATION
-	;
-	N OCXP1,OCXP2
-	S OCXP1=$G(^TMP("OCXSWAP",$J,"OCXODATA","PV1",2))
-	S OCXP2=$P($G(^TMP("OCXSWAP",$J,"OCXODATA","PV1",3)),"^",1)
-	I OCXP2 D
-	.S OCXP2=$P($G(^SC(+OCXP2,0)),"^",1,2)
-	.I $L($P(OCXP2,"^",2)) S OCXP2=$P(OCXP2,"^",2)
-	.E  S OCXP2=$P(OCXP2,"^",1)
-	.S:'$L(OCXP2) OCXP2="NO LOC"
-	I $L(OCXP1),$L(OCXP2) Q OCXP1_"^"_OCXP2
-	;
-	S OCXP2=$G(^DPT(+$G(DFN),.1))
-	I $L(OCXP2) Q "I^"_OCXP2
-	Q "O^OUTPT"
-	;
+OCXOZ0E ;SLC/RJS,CLA - Order Check Scan ;DEC 27,2007 at 06:00
+ ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,221**;Dec 17,1997
+ ;;  ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+ ;
+ ; ***************************************************************
+ ; ** Warning: This routine is automatically generated by the   **
+ ; ** Rule Compiler (^OCXOCMP) and ANY changes to this routine  **
+ ; ** will be lost the next time the rule compiler executes.    **
+ ; ***************************************************************
+ ;
+ Q
+ ;
+CHK400 ; Look through the current environment for valid Event/Elements for this patient.
+ ;  Called from CHK383+15^OCXOZ0D.
+ ;
+ Q:$G(OCXOERR)
+ ;
+ ;    Local CHK400 Variables
+ ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+ ; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
+ ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
+ ; OCXDF(145) --> Data Field: CLOZAPINE WBC 3.0-3.5 TEXT (FREE TEXT)
+ ;
+ ;      Local Extrinsic Functions
+ ; FILE(DFN,121, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: CLOZAPINE WBC >= 3.5)
+ ; MSGTEXT( ---------> MESSAGE TEXT
+ ;
+ S OCXDF(130)=$P($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4),OCXDF(145)=$$MSGTEXT("CLOZWBC30_35"),OCXOERR=$$FILE(DFN,121,"130,145") Q:OCXOERR 
+ Q
+ ;
+CHK406 ; Look through the current environment for valid Event/Elements for this patient.
+ ;  Called from CHK58+21^OCXOZ05.
+ ;
+ Q:$G(OCXOERR)
+ ;
+ ;    Local CHK406 Variables
+ ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+ ; OCXDF(62) ---> Data Field: PATIENT AGE (NUMERIC)
+ ; OCXDF(141) --> Data Field: AMITRIPTYLINE TEXT (FREE TEXT)
+ ; OCXDF(143) --> Data Field: DANGEROUS MEDS FOR PT > 64 NAME (FREE TEXT)
+ ;
+ ;      Local Extrinsic Functions
+ ; MSGTEXT( ---------> MESSAGE TEXT
+ ;
+ I (OCXDF(143)["AMITRIPTYLINE") S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXDF(62)=$$AGE^ORQPTQ4(OCXDF(37)),OCXDF(141)=$$MSGTEXT("AMITRIPTYLINE") D CHK411
+ I (OCXDF(143)["CHLORPROPAMIDE") S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXDF(62)=$$AGE^ORQPTQ4(OCXDF(37)),OCXDF(141)=$$MSGTEXT("AMITRIPTYLINE") D CHK418
+ I (OCXDF(143)["DIPYRIDAMOLE") S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXDF(62)=$$AGE^ORQPTQ4(OCXDF(37)),OCXDF(141)=$$MSGTEXT("AMITRIPTYLINE") D CHK425
+ Q
+ ;
+CHK411 ; Look through the current environment for valid Event/Elements for this patient.
+ ;  Called from CHK406+14.
+ ;
+ Q:$G(OCXOERR)
+ ;
+ ;    Local CHK411 Variables
+ ; OCXDF(142) --> Data Field: CHLORPROPAMIDE TEXT (FREE TEXT)
+ ; OCXDF(144) --> Data Field: DIPYRIDAMOLE TEXT (FREE TEXT)
+ ;
+ ;      Local Extrinsic Functions
+ ; FILE(DFN,122, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: AMITRIPTYLINE ORDER)
+ ; MSGTEXT( ---------> MESSAGE TEXT
+ ;
+ S OCXDF(142)=$$MSGTEXT("CHLORPROPAMIDE"),OCXDF(144)=$$MSGTEXT("DIPYRIDAMOLE"),OCXOERR=$$FILE(DFN,122,"62,141,142,144") Q:OCXOERR 
+ Q
+ ;
+CHK418 ; Look through the current environment for valid Event/Elements for this patient.
+ ;  Called from CHK406+15.
+ ;
+ Q:$G(OCXOERR)
+ ;
+ ;    Local CHK418 Variables
+ ; OCXDF(142) --> Data Field: CHLORPROPAMIDE TEXT (FREE TEXT)
+ ; OCXDF(144) --> Data Field: DIPYRIDAMOLE TEXT (FREE TEXT)
+ ;
+ ;      Local Extrinsic Functions
+ ; FILE(DFN,123, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: CHLORPROPAMIDE ORDER)
+ ; MSGTEXT( ---------> MESSAGE TEXT
+ ;
+ S OCXDF(142)=$$MSGTEXT("CHLORPROPAMIDE"),OCXDF(144)=$$MSGTEXT("DIPYRIDAMOLE"),OCXOERR=$$FILE(DFN,123,"62,141,142,144") Q:OCXOERR 
+ Q
+ ;
+CHK425 ; Look through the current environment for valid Event/Elements for this patient.
+ ;  Called from CHK406+16.
+ ;
+ Q:$G(OCXOERR)
+ ;
+ ;    Local CHK425 Variables
+ ; OCXDF(142) --> Data Field: CHLORPROPAMIDE TEXT (FREE TEXT)
+ ; OCXDF(144) --> Data Field: DIPYRIDAMOLE TEXT (FREE TEXT)
+ ;
+ ;      Local Extrinsic Functions
+ ; FILE(DFN,124, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: DIPYRIDAMOLE ORDER)
+ ; MSGTEXT( ---------> MESSAGE TEXT
+ ;
+ S OCXDF(142)=$$MSGTEXT("CHLORPROPAMIDE"),OCXDF(144)=$$MSGTEXT("DIPYRIDAMOLE"),OCXOERR=$$FILE(DFN,124,"62,141,142,144") Q:OCXOERR 
+ Q
+ ;
+CHK434 ; Look through the current environment for valid Event/Elements for this patient.
+ ;  Called from CHK164+16^OCXOZ08.
+ ;
+ Q:$G(OCXOERR)
+ ;
+ ;    Local CHK434 Variables
+ ; OCXDF(62) ---> Data Field: PATIENT AGE (NUMERIC)
+ ; OCXDF(141) --> Data Field: AMITRIPTYLINE TEXT (FREE TEXT)
+ ; OCXDF(142) --> Data Field: CHLORPROPAMIDE TEXT (FREE TEXT)
+ ; OCXDF(144) --> Data Field: DIPYRIDAMOLE TEXT (FREE TEXT)
+ ;
+ ;      Local Extrinsic Functions
+ ; MSGTEXT( ---------> MESSAGE TEXT
+ ;
+ I (OCXDF(62)>64) S OCXDF(141)=$$MSGTEXT("AMITRIPTYLINE"),OCXDF(142)=$$MSGTEXT("CHLORPROPAMIDE"),OCXDF(144)=$$MSGTEXT("DIPYRIDAMOLE") D CHK438
+ Q
+ ;
+CHK438 ; Look through the current environment for valid Event/Elements for this patient.
+ ;  Called from CHK434+14.
+ ;
+ Q:$G(OCXOERR)
+ ;
+ ;      Local Extrinsic Functions
+ ; FILE(DFN,125, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: MED ORDER FOR PT > 64)
+ ;
+ S OCXOERR=$$FILE(DFN,125,"62,141,142,144") Q:OCXOERR 
+ Q
+ ;
+CHK444 ; Look through the current environment for valid Event/Elements for this patient.
+ ;  Called from CHK1+33^OCXOZ02.
+ ;
+ Q:$G(OCXOERR)
+ ;
+ ;    Local CHK444 Variables
+ ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
+ ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+ ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
+ ; OCXDF(146) --> Data Field: INPT/OUTPT (FREE TEXT)
+ ; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
+ ;
+ ;      Local Extrinsic Functions
+ ; FILE(DFN,127, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: INPATIENT)
+ ; FILE(DFN,128, ----> FILE DATA IN PATIENT ACTIVE DATA FILE  (Event/Element: OUTPATIENT)
+ ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
+ ; PATLOC( ----------> PATIENT LOCATION
+ ;
+ I (OCXDF(146)="I"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXDF(147)=$P($$PATLOC(OCXDF(37)),"^",2),OCXOERR=$$FILE(DFN,127,"9,96,147") Q:OCXOERR 
+ I (OCXDF(146)="O"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXDF(147)=$P($$PATLOC(OCXDF(37)),"^",2),OCXOERR=$$FILE(DFN,128,"9,96,147") Q:OCXOERR 
+ Q
+ ;
+FILE(DFN,OCXELE,OCXDFL) ;     This Local Extrinsic Function logs a validated event/element.
+ ;
+ N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
+ S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
+ ;
+ Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
+ ;
+ S OCXDATA(DFN,OCXELE)=1
+ F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
+ .S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
+ ;
+ M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
+ ;
+ Q 0
+ ;
+MSGTEXT(ID)    ;  Compiler Function: MESSAGE TEXT
+ ;
+ N MSG
+ S MSG=""
+ ;
+ I ID="AMITRIPTYLINE" D
+ .S MSG="Amitriptyline can cause cognitive impairment and loss of"
+ .S MSG=MSG_" balance in older patients. Consider other antidepressant"
+ .S MSG=MSG_" medications on formulary."
+ ;
+ I ID="CHLORPROPAMIDE" D
+ .S MSG="Older patients may experience hypoglycemia with"
+ .S MSG=MSG_" Chlorpropamide due to its long duration and variable"
+ .S MSG=MSG_" renal secretion. They may also be at increased risk for"
+ .S MSG=MSG_" Chlorpropamide-induced SIADH."
+ ;
+ I ID="DIPYRIDAMOLE" D
+ .S MSG="Older patients can experience adverse reactions at high doses"
+ .S MSG=MSG_" of Dipyridamole (e.g., headache, dizziness, syncope, GI"
+ .S MSG=MSG_" intolerance.) There is also questionable efficacy at"
+ .S MSG=MSG_" lower doses."
+ ;
+ I ID="CLOZWBC30_35" D
+ .S MSG="WBC between 3.0 and 3.5 with no ANC - pharmacy cannot fill"
+ .S MSG=MSG_" clozapine order. Please order CBC/Diff with WBC and ANC"
+ .S MSG=MSG_" immediately."
+ ;
+ Q MSG
+ ;
+ORDITEM(OIEN) ;  Compiler Function: GET ORDERABLE ITEM FROM ORDER NUMBER
+ Q:'$G(OIEN) ""
+ ;
+ N OITXT,X S OITXT=$$OI^ORQOR2(OIEN) Q:'OITXT "No orderable item found."
+ S X=$G(^ORD(101.43,+OITXT,0)) Q:'$L(X) "No orderable item found."
+ Q $P(X,U,1)
+ ;
+PATLOC(DFN) ;  Compiler Function: PATIENT LOCATION
+ ;
+ N OCXP1,OCXP2
+ S OCXP1=$G(^TMP("OCXSWAP",$J,"OCXODATA","PV1",2))
+ S OCXP2=$P($G(^TMP("OCXSWAP",$J,"OCXODATA","PV1",3)),"^",1)
+ I OCXP2 D
+ .S OCXP2=$P($G(^SC(+OCXP2,0)),"^",1,2)
+ .I $L($P(OCXP2,"^",2)) S OCXP2=$P(OCXP2,"^",2)
+ .E  S OCXP2=$P(OCXP2,"^",1)
+ .S:'$L(OCXP2) OCXP2="NO LOC"
+ I $L(OCXP1),$L(OCXP2) Q OCXP1_"^"_OCXP2
+ ;
+ S OCXP2=$G(^DPT(+$G(DFN),.1))
+ I $L(OCXP2) Q "I^"_OCXP2
+ Q "O^OUTPT"
+ ;
