diff --git a/p/GPLMEDS.m b/p/GPLMEDS.m index 67270ff..fa350b4 100644 --- a/p/GPLMEDS.m +++ b/p/GPLMEDS.m @@ -33,6 +33,11 @@ EXTRACT(MEDXML,DFN,MEDOUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE . S HASOP=1 ; SET FLAG TO KNOW HOW TO ADD XML . S MEDCNT=@MEDOUTXML@(0) ; SAVE COUNT TO KNOW HOW TO ADD TO MAP . W "HAS ACTIVE OP MEDS",! + D EXTRACT^CCRMEDS2(MEDXML,DFN,MEDOUTXML) ; FIRST EXTRACT OUTPATIENT MEDS + I @MEDOUTXML@(0)>0 D ; CCRMEDS FOUND ACTIVE OP MEDS + . S HASOP=1 ; SET FLAG TO KNOW HOW TO ADD XML + . S MEDCNT=@MEDOUTXML@(0) ; SAVE COUNT TO KNOW HOW TO ADD TO MAP + . W "HAS OP MEDS",! N MEDRSLT,I,J,K,MEDPTMP,X,MEDVMAP,TBUF D ACTIVE^ORWPS(.MEDRSLT,DFN) I '$D(MEDRSLT(1)) D ; NO MEDS FOR THIS PATIENT, EXIT diff --git a/p/GPLXPATH.m b/p/GPLXPATH.m index 1c58d9e..c5b809e 100644 --- a/p/GPLXPATH.m +++ b/p/GPLXPATH.m @@ -368,13 +368,19 @@ MAP(IXML,INARY,OXML) ; SUBSTITUTE MULTIPLE @@X@@ VARS WITH VALUES IN INARY . . . S TNAM=$P(@OXML@(I),"@@",J) ; EXTRACT THE VARIABLE NAME . . . S TVAL="@@"_$P(@IXML@(I),"@@",J)_"@@" ; DEFAULT UNCHANGED . . . I $D(@INARY@(TNAM)) D ; IS THE VARIABLE IN THE MAP? - . . . . S TVAL=@INARY@(TNAM) ; PULL OUT MAPPED VALUE + . . . . I '$D(@INARY@(TNAM,"F")) D ; NOT A SPECIAL FIELD + . . . . . S TVAL=@INARY@(TNAM) ; PULL OUT MAPPED VALUE + . . . . E D DOFLD ; PROCESS A FIELD . . . S TSTR=TSTR_TVAL_$P(@IXML@(I),"@@",J+1) ; ADD VAR AND PART AFTER . . S @OXML@(I)=TSTR ; COPY LINE WITH MAPPED VALUES . . I DEBUG W TSTR I DEBUG W "MAPPED",! Q ; +DOFLD ; PROCESS A FILEMAN FIELD REFERENCED BY A VARIABLE + ; + Q + ; TRIM(THEXML) ; TAKES OUT ALL NULL ELEMENTS ; THEXML IS PASSED BY NAME N I,J,TMPXML,DEL,FOUND,INTXT