handle the case where meds are null

This commit is contained in:
george 2008-08-06 03:42:46 +00:00
parent a9da28e2c3
commit 53950bfbb9
2 changed files with 8 additions and 4 deletions

View File

@ -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")

View File

@ -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")=""