fix for field processing in meds
This commit is contained in:
parent
556edc8bfc
commit
69a66c2b04
|
@ -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 HASOP=1 ; SET FLAG TO KNOW HOW TO ADD XML
|
||||||
. S MEDCNT=@MEDOUTXML@(0) ; SAVE COUNT TO KNOW HOW TO ADD TO MAP
|
. S MEDCNT=@MEDOUTXML@(0) ; SAVE COUNT TO KNOW HOW TO ADD TO MAP
|
||||||
. W "HAS ACTIVE OP MEDS",!
|
. 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
|
N MEDRSLT,I,J,K,MEDPTMP,X,MEDVMAP,TBUF
|
||||||
D ACTIVE^ORWPS(.MEDRSLT,DFN)
|
D ACTIVE^ORWPS(.MEDRSLT,DFN)
|
||||||
I '$D(MEDRSLT(1)) D ; NO MEDS FOR THIS PATIENT, EXIT
|
I '$D(MEDRSLT(1)) D ; NO MEDS FOR THIS PATIENT, EXIT
|
||||||
|
|
|
@ -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 TNAM=$P(@OXML@(I),"@@",J) ; EXTRACT THE VARIABLE NAME
|
||||||
. . . S TVAL="@@"_$P(@IXML@(I),"@@",J)_"@@" ; DEFAULT UNCHANGED
|
. . . S TVAL="@@"_$P(@IXML@(I),"@@",J)_"@@" ; DEFAULT UNCHANGED
|
||||||
. . . I $D(@INARY@(TNAM)) D ; IS THE VARIABLE IN THE MAP?
|
. . . 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 TSTR=TSTR_TVAL_$P(@IXML@(I),"@@",J+1) ; ADD VAR AND PART AFTER
|
||||||
. . S @OXML@(I)=TSTR ; COPY LINE WITH MAPPED VALUES
|
. . S @OXML@(I)=TSTR ; COPY LINE WITH MAPPED VALUES
|
||||||
. . I DEBUG W TSTR
|
. . I DEBUG W TSTR
|
||||||
I DEBUG W "MAPPED",!
|
I DEBUG W "MAPPED",!
|
||||||
Q
|
Q
|
||||||
;
|
;
|
||||||
|
DOFLD ; PROCESS A FILEMAN FIELD REFERENCED BY A VARIABLE
|
||||||
|
;
|
||||||
|
Q
|
||||||
|
;
|
||||||
TRIM(THEXML) ; TAKES OUT ALL NULL ELEMENTS
|
TRIM(THEXML) ; TAKES OUT ALL NULL ELEMENTS
|
||||||
; THEXML IS PASSED BY NAME
|
; THEXML IS PASSED BY NAME
|
||||||
N I,J,TMPXML,DEL,FOUND,INTXT
|
N I,J,TMPXML,DEL,FOUND,INTXT
|
||||||
|
|
Loading…
Reference in New Issue