Changeset 312 for ccr/trunk/p/CCRMEDS3.m
- Timestamp:
- Jan 4, 2009, 5:55:58 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/CCRMEDS3.m
r295 r312 21 21 Q 22 22 ; 23 EXTRACT(MINXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE23 EXTRACT(MINXML,DFN,OUTXML) ; Extract medications into provided xml template 24 24 ; 25 25 ; MINXML is the Input XML Template, passed by name … … 78 78 . ; It' node 1, internal form. 79 79 . N MEDIEN S MEDIEN=MED(1,"I") 80 . I +MEDIEN D 81 . . S @MAP@("MEDPRODUCTNAMECODEVALUE")=$$GET1^DIQ(50,MEDIEN,31,"E") 82 . . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")="NDC" 83 . . S @MAP@("MEDPRODUCTNAMECODEVERSION")="none" 80 . I +MEDIEN D ; start of if/else block 81 . . ; 12/30/08: I will be using RxNorm for coding... 82 . . ; 176.001 is the file for Concepts; 176.003 is the file for 83 . . ; sources (i.e. for RxNorm Version) 84 . . ; 85 . . ; We need the VUID first for the National Drug File entry first 86 . . ; We get the VUID of the drug, by looking up the VA Product entry 87 . . ; (file 50.68) using the call NDF^PSS50, returned in node 22. 88 . . ; Field 99.99 is the VUID. 89 . . ; 90 . . ; We use the VUID to look up the RxNorm in file 176.001; same idea. 91 . . ; Get IEN first using $$FIND1^DIC, then get the RxNorm number by 92 . . ; $$GET1^DIQ. 93 . . ; 94 . . ; I get the RxNorm name and version from the RxNorm Sources (file 95 . . ; 176.003), by searching for "RXNORM", then get the data. 96 . . D NDF^PSS50(MEDIEN,,,,,"NDF") 97 . . N NDFDATA M NDFDATA=^TMP($J,"NDF",MEDIEN) 98 . . N NDFIEN S NDFIEN=$P(NDFDATA(20),U) 99 . . N VAPROD S VAPROD=$P(NDFDATA(22),U) 100 . . ; 101 . . ; NDFIEN is not necessarily defined; it won't be if the drug 102 . . ; is not matched to the national drug file (e.g. if the drug is 103 . . ; new on the market, compounded, or is a fake drug [blue pill]. 104 . . ; To protect against failure, I will put an if/else block 105 . . N VUID,RXNIEN,RXNORM,SRCIEN,RXNNAME,RXNVER 106 . . I NDFIEN D 107 . . . S VUID=$$GET1^DIQ(50.68,VAPROD,99.99) 108 . . . S RXNIEN=$$FIND1^DIC(176.001,,,VUID,"VUID") 109 . . . S RXNORM=$$GET1^DIQ(176.001,RXNIEN,.01) 110 . . . S SRCIEN=$$FIND1^DIC(176.003,,"B","RXNORM") 111 . . . S RXNNAME=$$GET1^DIQ(176.003,SRCIEN,6) 112 . . . S RXNVER=$$GET1^DIQ(176.003,SRCIEN,7) 113 . . ; 114 . . E S (RXNORM,RXNNAME,RXNVER)="" 115 . . ; End if/else block 116 . . S @MAP@("MEDPRODUCTNAMECODEVALUE")=RXNORM 117 . . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")=RXNNAME 118 . . S @MAP@("MEDPRODUCTNAMECODEVERSION")=RXNVER 119 . . ; 84 120 . . S @MAP@("MEDBRANDNAMETEXT")="" 85 121 . . D DOSE^PSS50(MEDIEN,,,,,"DOSE") … … 92 128 . . ; NDF Entry IEN, and VA Product Name 93 129 . . ; These can be obtained using NDF^PSS50 (IEN,,,,,"SUBSCRIPT") 94 . . ; Documented in the same manual .130 . . ; Documented in the same manual; executed above. 95 131 . . ; 96 . . ; If the drug is not matched to the National Drug File97 . . ; there will be no NDF Data.98 . . N NDFDATA,CONCDATA99 . . D NDF^PSS50(MEDIEN,,,,,"CONC")100 . . M NDFDATA=^TMP($J,"CONC",MEDIEN)101 . . N NDFIEN S NDFIEN=$P(NDFDATA(20),U)102 . . N VAPROD S VAPROD=$P(NDFDATA(22),U)103 132 . . ; If a drug was not matched to NDF, then the NDFIEN is gonna be "" 104 133 . . ; and this will crash the call. So... … … 130 159 . . S @MAP@("MEDQUANTITYVALUE")="" 131 160 . . S @MAP@("MEDQUANTITYUNIT")="" 132 . ; 161 . ; End If/Else 133 162 . ; --- START OF DIRECTIONS --- 134 163 . ; Dosage is field 2, route is 3, schedule is 4
Note:
See TracChangeset
for help on using the changeset viewer.