fixed crash in MEDS where med has no 3rd line of description

This commit is contained in:
george 2008-08-27 03:57:10 +00:00
parent 1cd3edb56f
commit 2e7bef3426
1 changed files with 4 additions and 2 deletions

View File

@ -63,8 +63,10 @@ EXTRACT(MEDXML,DFN,MEDOUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
. S @MEDVMAP@("MEDQUANTITYVALUE")=""
. S @MEDVMAP@("MEDQUANTITYUNIT")=""
. S @MEDVMAP@("MEDRFNO")=""
. S @MEDVMAP@("MEDICATIONDESCRIPTIONTEXT")=$P(MEDRSLT(J+1)," *",2)
. S @MEDVMAP@("MEDDIRECTIONDESCRIPTIONTEXT")=$P(MEDRSLT(J+2),"\ Sig: ",2)
. I $D(MEDRSLT(J+1)) D ; IF SECOND LINE EXISTS
. . S @MEDVMAP@("MEDICATIONDESCRIPTIONTEXT")=$P(MEDRSLT(J+1)," *",2)
. I $D(MEDRSLT(J+2)) D ; IF THIRD LINE EXISTS
. . S @MEDVMAP@("MEDDIRECTIONDESCRIPTIONTEXT")=$P(MEDRSLT(J+2),"\ Sig: ",2)
. S @MEDVMAP@("MEDICATIONDIRECTIONDOSEVALUE")=""
. S @MEDVMAP@("MEDICATIONDIRECTIONROUTETEXT")=""
. S @MEDVMAP@("MEDICATIONDIRECTIONFREQUENCYVALUE")=""