[613] | 1 | ECUERPC2 ;ALB/JAM;Event Capture Data Entry Broker Utilities ;Apr 24, 2002
|
---|
| 2 | ;;2.0; EVENT CAPTURE ;**41,39,50,72**;8 May 96
|
---|
| 3 | ;
|
---|
| 4 | ECDOD(RESULTS,ECARY) ;RPC Broker entry point to get a patient's date of death
|
---|
| 5 | ; RPC: EC DIEDON
|
---|
| 6 | ;INPUTS ECARY - Contains the following elements as input
|
---|
| 7 | ; ECDFN - Patient DFN
|
---|
| 8 | ;
|
---|
| 9 | ;OUTPUTS RESULTS - Fileman Internal Date of Patient date of Death^
|
---|
| 10 | ; Message with Patient External Date of Death
|
---|
| 11 | ;
|
---|
| 12 | N ECDFN,DFN,VADM
|
---|
| 13 | D SETENV^ECUMRPC
|
---|
| 14 | S ECDFN=$P(ECARY,U),RESULTS="^"
|
---|
| 15 | I ECDFN="" S RESULTS="0^Patient DFN not defined" Q
|
---|
| 16 | ;NOIS MWV-0603-21781: line below changed by VMP
|
---|
| 17 | S DFN=ECDFN D 2^VADPT I +VADM(6) S RESULTS=$P(VADM(6),U)_"^"_"[PATIENT DIED ON "_$P(VADM(6),U,2)_"]"
|
---|
| 18 | Q
|
---|
| 19 | VISINFO(RESULTS,ECARY) ;
|
---|
| 20 | ;
|
---|
| 21 | ;Broker call returns the EC values based on a Visit Number
|
---|
| 22 | ; RPC: EC GETVISITINFO
|
---|
| 23 | ;INPUTS ECARY - Contains the following subscripted elements
|
---|
| 24 | ; ECVSN - Visit Number, IEN in file (#9000010)
|
---|
| 25 | ;
|
---|
| 26 | ;OUTPUTS RESULTS - Contains the following data:-
|
---|
| 27 | ; Location IEN^DSS Unit IEN^Proc Date/Time Fileman^
|
---|
| 28 | ; Procedure Date/Time Readable^Patient DFN
|
---|
| 29 | ; 0^Error Message (if error)
|
---|
| 30 | ;
|
---|
| 31 | N ECLOC,ECUNT,NODE,Y,ECPXDT,DA,ECVSN,ECDFN,DSSF,LOC,UNT
|
---|
| 32 | D SETENV^ECUMRPC
|
---|
| 33 | S ECVSN=$P(ECARY,U) I ECVSN="" S RESULTS=0_"^Visit undefined" Q
|
---|
| 34 | K ^TMP($J,"ECVISINFO")
|
---|
| 35 | S DA=$O(^ECH("C",ECVSN,0)) I 'DA D Q
|
---|
| 36 | . S RESULTS=0_"^Visit not on File"
|
---|
| 37 | S NODE=$G(^ECH(DA,0)) I NODE="" D Q
|
---|
| 38 | . S RESULTS=0_"No corresponding EC procedures found for Visit"
|
---|
| 39 | S ECLOC=$P(NODE,U,4),ECUNT=$P(NODE,U,7),ECPXDT=$P(NODE,U,3)
|
---|
| 40 | S LOC=$P($G(^DIC(4,ECLOC,0)),U),UNT=$G(^ECD(ECUNT,0)),DSSF=$P(UNT,U,14)
|
---|
| 41 | S UNT=$P(UNT,U) S:DSSF="" DSSF="N"
|
---|
| 42 | S ECDFN=$P(NODE,U,2),Y=ECPXDT X ^DD("DD")
|
---|
| 43 | S RESULTS=ECLOC_U_LOC_U_ECUNT_U_UNT_U_DSSF_U_ECPXDT_U_Y_U_ECDFN
|
---|
| 44 | Q
|
---|
| 45 | PATPRV(ECIEN) ;
|
---|
| 46 | ;Returns to broker a patient providers (primary & secondary) entries
|
---|
| 47 | ;from EVENT CAPTURE PATIENT FILE #721
|
---|
| 48 | ;INPUTS ECIEN - Event Capture Patient ien
|
---|
| 49 | ;
|
---|
| 50 | ;OUTPUTS RESULTS - Array of Event Capture Patient file contains
|
---|
| 51 | ; ^ECH IEN^provider ien^provider description^Primary/Secondary
|
---|
| 52 | ; code^Primary/Secondary description
|
---|
| 53 | ;
|
---|
| 54 | N ECPRV,ECPROV
|
---|
| 55 | I '$D(^ECH(ECIEN,"PRV")) Q
|
---|
| 56 | K ^TMP($J,"ECPRV")
|
---|
| 57 | S ECPRV=$$GETPRV^ECPRVMUT(ECIEN,.ECPROV) I 'ECPRV D
|
---|
| 58 | .M ^TMP($J,"ECPRV")=ECPROV
|
---|
| 59 | S RESULTS=$NA(^TMP($J,"ECPRV"))
|
---|
| 60 | Q
|
---|