Fixed intervals in CCRMEDS6

This commit is contained in:
george 2009-01-20 08:26:30 +00:00
parent 7a40979a3d
commit ab16c09ef9
2 changed files with 18 additions and 5 deletions

View File

@ -202,10 +202,24 @@ EXTRACT(MINXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
. . ; However, it gets translated by a call to the administration schedule file
. . ; to see if that schedule exists.
. . ; That's the same thing I am going to do.
. . ; Search B index of 51.1 (Admin Schedule) with first abbr of schedule
. . N SCHEDIEN S SCHEDIEN=$$FIND1^DIC(51.1,,,$P(SIGDATA(7)," "),"B")
. . ; Search B index of 51.1 (Admin Schedule) with schedule
. . ; First, remove "PRN" if it exists (don't ask, that's how the file
. . ; works; I wouldn't do it that way).
. . N SCHNOPRN S SCHNOPRN=SIGDATA(7)
. . I SCHNOPRN["PRN" S SCHNOPRN=$E(SCHNOPRN,1,$F(SCHNOPRN,"PRN")-5)
. . ; Super call below:
. . ; 1=File 51.1 3=Field 2 (Frequency in Minutes)
. . ; 4=Packed format, Exact Match 5=Lookup Value
. . ; 6=# of entries to return 7=Index 10=Return Array
. . ;
. . ; I do not account for the fact that two schedules can be
. . ; spelled identically (ie duplicate entry). In that case,
. . ; I get the first. That's just a bad pharmacy pkg maintainer.
. . N C0C515
. . D FIND^DIC(51.1,,"@;2","PX",SCHNOPRN,1,"B",,,"C0C515")
. . N INTERVAL S INTERVAL="" ; Default
. . S:SCHEDIEN INTERVAL=$$GET1^DIQ(51.1,SCHEDIEN,2)
. . ; If there are entries found, get it
. . I +$G(C0C515("DILIST",0)) S INTERVAL=$P(C0C515("DILIST",1,0),U,2)
. . S @MAP@("M","DIRECTIONS",DIRCNT,"MEDINTERVALVALUE")=INTERVAL
. . S @MAP@("M","DIRECTIONS",DIRCNT,"MEDINTERVALUNIT")="Minute"
. . ; Duration is 10M minutes, 10H hours, 10D for Days

View File

@ -13,8 +13,7 @@ MEDS
W "Getting Med Template into INXML using",!
W "QUERY^GPLXPATH(T,XPATH,""INXML"")",!!
D QUERY^GPLXPATH(T,XPATH,"INXML")
B
W "Executing EXTRACT^CCRMEDS(INXML,DFN,OUTXML)",!
W "Executing EXTRACT^CCRMEDS(INXML,DFN,OUTXML)",!
W "OUTXML will be ^TMP($J,""OUT"")",!
N OUTXML S OUTXML=$NA(^TMP($J,"OUT"))
D EXTRACT^CCRMEDS6("INXML",DFN,OUTXML)