Changeset 332 for ccr/trunk/p


Ignore:
Timestamp:
Jan 19, 2009, 2:24:42 PM (16 years ago)
Author:
Sam Habiel
Message:

Bug fixes for CCRMEDS6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/CCRMEDS6.m

    r324 r332  
    5656 ; The next lines, however many, are the med and the sig.
    5757 ; 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
    5960 S MEDMAP=$NA(^TMP("GPLCCR",$J,"MEDMAP")) ; this is the variable map
    6061 S @MEDMAP@(0)=0 ; Initial count of meds
     62 S MEDCNT="" ; Initialize for $Order
    6163 F  S MEDCNT=$O(MEDS(MEDCNT)) Q:MEDCNT=""  D  ; for each medication in the list
    6264 . I DEBUG W "MEDCNT IS ",MEDCNT,!
     
    7779 . ; Provider only provided in API as text, not DUZ.
    7880 . ; 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)
    8184 . S @MAP@("MEDSOURCEACTORID")="ACTORPROVIDER_"_$$GET1^DIQ(52,RXIEN,4,"I")
    8285 . S @MAP@("MEDPRODUCTNAMETEXT")=$P(MEDS(MEDCNT),U,3)
     
    101104 . . S RXNIEN=$$FIND1^DIC(176.002,,,NDC,"NDC")
    102105 . . 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")
    104107 . . S RXNNAME=$$GET1^DIQ(176.003,SRCIEN,6)
    105108 . . S RXNVER=$$GET1^DIQ(176.003,SRCIEN,7)
     
    113116 . ;
    114117 . ; 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)
    116119 . ;
    117120 . ; Next I need Med Form (tab, cap etc), strength (250mg)
     
    153156 . ; --- START OF DIRECTIONS ---
    154157 . ; Sig data not in any API :-(  Oh yes, you can get the whole thing, but...
    155  . ; we want the compoenents.
     158 . ; we want the components.
    156159 . ; It's in multiple 113 in the Prescription File (52)
    157160 . ; #.01 DOSAGE ORDERED [1F]                   "20"
     
    201204 . . ; That's the same thing I am going to do.
    202205 . . ; 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")
    204207 . . N INTERVAL S INTERVAL="" ; Default
    205208 . . S:SCEHDIEN INTERVAL=$$GET1^DIQ(51.1,SCHEDIEN,2)
     
    208211 . . ; Duration is 10M minutes, 10H hours, 10D for Days
    209212 . . ; 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")=""
    214222 . . S @MAP@("M","DIRECTIONS",DIRCNT,"MEDPRNFLAG")=SIGDATA(4)["PRN"
    215223 . . S @MAP@("M","DIRECTIONS",DIRCNT,"MEDPROBLEMOBJECTID")="" ; when avail
Note: See TracChangeset for help on using the changeset viewer.