changed multiple directions structure in CCRMEDS
This commit is contained in:
parent
11f480b5ac
commit
a9a0f2efd5
58
p/CCRMEDS.m
58
p/CCRMEDS.m
|
@ -111,19 +111,19 @@ EXTRACT(MINXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
|||
. ; ==>DURATION [5F] ^ (#5) CONJUNCTION [6S] ^ (#6) ROUTE
|
||||
. ; ==>[7P:51.2] ^ (#7) SCHEDULE [8F] ^ (#8) VERB [9F] ^
|
||||
. ;
|
||||
. N DIRNUM S DIRNUM=0 ; Sigline number
|
||||
. F S DIRNUM=$O(^PSRX(RXIEN,6,DIRNUM)) Q:DIRNUM="" D
|
||||
. . S @MAP@("MEDDIRECTIONDESCRIPTIONTEXT",DIRNUM)="" ; This is reserved for systems not able to generate the sig in components.
|
||||
. . S @MAP@("MEDDOSEINDICATOR",DIRNUM)="1" ; means that we are specifying it. See E2369-05.
|
||||
. N DIRNUM S DIRNUM=0 ; Sigline number
|
||||
. F S DIRNUM=$O(^PSRX(RXIEN,6,DIRNUM)) Q:DIRNUM="" D
|
||||
. . S @MAP@("M",DIRNUM,"MEDDIRECTIONDESCRIPTIONTEXT")="" ; This is reserved for systems not able to generate the sig in components.
|
||||
. . S @MAP@("M",DIRNUM,"MEDDOSEINDICATOR")="1" ; means that we are specifying it. See E2369-05.
|
||||
. . N SIGDATA S SIGDATA=^PSRX(RXIEN,6,DIRNUM,0)
|
||||
. . S @MAP@("MEDDELIVERYMETHOD",DIRNUM)=$P(SIGDATA,U,9)
|
||||
. . S @MAP@("MEDDOSEVALUE",DIRNUM)=$P(SIGDATA,U,1)
|
||||
. . S @MAP@("MEDDOSEUNIT",DIRNUM)=@MAP@("MEDCONCUNIT")
|
||||
. . S @MAP@("MEDRATEVALUE",DIRNUM)="" ; For inpatient
|
||||
. . S @MAP@("MEDRATEUNIT",DIRNUM)="" ; For inpatient
|
||||
. . S @MAP@("MEDVEHICLETEXT",DIRNUM)="" ; For inpatient
|
||||
. . S @MAP@("MEDDIRECTIONROUTETEXT",DIRNUM)=$$GET1^DIQ(51.2,$P(SIGDATA,U,7),.01)
|
||||
. . S @MAP@("MEDFREQUENCYVALUE",DIRNUM)=$P(SIGDATA,U,8)
|
||||
. . S @MAP@("M",DIRNUM,"MEDDELIVERYMETHOD")=$P(SIGDATA,U,9)
|
||||
. . S @MAP@("M",DIRNUM,"MEDDOSEVALUE")=$P(SIGDATA,U,1)
|
||||
. . S @MAP@("M",DIRNUM,"MEDDOSEUNIT")=@MAP@("MEDCONCUNIT")
|
||||
. . S @MAP@("M",DIRNUM,"MEDRATEVALUE")="" ; For inpatient
|
||||
. . S @MAP@("M",DIRNUM,"MEDRATEUNIT")="" ; For inpatient
|
||||
. . S @MAP@("M",DIRNUM,"MEDVEHICLETEXT")="" ; For inpatient
|
||||
. . S @MAP@("M",DIRNUM,"MEDDIRECTIONROUTETEXT")=$$GET1^DIQ(51.2,$P(SIGDATA,U,7),.01)
|
||||
. . S @MAP@("M",DIRNUM,"MEDFREQUENCYVALUE")=$P(SIGDATA,U,8)
|
||||
. . ; Invervals... again another call.
|
||||
. . ; In the wisdom of the original programmers, the schedule is a free text field
|
||||
. . ; However, it gets translated by a call to the administration schedule file
|
||||
|
@ -140,22 +140,22 @@ EXTRACT(MINXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
|||
. . E D
|
||||
. . . N SUB S SUB=$O(SCHEDATA(0))
|
||||
. . . S INTERVAL=SCHEDATA(SUB,2)
|
||||
. . S @MAP@("MEDINTERVALVALUE",DIRNUM)=INTERVAL
|
||||
. . S @MAP@("MEDINTERVALUNIT",DIRNUM)="Minute"
|
||||
. . S @MAP@("MEDDURATIONVALUE",DIRNUM)=$P(SIGDATA,U,5)
|
||||
. . S @MAP@("MEDDURATIONUNIT",DIRNUM)=""
|
||||
. . S @MAP@("MEDPRNFLAG",DIRNUM)=$P(SIGDATA,U,8)["PRN"
|
||||
. . S @MAP@("MEDPROBLEMOBJECTID",DIRNUM)=""
|
||||
. . S @MAP@("MEDPROBLEMTYPETXT",DIRNUM)=""
|
||||
. . S @MAP@("MEDPROBLEMDESCRIPTION",DIRNUM)=""
|
||||
. . S @MAP@("MEDPROBLEMCODEVALUE",DIRNUM)=""
|
||||
. . S @MAP@("MEDPROBLEMCODINGSYSTEM",DIRNUM)=""
|
||||
. . S @MAP@("MEDPROBLEMCODINGVERSION",DIRNUM)=""
|
||||
. . S @MAP@("MEDPROBLEMSOURCEACTORID",DIRNUM)=""
|
||||
. . S @MAP@("MEDSTOPINDICATOR",DIRNUM)=""
|
||||
. . S @MAP@("MEDDIRSEQ",DIRNUM)=DIRNUM
|
||||
. . N DIRMOD S DIRMOD=$P(SIGDATA,U,6)
|
||||
. . S @MAP@("MEDMULDIRMOD",DIRNUM)=$S(DIRMOD="T":"THEN",DIRMOD="A":"AND",DIRMOD="X":"EXCEPT",1:"")
|
||||
. . S @MAP@("M",DIRNUM,"MEDINTERVALVALUE")=INTERVAL
|
||||
. . S @MAP@("M",DIRNUM,"MEDINTERVALUNIT")="Minute"
|
||||
. . S @MAP@("M",DIRNUM,"MEDDURATIONVALUE")=$P(SIGDATA,U,5)
|
||||
. . S @MAP@("M",DIRNUM,"MEDDURATIONUNIT")=""
|
||||
. . S @MAP@("M",DIRNUM,"MEDPRNFLAG")=$P(SIGDATA,U,8)["PRN"
|
||||
. . S @MAP@("M",DIRNUM,"MEDPROBLEMOBJECTID")=""
|
||||
. . S @MAP@("M",DIRNUM,"MEDPROBLEMTYPETXT")=""
|
||||
. . S @MAP@("M",DIRNUM,"MEDPROBLEMDESCRIPTION")=""
|
||||
. . S @MAP@("M",DIRNUM,"MEDPROBLEMCODEVALUE")=""
|
||||
. . S @MAP@("M",DIRNUM,"MEDPROBLEMCODINGSYSTEM")=""
|
||||
. . S @MAP@("M",DIRNUM,"MEDPROBLEMCODINGVERSION")=""
|
||||
. . S @MAP@("M",DIRNUM,"MEDPROBLEMSOURCEACTORID")=""
|
||||
. . S @MAP@("M",DIRNUM,"MEDSTOPINDICATOR")=""
|
||||
. . S @MAP@("M",DIRNUM,"MEDDIRSEQ")=DIRNUM
|
||||
. . N DIRMOD S DIRMOD=$P(SIGDATA,U,6)
|
||||
. . S @MAP@("M",DIRNUM,"MEDMULDIRMOD")=$S(DIRMOD="T":"THEN",DIRMOD="A":"AND",DIRMOD="X":"EXCEPT",1:"")
|
||||
. ;
|
||||
. ; --- END OF DIRECTIONS ---
|
||||
. ;
|
||||
|
@ -166,7 +166,7 @@ EXTRACT(MINXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
|||
. S @MAP@("MEDRFNO")=MED(9)
|
||||
. N RESULT S RESULT=$NA(^TMP("GPLCCR",$J,"MAPPED"))
|
||||
. K @RESULT
|
||||
. D MAP^GPLXPATH(MINXML,MAP,RESULT)
|
||||
. D MAP^GPLXPATH(MINXML,MAP,RESULT)
|
||||
. ; D PARY^GPLXPATH(RESULT)
|
||||
. D:MEDCOUNT=1 CP^GPLXPATH(RESULT,OUTXML) ; First one is a copy
|
||||
. D:MEDCOUNT>1 INSINNER^GPLXPATH(OUTXML,RESULT) ; AFTER THE FIRST, INSERT INNER XML
|
||||
|
|
Loading…
Reference in New Issue