From c0f8b2738c591805ebd2645627373c482309b009 Mon Sep 17 00:00:00 2001 From: george Date: Tue, 12 Aug 2008 18:45:52 +0000 Subject: [PATCH] Fixes for CCD narrative and no vitals processing --- p/GPLPROBS.m | 23 ++++++++++++++++------- p/GPLVITALS.m | 4 ++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/p/GPLPROBS.m b/p/GPLPROBS.m index be743a0..539b482 100644 --- a/p/GPLPROBS.m +++ b/p/GPLPROBS.m @@ -40,7 +40,7 @@ EXTRACT(IPXML,DFN,OUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE F J=1:1:RPCRSLT(0) D ; FOR EACH PROBLEM IN THE LIST . S VMAP=$NA(@TVMAP@(J)) . K @VMAP - . I DEBUG W "VMAP= ",VMAP,! + . W "VMAP= ",VMAP,! . S PTMP=RPCRSLT(J) ; PULL OUT PROBLEM FROM RPC RETURN ARRAY . S @VMAP@("PROBLEMOBJECTID")="PROBLEM"_J ; UNIQUE OBJID FOR PROBLEM . S @VMAP@("PROBLEMIEN")=$P(PTMP,U,1) @@ -77,18 +77,27 @@ EXTRACT(IPXML,DFN,OUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE ; $$HTML^DILF( ; GENERATE THE NARITIVE HTML FOR THE CCD I CCD D ; IF THIS IS FOR A CCD - . N HTMP,HOUT,HTMLO,I,ZX - . F I=1:1:RPCRSLT(0) D ; FOR EACH PROBLEM - . . S VMAP=$NA(@TVMAP@(I)) + . N HTMP,HOUT,HTMLO,GPLPROBI,ZX + . F GPLPROBI=1:1:RPCRSLT(0) D ; FOR EACH PROBLEM + . . S VMAP=$NA(@TVMAP@(GPLPROBI)) + . . W "VMAP =",VMAP,! . . D QUERY^GPLXPATH(TGLOBAL,"//ContinuityOfCareRecord/Body/PROBLEMS-HTML","HTMP") ; GET THE HTML FROM THE TEMPLATE . . D UNMARK^GPLXPATH("HTMP") ; REMOVE MARKUP . . ; D PARY^GPLXPATH("HTMP") ; PRINT IT . . D MAP^GPLXPATH("HTMP",VMAP,"HOUT") ; MAP THE VARIABLES . . ; D PARY^GPLXPATH("HOUT") ; PRINT IT AGAIN - . . I I=1 D ; FIRST ONE IS JUST A COPY + . . I GPLPROBI=1 D ; FIRST ONE IS JUST A COPY . . . D CP^GPLXPATH("HOUT","HTMLO") - . . I I>1 D ; AFTER THE FIRST, INSERT INNER HTML - . . . D INSINNER^GPLXPATH("HOUT","HTMLO","//") + . . I GPLPROBI>1 D ; AFTER THE FIRST, INSERT INNER HTML + . . . W "DOING INNER",! + . . . N HTMLBLD,HTMLTMP + . . . D QUEUE^GPLXPATH("HTMLBLD","HTMLO",1,HTMLO(0)-1) + . . . D QUEUE^GPLXPATH("HTMLBLD","HOUT",2,HOUT(0)-1) + . . . D QUEUE^GPLXPATH("HTMLBLD","HTMLO",HTMLO(0),HTMLO(0)) + . . . D BUILD^GPLXPATH("HTMLBLD","HTMLTMP") + . . . D CP^GPLXPATH("HTMLTMP","HTMLO") + . . . ; D INSINNER^GPLXPATH("HOUT","HTMLO","//") + . D PARY^GPLXPATH("HTMLO") . D INSB4^GPLXPATH(OUTXML,"HTMLO") ; INSERT AT TOP OF SECTION N PROBSTMP,I D MISSING^GPLXPATH(ARYTMP,"PROBSTMP") ; SEARCH XML FOR MISSING VARS diff --git a/p/GPLVITALS.m b/p/GPLVITALS.m index 93b84f5..2b57b5f 100644 --- a/p/GPLVITALS.m +++ b/p/GPLVITALS.m @@ -27,8 +27,8 @@ EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT VITALS INTO PROVIDED XML TEMPLATE ; N VITRSLT,J,K,VITPTMP,X,VITVMAP,TBUF D VITALS^ORQQVI(.VITRSLT,DFN,"","") - I '$D(VITRSLT(1)) D ; NULL RESULT FROM RPC - . W "NULL RESULT FROM VITALS RPC",! + I $P(VITRSLT(1),U,2)="No vitals found." D ; NULL RESULT FROM RPC + . W "NO VITALS FOUND FROM VITALS RPC",! . S @VITOUTXML@(0)=0 . Q ; ZWR RPCRSLT