Changeset 295 for ccr/trunk/p/CCRMEDS2.m
- Timestamp:
- Nov 23, 2008, 4:27:27 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/CCRMEDS2.m
r281 r295 79 79 . ; MED(11) piece 1 has the IEN of the drug (file 50) 80 80 . ; IEN is field 31 in the drug file. 81 . ; 82 . ; MEDIEN (node 11 in the returned output) might not necessarily be defined 83 . ; It is not defined when a dose in not chosen in CPRS. There is a long 84 . ; series of fields that depend on it. We will use If and Else to deal 85 . ; with that 81 86 . N MEDIEN S MEDIEN=$P(MED(11),U) 82 . S @MAP@("MEDPRODUCTNAMECODEVALUE")=$$GET1^DIQ(50,MEDIEN,31,"E")83 . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")="NDC"84 . S @MAP@("MEDPRODUCTNAMECODEVERSION")="none"85 . S @MAP@("MEDBRANDNAMETEXT")=""86 . D DOSE^PSS50(MEDIEN,,,,,"DOSE")87 . I $D(^TMP($J,"DOSE",MEDIEN)) D ; GPL ; CALL SUCCESSFUL87 . I +MEDIEN>0 D 88 . . S @MAP@("MEDPRODUCTNAMECODEVALUE")=$$GET1^DIQ(50,MEDIEN,31,"E") 89 . . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")="NDC" 90 . . S @MAP@("MEDPRODUCTNAMECODEVERSION")="none" 91 . . S @MAP@("MEDBRANDNAMETEXT")="" 92 . . D DOSE^PSS50(MEDIEN,,,,,"DOSE") 88 93 . . N DOSEDATA M DOSEDATA=^TMP($J,"DOSE",MEDIEN) 89 94 . . S @MAP@("MEDSTRENGTHVALUE")=DOSEDATA(901) 90 95 . . S @MAP@("MEDSTRENGTHUNIT")=$P(DOSEDATA(902),U,2) 91 . E D ; GPL CALL UNSUCCESSUFL 92 . . S @MAP@("MEDSTRENGTHVALUE")="" ; NO DOSE INFORMATION AVAILABLE 93 . . S @MAP@("MEDSTRENGTHUNIT")="" ; 94 . ; Units, concentration, etc, come from another call 95 . ; $$CPRS^PSNAPIS which returns dosage-form^va class^strengh^unit 96 . ; This call takes nodes 1 and 3 of ^PSDRUG(D0,"ND") as parameters 97 . ; NDF Entry IEN, and VA Product Name 98 . ; These can be obtained using NDF^PSS50 (IEN,,,,,"SUBSCRIPT") 99 . ; Documented in the same manual. 100 . D NDF^PSS50(MEDIEN,,,,,"CONC") 101 . N NDFDATA M NDFDATA=^TMP($J,"CONC",MEDIEN) 102 . N NDFIEN S NDFIEN=$P(NDFDATA(20),U) 103 . N VAPROD S VAPROD=$P(NDFDATA(22),U) 104 . N CONCDATA 105 . ; If a drug was not matched to NDF, then the NDFIEN is gonna be "" 106 . ; and this will crash the call. So... 107 . I NDFIEN="" S CONCDATA="" 108 . E S CONCDATA=$$CPRS^PSNAPIS(NDFIEN,VAPROD) 109 . S @MAP@("MEDFORMTEXT")=$P(CONCDATA,U,1) 110 . S @MAP@("MEDCONCVALUE")=$P(CONCDATA,U,3) 111 . S @MAP@("MEDCONCUNIT")=$P(CONCDATA,U,4) 112 . S @MAP@("MEDSIZETEXT")=$P(NDFDATA(23),U,2)_" "_$P(NDFDATA(24),U,2) 113 . S @MAP@("MEDQUANTITYVALUE")=$$GET1^DIQ(52.41,RXIEN,12) 114 . ; Oddly, there is no easy place to find the dispense unit. 115 . ; It's not included in the original call, so we have to go to the drug file. 116 . ; That would be DATA^PSS50(IEN,,,,,"SUBSCRIPT") 117 . ; Node 14.5 is the Dispense Unit 118 . D DATA^PSS50(MEDIEN,,,,,"QTY") 119 . N QTYDATA M QTYDATA=^TMP($J,"QTY",MEDIEN) 120 . S @MAP@("MEDQUANTITYUNIT")=QTYDATA(14.5) 96 . . ; Units, concentration, etc, come from another call 97 . . ; $$CPRS^PSNAPIS which returns dosage-form^va class^strengh^unit 98 . . ; This call takes nodes 1 and 3 of ^PSDRUG(D0,"ND") as parameters 99 . . ; NDF Entry IEN, and VA Product Name 100 . . ; These can be obtained using NDF^PSS50 (IEN,,,,,"SUBSCRIPT") 101 . . ; Documented in the same manual. 102 . . D NDF^PSS50(MEDIEN,,,,,"CONC") 103 . . N NDFDATA M NDFDATA=^TMP($J,"CONC",MEDIEN) 104 . . N NDFIEN S NDFIEN=$P(NDFDATA(20),U) 105 . . N VAPROD S VAPROD=$P(NDFDATA(22),U) 106 . . N CONCDATA 107 . . ; If a drug was not matched to NDF, then the NDFIEN is gonna be "" 108 . . ; and this will crash the call. So... 109 . . I NDFIEN="" S CONCDATA="" 110 . . E S CONCDATA=$$CPRS^PSNAPIS(NDFIEN,VAPROD) 111 . . S @MAP@("MEDFORMTEXT")=$P(CONCDATA,U,1) 112 . . S @MAP@("MEDCONCVALUE")=$P(CONCDATA,U,3) 113 . . S @MAP@("MEDCONCUNIT")=$P(CONCDATA,U,4) 114 . . S @MAP@("MEDSIZETEXT")=$P(NDFDATA(23),U,2)_" "_$P(NDFDATA(24),U,2) 115 . . S @MAP@("MEDQUANTITYVALUE")=$$GET1^DIQ(52.41,RXIEN,12) 116 . . ; Oddly, there is no easy place to find the dispense unit. 117 . . ; It's not included in the original call, so we have to go to the drug file. 118 . . ; That would be DATA^PSS50(IEN,,,,,"SUBSCRIPT") 119 . . ; Node 14.5 is the Dispense Unit 120 . . D DATA^PSS50(MEDIEN,,,,,"QTY") 121 . . N QTYDATA M QTYDATA=^TMP($J,"QTY",MEDIEN) 122 . . S @MAP@("MEDQUANTITYUNIT")=QTYDATA(14.5) 123 . E D 124 . . S @MAP@("MEDPRODUCTNAMECODEVALUE")="" 125 . . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")="" 126 . . S @MAP@("MEDPRODUCTNAMECODEVERSION")="" 127 . . S @MAP@("MEDBRANDNAMETEXT")="" 128 . . S @MAP@("MEDSTRENGTHVALUE")="" 129 . . S @MAP@("MEDSTRENGTHUNIT")="" 130 . . S @MAP@("MEDFORMTEXT")="" 131 . . S @MAP@("MEDCONCVALUE")="" 132 . . S @MAP@("MEDCONCUNIT")="" 133 . . S @MAP@("MEDSIZETEXT")="" 134 . . S @MAP@("MEDQUANTITYVALUE")="" 135 . . S @MAP@("MEDQUANTITYUNIT")="" 136 . ; 121 137 . ; 122 138 . ; --- START OF DIRECTIONS ---
Note:
See TracChangeset
for help on using the changeset viewer.