update to record DUZ when importing XML

This commit is contained in:
george 2010-05-07 22:30:28 +00:00
parent 63db3a2c3e
commit 3444bfbb71
1 changed files with 9 additions and 6 deletions

View File

@ -24,16 +24,17 @@ TEST ; TESTS BOTH ROUTINES AT ONCE
N ZI,ZJ
S ZI="/home/vademo2/CCR" ;directory purposely leaving off the trailing /
S ZJ="PAT_358_CCR_V1_0_21.xml" ; random test patient
D RPCFIN(.GPL,358,"GPLTEST","CCR",ZJ,ZI)
D RPCFIN(.GPL,358,135,"GPLTEST","CCR",ZJ,ZI)
Q
;
RPCAIN(RTN,DFN,SOURCE,TYPE,ARY) ; ARRAY IN RPC - ACCEPT AN XML DOCUMENT
RPCAIN(RTN,DFN,DUZ,SOURCE,TYPE,ARY) ; ARRAY IN RPC - ACCEPT AN XML DOCUMENT
; AND STORE IT IN THE INCOMING XML FILE
; RETURNS THE IEN OF THE RECORD OR TEXT IF THERE IS AN ERROR
I $G(DFN)="" S RTN="DFN NOT DEFINED" Q ;
N C0CXF S C0CXF=175 ; FILE NUMBER FOR INCOMING XML FILE
N C0CFDA,ZX
S C0CFDA(C0CXF,"+1,",.01)=DFN ; PATIENT
S C0CFDA(C0CXF,"+1,",.02)=DUZ ; PROVIDER CREATING THE RECORD
S C0CFDA(C0CXF,"+1,",1)=$$NOW^XLFDT ;DATE
S C0CFDA(C0CXF,"+1,",2)=TYPE ;TYPE
S C0CFDA(C0CXF,"+1,",3)=$$ADDSRC(SOURCE) ;SOURCE
@ -54,7 +55,7 @@ ADDSRC(ZSRC) ;EXTRISIC TO ADD A SOURCE TO THE CCR SOURCE FILE
D UPDIE
Q $O(^C0C(171.401,"B",ZSRC,""))
;
RPCFIN(RTN,DFN,SOURCE,TYPE,FN,FP) ; FILE IN RPC - READ AN XML DOCUMENT
RPCFIN(RTN,DFN,DUZ,SOURCE,TYPE,FN,FP) ; FILE IN RPC - READ AN XML DOCUMENT
; FROM A HOST FILE AND STORE IT IN THE INCOMING XML FILE
N ZX,ZTMP
I $E($RE(FP))'="/" S ZX=FP_"/"
@ -63,7 +64,7 @@ RPCFIN(RTN,DFN,SOURCE,TYPE,FN,FP) ; FILE IN RPC - READ AN XML DOCUMENT
D LOAD("ZTMP",ZX)
I '$D(ZTMP) D Q ; NO LUCK
. W "FILE NOT LOADED",!
D RPCAIN(.RTN,DFN,SOURCE,TYPE,"ZTMP")
D RPCAIN(.RTN,DFN,DUZ,SOURCE,TYPE,"ZTMP")
N C0CFDA
S C0CFDA(175,RTN_",",5)=FN ; FILE NAME
S C0CFDA(175,RTN_",",6)=FP ; FILE PATH
@ -73,12 +74,13 @@ RPCFIN(RTN,DFN,SOURCE,TYPE,FN,FP) ; FILE IN RPC - READ AN XML DOCUMENT
RPCLIST(RTN,DFN) ; CCR LIST - LIST XML DOCUMENTS FOR PATIENT DFN
; THAT ARE STORED IN THE INCOMING XML FILE
; RETURNS AN ARRAY OF THE FORM
; RTN(x)="IEN^DATE^TYPE^SOURCE^STATUS" WHERE
; RTN(x)="IEN^DATE^TYPE^SOURCE^STATUS^CREATEDBY" WHERE
; IEN IS THE RECORD NUMBER OF THE XML DOCUMENT
; DATE IS THE DATE THE DOCUMENT WAS STORED IN THE FILE
; TYPE IS "CCD" OR "CCR" OR "OTHER"
; SOURCE IS THE NAME OF THE DOCUMENT SOURCE FROM THE CCR SOURCE FILE
; STATUS IS THE STATUS OF THE DOCUMENT (VALUES TO BE DEFINED)
; CREATEDBY IS THE NAME OF THE PROVIDER WHO UPLOADED THE XML
N ZF S ZF=175 ; FILE NUMBER OF INCOMING XML FILE
N ZI S ZI=""
N ZN S ZN=0
@ -89,6 +91,7 @@ RPCLIST(RTN,DFN) ; CCR LIST - LIST XML DOCUMENTS FOR PATIENT DFN
. S $P(RTN(ZN),"^",3)=$$GET1^DIQ(ZF,ZI_",",2,"E") ;TYPE
. S $P(RTN(ZN),"^",4)=$$GET1^DIQ(ZF,ZI_",",3,"E") ;SOURCE
. S $P(RTN(ZN),"^",5)=$$GET1^DIQ(ZF,ZI_",",7,"I") ; STATUS
. S $P(RTN(ZN),"^",6)=$$GET1^DIQ(ZF,ZI_",",.02,"E") ; CREATED BY
Q
;
RPCDOC(RTN,IEN) ; RETRIEVE DOCUMENT NUMBER IEN FROM THE INCOMING XML FILE