Changeset 347 for ccr/trunk/p


Ignore:
Timestamp:
Jan 30, 2009, 1:07:28 PM (16 years ago)
Author:
George Lilly
Message:

update to support parameters .. XPATGPLCCR(1,"LABSTART:T^LABLIMIT:T-5000")

Location:
ccr/trunk/p
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/CCRMEDS1.m

    r322 r347  
    3838 ; D PARY^GPLXPATH(MINXML)
    3939 N MEDS,MAP
    40  K ^TMP($J)
     40 K ^TMP($J,"CCDCCR") ; PLEASE DON'T KILL ALL OF ^TMP($J) HERE!!!!
    4141 D RX^PSO52API(DFN,"CCDCCR")
    4242 M MEDS=^TMP($J,"CCDCCR",DFN)
     
    8080 . ;
    8181 . ; We use the VUID to look up the RxNorm in file 176.001; same idea.
    82  . ; Get IEN first using $$FIND1^DIC, then get the RxNorm number by 
     82 . ; Get IEN first using $$FIND1^DIC, then get the RxNorm number by
    8383 . ; $$GET1^DIQ.
    8484 . ;
    85  . ; I get the RxNorm name and version from the RxNorm Sources (file 
     85 . ; I get the RxNorm name and version from the RxNorm Sources (file
    8686 . ; 176.003), by searching for "RXNORM", then get the data.
    8787 . N MEDIEN S MEDIEN=$P(MED(6),U)
     
    8989 . N NDFDATA M NDFDATA=^TMP($J,"NDF",MEDIEN)
    9090 . N NDFIEN S NDFIEN=$P(NDFDATA(20),U)
    91  . N VAPROD S VAPROD=$P(NDFDATA(22),U) 
     91 . N VAPROD S VAPROD=$P(NDFDATA(22),U)
    9292 . ;
    9393 . ; NDFIEN is not necessarily defined; it won't be if the drug
  • ccr/trunk/p/CCRMEDS2.m

    r322 r347  
    4141 ; So, most of the info is going to get pulled from 52.41.
    4242 N MEDS,MAP
    43  K ^TMP($J)
     43 K ^TMP($J,"CCDCCR") ; PLEASE DON'T KILL ALL OF ^TMP($J) HERE!!!!
    4444 D PEN^PSO5241(DFN,"CCDCCR")
    4545 M MEDS=^TMP($J,"CCDCCR",DFN)
     
    8080 . ; MED(11) piece 1 has the IEN of the drug (file 50)
    8181 . ; IEN is field 31 in the drug file.
    82  . ; 
     82 . ;
    8383 . ; MEDIEN (node 11 in the returned output) might not necessarily be defined
    8484 . ; It is not defined when a dose in not chosen in CPRS. There is a long
     
    9797 . . ;
    9898 . . ; We use the VUID to look up the RxNorm in file 176.001; same idea.
    99  . . ; Get IEN first using $$FIND1^DIC, then get the RxNorm number by 
     99 . . ; Get IEN first using $$FIND1^DIC, then get the RxNorm number by
    100100 . . ; $$GET1^DIQ.
    101101 . . ;
    102  . . ; I get the RxNorm name and version from the RxNorm Sources (file 
     102 . . ; I get the RxNorm name and version from the RxNorm Sources (file
    103103 . . ; 176.003), by searching for "RXNORM", then get the data.
    104104 . . D NDF^PSS50(MEDIEN,,,,,"NDF")
    105105 . . N NDFDATA M NDFDATA=^TMP($J,"NDF",MEDIEN)
    106106 . . N NDFIEN S NDFIEN=$P(NDFDATA(20),U)
    107  . . N VAPROD S VAPROD=$P(NDFDATA(22),U) 
     107 . . N VAPROD S VAPROD=$P(NDFDATA(22),U)
    108108 . . ;
    109109 . . ; NDFIEN is not necessarily defined; it won't be if the drug
  • ccr/trunk/p/CCRMEDS3.m

    r322 r347  
    3838 ;
    3939 N MEDS,MAP
    40  K ^TMP($J),NVA
     40 K ^TMP($J,"CCDCCR") ; PLEASE DON'T KILL ALL OF ^TMP($J) HERE!!!!
     41 K NVA
    4142 D GETS^DIQ(55,DFN,"52.2*","IE","NVA") ; Output in NVA in FDA array format.
    4243 ; If NVA does not exist, then patient has no non-VA meds
     
    9091 . . ;
    9192 . . ; We use the VUID to look up the RxNorm in file 176.001; same idea.
    92  . . ; Get IEN first using $$FIND1^DIC, then get the RxNorm number by 
     93 . . ; Get IEN first using $$FIND1^DIC, then get the RxNorm number by
    9394 . . ; $$GET1^DIQ.
    9495 . . ;
    95  . . ; I get the RxNorm name and version from the RxNorm Sources (file 
     96 . . ; I get the RxNorm name and version from the RxNorm Sources (file
    9697 . . ; 176.003), by searching for "RXNORM", then get the data.
    9798 . . D NDF^PSS50(MEDIEN,,,,,"NDF")
    9899 . . N NDFDATA M NDFDATA=^TMP($J,"NDF",MEDIEN)
    99100 . . N NDFIEN S NDFIEN=$P(NDFDATA(20),U)
    100  . . N VAPROD S VAPROD=$P(NDFDATA(22),U) 
     101 . . N VAPROD S VAPROD=$P(NDFDATA(22),U)
    101102 . . ;
    102103 . . ; NDFIEN is not necessarily defined; it won't be if the drug
     
    130131 . . ; These can be obtained using NDF^PSS50 (IEN,,,,,"SUBSCRIPT")
    131132 . . ; Documented in the same manual; executed above.
    132  . . ; 
     133 . . ;
    133134 . . ; If a drug was not matched to NDF, then the NDFIEN is gonna be ""
    134135 . . ; and this will crash the call. So...
  • ccr/trunk/p/GPLCCR.m

    r330 r347  
    2525 I Y<1 Q  ; EXIT
    2626 S DFN=$P(Y,U,1) ; SET THE PATIENT
    27  D XPAT(DFN,"","") ; EXPORT TO A FILE
    28  Q
    29  ;
    30 XPAT(DFN,DIR,FN) ; EXPORT ONE PATIENT TO A FILE
     27 D XPAT(DFN) ; EXPORT TO A FILE
     28 Q
     29 ;
     30XPAT(DFN,XPARMS,DIR,FN) ; EXPORT ONE PATIENT TO A FILE
    3131 ; DIR IS THE DIRECTORY, DEFAULTS IF NULL TO ^TMP("GPLCCR","ODIR")
    3232 ; FN IS FILE NAME, DEFAULTS IF NULL
     
    3636 I '$D(FN) S UFN=""
    3737 E  S UFN=FN
    38  D CCRRPC(.CCRGLO,DFN,"CCR","","","")
     38 I '$D(XPARMS) S XPARMS=""
     39 D CCRRPC(.CCRGLO,DFN,XPARMS,"CCR")
    3940 S OARY=$NA(^TMP("GPLCCR",$J,DFN,"CCR",1))
    4041 S ONAM=UFN
    41  I UFN="" S ONAM="PAT_"_DFN_"_CCR_V1_0_12.xml"
     42 I UFN="" S ONAM="PAT_"_DFN_"_CCR_V1_0_14.xml"
    4243 S ODIRGLB=$NA(^TMP("GPLCCR","ODIR"))
    4344 I '$D(@ODIRGLB) D  ; IF NOT ODIR HAS BEEN SET
     
    6162 Q
    6263 ;
    63 CCRRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY)  ;RPC ENTRY POINT FOR CCR OUTPUT
     64CCRRPC(CCRGRTN,DFN,CCRPARMS,CCRPART)  ;RPC ENTRY POINT FOR CCR OUTPUT
    6465 ; CCRGRTN IS RETURN ARRAY PASSED BY NAME
    6566 ; DFN IS PATIENT IEN
    6667 ; CCRPART IS "CCR" FOR ENTIRE CCR, OR SECTION NAME FOR A PART
    6768 ;   OF THE CCR BODY.. PARTS INCLUDE "PROBLEMS" "VITALS" ETC
    68  ; TIME1 IS STARTING TIME TO INCLUDE - NULL MEANS ALL
    69  ; TIME2 IS ENDING TIME TO INCLUDE TIME IS FILEMAN TIME
    70  ; - NULL MEANS NOW
    71  ; HDRARY IS THE HEADER ARRAY DEFINING THE "FROM" AND
    72  ;    "TO" VARIABLES
    73  ;    IF NULL WILL DEFAULT TO "FROM" DUZ AND "TO" DFN
     69 ; CCRPARMS ARE PARAMETERS THAT AFFECT THE EXTRACTION
     70 ; IN THE FORM "PARM1:VALUE1^PARM2:VALUE2"
     71 ; EXAMPLE: "LABLIMIT:T-60" TO LIMIT LAB EXTRACTION TO THE LAST 60 DAYS
     72 ; SEE C0CPARMS FOR A COMPLETE LIST OF SUPPORTED PARAMETERS
    7473 I '$D(DEBUG) S DEBUG=0
    7574 S CCD=0 ; NEED THIS FLAG TO DISTINGUISH FROM CCD
     75 D SET^C0CPARMS(XPARMS) ;SET PARAMETERS WITH XPARMS AS OVERRIDES
    7676 I '$D(TESTLAB) S TESTLAB=0 ; FLAG FOR TESTING RESULTS SECTION
    7777 I '$D(TESTALERT) S TESTALERT=1 ; FLAG FOR TESTING ALERTS SECTION
     
    9292 I DEBUG F I=1:1:@CCRGLO@(0) W @CCRGLO@(I),!
    9393 ;
    94  D HDRMAP(CCRGLO,DFN,HDRARY) ; MAP HEADER VARIABLES
     94 D HDRMAP(CCRGLO,DFN) ; MAP HEADER VARIABLES
    9595 ;
    9696 K ^TMP("GPLCCR",$J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT
     
    138138 Q
    139139 ;
    140 HDRMAP(CXML,DFN,IHDR) ; MAP HEADER VARIABLES: FROM, TO ECT
     140HDRMAP(CXML,DFN) ; MAP HEADER VARIABLES: FROM, TO ECT
    141141 N VMAP S VMAP=$NA(^TMP("GPLCCR",$J,DFN,"HEADER"))
    142142 ; K @VMAP
  • ccr/trunk/p/GPLLABS.m

    r327 r347  
    143143 . S C0CNSSN=1 ; SET NO SSN FLAG
    144144 S C0CSPC="*" ; LOOKING FOR ALL LAB TYPES
    145  I $D(^TMP("GPLCCR","LABLIMIT")) D  ; IS LAB LIMIT SET? MOVE THIS TO PARMS
    146  . S C0CLLMT=^TMP("GPLCCR","LABLIMIT") ;USE THE LAB LIMIT PARAMATER
    147  E  S C0CLLMT="T-360" ;START DATE LONG AGO TO GET EVERYTHING
    148  D DT^DILF(,C0CLLMT,.C0CSDT) ;
     145 ;I $D(^TMP("GPLCCR","LABLIMIT")) D  ; IS LAB LIMIT SET? MOVE THIS TO PARMS
     146 ;. S C0CLLMT=^TMP("GPLCCR","LABLIMIT") ;USE THE LAB LIMIT PARAMATER
     147 ;E  S C0CLLMT="T-360" ;START DATE LONG AGO TO GET EVERYTHING
     148 S C0CLLMT=$$GET^C0CPARMS("LABLIMIT") ; GET THE LIMIT PARM
     149 S C0CLSTRT=$$GET^C0CPARMS("LABSTART") ; GET START PARM
     150 D DT^DILF(,C0CLLMT,.C0CSDT) ;
    149151 W "LAB LIMIT: ",C0CLLMT,!
    150  D DT^DILF(,"T",.C0CEDT) ; END DATE TODAY - IMPLEMENT END DATE PARM
     152 D DT^DILF(,C0CLSTRT,.C0CEDT) ; END DATE TODAY - IMPLEMENT END DATE PARM
    151153 S C0CR=$$GCPR^LA7QRY(C0CPTID,C0CSDT,C0CEDT,C0CSPC,C0CSPC) ; CALL LAB LOOKUP
    152154 Q
     
    159161 I '$D(DFN) S DFN=1 ; DEFAULT TEST PATIENT
    160162 I '$D(^KVAI(0)) D SETTBL ; INITIALIZE LAB TABLE
    161  I ^KBAI(0)'="V2" D SETTBL ; NEED NEWEST VERSION
     163 I ^TMP("GPLCCR","LABTBL",0)'="V2" D SETTBL ; NEED NEWEST VERSION
    162164 I '$D(^TMP("HLS",$J,1)) D GHL7 ; GET HL7 MGS IF NOT ALREADY DONE
    163  S C0CTAB=$NA(^KBAI) ; BASE OF OBX TABLE
     165 S C0CTAB=$NA(^TMP("GPLCCR","LABTBL")) ; BASE OF OBX TABLE
    164166 S C0CHB=$NA(^TMP("HLS",$J))
    165167 S C0CI=""
     
    377379 S X("OBX","OBX16")="16^00584^Responsible Observer"
    378380 S X("OBX","OBX17")="17^00936^Observation Method"
    379  M ^KBAI=X ; SET VALUES IN ^KBAI
    380  S ^KBAI(0)="V2"
    381  Q
    382  ;
     381 M ^TMP("GPLCCR","LABTBL")=X ; SET VALUES IN ^TMP("GPLCCR","LABTBL")
     382 S ^TMP("GPLCCR","LABTBL",0)="V2"
     383 Q
     384 ;
Note: See TracChangeset for help on using the changeset viewer.