| 1 | DGRUDD01 ;ALB/SCK - Data Dictionary Utilities MDS COTS update ;8-10-99
|
|---|
| 2 | ;;5.3;Registration;**190**;Aug 13, 1993
|
|---|
| 3 | ;
|
|---|
| 4 | ADGRU(DFN) ; ADGRU* cross reference for Patient File (#2)
|
|---|
| 5 | ;
|
|---|
| 6 | ; Input : DFN - Pointer to entry in PATIENT File (#2)
|
|---|
| 7 | ;
|
|---|
| 8 | ; Output : None
|
|---|
| 9 | ;
|
|---|
| 10 | ; Note: The ADGRU* cross references are used to remember that changes
|
|---|
| 11 | ; were made to the PATIENT File(#2) outside of the Registration
|
|---|
| 12 | ; Process. Execution of this cross reference will mark an entry
|
|---|
| 13 | ; in the ADT/HL7 PIVOT file (#391.71) and mark it as requiring
|
|---|
| 14 | ; transmission on an HL7 ADT-A08 message.
|
|---|
| 15 | ;
|
|---|
| 16 | ; Execution of this cross reference can be prevented by setting
|
|---|
| 17 | ; the local variable DGRUGA08 equal to 1
|
|---|
| 18 | ;
|
|---|
| 19 | ; This cross reference is intended for notifing the Resident
|
|---|
| 20 | ; Assessment Instrument COTS database of a demographic change
|
|---|
| 21 | ; to a patients data.
|
|---|
| 22 | ;
|
|---|
| 23 | ; Check Input
|
|---|
| 24 | I +$G(DFN),$D(^DPT(DFN,0))
|
|---|
| 25 | E Q
|
|---|
| 26 | ;
|
|---|
| 27 | N VARPTR,PIVOTNUM,DGRU,VAFHDT,VAROOT
|
|---|
| 28 | ;
|
|---|
| 29 | ; Check for flag
|
|---|
| 30 | Q:$G(DGRUGA08)
|
|---|
| 31 | ; Test for HL7 ADT on/off parameter
|
|---|
| 32 | Q:'$P($$SEND^VAFHUTL(),"^",2)
|
|---|
| 33 | ; Test for Inpatient status on TODAY, if patient is not an inpatient today
|
|---|
| 34 | ; then quit any further processing.
|
|---|
| 35 | S VAROOT="DGRU",VAFHDT=$$DT^XLFDT
|
|---|
| 36 | D INP^VADPT
|
|---|
| 37 | ; check admission date and ward location for inpatient status
|
|---|
| 38 | I '(+DGRU(1)),'(+DGRU(4)) Q
|
|---|
| 39 | ; check for ward flagged as RAI/MDS ward.
|
|---|
| 40 | Q:'$$CHKWARD^DGRUUTL(+DGRU(4))
|
|---|
| 41 | ; All checks passed
|
|---|
| 42 | ; Check for change to SSN. If the SSN has changed, then we need to process
|
|---|
| 43 | ; the SSN change differently through the RAI MONITOR file rather than using
|
|---|
| 44 | ; the pivot file.
|
|---|
| 45 | ;
|
|---|
| 46 | N DGOK
|
|---|
| 47 | S DGSNOLD=$P($G(D),"^",9)
|
|---|
| 48 | S DGSNNEW=$P($G(DV),"^",9)
|
|---|
| 49 | I +DGSNNEW>0&(+DGSNOLD>0) D Q:$G(DGOK)
|
|---|
| 50 | . I DGSNOLD'=DGSNNEW D Q
|
|---|
| 51 | .. N DGX S DGX=$O(^DGRU(46.11,"B",DGSNNEW,0))
|
|---|
| 52 | .. Q:$G(DGX)>0
|
|---|
| 53 | .. N FDA
|
|---|
| 54 | .. S FDA(1,46.11,"+1,",.01)=DGSNNEW
|
|---|
| 55 | .. S FDA(1,46.11,"+1,",.02)=DGSNOLD
|
|---|
| 56 | .. S FDA(1,46.11,"+1,",.03)=2
|
|---|
| 57 | .. S FDA(1,46.11,"+1,",.04)=DFN
|
|---|
| 58 | .. D UPDATE^DIE("E","FDA(1)")
|
|---|
| 59 | .. S DGOK=1
|
|---|
| 60 | ;
|
|---|
| 61 | ; Create entry in pivot file
|
|---|
| 62 | D PVT4A08(DFN)
|
|---|
| 63 | ;
|
|---|
| 64 | I PIVOTNUM<0 Q
|
|---|
| 65 | D XMITFLAG^VAFCDD01(0,PIVOTNUM)
|
|---|
| 66 | ;
|
|---|
| 67 | Q
|
|---|
| 68 | ;
|
|---|
| 69 | PVT4A08(DFN) ; Create an entry in the ADT/HL7 PIVOT file for a patient demographic
|
|---|
| 70 | ; update event and mark it for transmission
|
|---|
| 71 | ;
|
|---|
| 72 | ; Input : DFN - pointer to entry in PATIENT File (#2)
|
|---|
| 73 | ;
|
|---|
| 74 | ; Output : None
|
|---|
| 75 | ;
|
|---|
| 76 | ; Check input
|
|---|
| 77 | I +$G(DFN),$D(^DPT(DFN,0))
|
|---|
| 78 | E Q
|
|---|
| 79 | ;
|
|---|
| 80 | S VARPTR=DFN_";DPT("
|
|---|
| 81 | ;
|
|---|
| 82 | S PIVOTNUM=+$$PIVNW^VAFHPIVT(DFN,$P(DT,"."),6,VARPTR)
|
|---|
| 83 | Q:(PIVOTNUM<0)
|
|---|
| 84 | ;
|
|---|
| 85 | ; Mark entry as requires transmission
|
|---|
| 86 | I $G(DGRUGA08),$P($$SEND^VAFHUTL(),"^",2) D XMITFLAG^VAFCDD01(0,PIVOTNUM)
|
|---|
| 87 | ; Mark entry as transmitted field YES
|
|---|
| 88 | ;I $G(DGRUGA08),$$SEND^VAFHUTL() S SETFLAG^VAFCDD01(0,PIVOTNUM)
|
|---|
| 89 | Q
|
|---|