updated RPMS Meds...; still working on RxNorm
This commit is contained in:
parent
20208f27ed
commit
4c2511b09c
12
p/C0CMED6.m
12
p/C0CMED6.m
|
@ -41,9 +41,11 @@ EXTRACT(MINXML,DFN,OUTXML,FLAGS) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLA
|
||||||
; -- DAYS is passed by value (optional; if not passed defaults to 365)
|
; -- DAYS is passed by value (optional; if not passed defaults to 365)
|
||||||
;
|
;
|
||||||
; Return:
|
; Return:
|
||||||
; ~Type^PharmID^Drug^InfRate^StopDt^RefRem^TotDose^UnitDose^OrderID
|
; ~Type(1)^PharmID(2)^Drug(3)^InfRate(4)^StopDt(5)^RefRem(6)^
|
||||||
; ^Status^LastFill^Chronic^Issued^Rx #^Provider^
|
; TotDose(7)^UnitDose(8)^OrderID(9)^Status(10)^LastFill(11)^
|
||||||
; Status Reason^DEA Handling
|
; Days Supply(12)^Quantity(13)^Chronic(14)^Issued(15)^
|
||||||
|
; Rx #(16)^Provider(17)^Status Reason(18)^DEA Handling(19)^
|
||||||
|
; Pharmacy Site(20)
|
||||||
;
|
;
|
||||||
N MEDS,MEDS1,MAP
|
N MEDS,MEDS1,MAP
|
||||||
D GETRXS^BEHORXFN("MEDS1",DFN,$P($P(FLAGS,U,2),"-",2)) ; 2nd piece of FLAGS is # of days to retrieve, which comes in the form "T-360"
|
D GETRXS^BEHORXFN("MEDS1",DFN,$P($P(FLAGS,U,2),"-",2)) ; 2nd piece of FLAGS is # of days to retrieve, which comes in the form "T-360"
|
||||||
|
@ -73,11 +75,11 @@ EXTRACT(MINXML,DFN,OUTXML,FLAGS) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLA
|
||||||
. I DEBUG W "MAP= ",MAP,!
|
. I DEBUG W "MAP= ",MAP,!
|
||||||
. S @MAP@("MEDOBJECTID")="MED"_MEDCNT ; MEDCNT FOR ID
|
. S @MAP@("MEDOBJECTID")="MED"_MEDCNT ; MEDCNT FOR ID
|
||||||
. S @MAP@("MEDISSUEDATETXT")="Issue Date"
|
. S @MAP@("MEDISSUEDATETXT")="Issue Date"
|
||||||
. S @MAP@("MEDISSUEDATE")=$$FMDTOUTC^C0CUTIL($P(MEDS(MEDCNT),U,13))
|
. S @MAP@("MEDISSUEDATE")=$$FMDTOUTC^C0CUTIL($P(MEDS(MEDCNT),U,15))
|
||||||
. S @MAP@("MEDLASTFILLDATETXT")="Last Fill Date"
|
. S @MAP@("MEDLASTFILLDATETXT")="Last Fill Date"
|
||||||
. S @MAP@("MEDLASTFILLDATE")=$$FMDTOUTC^C0CUTIL($P(MEDS(MEDCNT),U,11))
|
. S @MAP@("MEDLASTFILLDATE")=$$FMDTOUTC^C0CUTIL($P(MEDS(MEDCNT),U,11))
|
||||||
. S @MAP@("MEDRXNOTXT")="Prescription Number"
|
. S @MAP@("MEDRXNOTXT")="Prescription Number"
|
||||||
. S @MAP@("MEDRXNO")=$P(MEDS(MEDCNT),U,14)
|
. S @MAP@("MEDRXNO")=$P(MEDS(MEDCNT),U,16)
|
||||||
. S @MAP@("MEDTYPETEXT")="Medication"
|
. S @MAP@("MEDTYPETEXT")="Medication"
|
||||||
. S @MAP@("MEDDETAILUNADORNED")="" ; Leave blank, field has its uses
|
. S @MAP@("MEDDETAILUNADORNED")="" ; Leave blank, field has its uses
|
||||||
. S @MAP@("MEDSTATUSTEXT")=$P(MEDS(MEDCNT),U,10)
|
. S @MAP@("MEDSTATUSTEXT")=$P(MEDS(MEDCNT),U,10)
|
||||||
|
|
32
p/C0CRXNRD.m
32
p/C0CRXNRD.m
|
@ -2,23 +2,15 @@ C0CRXNRD ; WV/SMH - CCR/CCD PROJECT: Routine to Read RxNorm files;11/15/08
|
||||||
;;0.1;CCDCCR;nopatch;noreleasedate
|
;;0.1;CCDCCR;nopatch;noreleasedate
|
||||||
W "No entry from top" Q
|
W "No entry from top" Q
|
||||||
;
|
;
|
||||||
DELFILED(FN,ERR) ; Delete file data; PEP procedure; READ WARNING
|
DELFILED(FN) ; Delete file data; PEP procedure; only for RxNorm files
|
||||||
; FN is Filenumber passed by Value
|
; FN is Filenumber passed by Value
|
||||||
; ERR is error info, passed by reference
|
QUIT:$E(FN,1,3)'=176 ; Quit if not RxNorm files
|
||||||
; If ERR is 1, then the operation failed.
|
|
||||||
; WARNING: THIS IS VERY DANGEROUS OPERATION
|
|
||||||
; I DON'T EVEN CHECK THE DEL NODE ON THE FILE!!!!
|
|
||||||
;
|
|
||||||
D CLEAN^DILF ; Clean FM variables
|
D CLEAN^DILF ; Clean FM variables
|
||||||
N C0CFINFO ; File info
|
N ROOT S ROOT=$$ROOT^DILFD(FN,"",1) ; global root
|
||||||
D FILE^DID(FN,"","GLOBAL NAME","C0CROOT") ; Get file info
|
N ZERO S ZERO=@ROOT@(0) ; Save zero node
|
||||||
I $D(DIERR) D EN^DDIOL("Error...") S ERR=1 QUIT
|
|
||||||
N ROOT2 S ROOT2=C0CROOT("GLOBAL NAME") ; Open global root
|
|
||||||
N CLROOT S CLROOT=$$CREF^DILF(ROOT2) ; Closed Root
|
|
||||||
N ZERO S ZERO=@CLROOT@(0) ; Save zero node
|
|
||||||
S $P(ZERO,U,3,9999)="" ; Remove entry # and last edited
|
S $P(ZERO,U,3,9999)="" ; Remove entry # and last edited
|
||||||
K @CLROOT ; Kill the file -- so sad!
|
K @ROOT ; Kill the file -- so sad!
|
||||||
S @CLROOT@(0)=ZERO ; It riseth again!
|
S @ROOT@(0)=ZERO ; It riseth again!
|
||||||
QUIT
|
QUIT
|
||||||
GETLINES(PATH,FILENAME) ; Get number of lines in a file
|
GETLINES(PATH,FILENAME) ; Get number of lines in a file
|
||||||
D OPEN^%ZISH("FILE",PATH,FILENAME,"R")
|
D OPEN^%ZISH("FILE",PATH,FILENAME,"R")
|
||||||
|
@ -30,9 +22,7 @@ GETLINES(PATH,FILENAME) ; Get number of lines in a file
|
||||||
READCON(PATH) ; Open and read concepts file: RXNCONSO.RRF
|
READCON(PATH) ; Open and read concepts file: RXNCONSO.RRF
|
||||||
I PATH="" QUIT
|
I PATH="" QUIT
|
||||||
N FILENAME S FILENAME="RXNCONSO.RRF"
|
N FILENAME S FILENAME="RXNCONSO.RRF"
|
||||||
N ERR
|
D DELFILED(176.001) ; delete data
|
||||||
D DELFILED(176.001,.ERR) ; delete data
|
|
||||||
IF $G(ERR) D EN^DDIOL("Couldn't delete file") G EX
|
|
||||||
N LINES S LINES=$$GETLINES(PATH,FILENAME)
|
N LINES S LINES=$$GETLINES(PATH,FILENAME)
|
||||||
D OPEN^%ZISH("FILE",PATH,FILENAME,"R")
|
D OPEN^%ZISH("FILE",PATH,FILENAME,"R")
|
||||||
IF POP D EN^DDIOL("Error reading file..., Please check...") G EX
|
IF POP D EN^DDIOL("Error reading file..., Please check...") G EX
|
||||||
|
@ -71,9 +61,7 @@ EX D CLOSE^%ZISH("FILE")
|
||||||
READNDC(PATH) ; Open and read NDC/RxNorm/VANDF relationship file: RXNSAT.RRF
|
READNDC(PATH) ; Open and read NDC/RxNorm/VANDF relationship file: RXNSAT.RRF
|
||||||
I PATH="" QUIT
|
I PATH="" QUIT
|
||||||
N FILENAME S FILENAME="RXNSAT.RRF"
|
N FILENAME S FILENAME="RXNSAT.RRF"
|
||||||
N ERR
|
D DELFILED(176.002) ; delete data
|
||||||
D DELFILED(176.002,.ERR) ; delete data
|
|
||||||
IF $G(ERR) D EN^DDIOL("Couldn't delete file") G EX2
|
|
||||||
N LINES S LINES=$$GETLINES(PATH,FILENAME)
|
N LINES S LINES=$$GETLINES(PATH,FILENAME)
|
||||||
D OPEN^%ZISH("FILE",PATH,FILENAME,"R")
|
D OPEN^%ZISH("FILE",PATH,FILENAME,"R")
|
||||||
IF POP W "Error reading file..., Please check...",! G EX2
|
IF POP W "Error reading file..., Please check...",! G EX2
|
||||||
|
@ -98,9 +86,7 @@ EX2 D CLOSE^%ZISH("FILE")
|
||||||
READSRC(PATH) ; Open the read RxNorm Sources file: RXNSAB.RRF
|
READSRC(PATH) ; Open the read RxNorm Sources file: RXNSAB.RRF
|
||||||
I PATH="" QUIT
|
I PATH="" QUIT
|
||||||
N FILENAME S FILENAME="RXNSAB.RRF"
|
N FILENAME S FILENAME="RXNSAB.RRF"
|
||||||
N ERR
|
D DELFILED(176.003) ; delete data
|
||||||
D DELFILED(176.003,.ERR) ; delete data
|
|
||||||
IF $G(ERR) D EN^DDIOL("Couldn't delete file") G EX2
|
|
||||||
D OPEN^%ZISH("FILE",PATH,FILENAME,"R")
|
D OPEN^%ZISH("FILE",PATH,FILENAME,"R")
|
||||||
IF POP W "Error reading file..., Please check...",! G EX3
|
IF POP W "Error reading file..., Please check...",! G EX3
|
||||||
F I=1:1 Q:$$STATUS^%ZISH D
|
F I=1:1 Q:$$STATUS^%ZISH D
|
||||||
|
|
|
@ -112,8 +112,3 @@ Most of the command line interface functions in the package are intended to also
|
||||||
The "RIM" variables and attributes that are now being stored in ^TMP("C0CRIM") are intended to be maintained in a standard FILEMAN global, and to take advantage of FILEMAN indexing for efficient batch analysis and processing.
|
The "RIM" variables and attributes that are now being stored in ^TMP("C0CRIM") are intended to be maintained in a standard FILEMAN global, and to take advantage of FILEMAN indexing for efficient batch analysis and processing.
|
||||||
|
|
||||||
It is intended that menu interfaces be provided in addition to command line interfaces for all package functions.
|
It is intended that menu interfaces be provided in addition to command line interfaces for all package functions.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue