update to support parameters .. XPAT^GPLCCR(1,"LABSTART:T^LABLIMIT:T-5000")
This commit is contained in:
parent
5ea8987faa
commit
7d4b190641
|
@ -0,0 +1,51 @@
|
||||||
|
GPLPARMS ; 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.
|
||||||
|
;
|
||||||
|
;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.
|
||||||
|
;
|
||||||
|
SET(INPARMS) ;INITIALIZE RUNTIME PARMS USING INPARMS TO OVERRIDE DEFAULTS
|
||||||
|
; PARAMETERS ARE PASSED AS A STRING: "PARM1:VALUE1^PARM2:VALUE2^ETC"
|
||||||
|
; THE SAME FORMAT IS USED BY RPC AND COMMAND LINE ENTRY POINTS
|
||||||
|
;
|
||||||
|
N PTMP ;
|
||||||
|
S C0CPARMS=$NA(^TMP($J,"C0CPARMS")) ;BASE FOR THIS RUN
|
||||||
|
;K @C0CPARMS ;START WITH EMPTY PARMS; MAY NOT WANT TO DO THIS KILL
|
||||||
|
I $G(INPARMS)'="" D ; OVERRIDES PROVIDED
|
||||||
|
. N C0CI S C0CI=""
|
||||||
|
. N C0CN S C0CN=1
|
||||||
|
. F S C0CI=$P(INPARMS,"^",C0CN) Q:C0CI="" D ;
|
||||||
|
. . S C0CN=C0CN+1 ;NEXT PARM
|
||||||
|
. . S @C0CPARMS@($P(C0CI,":",1))=$P(C0CI,":",2) ; SET THE PARM
|
||||||
|
. I C0CN=1 S @C0CPARMS@($P(INPARMS,":",1))=$P(C0CI,":",2) ; ONLY ONE
|
||||||
|
; THIS IS WHERE WE WILL INSERT CALLS TO THE PARAMETER FILE FOR DEFAULTS
|
||||||
|
; IF THEY FAIL, THE FOLLOWING WILL BE HARDCODED DEFAULTS
|
||||||
|
I '$D(@C0CPARMS@("LABLIMIT")) S @C0CPARMS@("LABLIMIT")="T-360" ;ONE YR WORTH
|
||||||
|
I '$D(@C0CPARMS@("LABSTART")) S @C0CPARMS@("LABSTART")="T" ;TODAY
|
||||||
|
Q
|
||||||
|
;
|
||||||
|
CHECK ; CHECK TO SEE IF PARMS ARE PRESENT, ELSE RUN SET
|
||||||
|
;
|
||||||
|
I '$D(C0CPARMS) S C0CPARMS=$NA(^TMP($J,"C0CPARMS")) ;SHOULDN'T HAPPEN
|
||||||
|
I '$D(@C0CPARMS) D SET("SETWITHCHECK:1")
|
||||||
|
Q
|
||||||
|
;
|
||||||
|
GET(WHICHP) ;EXTRINSIC TO RETURN THE VALUE OF PARAMETER WHICHP
|
||||||
|
;
|
||||||
|
D CHECK ; SHOULDN'T HAPPEN BUT TO BE SAFE
|
||||||
|
N GTMP
|
||||||
|
Q $G(@C0CPARMS@(WHICHP)) ;PULL THE PARM FROM THE TABLE
|
||||||
|
;
|
|
@ -37,7 +37,7 @@ EXTRACT(MINXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
||||||
; Output of API is ^TMP($J,"SUBSCRIPT",DFN,RXIENS).
|
; Output of API is ^TMP($J,"SUBSCRIPT",DFN,RXIENS).
|
||||||
; D PARY^GPLXPATH(MINXML)
|
; D PARY^GPLXPATH(MINXML)
|
||||||
N MEDS,MAP
|
N MEDS,MAP
|
||||||
K ^TMP($J)
|
K ^TMP($J,"CCDCCR") ; PLEASE DON'T KILL ALL OF ^TMP($J) HERE!!!!
|
||||||
D RX^PSO52API(DFN,"CCDCCR")
|
D RX^PSO52API(DFN,"CCDCCR")
|
||||||
M MEDS=^TMP($J,"CCDCCR",DFN)
|
M MEDS=^TMP($J,"CCDCCR",DFN)
|
||||||
; @(0) contains the number of meds or -1^NO DATA FOUND
|
; @(0) contains the number of meds or -1^NO DATA FOUND
|
||||||
|
|
|
@ -40,7 +40,7 @@ EXTRACT(MINXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEM
|
||||||
; the IEN in 52.41, and the Med Name, and route.
|
; the IEN in 52.41, and the Med Name, and route.
|
||||||
; So, most of the info is going to get pulled from 52.41.
|
; So, most of the info is going to get pulled from 52.41.
|
||||||
N MEDS,MAP
|
N MEDS,MAP
|
||||||
K ^TMP($J)
|
K ^TMP($J,"CCDCCR") ; PLEASE DON'T KILL ALL OF ^TMP($J) HERE!!!!
|
||||||
D PEN^PSO5241(DFN,"CCDCCR")
|
D PEN^PSO5241(DFN,"CCDCCR")
|
||||||
M MEDS=^TMP($J,"CCDCCR",DFN)
|
M MEDS=^TMP($J,"CCDCCR",DFN)
|
||||||
; @(0) contains the number of meds or -1^NO DATA FOUND
|
; @(0) contains the number of meds or -1^NO DATA FOUND
|
||||||
|
|
|
@ -37,7 +37,8 @@ EXTRACT(MINXML,DFN,OUTXML) ; Extract medications into provided xml template
|
||||||
; Will use Fileman API GETS^DIQ
|
; Will use Fileman API GETS^DIQ
|
||||||
;
|
;
|
||||||
N MEDS,MAP
|
N MEDS,MAP
|
||||||
K ^TMP($J),NVA
|
K ^TMP($J,"CCDCCR") ; PLEASE DON'T KILL ALL OF ^TMP($J) HERE!!!!
|
||||||
|
K NVA
|
||||||
D GETS^DIQ(55,DFN,"52.2*","IE","NVA") ; Output in NVA in FDA array format.
|
D GETS^DIQ(55,DFN,"52.2*","IE","NVA") ; Output in NVA in FDA array format.
|
||||||
; If NVA does not exist, then patient has no non-VA meds
|
; If NVA does not exist, then patient has no non-VA meds
|
||||||
I $D(NVA)=0 S @OUTXML@(0)=0 QUIT
|
I $D(NVA)=0 S @OUTXML@(0)=0 QUIT
|
||||||
|
|
26
p/GPLCCR.m
26
p/GPLCCR.m
|
@ -24,10 +24,10 @@ EXPORT ; EXPORT ENTRY POINT FOR CCR
|
||||||
S DIC=2,DIC(0)="AEMQ" D ^DIC
|
S DIC=2,DIC(0)="AEMQ" D ^DIC
|
||||||
I Y<1 Q ; EXIT
|
I Y<1 Q ; EXIT
|
||||||
S DFN=$P(Y,U,1) ; SET THE PATIENT
|
S DFN=$P(Y,U,1) ; SET THE PATIENT
|
||||||
D XPAT(DFN,"","") ; EXPORT TO A FILE
|
D XPAT(DFN) ; EXPORT TO A FILE
|
||||||
Q
|
Q
|
||||||
;
|
;
|
||||||
XPAT(DFN,DIR,FN) ; EXPORT ONE PATIENT TO A FILE
|
XPAT(DFN,XPARMS,DIR,FN) ; EXPORT ONE PATIENT TO A FILE
|
||||||
; DIR IS THE DIRECTORY, DEFAULTS IF NULL TO ^TMP("GPLCCR","ODIR")
|
; DIR IS THE DIRECTORY, DEFAULTS IF NULL TO ^TMP("GPLCCR","ODIR")
|
||||||
; FN IS FILE NAME, DEFAULTS IF NULL
|
; FN IS FILE NAME, DEFAULTS IF NULL
|
||||||
N CCRGLO,UDIR,UFN
|
N CCRGLO,UDIR,UFN
|
||||||
|
@ -35,10 +35,11 @@ XPAT(DFN,DIR,FN) ; EXPORT ONE PATIENT TO A FILE
|
||||||
E S UDIR=DIR
|
E S UDIR=DIR
|
||||||
I '$D(FN) S UFN=""
|
I '$D(FN) S UFN=""
|
||||||
E S UFN=FN
|
E S UFN=FN
|
||||||
D CCRRPC(.CCRGLO,DFN,"CCR","","","")
|
I '$D(XPARMS) S XPARMS=""
|
||||||
|
D CCRRPC(.CCRGLO,DFN,XPARMS,"CCR")
|
||||||
S OARY=$NA(^TMP("GPLCCR",$J,DFN,"CCR",1))
|
S OARY=$NA(^TMP("GPLCCR",$J,DFN,"CCR",1))
|
||||||
S ONAM=UFN
|
S ONAM=UFN
|
||||||
I UFN="" S ONAM="PAT_"_DFN_"_CCR_V1_0_12.xml"
|
I UFN="" S ONAM="PAT_"_DFN_"_CCR_V1_0_14.xml"
|
||||||
S ODIRGLB=$NA(^TMP("GPLCCR","ODIR"))
|
S ODIRGLB=$NA(^TMP("GPLCCR","ODIR"))
|
||||||
I '$D(@ODIRGLB) D ; IF NOT ODIR HAS BEEN SET
|
I '$D(@ODIRGLB) D ; IF NOT ODIR HAS BEEN SET
|
||||||
. ;S @ODIRGLB="/home/glilly/CCROUT"
|
. ;S @ODIRGLB="/home/glilly/CCROUT"
|
||||||
|
@ -60,19 +61,18 @@ DCCR(DFN) ; DISPLAY A CCR THAT HAS JUST BEEN EXTRACTED
|
||||||
E W "CCR NOT CREATED, RUN D XPAT^GPLCCR(DFN,"""","""") FIRST",!
|
E W "CCR NOT CREATED, RUN D XPAT^GPLCCR(DFN,"""","""") FIRST",!
|
||||||
Q
|
Q
|
||||||
;
|
;
|
||||||
CCRRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY) ;RPC ENTRY POINT FOR CCR OUTPUT
|
CCRRPC(CCRGRTN,DFN,CCRPARMS,CCRPART) ;RPC ENTRY POINT FOR CCR OUTPUT
|
||||||
; CCRGRTN IS RETURN ARRAY PASSED BY NAME
|
; CCRGRTN IS RETURN ARRAY PASSED BY NAME
|
||||||
; DFN IS PATIENT IEN
|
; DFN IS PATIENT IEN
|
||||||
; CCRPART IS "CCR" FOR ENTIRE CCR, OR SECTION NAME FOR A PART
|
; CCRPART IS "CCR" FOR ENTIRE CCR, OR SECTION NAME FOR A PART
|
||||||
; OF THE CCR BODY.. PARTS INCLUDE "PROBLEMS" "VITALS" ETC
|
; OF THE CCR BODY.. PARTS INCLUDE "PROBLEMS" "VITALS" ETC
|
||||||
; TIME1 IS STARTING TIME TO INCLUDE - NULL MEANS ALL
|
; CCRPARMS ARE PARAMETERS THAT AFFECT THE EXTRACTION
|
||||||
; TIME2 IS ENDING TIME TO INCLUDE TIME IS FILEMAN TIME
|
; IN THE FORM "PARM1:VALUE1^PARM2:VALUE2"
|
||||||
; - NULL MEANS NOW
|
; EXAMPLE: "LABLIMIT:T-60" TO LIMIT LAB EXTRACTION TO THE LAST 60 DAYS
|
||||||
; HDRARY IS THE HEADER ARRAY DEFINING THE "FROM" AND
|
; SEE C0CPARMS FOR A COMPLETE LIST OF SUPPORTED PARAMETERS
|
||||||
; "TO" VARIABLES
|
|
||||||
; IF NULL WILL DEFAULT TO "FROM" DUZ AND "TO" DFN
|
|
||||||
I '$D(DEBUG) S DEBUG=0
|
I '$D(DEBUG) S DEBUG=0
|
||||||
S CCD=0 ; NEED THIS FLAG TO DISTINGUISH FROM CCD
|
S CCD=0 ; NEED THIS FLAG TO DISTINGUISH FROM CCD
|
||||||
|
D SET^C0CPARMS(XPARMS) ;SET PARAMETERS WITH XPARMS AS OVERRIDES
|
||||||
I '$D(TESTLAB) S TESTLAB=0 ; FLAG FOR TESTING RESULTS SECTION
|
I '$D(TESTLAB) S TESTLAB=0 ; FLAG FOR TESTING RESULTS SECTION
|
||||||
I '$D(TESTALERT) S TESTALERT=1 ; FLAG FOR TESTING ALERTS SECTION
|
I '$D(TESTALERT) S TESTALERT=1 ; FLAG FOR TESTING ALERTS SECTION
|
||||||
I '$D(TESTMEDS) S TESTMEDS=0 ; FLAG FOR TESTING CCRMEDS SECTION
|
I '$D(TESTMEDS) S TESTMEDS=0 ; FLAG FOR TESTING CCRMEDS SECTION
|
||||||
|
@ -91,7 +91,7 @@ CCRRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY) ;RPC ENTRY POINT FOR CCR OUTPUT
|
||||||
D REPLACE^GPLXPATH(CCRGLO,"","//ContinuityOfCareRecord/Signatures")
|
D REPLACE^GPLXPATH(CCRGLO,"","//ContinuityOfCareRecord/Signatures")
|
||||||
I DEBUG F I=1:1:@CCRGLO@(0) W @CCRGLO@(I),!
|
I DEBUG F I=1:1:@CCRGLO@(0) W @CCRGLO@(I),!
|
||||||
;
|
;
|
||||||
D HDRMAP(CCRGLO,DFN,HDRARY) ; MAP HEADER VARIABLES
|
D HDRMAP(CCRGLO,DFN) ; MAP HEADER VARIABLES
|
||||||
;
|
;
|
||||||
K ^TMP("GPLCCR",$J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT
|
K ^TMP("GPLCCR",$J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT
|
||||||
S CCRXTAB=$NA(^TMP("GPLCCR",$J,"CCRSTEP")) ; GLOBAL TO STORE CCR STEPS
|
S CCRXTAB=$NA(^TMP("GPLCCR",$J,"CCRSTEP")) ; GLOBAL TO STORE CCR STEPS
|
||||||
|
@ -137,7 +137,7 @@ INITSTPS(TAB) ; INITIALIZE CCR PROCESSING STEPS
|
||||||
I TESTALERT D PUSH^GPLXPATH(TAB,"EXTRACT;GPLALERT;//ContinuityOfCareRecord/Body/Alerts;^TMP(""GPLCCR"",$J,DFN,""ALERTS"")")
|
I TESTALERT D PUSH^GPLXPATH(TAB,"EXTRACT;GPLALERT;//ContinuityOfCareRecord/Body/Alerts;^TMP(""GPLCCR"",$J,DFN,""ALERTS"")")
|
||||||
Q
|
Q
|
||||||
;
|
;
|
||||||
HDRMAP(CXML,DFN,IHDR) ; MAP HEADER VARIABLES: FROM, TO ECT
|
HDRMAP(CXML,DFN) ; MAP HEADER VARIABLES: FROM, TO ECT
|
||||||
N VMAP S VMAP=$NA(^TMP("GPLCCR",$J,DFN,"HEADER"))
|
N VMAP S VMAP=$NA(^TMP("GPLCCR",$J,DFN,"HEADER"))
|
||||||
; K @VMAP
|
; K @VMAP
|
||||||
S @VMAP@("DATETIME")=$$FMDTOUTC^CCRUTIL($$NOW^XLFDT,"DT")
|
S @VMAP@("DATETIME")=$$FMDTOUTC^CCRUTIL($$NOW^XLFDT,"DT")
|
||||||
|
|
18
p/GPLLABS.m
18
p/GPLLABS.m
|
@ -142,12 +142,14 @@ GHL7 ; GET HL7 MESSAGE FOR LABS FOR THIS PATIENT
|
||||||
. W "LAB LOOKUP FAILED, NO SSN",!
|
. W "LAB LOOKUP FAILED, NO SSN",!
|
||||||
. S C0CNSSN=1 ; SET NO SSN FLAG
|
. S C0CNSSN=1 ; SET NO SSN FLAG
|
||||||
S C0CSPC="*" ; LOOKING FOR ALL LAB TYPES
|
S C0CSPC="*" ; LOOKING FOR ALL LAB TYPES
|
||||||
I $D(^TMP("GPLCCR","LABLIMIT")) D ; IS LAB LIMIT SET? MOVE THIS TO PARMS
|
;I $D(^TMP("GPLCCR","LABLIMIT")) D ; IS LAB LIMIT SET? MOVE THIS TO PARMS
|
||||||
. S C0CLLMT=^TMP("GPLCCR","LABLIMIT") ;USE THE LAB LIMIT PARAMATER
|
;. S C0CLLMT=^TMP("GPLCCR","LABLIMIT") ;USE THE LAB LIMIT PARAMATER
|
||||||
E S C0CLLMT="T-360" ;START DATE LONG AGO TO GET EVERYTHING
|
;E S C0CLLMT="T-360" ;START DATE LONG AGO TO GET EVERYTHING
|
||||||
|
S C0CLLMT=$$GET^C0CPARMS("LABLIMIT") ; GET THE LIMIT PARM
|
||||||
|
S C0CLSTRT=$$GET^C0CPARMS("LABSTART") ; GET START PARM
|
||||||
D DT^DILF(,C0CLLMT,.C0CSDT) ;
|
D DT^DILF(,C0CLLMT,.C0CSDT) ;
|
||||||
W "LAB LIMIT: ",C0CLLMT,!
|
W "LAB LIMIT: ",C0CLLMT,!
|
||||||
D DT^DILF(,"T",.C0CEDT) ; END DATE TODAY - IMPLEMENT END DATE PARM
|
D DT^DILF(,C0CLSTRT,.C0CEDT) ; END DATE TODAY - IMPLEMENT END DATE PARM
|
||||||
S C0CR=$$GCPR^LA7QRY(C0CPTID,C0CSDT,C0CEDT,C0CSPC,C0CSPC) ; CALL LAB LOOKUP
|
S C0CR=$$GCPR^LA7QRY(C0CPTID,C0CSDT,C0CEDT,C0CSPC,C0CSPC) ; CALL LAB LOOKUP
|
||||||
Q
|
Q
|
||||||
;
|
;
|
||||||
|
@ -158,9 +160,9 @@ LIST ; LIST THE HL7 MESSAGE; ALSO, EXTRACT THE RESULT VARIABLES TO C0CLB
|
||||||
I '$D(C0CQT) S C0CQT=0
|
I '$D(C0CQT) S C0CQT=0
|
||||||
I '$D(DFN) S DFN=1 ; DEFAULT TEST PATIENT
|
I '$D(DFN) S DFN=1 ; DEFAULT TEST PATIENT
|
||||||
I '$D(^KVAI(0)) D SETTBL ; INITIALIZE LAB TABLE
|
I '$D(^KVAI(0)) D SETTBL ; INITIALIZE LAB TABLE
|
||||||
I ^KBAI(0)'="V2" D SETTBL ; NEED NEWEST VERSION
|
I ^TMP("GPLCCR","LABTBL",0)'="V2" D SETTBL ; NEED NEWEST VERSION
|
||||||
I '$D(^TMP("HLS",$J,1)) D GHL7 ; GET HL7 MGS IF NOT ALREADY DONE
|
I '$D(^TMP("HLS",$J,1)) D GHL7 ; GET HL7 MGS IF NOT ALREADY DONE
|
||||||
S C0CTAB=$NA(^KBAI) ; BASE OF OBX TABLE
|
S C0CTAB=$NA(^TMP("GPLCCR","LABTBL")) ; BASE OF OBX TABLE
|
||||||
S C0CHB=$NA(^TMP("HLS",$J))
|
S C0CHB=$NA(^TMP("HLS",$J))
|
||||||
S C0CI=""
|
S C0CI=""
|
||||||
S @C0CLB@(0)=0 ; INITALIZE RESULTS VARS COUNT
|
S @C0CLB@(0)=0 ; INITALIZE RESULTS VARS COUNT
|
||||||
|
@ -376,7 +378,7 @@ SETTBL ;
|
||||||
S X("OBX","OBX15")="15^00583^Producer.s ID^RESULTTESTSOURCEACTORID"
|
S X("OBX","OBX15")="15^00583^Producer.s ID^RESULTTESTSOURCEACTORID"
|
||||||
S X("OBX","OBX16")="16^00584^Responsible Observer"
|
S X("OBX","OBX16")="16^00584^Responsible Observer"
|
||||||
S X("OBX","OBX17")="17^00936^Observation Method"
|
S X("OBX","OBX17")="17^00936^Observation Method"
|
||||||
M ^KBAI=X ; SET VALUES IN ^KBAI
|
M ^TMP("GPLCCR","LABTBL")=X ; SET VALUES IN ^TMP("GPLCCR","LABTBL")
|
||||||
S ^KBAI(0)="V2"
|
S ^TMP("GPLCCR","LABTBL",0)="V2"
|
||||||
Q
|
Q
|
||||||
;
|
;
|
||||||
|
|
Loading…
Reference in New Issue