From c1c9ec5cf768131917755776a8ec8df47833c601 Mon Sep 17 00:00:00 2001 From: cje Date: Wed, 16 Jul 2008 18:42:13 +0000 Subject: [PATCH] created skeleton for Meds --- p/GPLMEDS.m | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ p/GPLVITALS.m | 10 ++++++--- 2 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 p/GPLMEDS.m diff --git a/p/GPLMEDS.m b/p/GPLMEDS.m new file mode 100644 index 0000000..f9dedeb --- /dev/null +++ b/p/GPLMEDS.m @@ -0,0 +1,61 @@ +GPLVITALS ; CCDCCR/CJE - CCR/CCD PROCESSING FOR MEDICATIONS ; 07/16/08 + ;;0.1;CCDCCR;;JUL 16,2008; + ;Copyright 2008 WorldVistA. Licensed under the terms of the GNU + ;General Public License See attached copy of the License. + ; + ;This program is free software; you can redistribute it and/or modify + ;it under the terms of the GNU General Public License as published by + ;the Free Software Foundation; either version 2 of the License, or + ;(at your option) any later version. + ; + ;This program is distributed in the hope that it will be useful, + ;but WITHOUT ANY WARRANTY; without even the implied warranty of + ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ;GNU General Public License for more details. + ; + ;You should have received a copy of the GNU General Public License along + ;with this program; if not, write to the Free Software Foundation, Inc., + ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + ; + W "NO ENTRY FROM TOP",! + W ! + Q + ; +EXTRACT(MEDXML,DFN,MEDOUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE + ; + ; MEDXML AND OUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED + ; IMEDXML WILL CONTAIN ONLY THE MEDICATIONS SECTION OF THE OVERALL TEMPLATE + ; + N MEDRSLT,J,K,MEDPTMP,X,MEDVMAP,TBUF + ; REPLACE ME WITH MEDS RPC!! + I '$D(MEDRSLT(1)) W "ERROR RUNNINIG MEDICATIONS RPC",! Q + ; ZWR RPCRSLT + S MEDTVMAP=$NA(^TMP("GPLCCR",$J,"VITALS")) + S MEDTARYTMP=$NA(^TMP("GPLCCR",$J,"VITALARYTMP")) + F J=1:1:MEDRSLT(1) D ; FOR EACH MEDICATION IN THE LIST + . I $D(MEDRSLT(J)) D + . . S MEDVMAP=$NA(@MEDTVMAP@(J)) + . . K @MEDVMAP + . . I DEBUG W "VMAP= ",VMAP,! + . . S MEDPTMP=MEDRSLT(J) ; PULL OUT MEDICATION FROM RPC RETURN ARRAY + . . S @MEDVMAP@("MEDDATAOBJECTID")="VITAL"_J ; UNIQUE OBJID FOR MEDICATION + . . ; PROCESSING FOR MEDS GOES HERE + . . S MEDARYTMP=$NA(@MEDTARYTMP@(J)) + . . K @MEDARYTMP + . . D MAP^GPLXPATH(MEDXML,MEDVMAP,MEDARYTMP) + . . I J=1 D ; FIRST ONE IS JUST A COPY + . . . ; W "FIRST ONE",! + . . . D CP^GPLXPATH(MEDARYTMP,MEDOUTXML) + . . . ; W "OUTXML ",OUTXML,! + . . I J>1 D ; AFTER THE FIRST, INSERT INNER XML + . . . D INSINNER^GPLXPATH(MEDOUTXML,MEDARYTMP) + ; ZWR ^TMP($J,"VITALS",*) + ; ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS + ; ZWR @OUTXML + N MEDTMP,I + D MISSING^GPLXPATH(MEDOUTXML,"MEDTMP") ; SEARCH XML FOR MISSING VARS + I MEDTMP(0)>0 D ; IF THERE ARE MISSING VARS - MARKED AS @@X@@ + . W "MEDICATION MISSING ",! + . F I=1:1:MEDTMP(0) W MEDTMP(I),! + Q + ; diff --git a/p/GPLVITALS.m b/p/GPLVITALS.m index fd9992b..a60156b 100644 --- a/p/GPLVITALS.m +++ b/p/GPLVITALS.m @@ -1,5 +1,5 @@ -GPLVITALS ; CCDCCR/CJE - CCR/CCD PROCESSING FOR VITALS ; 07/03/08 - ;;0.1;CCDCCR;;JUL 3,2008; +GPLVITALS ; CCDCCR/CJE - CCR/CCD PROCESSING FOR VITALS ; 07/16/08 + ;;0.1;CCDCCR;;JUL 16,2008; ;Copyright 2008 WorldVistA. Licensed under the terms of the GNU ;General Public License See attached copy of the License. ; @@ -17,7 +17,11 @@ GPLVITALS ; CCDCCR/CJE - CCR/CCD PROCESSING FOR VITALS ; 07/03/08 ;with this program; if not, write to the Free Software Foundation, Inc., ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ; -EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE + W "NO ENTRY FROM TOP",! + W ! + Q + ; +EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT VITALS INTO PROVIDED XML TEMPLATE ; ; VITXML AND OUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED ; IVITXML WILL CONTAIN ONLY THE VITALS SECTION OF THE OVERALL TEMPLATE