Changeset 421 for ccr/trunk/p/C0CMED.m
- Timestamp:
- Mar 29, 2009, 4:19:05 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CMED.m
r418 r421 41 41 ; 42 42 ; --Prep variables 43 D:$$RPMS^C0CUTIL() RPMS QUIT 44 D:($$VISTA^C0CUTIL())!($$WV^C0CUTIL()) VISTA QUIT 45 D EXTRACT^C0CMED1(MEDXML,DFN,MEDOUTXML) ; FIRST EXTRACT OUTPATIENT MEDS 46 I @MEDOUTXML@(0)>0 D ; C0CMED FOUND ACTIVE OP MEDS 47 . W "HAS ACTIVE OP MEDS",! 48 N PENDINGXML 49 S PENDINGXML="MEDPENDING" ;NAME FOR ARRAY 50 D EXTRACT^C0CMED2(MEDXML,DFN,PENDINGXML) ; FIRST EXTRACT OUTPATIENT MEDS 51 I @PENDINGXML@(0)>0 D ; C0CMED FOUND PENDING OP MEDS 52 . I @MEDOUTXML@(0)>0 D ; IF WE NEED TO COMBINE MEDS 53 . . D INSINNER^C0CXPATH(MEDOUTXML,PENDINGXML) ;ADD PENDING TO ACTIVE 54 . E D CP^C0CXPATH(PENDINGXML,MEDOUTXML) ; NO ACTIVE MEDS, JUST COPY 55 . W "HAS OP PENDING MEDS",! 56 N PENDINGXML 57 S PENDINGXML="MEDPENDING" ;NAME FOR ARRAY 58 D EXTRACT^C0CMED3(MEDXML,DFN,PENDINGXML) ; FIRST EXTRACT OUTPATIENT MEDS 59 I @PENDINGXML@(0)>0 D ; C0CMED FOUND PENDING OP MEDS 60 . I @MEDOUTXML@(0)>0 D ; IF WE NEED TO COMBINE MEDS 61 . . D INSINNER^C0CXPATH(MEDOUTXML,PENDINGXML) ;ADD NON-VA TO MEDS 62 . E D CP^C0CXPATH(PENDINGXML,MEDOUTXML) ; NO PREVIOUS MEDS, JUST COPY 43 I $$RPMS^C0CUTIL() D RPMS QUIT 44 I ($$VISTA^C0CUTIL())!($$WV^C0CUTIL())!($$OV^C0CUTIL()) D VISTA QUIT 45 ; Extraction Sections 46 RPMS 47 D EXTRACT^C0CMED6(MEDXML,DFN,MEDOUTXML) QUIT 48 VISTA 49 N MEDCOUNT S MEDCOUNT=0 50 N HIST S HIST=$NA(^TMP($J,"MED","HIST")) ; Meds already dispensed 51 N PEND S PEND=$NA(^TMP($J,"MED","PEND")) ; Pending Meds 52 N NVA S NVA=$NA(^TMP($J,"MED","NVA")) ; non-VA Meds 53 ; N IPIV ; Inpatient IV Meds 54 ; N IPUD ; Inpatient UD Meds 55 K ^TMP($J,"MED") 56 D EXTRACT^C0CMED1(MEDXML,DFN,HIST,.MEDCOUNT) ; Historical OP Meds 57 D EXTRACT^C0CMED2(MEDXML,DFN,PEND,.MEDCOUNT) ; Pending Meds 58 D EXTRACT^C0CMED3(MEDXML,DFN,NVA,.MEDCOUNT) ; non-VA Meds 59 I @HIST@(0)>0 D 60 . D CP^C0CXPATH(HIST,MEDOUTXML) 61 . W:$G(DEBUG) "HAS ACTIVE OP MEDS",! 62 I @PEND@(0)>0 D 63 . I @HIST@(0)>0 D INSINNER^C0CXPATH(MEDOUTXML,PEND) ;Add Pending to Historical 64 . E D CP^C0CXPATH(PEND,MEDOUTXML) ; No historical, just copy 65 . W:$G(DEBUG) "HAS OP PENDING MEDS",! 66 I @NVA@(0)>0 D 67 . I @HIST@(0)>0!(@PEND@(0)>0) D INSINNER^C0CXPATH(MEDOUTXML,NVA) 68 . E D CP^C0CXPATH(NVA,MEDOUTXML) 63 69 . W:$G(DEBUG) "HAS NON-VA MEDS",! 64 70 Q 65 ; Extraction Sections66 RPMS67 D EXTRACT^C0CMED6(MEDXML,DFN,MEDOUTXML) QUIT68 VISTA69 71
Note:
See TracChangeset
for help on using the changeset viewer.