remove unused ADDDRUG EP
This commit is contained in:
parent
f60595f14a
commit
56c6036685
92
p/C0XPT3.m
92
p/C0XPT3.m
|
@ -1,4 +1,4 @@
|
|||
C0XPT3 ;ISI/MLS,VEN/SMH -- MEDS IMPORT ;2013-04-19 5:42 PM
|
||||
C0XPT3 ;ISI/MLS,VEN/SMH -- MEDS IMPORT ;2013-05-06 10:21 AM
|
||||
;;1.0;FILEMAN TRIPLE STORE;;Jun 26,2012;Build 29
|
||||
; (C) Sam Habiel 2013
|
||||
; Proprietary code. Stay out!
|
||||
|
@ -236,93 +236,3 @@ F525 ;UPDATE SUSPENSE FILE
|
|||
S DA=PSOIEN,X=PSOIEN,FDT=$P($G(^PSRX(PSOIEN,2)),"^",2),TYPE=$P($G(^PSRX(PSOIEN,0)),"^",11)
|
||||
S DIC="^PS(52.5,",DIC(0)="L",DLAYGO=52.5,DIC("DR")=".02///"_FDT_";.03////"_$P(^PSRX(PSOIEN,0),"^",2)_";.04////"_TYPE_";.05///0;.06////"_DIV_";2///0" K DD,D0 D FILE^DICN K DD,D0
|
||||
Q
|
||||
;
|
||||
ADDDRUG(RXN,NDC,BARCODE) ; Public Proc; Add Drug to Drug File
|
||||
; Input: RXN - RxNorm Semantic Clinical Drug CUI by Value. Required.
|
||||
; Input: NDC - Drug NDC by Value. Optional. Pass in 11 digit format without dashes.
|
||||
; Input: BARCODE - Wand Barcode. Optional. Pass exactly as wand reads minus control characters.
|
||||
; Output: None.
|
||||
;
|
||||
; Prelim Checks
|
||||
I '$G(RXN) S $EC=",U1," ; Required
|
||||
I $L($G(NDC)),$L(NDC)'=11 S $EC=",U1,"
|
||||
;
|
||||
N PSSZ S PSSZ=1 ; Needed for the drug file to let me in!
|
||||
;
|
||||
; If RXN refers to a brand drug, get the generic instead.
|
||||
I $$ISBRAND^C0CRXNLK(RXN) S RXN=$$BR2GEN^C0CRXNLK(RXN)
|
||||
W !,"(debug) RxNorm is "_RXN,!
|
||||
;
|
||||
; Get first VUID for this RxNorm drug
|
||||
N VUID S VUID=+$$RXN2VUI^C0CRXNLK(RXN)
|
||||
Q:'VUID
|
||||
W "(debug) VUID for RxNorm CUI "_RXN_" is "_VUID,!
|
||||
;
|
||||
; IEN in 50.68
|
||||
N C0XVUID ; For Searching Compound Index
|
||||
S C0XVUID(1)=VUID
|
||||
S C0XVUID(2)=1
|
||||
N F5068IEN S F5068IEN=$$FIND1^DIC(50.68,"","XQ",.C0XVUID,"AMASTERVUID")
|
||||
Q:'F5068IEN
|
||||
W "F 50.68 IEN (debug): "_F5068IEN,!
|
||||
;
|
||||
; FDA Array
|
||||
N C0XFDA
|
||||
;
|
||||
; Name, shortened
|
||||
S C0XFDA(50,"+1,",.01)=$E($$GET1^DIQ(50.68,F5068IEN,.01),1,40)
|
||||
;
|
||||
; File BarCode as a Synonym for BCMA
|
||||
I $L($G(BARCODE)) D
|
||||
. S C0XFDA(50.1,"+2,+1,",.01)=BARCODE
|
||||
. S C0XFDA(50.1,"+2,+1,",1)="Q"
|
||||
;
|
||||
; Brand Names
|
||||
N BNS S BNS=$$RXN2BNS^C0CRXNLK(RXN) ; Brands
|
||||
I $L(BNS) N I F I=1:1:$L(BNS,U) D
|
||||
. N IENS S IENS=I+2
|
||||
. S C0XFDA(50.1,"+"_IENS_",+1,",.01)=$$UP^XLFSTR($E($P(BNS,U,I),1,40))
|
||||
. S C0XFDA(50.1,"+"_IENS_",+1,",1)="T"
|
||||
;
|
||||
; NDC (string)
|
||||
I $G(NDC) S C0XFDA(50,"+1,",31)=$E(NDC,1,5)_"-"_$E(NDC,6,9)_"-"_$E(NDC,10,11)
|
||||
;
|
||||
; Dispense Unit (string)
|
||||
S C0XFDA(50,"+1,",14.5)=$$GET1^DIQ(50.68,F5068IEN,"VA DISPENSE UNIT")
|
||||
;
|
||||
; National Drug File Entry (pointer to 50.6)
|
||||
S C0XFDA(50,"+1,",20)="`"_$$GET1^DIQ(50.68,F5068IEN,"VA GENERIC NAME","I")
|
||||
;
|
||||
; VA Product Name (string)
|
||||
S C0XFDA(50,"+1,",21)=$E($$GET1^DIQ(50.68,F5068IEN,.01),1,70)
|
||||
;
|
||||
; PSNDF VA PRODUCT NAME ENTRY (pointer to 50.68)
|
||||
S C0XFDA(50,"+1,",22)="`"_F5068IEN
|
||||
;
|
||||
; DEA, SPECIAL HDLG (string)
|
||||
D ; From ^PSNMRG
|
||||
. N CS S CS=$$GET1^DIQ(50.68,F5068IEN,"CS FEDERAL SCHEDULE","I")
|
||||
. S CS=$S(CS?1(1"2n",1"3n"):+CS_"C",+CS=2!(+CS=3)&(CS'["C"):+CS_"A",1:CS)
|
||||
. S C0XFDA(50,"+1,",3)=CS
|
||||
;
|
||||
; NATIONAL DRUG CLASS (pointer to 50.605) (triggers VA Classification field)
|
||||
S C0XFDA(50,"+1,",25)="`"_$$GET1^DIQ(50.68,F5068IEN,"PRIMARY VA DRUG CLASS","I")
|
||||
;
|
||||
; Right Now, I don't file the following which ^PSNMRG does (cuz I don't need them)
|
||||
; - Package Size (derived from NDC/UPN file)
|
||||
; - Package Type (ditto)
|
||||
; - CMOP ID (from $$PROD2^PSNAPIS)
|
||||
; - National Formulary Indicator (from 50.68)
|
||||
;
|
||||
; Next Step is to kill Old OI if Dosage Form doesn't match
|
||||
; Won't do that here as it's assumed any drugs that's added is new.
|
||||
; This happens at ^PSNPSS
|
||||
;
|
||||
; Next Step: Kill off old doses and add new ones. We need to to that.
|
||||
; TODO: Add doses. Happens at EN1^PSSUTIL.
|
||||
N C0XERR,C0XIEN
|
||||
D UPDATE^DIE("E","C0XFDA","C0XIEN","C0XERR")
|
||||
;
|
||||
S:$D(C0XERR) $EC=",U1,"
|
||||
;
|
||||
QUIT C0XIEN(1)
|
||||
|
|
Loading…
Reference in New Issue