First take on implementing paramters for RPMS...
This commit is contained in:
parent
67d0bf0a72
commit
89b7902306
10
p/C0CMED.m
10
p/C0CMED.m
|
@ -1,5 +1,5 @@
|
|||
C0CMED ; WV/CCDCCR/GPL/SMH - CCR/CCD Medications Driver; Mar 23 2009
|
||||
;;0.5;CCDCCR;;JUL 16,2008;
|
||||
;;0.6;CCDCCR;;JUL 16,2008;
|
||||
; Copyright 2008,2009 George Lilly, University of Minnesota and Sam Habiel.
|
||||
; Licensed under the terms of the GNU General Public License.
|
||||
; See attached copy of the License.
|
||||
|
@ -39,12 +39,14 @@ EXTRACT(MEDXML,DFN,MEDOUTXML) ; Private; Extract medications into provided XML t
|
|||
; 5. VA Inpatient UD Meds are in C0CMED5 (doesn't exist yet)--March 2009
|
||||
; 6. RPMS Meds are in C0CMED6. Need to create other routines for subdivisions of RPMS Meds is not known at this time.
|
||||
;
|
||||
; --Prep variables
|
||||
; --Find out what system we are on...
|
||||
I $$RPMS^C0CUTIL() D RPMS QUIT
|
||||
I ($$VISTA^C0CUTIL())!($$WV^C0CUTIL())!($$OV^C0CUTIL()) D VISTA QUIT
|
||||
; Extraction Sections
|
||||
; --Get parameters for meds
|
||||
N C0CMFLAG
|
||||
S C0CMFLAG=$$GET^C0CPARMS("MEDALL")_"^"_$$GET^C0CPARMS("MEDLIMIT")_"^"_$$GET^C0CPARMS("MEDACTIVE")_"^"_$$GET^C0CPARMS("MEDPENDING")
|
||||
RPMS
|
||||
D EXTRACT^C0CMED6(MEDXML,DFN,MEDOUTXML) QUIT
|
||||
D EXTRACT^C0CMED6(MEDXML,DFN,MEDOUTXML,C0CMFLAG) QUIT
|
||||
VISTA
|
||||
N MEDCOUNT S MEDCOUNT=0
|
||||
N HIST S HIST=$NA(^TMP($J,"MED","HIST")) ; Meds already dispensed
|
||||
|
|
14
p/C0CMED6.m
14
p/C0CMED6.m
|
@ -20,10 +20,12 @@ C0CMED6 ; WV/CCDCCR/SMH - Meds from RPMS: Outpatient Meds;01/10/09
|
|||
W "NO ENTRY FROM TOP",!
|
||||
Q
|
||||
;
|
||||
EXTRACT(MINXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
||||
EXTRACT(MINXML,DFN,OUTXML,FLAGS) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
||||
;
|
||||
; MINXML and OUTXML are passed by name so globals can be used
|
||||
; MINXML will contain only the medications skeleton of the overall template
|
||||
; FLAGS are: MEDALL(bool)^MEDLIMIT(int)^MEDACTIVE(bool)^MEDPENDING(bool)
|
||||
; FLAGS are set-up in C0CMED.
|
||||
;
|
||||
; MEDS is return array from RPC.
|
||||
; MAP is a mapping variable map (store result) for each med
|
||||
|
@ -44,7 +46,10 @@ EXTRACT(MINXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
|||
; Status Reason^DEA Handling
|
||||
;
|
||||
N MEDS,MEDS1,MAP
|
||||
D GETRXS^BEHORXFN("MEDS1",DFN,365) ; Days hard set to 365
|
||||
D GETRXS^BEHORXFN("MEDS1",DFN,$P(FLAGS,U,2)) ; 2nd piece of FLAGS is # of days to retrieve
|
||||
N ALL S ALL=+FLAGS
|
||||
N ACTIVE S ACTIVE=$P(FLAGS,U,3)
|
||||
N PENDING S PENDING=$P(FLAGS,U,4)
|
||||
; If MEDS1 is not defined, then no meds
|
||||
I '$D(MEDS1) S @OUTXML@(0)=0 QUIT
|
||||
I DEBUG ZWR MEDS1,MINXML
|
||||
|
@ -57,14 +62,13 @@ EXTRACT(MINXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
|||
; I won't be using those because I have to get the sig parsed exactly.
|
||||
N J S J="" F S J=$O(MEDS1(J)) Q:J="" I $E(MEDS1(J),1,3)="~OP" S MEDCNT=MEDCNT+1 S MEDS(MEDCNT)=MEDS1(J)
|
||||
K MEDS1
|
||||
S MEDMAP=$NA(^TMP("C0CCCR",$J,"MEDMAP")) ; this is the variable map
|
||||
S @MEDMAP@(0)=0 ; Initial count of meds
|
||||
S MEDCNT="" ; Initialize for $Order
|
||||
F S MEDCNT=$O(MEDS(MEDCNT)) Q:MEDCNT="" D ; for each medication in the list
|
||||
. I 'ALL,ACTIVE,$P(MEDS(MEDCNT),U,10)'="ACTIVE" QUIT
|
||||
. I 'ALL,PENDING,$P(MEDS(MEDCNT),U,10)'="PENDING" QUIT
|
||||
. I DEBUG W "MEDCNT IS ",MEDCNT,!
|
||||
. S MAP=$NA(^TMP("C0CCCR",$J,"MEDMAP",MEDCNT))
|
||||
. ; K @MAP DO NOT KILL HERE, WAS CLEARED IN C0CMED
|
||||
. S @MEDMAP@(0)=@MEDMAP@(0)+1 ; increment total meds in var array
|
||||
. I DEBUG W "MAP= ",MAP,!
|
||||
. S @MAP@("MEDOBJECTID")="MED"_MEDCNT ; MEDCNT FOR ID
|
||||
. S @MAP@("MEDISSUEDATETXT")="Issue Date"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
GPLPARMS ; CCDCCR/GPL - CCR/CCD PARAMETER PROCESSING ; 1/29/09
|
||||
C0CPARMS ; CCDCCR/GPL - CCR/CCD PARAMETER PROCESSING ; 1/29/09
|
||||
;;0.3;CCDCCR;nopatch;noreleasedate
|
||||
;Copyright 2008 WorldVistA. Licensed under the terms of the GNU
|
||||
;General Public License See attached copy of the License.
|
||||
|
|
Loading…
Reference in New Issue