MEDS DEBUGGING
This commit is contained in:
parent
7a08629ad7
commit
efb41d328e
|
@ -33,8 +33,10 @@ EXTRACT(MEDXML,DFN,MEDOUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
||||||
; INPATIENT MEDS IN EXTRACT^CCRMEDS4
|
; INPATIENT MEDS IN EXTRACT^CCRMEDS4
|
||||||
; ALL OTHERS HERE
|
; ALL OTHERS HERE
|
||||||
S MEDTVMAP=$NA(^TMP("GPLCCR",$J,"MEDMAP"))
|
S MEDTVMAP=$NA(^TMP("GPLCCR",$J,"MEDMAP"))
|
||||||
|
K @MEDTVMAP ; CLEAR VARIABLE ARRAY
|
||||||
S @MEDTVMAP@(0)=0 ; INITIALIZE NUMBER OF MEDS PROCESSED
|
S @MEDTVMAP@(0)=0 ; INITIALIZE NUMBER OF MEDS PROCESSED
|
||||||
S MEDTARYTMP=$NA(^TMP("GPLCCR",$J,"MEDARYTMP"))
|
S MEDTARYTMP=$NA(^TMP("GPLCCR",$J,"MEDARYTMP"))
|
||||||
|
K @MEDTARYTMP ; KILL XML ARRAY
|
||||||
D EXTRACT^CCRMEDS1(MEDXML,DFN,MEDOUTXML) ; FIRST EXTRACT OUTPATIENT MEDS
|
D EXTRACT^CCRMEDS1(MEDXML,DFN,MEDOUTXML) ; FIRST EXTRACT OUTPATIENT MEDS
|
||||||
I @MEDOUTXML@(0)>0 D ; CCRMEDS FOUND ACTIVE OP MEDS
|
I @MEDOUTXML@(0)>0 D ; CCRMEDS FOUND ACTIVE OP MEDS
|
||||||
. S HASOP=1 ; SET FLAG TO KNOW HOW TO ADD XML
|
. S HASOP=1 ; SET FLAG TO KNOW HOW TO ADD XML
|
||||||
|
@ -87,6 +89,7 @@ EXTRACT(MEDXML,DFN,MEDOUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
||||||
. S ZJ=$P(ZA(ZI),U,1) ; INDEX OF FIRST LINE OF MED IN MEDRSLT
|
. S ZJ=$P(ZA(ZI),U,1) ; INDEX OF FIRST LINE OF MED IN MEDRSLT
|
||||||
. S MEDPTMP=MEDRSLT(ZJ) ; PULL OUT FIRST LINE OF MED
|
. S MEDPTMP=MEDRSLT(ZJ) ; PULL OUT FIRST LINE OF MED
|
||||||
. I $P(MEDPTMP,U,1)?1"~OP" Q ; SKIP OP ACTIVE AND PENDING
|
. I $P(MEDPTMP,U,1)?1"~OP" Q ; SKIP OP ACTIVE AND PENDING
|
||||||
|
. S @MEDTVMAP@(0)=@MEDTVMAP@(0)+1 ; ADDING A MED HERE
|
||||||
. S @MEDVMAP@("MEDOBJECTID")="MED"_(ZI+MEDCNT) ; UNIQUE OBJID FOR MEDS
|
. S @MEDVMAP@("MEDOBJECTID")="MED"_(ZI+MEDCNT) ; UNIQUE OBJID FOR MEDS
|
||||||
. I $P(MEDPTMP,"^",11)="" S @MEDVMAP@("MEDISSUEDATETXT")=""
|
. I $P(MEDPTMP,"^",11)="" S @MEDVMAP@("MEDISSUEDATETXT")=""
|
||||||
. E S @MEDVMAP@("MEDISSUEDATETXT")=$$FMDTOUTC^CCRUTIL($P(MEDPTMP,"^",11),"DT") ; GETS LAST FILL DATE
|
. E S @MEDVMAP@("MEDISSUEDATETXT")=$$FMDTOUTC^CCRUTIL($P(MEDPTMP,"^",11),"DT") ; GETS LAST FILL DATE
|
||||||
|
|
|
@ -45,14 +45,18 @@ EXTRACT(MINXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
||||||
I DEBUG ZWR MEDS
|
I DEBUG ZWR MEDS
|
||||||
N RXIEN S RXIEN=0
|
N RXIEN S RXIEN=0
|
||||||
N MEDCOUNT S MEDCOUNT=0
|
N MEDCOUNT S MEDCOUNT=0
|
||||||
|
S MEDMAP=$NA(^TMP("GPLCCR",$J,"MEDMAP")) ; THIS IS THE VARIABLE MAP
|
||||||
|
S MEDCOUNT=@MEDMAP@(0) ; ACCOUNT FOR MEDS ALREADY IN ARRAY
|
||||||
F S RXIEN=$O(MEDS(RXIEN)) Q:RXIEN="" D ; FOR EACH MEDICATION IN THE LIST
|
F S RXIEN=$O(MEDS(RXIEN)) Q:RXIEN="" D ; FOR EACH MEDICATION IN THE LIST
|
||||||
. S MEDCOUNT=MEDCOUNT+1
|
. S MEDCOUNT=MEDCOUNT+1
|
||||||
. I DEBUG W "RXIEN IS ",RXIEN,!
|
. I DEBUG W "RXIEN IS ",RXIEN,!
|
||||||
. S MAP=$NA(^TMP("GPLCCR",$J,"MEDMAP",MEDCOUNT))
|
. S MAP=$NA(^TMP("GPLCCR",$J,"MEDMAP",MEDCOUNT))
|
||||||
. K @MAP
|
. ; K @MAP DO NOT KILL HERE, WAS CLEARED IN CCRMEDS
|
||||||
|
. S @MEDMAP@(0)=@MEDMAP@(0)+1 ; INCREMENT TOTAL MEDS IN VAR ARRAY
|
||||||
. I DEBUG W "MAP= ",MAP,!
|
. I DEBUG W "MAP= ",MAP,!
|
||||||
. N MED M MED=MEDS(RXIEN) ; PULL OUT MEDICATION FROM
|
. N MED M MED=MEDS(RXIEN) ; PULL OUT MEDICATION FROM
|
||||||
. S @MAP@("MEDOBJECTID")="MED"_MED(.01) ;Rx Number
|
. S @MAP@("MEDOBJECTID")="MED"_MEDCOUNT ; MEDCOUNT FOR ID
|
||||||
|
. ; S @MAP@("MEDOBJECTID")="MED"_MED(.01) ;Rx Number
|
||||||
. S @MAP@("MEDISSUEDATETXT")="Issue Date"
|
. S @MAP@("MEDISSUEDATETXT")="Issue Date"
|
||||||
. S @MAP@("MEDISSUEDATE")=$$FMDTOUTC^CCRUTIL($P(MED(1),U))
|
. S @MAP@("MEDISSUEDATE")=$$FMDTOUTC^CCRUTIL($P(MED(1),U))
|
||||||
. S @MAP@("MEDLASTFILLDATETXT")="Last Fill Date"
|
. S @MAP@("MEDLASTFILLDATETXT")="Last Fill Date"
|
||||||
|
|
|
@ -48,15 +48,19 @@ EXTRACT(MINXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEM
|
||||||
I DEBUG ZWR MEDS
|
I DEBUG ZWR MEDS
|
||||||
N RXIEN S RXIEN=0
|
N RXIEN S RXIEN=0
|
||||||
N MEDCOUNT S MEDCOUNT=0
|
N MEDCOUNT S MEDCOUNT=0
|
||||||
|
S MEDMAP=$NA(^TMP("GPLCCR",$J,"MEDMAP")) ; THIS IS THE VARIABLE MAP
|
||||||
|
S MEDCOUNT=@MEDMAP@(0) ; ACCOUNT FOR MEDS ALREADY IN ARRAY
|
||||||
F S RXIEN=$O(MEDS(RXIEN)) Q:RXIEN="B" D ; FOR EACH MEDICATION IN THE LIST
|
F S RXIEN=$O(MEDS(RXIEN)) Q:RXIEN="B" D ; FOR EACH MEDICATION IN THE LIST
|
||||||
. I $$GET1^DIQ(52.41,RXIEN,2,"I")="RF" QUIT ; Dont' want refill request as a "pending" order
|
. I $$GET1^DIQ(52.41,RXIEN,2,"I")="RF" QUIT ; Dont' want refill request as a "pending" order
|
||||||
. S MEDCOUNT=MEDCOUNT+1
|
. S MEDCOUNT=MEDCOUNT+1
|
||||||
. I DEBUG W "RXIEN IS ",RXIEN,!
|
. I DEBUG W "RXIEN IS ",RXIEN,!
|
||||||
. S MAP=$NA(^TMP("GPLCCR",$J,"MEDMAP",MEDCOUNT))
|
. S MAP=$NA(^TMP("GPLCCR",$J,"MEDMAP",MEDCOUNT))
|
||||||
. K @MAP
|
. ; K @MAP DON'T KILL MAP HERE, IT IS DONE IN CCRMEDS
|
||||||
|
. S @MEDMAP@(0)=@MEDMAP@(0)+1 ; INCREMENT TOTAL MEDS IN VAR ARRAY
|
||||||
. I DEBUG W "MAP= ",MAP,!
|
. I DEBUG W "MAP= ",MAP,!
|
||||||
. N MED M MED=MEDS(RXIEN) ; PULL OUT MEDICATION FROM
|
. N MED M MED=MEDS(RXIEN) ; PULL OUT MEDICATION FROM
|
||||||
. S @MAP@("MEDOBJECTID")="MED_PENDING"_MED(.01) ;Pending IEN
|
. S @MAP@("MEDOBJECTID")="MED_PENDING"_MEDCOUNT ; MEDCOUNT FOR ID
|
||||||
|
. ; S @MAP@("MEDOBJECTID")="MED_PENDING"_MED(.01) ;Pending IEN
|
||||||
. S @MAP@("MEDISSUEDATETXT")="Issue Date"
|
. S @MAP@("MEDISSUEDATETXT")="Issue Date"
|
||||||
. ; Field 6 is "Effective date", and we pull it in timson format w/ I
|
. ; Field 6 is "Effective date", and we pull it in timson format w/ I
|
||||||
. S @MAP@("MEDISSUEDATE")=$$FMDTOUTC^CCRUTIL($$GET1^DIQ(52.41,RXIEN,6,"I"))
|
. S @MAP@("MEDISSUEDATE")=$$FMDTOUTC^CCRUTIL($$GET1^DIQ(52.41,RXIEN,6,"I"))
|
||||||
|
|
Loading…
Reference in New Issue