DGADDUT2 ;ALB/ERC,CKN - CONTINUATION OF ADDRESS UTILITIES ; 8/1/08 1:48pm
;;5.3;PIMS;**1016**;JUN 30, 2012;Build 20
;a continuation of utilities from DGADDUTL
;
UPDDTTM(DFN,TYPE) ; Update the PATIENT file #2 with the current date and time
;
N %H,%,X,%Y,%D,%M,%I,ADDDTTM,DIE,DA,DR
D NOW^%DTC
S ADDDTTM=%,DIE="^DPT(",DA=DFN
;
; If it's the Temporary Address, the field is .12113
; If not, it should be the Permanent Address and the default field is .118
S DR=$S(TYPE="TEMP":".12113///^S X=ADDDTTM",1:".118///^S X=ADDDTTM")
D ^DIE
Q
UPDADDLG(DFN,DGPRIOR,DGINPUT) ; Update the IVM ADDRESS CHANGE LOG file #301.7
;
N DGDATA
; Zero node:
S DGDATA(.01)=DGINPUT(.118)
S DGDATA(1)=DFN
S DGDATA(2)=DGINPUT(.122)
S DGDATA(3)=DGINPUT(.119)
S DGDATA(3.5)=DGINPUT(.12)
;
; One node:
S DGDATA(4)=DGPRIOR(.118)
S DGDATA(5)=DGPRIOR(.122)
S DGDATA(6)=DGPRIOR(.12)
S DGDATA(7)=DGPRIOR(.119)
S DGDATA(8)=DGPRIOR(.131)
S DGDATA(9)=DGPRIOR(.111)
S DGDATA(10)=DGPRIOR(.112)
S DGDATA(11)=DGPRIOR(.114)
S DGDATA(12)=DGPRIOR(.117)
S DGDATA(13)=DGPRIOR(.115)
S DGDATA(14)=DGPRIOR(.1112)
S DGDATA(15)=DGPRIOR(.1171)
S DGDATA(16)=DGPRIOR(.1172)
S DGDATA(17)=DGPRIOR(.1173)
S DGDATA(18)=DGPRIOR(.121)
S DGDATA(19)=DGPRIOR(.113)
;
I $$ADD^DGENDBS(301.7,,.DGDATA) ;
Q
CNTRY(DGARR) ;
;where DGARR is an array of values which includes a node for "CNTRY"
;DGARR("CNTRY") is returned in upper case display mode
;called from DGREGARP
N DGC
S DGC=$G(DGARR("CNTRY"))
I '$D(^HL(779.004,"B",DGC)) Q ""
S DGC=$$COUNTRY^DGADDUTL(DGC)
S DGARR("CNTRY")=DGC
Q
DGADDUT2 ;ALB/ERC,CKN - CONTINUATION OF ADDRESS UTILITIES ; 8/1/08 1:48pm
+1 ;;5.3;PIMS;**1016**;JUN 30, 2012;Build 20
+2 ;a continuation of utilities from DGADDUTL
+3 ;
UPDDTTM(DFN,TYPE) ; Update the PATIENT file #2 with the current date and time
+1 ;
+2 NEW %H,%,X,%Y,%D,%M,%I,ADDDTTM,DIE,DA,DR
+3 DO NOW^%DTC
+4 SET ADDDTTM=%
SET DIE="^DPT("
SET DA=DFN
+5 ;
+6 ; If it's the Temporary Address, the field is .12113
+7 ; If not, it should be the Permanent Address and the default field is .118
+8 SET DR=$SELECT(TYPE="TEMP":".12113///^S X=ADDDTTM",1:".118///^S X=ADDDTTM")
+9 DO ^DIE
+10 QUIT
UPDADDLG(DFN,DGPRIOR,DGINPUT) ; Update the IVM ADDRESS CHANGE LOG file #301.7
+1 ;
+2 NEW DGDATA
+3 ; Zero node:
+4 SET DGDATA(.01)=DGINPUT(.118)
+5 SET DGDATA(1)=DFN
+6 SET DGDATA(2)=DGINPUT(.122)
+7 SET DGDATA(3)=DGINPUT(.119)
+8 SET DGDATA(3.5)=DGINPUT(.12)
+9 ;
+10 ; One node:
+11 SET DGDATA(4)=DGPRIOR(.118)
+12 SET DGDATA(5)=DGPRIOR(.122)
+13 SET DGDATA(6)=DGPRIOR(.12)
+14 SET DGDATA(7)=DGPRIOR(.119)
+15 SET DGDATA(8)=DGPRIOR(.131)
+16 SET DGDATA(9)=DGPRIOR(.111)
+17 SET DGDATA(10)=DGPRIOR(.112)
+18 SET DGDATA(11)=DGPRIOR(.114)
+19 SET DGDATA(12)=DGPRIOR(.117)
+20 SET DGDATA(13)=DGPRIOR(.115)
+21 SET DGDATA(14)=DGPRIOR(.1112)
+22 SET DGDATA(15)=DGPRIOR(.1171)
+23 SET DGDATA(16)=DGPRIOR(.1172)
+24 SET DGDATA(17)=DGPRIOR(.1173)
+25 SET DGDATA(18)=DGPRIOR(.121)
+26 SET DGDATA(19)=DGPRIOR(.113)
+27 ;
+28 ;
IF $$ADD^DGENDBS(301.7,,.DGDATA)
+29 QUIT
CNTRY(DGARR) ;
+1 ;where DGARR is an array of values which includes a node for "CNTRY"
+2 ;DGARR("CNTRY") is returned in upper case display mode
+3 ;called from DGREGARP
+4 NEW DGC
+5 SET DGC=$GET(DGARR("CNTRY"))
+6 IF '$DATA(^HL(779.004,"B",DGC))
QUIT ""
+7 SET DGC=$$COUNTRY^DGADDUTL(DGC)
+8 SET DGARR("CNTRY")=DGC
+9 QUIT