handle the case where meds are null
This commit is contained in:
parent
a9da28e2c3
commit
53950bfbb9
|
@ -85,8 +85,9 @@ CCRRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY) ;RPC ENTRY POINT FOR CCR OUTPUT
|
|||
. W "RUNNING ",CALL,!
|
||||
. X CALL
|
||||
. ; NOW INSERT THE RESULTS IN THE CCR BUFFER
|
||||
. D INSERT^GPLXPATH(CCRGLO,OXML,"//ContinuityOfCareRecord/Body")
|
||||
. I DEBUG F GPLI=1:1:@OXML@(0) W @OXML@(GPLI),!
|
||||
. I @OXML@(0)'=0 D ; THERE IS A RESULT
|
||||
. . D INSERT^GPLXPATH(CCRGLO,OXML,"//ContinuityOfCareRecord/Body")
|
||||
. . I DEBUG F GPLI=1:1:@OXML@(0) W @OXML@(GPLI),!
|
||||
D ACTLST^GPLCCR(CCRGLO,ACTGLO) ; GEN THE ACTOR LIST
|
||||
D QUERY^GPLXPATH(TGLOBAL,"//ContinuityOfCareRecord/Actors","ACTT")
|
||||
D EXTRACT^GPLACTORS("ACTT",ACTGLO,"ACTT2")
|
||||
|
|
|
@ -27,7 +27,10 @@ EXTRACT(MEDXML,DFN,MEDOUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
|||
;
|
||||
N MEDRSLT,J,K,MEDPTMP,X,MEDVMAP,TBUF
|
||||
D ACTIVE^ORWPS(.MEDRSLT,DFN)
|
||||
I '$D(MEDRSLT(1)) W "ERROR RUNNINIG MEDICATIONS RPC",! Q
|
||||
I '$D(MEDRSLT(1)) D ; NO MEDS FOR THIS PATIENT, EXIT
|
||||
. W "ERROR RUNNINIG MEDICATIONS RPC",!
|
||||
. S @MEDOUTXML@(0)=0
|
||||
. Q
|
||||
IF DEBUG ZWR MEDRSLT
|
||||
S MEDTVMAP=$NA(^TMP("GPLCCR",$J,"MEDICATIONS"))
|
||||
S MEDTARYTMP=$NA(^TMP("GPLCCR",$J,"MEDARYTMP"))
|
||||
|
@ -37,7 +40,7 @@ EXTRACT(MEDXML,DFN,MEDOUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
|||
. 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 MEDICATION
|
||||
. 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@("MEDICATIONDATETIMEAGE")=""
|
||||
|
|
Loading…
Reference in New Issue