Changeset 332 for ccr/trunk/p/CCRMEDS6.m
- Timestamp:
- Jan 19, 2009, 2:24:42 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/CCRMEDS6.m
r324 r332 56 56 ; The next lines, however many, are the med and the sig. 57 57 ; I won't be using those because I have to get the sig parsed exactly. 58 N J S J="" F S J=$O(MEDS1(J)) Q:J="" I $E(MEDS1(J),1,3)="~OP" S MEDCNT=MEDCNT+1 S MED(MEDCNT)=MEDS1(J) 58 N J S J="" F S J=$O(MEDS1(J)) Q:J="" I $E(MEDS1(J),1,3)="~OP" S MEDCNT=MEDCNT+1 S MEDS(MEDCNT)=MEDS1(J) 59 K MEDS1 59 60 S MEDMAP=$NA(^TMP("GPLCCR",$J,"MEDMAP")) ; this is the variable map 60 61 S @MEDMAP@(0)=0 ; Initial count of meds 62 S MEDCNT="" ; Initialize for $Order 61 63 F S MEDCNT=$O(MEDS(MEDCNT)) Q:MEDCNT="" D ; for each medication in the list 62 64 . I DEBUG W "MEDCNT IS ",MEDCNT,! … … 77 79 . ; Provider only provided in API as text, not DUZ. 78 80 . ; We need to get DUZ from filman file 52 (Prescription) 79 . ; Field 4;; IEN is Piece 1 of Meds stripped of trailing characters. 80 . N RXIEN S RXIEN=+$P(MEDS(MEDCNT),U) 81 . ; Field 4; IEN is Piece 2 of Meds stripped of trailing characters. 82 . ; Note that I will use RXIEN several times later 83 . N RXIEN S RXIEN=+$P(MEDS(MEDCNT),U,2) 81 84 . S @MAP@("MEDSOURCEACTORID")="ACTORPROVIDER_"_$$GET1^DIQ(52,RXIEN,4,"I") 82 85 . S @MAP@("MEDPRODUCTNAMETEXT")=$P(MEDS(MEDCNT),U,3) … … 101 104 . . S RXNIEN=$$FIND1^DIC(176.002,,,NDC,"NDC") 102 105 . . S RXNORM=$$GET1^DIQ(176.002,RXNIEN,.01) 103 . . S SRCIEN=$$FIND1^DIC(176.003,, "B","RXNORM")106 . . S SRCIEN=$$FIND1^DIC(176.003,,,"RXNORM","B") 104 107 . . S RXNNAME=$$GET1^DIQ(176.003,SRCIEN,6) 105 108 . . S RXNVER=$$GET1^DIQ(176.003,SRCIEN,7) … … 113 116 . ; 114 117 . ; Brand name is 52 field 6.5 115 . S @MAP@("MEDBRANDNAMETEXT")=$$GET1^DIQ(52,RXIEN,6.5 ,"I")118 . S @MAP@("MEDBRANDNAMETEXT")=$$GET1^DIQ(52,RXIEN,6.5) 116 119 . ; 117 120 . ; Next I need Med Form (tab, cap etc), strength (250mg) … … 153 156 . ; --- START OF DIRECTIONS --- 154 157 . ; Sig data not in any API :-( Oh yes, you can get the whole thing, but... 155 . ; we want the compo enents.158 . ; we want the components. 156 159 . ; It's in multiple 113 in the Prescription File (52) 157 160 . ; #.01 DOSAGE ORDERED [1F] "20" … … 201 204 . . ; That's the same thing I am going to do. 202 205 . . ; Search B index of 51.1 (Admin Schedule) with first abbr of schedule 203 . . N SCHEDIEN=$$FIND ^DIC(51.1,,,$P(SIGDATA(7)," "),"B")206 . . N SCHEDIEN=$$FIND1^DIC(51.1,,,$P(SIGDATA(7)," "),"B") 204 207 . . N INTERVAL S INTERVAL="" ; Default 205 208 . . S:SCEHDIEN INTERVAL=$$GET1^DIQ(51.1,SCHEDIEN,2) … … 208 211 . . ; Duration is 10M minutes, 10H hours, 10D for Days 209 212 . . ; 10W for weeks, 10L for months. I smell $Select 210 . . N DURUNIT S DURUNIT=$E(SIGDATA(4),$L(SIGDATA(4))) ; get last char 211 . . N DURTXT S DURTXT=$S(DURUNIT="M":"Minutes",DURUNIT="H":"Hours",DURUNIT="D":"Days",DURUNIT="W":"Weeks",DURUNIT="L":"Months",1:"Days") 212 . . S @MAP@("M","DIRECTIONS",DIRCNT,"MEDDURATIONVALUE")=+SIGDATA(4) 213 . . S @MAP@("M","DIRECTIONS",DIRCNT,"MEDDURATIONUNIT")=DURTXT 213 . . ; But we don't need to do that if there isn't a duration 214 . . I +SIGDATA(4) D 215 . . . N DURUNIT S DURUNIT=$E(SIGDATA(4),$L(SIGDATA(4))) ; get last char 216 . . . N DURTXT S DURTXT=$S(DURUNIT="M":"Minutes",DURUNIT="H":"Hours",DURUNIT="D":"Days",DURUNIT="W":"Weeks",DURUNIT="L":"Months",1:"Days") 217 . . . S @MAP@("M","DIRECTIONS",DIRCNT,"MEDDURATIONVALUE")=+SIGDATA(4) 218 . . . S @MAP@("M","DIRECTIONS",DIRCNT,"MEDDURATIONUNIT")=DURTXT 219 . . E D 220 . . . S @MAP@("M","DIRECTIONS",DIRCNT,"MEDDURATIONVALUE")="" 221 . . . S @MAP@("M","DIRECTIONS",DIRCNT,"MEDDURATIONUNIT")="" 214 222 . . S @MAP@("M","DIRECTIONS",DIRCNT,"MEDPRNFLAG")=SIGDATA(4)["PRN" 215 223 . . S @MAP@("M","DIRECTIONS",DIRCNT,"MEDPROBLEMOBJECTID")="" ; when avail
Note:
See TracChangeset
for help on using the changeset viewer.