fixed Meds processing - patched up until new APIs are in place
This commit is contained in:
parent
2a10e4c419
commit
c647326661
|
@ -48,7 +48,7 @@ CCRRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY) ;RPC ENTRY POINT FOR CCR OUTPUT
|
|||
; HDRARY IS THE HEADER ARRAY DEFINING THE "FROM" AND
|
||||
; "TO" VARIABLES
|
||||
; IF NULL WILL DEFAULT TO "FROM" DUZ AND "TO" DFN
|
||||
S DEBUG=0
|
||||
I '$D(DEBUG) S DEBUG=0
|
||||
S CCD=0 ; NEED THIS FLAG TO DISTINGUISH FROM CCD
|
||||
I '$D(TESTLAB) S TESTLAB=0 ; FLAG FOR TESTING RESULTS SECTION
|
||||
S TGLOBAL=$NA(^TMP("GPLCCR",$J,"TEMPLATE")) ; GLOBAL FOR STORING TEMPLATE
|
||||
|
|
27
p/GPLMEDS.m
27
p/GPLMEDS.m
|
@ -31,36 +31,39 @@ EXTRACT(MEDXML,DFN,MEDOUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
|||
. W "ERROR RUNNINIG MEDICATIONS RPC",!
|
||||
. S @MEDOUTXML@(0)=0
|
||||
. Q
|
||||
IF DEBUG ZWR MEDRSLT
|
||||
I DEBUG ZWR MEDRSLT
|
||||
S MEDTVMAP=$NA(^TMP("GPLCCR",$J,"MEDICATIONS"))
|
||||
S MEDTARYTMP=$NA(^TMP("GPLCCR",$J,"MEDARYTMP"))
|
||||
F J=1:3 Q:'$D(MEDRSLT(J)) D ; FOR EACH MEDICATION IN THE LIST
|
||||
. W "J IS ",J,!
|
||||
. I DEBUG W "J IS ",J,!
|
||||
. S MEDVMAP=$NA(@MEDTVMAP@(J))
|
||||
. K @MEDVMAP
|
||||
. I DEBUG W "VMAP= ",VMAP,!
|
||||
. S MEDPTMP=MEDRSLT(J) ; PULL OUT MEDICATION FROM RPC RETURN ARRAY
|
||||
. S @MEDVMAP@("MEDICATIONOBJECTID")="MED"_J ; UNIQUE OBJID FOR MEDS
|
||||
. ; PROCESSING FOR MEDS GOES HERE
|
||||
. S @MEDVMAP@("MEDICATIONDATETIMETEXT")=$$FMDTOUTC^CCRUTIL($P(MEDPTMP,"^",11),"DT") ; GETS LAST FILL DATE
|
||||
. S @MEDVMAP@("MEDISSUEDATETXT")=$$FMDTOUTC^CCRUTIL($P(MEDPTMP,"^",11),"DT") ; GETS LAST FILL DATE
|
||||
. S @MEDVMAP@("MEDICATIONDATETIMEAGE")=""
|
||||
. S @MEDVMAP@("MEDICATIONDATETIMEAGEUNITS")=""
|
||||
. S @MEDVMAP@("MEDICATIONTYPETEXT")="Medication"
|
||||
. S @MEDVMAP@("MEDICATIONSTATUSTEXT")=$P(MEDPTMP,"^",10) ; STATUS FROM RPC
|
||||
. S @MEDVMAP@("MEDICATIONSOURCEACTORID")="ACTORSYSTEM_1"
|
||||
. S @MEDVMAP@("MEDICATIONPRODUCTNAMETEXT")=$P(MEDPTMP,"^",3)
|
||||
. S @MEDVMAP@("MEDTYPETEXT")="Medication"
|
||||
. S @MEDVMAP@("MEDSTATUSTEXT")=$P(MEDPTMP,"^",10) ; STATUS FROM RPC
|
||||
. S @MEDVMAP@("MEDSOURCEACTORID")="ACTORSYSTEM_1"
|
||||
. S @MEDVMAP@("MEDPRODUCTNAMETEXT")=$P(MEDPTMP,"^",3)
|
||||
. S @MEDVMAP@("MEDICATIONPRODUCTNAMECODEVALUE")=""
|
||||
. S @MEDVMAP@("MEDICATIONPRODUCTNAMECODINGINGSYSTEM")=""
|
||||
. S @MEDVMAP@("MEDICATIONPRODUCTNAMECODEVERSION")=""
|
||||
. S @MEDVMAP@("MEDICATIONBRANDNAMETEXT")=""
|
||||
. S @MEDVMAP@("MEDBRANDNAMETEXT")=""
|
||||
. S @MEDVMAP@("MEDICATIONBRANDNAMECODEVALUE")=""
|
||||
. S @MEDVMAP@("MEDICATIONBRANDNAMECODINGSYSTEM")=""
|
||||
. S @MEDVMAP@("MEDICATIONBRANDNAMECODEVERSION")=""
|
||||
. S @MEDVMAP@("MEDICATIONSTRENGTHVALUE")=""
|
||||
. S @MEDVMAP@("MEDICATIONSTRENGTHUNIT")=""
|
||||
. S @MEDVMAP@("MEDICATIONFORMTEXT")=""
|
||||
. S @MEDVMAP@("MEDSTRENGTHVALUE")=""
|
||||
. S @MEDVMAP@("MEDSTRENGTHUNIT")=""
|
||||
. S @MEDVMAP@("MEDFORMTEXT")=""
|
||||
. S @MEDVMAP@("MEDQUANTITYVALUE")=""
|
||||
. S @MEDVMAP@("MEDQUANTITYUNIT")=""
|
||||
. S @MEDVMAP@("MEDRFNO")=""
|
||||
. S @MEDVMAP@("MEDICATIONDESCRIPTIONTEXT")=$P(MEDRSLT(J+1)," *",2)
|
||||
. S @MEDVMAP@("MEDICATIONDIRECTIONDESCRIPTIONTEXT")=$P(MEDRSLT(J+2),"\ Sig: ",2)
|
||||
. S @MEDVMAP@("MEDDIRECTIONDESCRIPTIONTEXT")=$P(MEDRSLT(J+2),"\ Sig: ",2)
|
||||
. S @MEDVMAP@("MEDICATIONDIRECTIONDOSEVALUE")=""
|
||||
. S @MEDVMAP@("MEDICATIONDIRECTIONROUTETEXT")=""
|
||||
. S @MEDVMAP@("MEDICATIONDIRECTIONFREQUENCYVALUE")=""
|
||||
|
|
|
@ -34,7 +34,7 @@ EXTRACT(IPXML,DFN,OUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
|
|||
. W "NULL RESULT FROM LIST^ORQQPL3 ",!
|
||||
. S @OUTXML@(0)=0
|
||||
. ; Q
|
||||
ZWR RPCRSLT
|
||||
I DEBUG ZWR RPCRSLT
|
||||
S TVMAP=$NA(^TMP("GPLCCR",$J,"PROBVALS"))
|
||||
S TARYTMP=$NA(^TMP("GPLCCR",$J,"PROBARYTMP"))
|
||||
F J=1:1:RPCRSLT(0) D ; FOR EACH PROBLEM IN THE LIST
|
||||
|
@ -97,7 +97,7 @@ EXTRACT(IPXML,DFN,OUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
|
|||
. . . D BUILD^GPLXPATH("HTMLBLD","HTMLTMP")
|
||||
. . . D CP^GPLXPATH("HTMLTMP","HTMLO")
|
||||
. . . ; D INSINNER^GPLXPATH("HOUT","HTMLO","//")
|
||||
. D PARY^GPLXPATH("HTMLO")
|
||||
. I DEBUG D PARY^GPLXPATH("HTMLO")
|
||||
. D INSB4^GPLXPATH(OUTXML,"HTMLO") ; INSERT AT TOP OF SECTION
|
||||
N PROBSTMP,I
|
||||
D MISSING^GPLXPATH(ARYTMP,"PROBSTMP") ; SEARCH XML FOR MISSING VARS
|
||||
|
|
|
@ -165,7 +165,7 @@ EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT VITALS INTO PROVIDED XML TEMPLATE
|
|||
. . . D INSINNER^GPLXPATH(VITOUTXML,VITARYTMP)
|
||||
; ZWR ^TMP($J,"VITALS",*)
|
||||
ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS
|
||||
D PARY^GPLXPATH(VITOUTXML)
|
||||
I DEBUG D PARY^GPLXPATH(VITOUTXML)
|
||||
N VITTMP,I
|
||||
D MISSING^GPLXPATH(VITOUTXML,"VITTMP") ; SEARCH XML FOR MISSING VARS
|
||||
I VITTMP(0)>0 D ; IF THERE ARE MISSING VARS - MARKED AS @@X@@
|
||||
|
|
Loading…
Reference in New Issue