Changeset 426
- Timestamp:
- Mar 29, 2009, 7:58:12 PM (16 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CMED.m
r425 r426 41 41 ; 42 42 ; --Get parameters for meds 43 S @MEDOUTXML@(0)=0 ; By default, empty. 43 44 N C0CMFLAG 44 45 S C0CMFLAG=$$GET^C0CPARMS("MEDALL")_"^"_$$GET^C0CPARMS("MEDLIMIT")_"^"_$$GET^C0CPARMS("MEDACTIVE")_"^"_$$GET^C0CPARMS("MEDPENDING") … … 56 57 VISTA 57 58 N MEDCOUNT S MEDCOUNT=0 59 K ^TMP($J,"MED") 58 60 N HIST S HIST=$NA(^TMP($J,"MED","HIST")) ; Meds already dispensed 59 61 N PEND S PEND=$NA(^TMP($J,"MED","PEND")) ; Pending Meds 60 62 N NVA S NVA=$NA(^TMP($J,"MED","NVA")) ; non-VA Meds 63 S @HIST@(0)=0,@PEND@(0)=0,@NVA@(0)=0 ; At first, they are all empty... (prevent undefined errors) 61 64 ; N IPIV ; Inpatient IV Meds 62 65 ; N IPUD ; Inpatient UD Meds 63 K ^TMP($J,"MED") 64 D EXTRACT^C0CMED1(MEDXML,DFN,HIST,.MEDCOUNT) ; Historical OP Meds 65 D EXTRACT^C0CMED2(MEDXML,DFN,PEND,.MEDCOUNT) ; Pending Meds 66 D EXTRACT^C0CMED3(MEDXML,DFN,NVA,.MEDCOUNT) ; non-VA Meds 66 D EXTRACT^C0CMED1(MEDXML,DFN,HIST,.MEDCOUNT,C0CMFLAG) ; Historical OP Meds 67 D:$P(C0CMFLAG,U,4) EXTRACT^C0CMED2(MEDXML,DFN,PEND,.MEDCOUNT) ; Pending Meds 68 D:+C0CMFLAG EXTRACT^C0CMED3(MEDXML,DFN,NVA,.MEDCOUNT) ; non-VA Meds 67 69 I @HIST@(0)>0 D 68 70 . D CP^C0CXPATH(HIST,MEDOUTXML) -
ccr/trunk/p/C0CMED1.m
r421 r426 22 22 Q 23 23 ; 24 EXTRACT(MINXML,DFN,OUTXML,MEDCOUNT ); EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE24 EXTRACT(MINXML,DFN,OUTXML,MEDCOUNT,FLAGS) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE 25 25 ; 26 26 ; INXML AND OUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED … … 31 31 ; MED is holds each array element from MEDS(J), one medicine 32 32 ; MEDCOUNT is a counter passed by Reference. 33 ; FLAGS are: MEDALL(bool)^MEDLIMIT(int)^MEDACTIVE(bool)^MEDPENDING(bool) 34 ; FLAGS are set-up in C0CMED. 33 35 ; 34 36 ; RX^PSO52API is a Pharmacy Re-Enginnering (PRE) API to get all … … 39 41 N MEDS,MAP 40 42 K ^TMP($J,"CCDCCR") ; PLEASE DON'T KILL ALL OF ^TMP($J) HERE!!!! 41 D RX^PSO52API(DFN,"CCDCCR") 43 N ALL S ALL=+FLAGS 44 N ACTIVE S ACTIVE=$P(FLAGS,U,3) 45 ; Below, X1 is today; X2 is the number of days we want to go back 46 ; X is the result of this calculation using C^%DTC. 47 N X,X1,X2 48 S X1=DT 49 S X2=-$P($P(FLAGS,U,2),"-",2) 50 D C^%DTC 51 ; I discovered that I shouldn't put an ending date (last parameter) 52 ; because it seems that it will get meds whose beginning is after X but 53 ; whose exipriation is before the ending date. 54 D RX^PSO52API(DFN,"CCDCCR","","","",X,"") 42 55 M MEDS=^TMP($J,"CCDCCR",DFN) 43 56 ; @(0) contains the number of meds or -1^NO DATA FOUND … … 47 60 N RXIEN S RXIEN=0 48 61 F S RXIEN=$O(MEDS(RXIEN)) Q:RXIEN="" D ; FOR EACH MEDICATION IN THE LIST 62 . N MED M MED=MEDS(RXIEN) 63 . I 'ALL,ACTIVE,$P(MED(100),U,2)'="ACTIVE" QUIT 49 64 . S MEDCOUNT=MEDCOUNT+1 50 65 . W:$G(DEBUG) "RXIEN IS ",RXIEN,! … … 52 67 . ; K @MAP DO NOT KILL HERE, WAS CLEARED IN C0CMED 53 68 . W:$G(DEBUG) "MAP= ",MAP,! 54 . N MED M MED=MEDS(RXIEN) ; PULL OUT MEDICATION FROM55 69 . S @MAP@("MEDOBJECTID")="MED"_MEDCOUNT ; MEDCOUNT FOR ID 56 70 . ; S @MAP@("MEDOBJECTID")="MED"_MED(.01) ;Rx Number
Note:
See TracChangeset
for help on using the changeset viewer.