- Timestamp:
- Jan 30, 2009, 1:07:28 PM (16 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/CCRMEDS1.m
r322 r347 38 38 ; D PARY^GPLXPATH(MINXML) 39 39 N MEDS,MAP 40 K ^TMP($J )40 K ^TMP($J,"CCDCCR") ; PLEASE DON'T KILL ALL OF ^TMP($J) HERE!!!! 41 41 D RX^PSO52API(DFN,"CCDCCR") 42 42 M MEDS=^TMP($J,"CCDCCR",DFN) … … 80 80 . ; 81 81 . ; 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 83 83 . ; $$GET1^DIQ. 84 84 . ; 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 86 86 . ; 176.003), by searching for "RXNORM", then get the data. 87 87 . N MEDIEN S MEDIEN=$P(MED(6),U) … … 89 89 . N NDFDATA M NDFDATA=^TMP($J,"NDF",MEDIEN) 90 90 . 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) 92 92 . ; 93 93 . ; NDFIEN is not necessarily defined; it won't be if the drug -
ccr/trunk/p/CCRMEDS2.m
r322 r347 41 41 ; So, most of the info is going to get pulled from 52.41. 42 42 N MEDS,MAP 43 K ^TMP($J )43 K ^TMP($J,"CCDCCR") ; PLEASE DON'T KILL ALL OF ^TMP($J) HERE!!!! 44 44 D PEN^PSO5241(DFN,"CCDCCR") 45 45 M MEDS=^TMP($J,"CCDCCR",DFN) … … 80 80 . ; MED(11) piece 1 has the IEN of the drug (file 50) 81 81 . ; IEN is field 31 in the drug file. 82 . ; 82 . ; 83 83 . ; MEDIEN (node 11 in the returned output) might not necessarily be defined 84 84 . ; It is not defined when a dose in not chosen in CPRS. There is a long … … 97 97 . . ; 98 98 . . ; 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 100 100 . . ; $$GET1^DIQ. 101 101 . . ; 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 103 103 . . ; 176.003), by searching for "RXNORM", then get the data. 104 104 . . D NDF^PSS50(MEDIEN,,,,,"NDF") 105 105 . . N NDFDATA M NDFDATA=^TMP($J,"NDF",MEDIEN) 106 106 . . 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) 108 108 . . ; 109 109 . . ; NDFIEN is not necessarily defined; it won't be if the drug -
ccr/trunk/p/CCRMEDS3.m
r322 r347 38 38 ; 39 39 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 41 42 D GETS^DIQ(55,DFN,"52.2*","IE","NVA") ; Output in NVA in FDA array format. 42 43 ; If NVA does not exist, then patient has no non-VA meds … … 90 91 . . ; 91 92 . . ; 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 93 94 . . ; $$GET1^DIQ. 94 95 . . ; 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 96 97 . . ; 176.003), by searching for "RXNORM", then get the data. 97 98 . . D NDF^PSS50(MEDIEN,,,,,"NDF") 98 99 . . N NDFDATA M NDFDATA=^TMP($J,"NDF",MEDIEN) 99 100 . . 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) 101 102 . . ; 102 103 . . ; NDFIEN is not necessarily defined; it won't be if the drug … … 130 131 . . ; These can be obtained using NDF^PSS50 (IEN,,,,,"SUBSCRIPT") 131 132 . . ; Documented in the same manual; executed above. 132 . . ; 133 . . ; 133 134 . . ; If a drug was not matched to NDF, then the NDFIEN is gonna be "" 134 135 . . ; and this will crash the call. So... -
ccr/trunk/p/GPLCCR.m
r330 r347 25 25 I Y<1 Q ; EXIT 26 26 S DFN=$P(Y,U,1) ; SET THE PATIENT 27 D XPAT(DFN ,"","") ; EXPORT TO A FILE28 Q 29 ; 30 XPAT(DFN, DIR,FN) ; EXPORT ONE PATIENT TO A FILE27 D XPAT(DFN) ; EXPORT TO A FILE 28 Q 29 ; 30 XPAT(DFN,XPARMS,DIR,FN) ; EXPORT ONE PATIENT TO A FILE 31 31 ; DIR IS THE DIRECTORY, DEFAULTS IF NULL TO ^TMP("GPLCCR","ODIR") 32 32 ; FN IS FILE NAME, DEFAULTS IF NULL … … 36 36 I '$D(FN) S UFN="" 37 37 E S UFN=FN 38 D CCRRPC(.CCRGLO,DFN,"CCR","","","") 38 I '$D(XPARMS) S XPARMS="" 39 D CCRRPC(.CCRGLO,DFN,XPARMS,"CCR") 39 40 S OARY=$NA(^TMP("GPLCCR",$J,DFN,"CCR",1)) 40 41 S ONAM=UFN 41 I UFN="" S ONAM="PAT_"_DFN_"_CCR_V1_0_1 2.xml"42 I UFN="" S ONAM="PAT_"_DFN_"_CCR_V1_0_14.xml" 42 43 S ODIRGLB=$NA(^TMP("GPLCCR","ODIR")) 43 44 I '$D(@ODIRGLB) D ; IF NOT ODIR HAS BEEN SET … … 61 62 Q 62 63 ; 63 CCRRPC(CCRGRTN,DFN,CCRPAR T,TIME1,TIME2,HDRARY) ;RPC ENTRY POINT FOR CCR OUTPUT64 CCRRPC(CCRGRTN,DFN,CCRPARMS,CCRPART) ;RPC ENTRY POINT FOR CCR OUTPUT 64 65 ; CCRGRTN IS RETURN ARRAY PASSED BY NAME 65 66 ; DFN IS PATIENT IEN 66 67 ; CCRPART IS "CCR" FOR ENTIRE CCR, OR SECTION NAME FOR A PART 67 68 ; 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 74 73 I '$D(DEBUG) S DEBUG=0 75 74 S CCD=0 ; NEED THIS FLAG TO DISTINGUISH FROM CCD 75 D SET^C0CPARMS(XPARMS) ;SET PARAMETERS WITH XPARMS AS OVERRIDES 76 76 I '$D(TESTLAB) S TESTLAB=0 ; FLAG FOR TESTING RESULTS SECTION 77 77 I '$D(TESTALERT) S TESTALERT=1 ; FLAG FOR TESTING ALERTS SECTION … … 92 92 I DEBUG F I=1:1:@CCRGLO@(0) W @CCRGLO@(I),! 93 93 ; 94 D HDRMAP(CCRGLO,DFN ,HDRARY) ; MAP HEADER VARIABLES94 D HDRMAP(CCRGLO,DFN) ; MAP HEADER VARIABLES 95 95 ; 96 96 K ^TMP("GPLCCR",$J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT … … 138 138 Q 139 139 ; 140 HDRMAP(CXML,DFN ,IHDR) ; MAP HEADER VARIABLES: FROM, TO ECT140 HDRMAP(CXML,DFN) ; MAP HEADER VARIABLES: FROM, TO ECT 141 141 N VMAP S VMAP=$NA(^TMP("GPLCCR",$J,DFN,"HEADER")) 142 142 ; K @VMAP -
ccr/trunk/p/GPLLABS.m
r327 r347 143 143 . S C0CNSSN=1 ; SET NO SSN FLAG 144 144 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) ; 149 151 W "LAB LIMIT: ",C0CLLMT,! 150 D DT^DILF(, "T",.C0CEDT) ; END DATE TODAY - IMPLEMENT END DATE PARM152 D DT^DILF(,C0CLSTRT,.C0CEDT) ; END DATE TODAY - IMPLEMENT END DATE PARM 151 153 S C0CR=$$GCPR^LA7QRY(C0CPTID,C0CSDT,C0CEDT,C0CSPC,C0CSPC) ; CALL LAB LOOKUP 152 154 Q … … 159 161 I '$D(DFN) S DFN=1 ; DEFAULT TEST PATIENT 160 162 I '$D(^KVAI(0)) D SETTBL ; INITIALIZE LAB TABLE 161 I ^ KBAI(0)'="V2" D SETTBL ; NEED NEWEST VERSION163 I ^TMP("GPLCCR","LABTBL",0)'="V2" D SETTBL ; NEED NEWEST VERSION 162 164 I '$D(^TMP("HLS",$J,1)) D GHL7 ; GET HL7 MGS IF NOT ALREADY DONE 163 S C0CTAB=$NA(^ KBAI) ; BASE OF OBX TABLE165 S C0CTAB=$NA(^TMP("GPLCCR","LABTBL")) ; BASE OF OBX TABLE 164 166 S C0CHB=$NA(^TMP("HLS",$J)) 165 167 S C0CI="" … … 377 379 S X("OBX","OBX16")="16^00584^Responsible Observer" 378 380 S X("OBX","OBX17")="17^00936^Observation Method" 379 M ^ KBAI=X ; SET VALUES IN ^KBAI380 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.