Index: ccr/branches/ohum/p/C0CMED3.m
===================================================================
--- ccr/branches/ohum/p/C0CMED3.m	(revision 1291)
+++ ccr/branches/ohum/p/C0CMED3.m	(revision 1325)
@@ -1,4 +1,4 @@
 C0CMED3 ; WV/CCDCCR/SMH - Meds: Non-VA/Outside Meds for Vista
- ;;1.0;C0C;;May 19, 2009;Build 38
+ ;;1.0;C0C;;May 19, 2009;Build 39
  ;;Last Modified: Sun Jan 11 05:45:03 UTC 2009
  ; Copyright 2009 WorldVistA.  Licensed under the terms of the GNU
@@ -71,5 +71,5 @@
  . S @MAP@("MEDTYPETEXT")="Medication"
  . S @MAP@("MEDDETAILUNADORNED")=""  ; Leave blank, field has its uses
- . S @MAP@("MEDSTATUSTEXT")="Active" ; nearest status for pending meds
+ . S @MAP@("MEDSTATUSTEXT")="ACTIVE" ; nearest status for pending meds
  . S @MAP@("MEDSOURCEACTORID")="ACTORPROVIDER_"_MED(12,"I")
  . S @MAP@("MEDPRODUCTNAMETEXT")=MED(.01,"E")
@@ -114,23 +114,5 @@
  . . ; To protect against failure, I will put an if/else block
  . . N VUID,RXNIEN,RXNORM,SRCIEN,RXNNAME,RXNVER
- . . ; 
- . . ; begin changes for systems that have eRx installed
- . . ; RxNorm is found in the ^C0P("RXN") global - gpl
- . . ;
- . . N ZC,ZCD,ZCDS,ZCDSV ; CODE,CODE SYSTEM,CODE VERSION
- . . S (ZC,ZCD,ZCDS,ZCDSV)="" ; INITIALIZE
- . . S (RXNORM,RXNNAME,RXNVER)="" ;INITIALIZE
- . . I NDFIEN,$D(^C0P("RXN")) D  ; 
- . . . S VUID=$$GET1^DIQ(50.68,VAPROD,99.99)
- . . . S ZC=$$CODE^C0CUTIL(VUID)
- . . . S ZCD=$P(ZC,"^",1) ; CODE TO USE
- . . . S ZCDS=$P(ZC,"^",2) ; CODING SYSTEM - RXNORM OR VUID
- . . . S ZCDSV=$P(ZC,"^",3) ; CODING SYSTEM VERSION
- . . . S RXNORM=ZCD ; THE CODE
- . . . S RXNNAME=ZCDS ; THE CODING SYSTEM
- . . . S RXNVER=ZCDSV ; THE CODING SYSTEM VERSION
- . . . N ZGMED S ZGMED=@MAP@("MEDPRODUCTNAMETEXT")
- . . . S @MAP@("MEDPRODUCTNAMETEXT")=ZGMED_" "_ZCDS_": "_ZCD
- . . E  I NDFIEN,$D(^C0CRXN) D  ; $Data is for Systems that don't have our RxNorm file yet.
+ . . I NDFIEN,$D(^C0CRXN) D  ; $Data is for Systems that don't have our RxNorm file yet.
  . . . S VUID=$$GET1^DIQ(50.68,VAPROD,99.99)
  . . . S RXNIEN=$$FIND1^DIC(176.001,,,VUID,"VUID")
@@ -140,5 +122,5 @@
  . . . S RXNVER=$$GET1^DIQ(176.003,SRCIEN,7)
  . . ;
- . . ;E  S (RXNORM,RXNNAME,RXNVER)=""
+ . . E  S (RXNORM,RXNNAME,RXNVER)=""
  . . ; End if/else block
  . . S @MAP@("MEDPRODUCTNAMECODEVALUE")=RXNORM
@@ -179,5 +161,4 @@
  . . . S @MAP@("MEDQUANTITYUNIT")=QTYDATA(14.5)
  . . E  S @MAP@("MEDQUANTITYUNIT")=""
- . . S @MAP@("MEDQUANTITYUNIT")="" ; don't show these
  . E  D
  . . S @MAP@("MEDPRODUCTNAMECODEVALUE")=""
@@ -200,33 +181,5 @@
  . ; MEDDIRECTIONDESCRIPTIONTEXT
  . S DIRCNT=1 ; THERE IS ONLY ONE DIRECTION FOR OUTSIDE MEDS
- . ;
- . ; change for eRx meds - gpl 6/25/2011
- . ;
- . N ZERX S ZERX=MED(2,"E")_" "_MED(3,"E")_" "_MED(4,"E")
- . I ZERX["|" S ZERX=$P(ZERX,"|",2) ; GET RID OF MED NAME
- . S @MAP@("M","DIRECTIONS",1,"MEDDIRECTIONDESCRIPTIONTEXT")=ZERX
- . N ZERX2 S ZERX2=$P(MED(2,"E"),"|",2) ; sig for quantity
- . N ZFDBDRUG S ZFDBDRUG=$P(MED(2,"E"),"|",1) ; FDB DRUG NAME
- . I @MAP@("MEDPRODUCTNAMETEXT")["FREE TXT" D  ; FIX THE DRUG NAME
- . . S @MAP@("MEDPRODUCTNAMETEXT")=ZFDBDRUG ; USE FDB NAME
- . . S RXNORM=$P($P($G(MED(14,7)),"RXNORM:",2)," ",1) ; THE RXNORM
- . . S RXNORM=$$NISTMAP^C0CUTIL(RXNORM) ; CHANGE IF NECESSARY
- . . I RXNORM'="" D  ;
- . . . W !,"FOUND FREE TEXT RXNORM:",RXNORM
- . . . S RXNNAME="RXNORM" ; THE CODING SYSTEM
- . . . S RXNVER="" ; THE CODING SYSTEM VERSION
- . . . N ZGMED S ZGMED=@MAP@("MEDPRODUCTNAMETEXT")
- . . . S @MAP@("MEDPRODUCTNAMETEXT")=ZGMED_" "_RXNNAME_": "_RXNORM
- . . . S @MAP@("MEDPRODUCTNAMECODEVALUE")=RXNORM
- . . . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")=RXNNAME
- . . . S @MAP@("MEDPRODUCTNAMECODEVERSION")=RXNVER
- . . . I RXNORM["979334" D  ; PATCH FOR CERTIFICATION
- . . . . S @MAP@("MEDSTRENGTHVALUE")=650
- . . . . S @MAP@("MEDSTRENGTHUNIT")="mcg"
- . . . . S @MAP@("MEDFORMTEXT")="INHALER"
- . S @MAP@("MEDQUANTITYUNIT")=$P(ZERX2," ",3) ; THE UNITS
- . S @MAP@("MEDQUANTITYVALUE")=$P(ZERX2," ",2) ; THE QUANTITY
- . I @MAP@("MEDFORMTEXT")="" S @MAP@("MEDFORMTEXT")=$P(ZERX2," ",3) ;
- . ;S @MAP@("M","DIRECTIONS",1,"MEDDIRECTIONDESCRIPTIONTEXT")=MED(2,"E")_" "_MED(3,"E")_" "_MED(4,"E")
+ . S @MAP@("M","DIRECTIONS",1,"MEDDIRECTIONDESCRIPTIONTEXT")=MED(2,"E")_" "_MED(3,"E")_" "_MED(4,"E")
  . S @MAP@("M","DIRECTIONS",1,"MEDDOSEINDICATOR")="4"  ; means look in description text. See E2369-05.
  . S @MAP@("M","DIRECTIONS",1,"MEDDELIVERYMETHOD")=""
@@ -260,5 +213,4 @@
  . . S @MAP@("MEDFULLFILLMENTINSTRUCTIONS")=MED(14,1) ; WP Field
  . E  S @MAP@("MEDFULLFILLMENTINSTRUCTIONS")=""
- . S @MAP@("MEDFULLFILLMENTINSTRUCTIONS")="" ; don't put in these - gpl
  . N RESULT S RESULT=$NA(^TMP("C0CCCR",$J,"MAPPED"))
  . K @RESULT
