Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DGCNTRY

DGCNTRY.m

Go to the documentation of this file.
DGCNTRY ;BAJ,JAM,JAM - REGISTRATION SCREEN 7/CROSS REFERENCE CLEANUP ;15 Feb 2018  4:03 PM
 ;;5.3;Registration;**688,941,997**;Aug 13, 1993;Build 42
 ;
 ; This routine is called by a New style MUMPS index named AXCNTRY
 ; The purpose of this routine is to clear certain fields when the Country field is changed
 ; Values:       X1(#) contains the OLD values
 ;                       X2(#) contains the NEW values
 ;               
 ; DG*5.3*941 - JAM - Updated for Residential Address fields - see tag DTABLE. Related to index AXRCNTRY.
 ; DG*5.3*997 - JAM - Updated for NOK/E-Contact Address fields - see tag DTABLE. Related to indexes AXNCNTRY, AXN2CNTRY, AXECNTRY, AXE2CNTRY, AXDCNTRY.
 ;
EN(FILE,ATYPE,FIELD) ; entry point
 ;
 ; Code to TRIGGER deletion of field data.
 N DGENDA,DATA,FORGN,ERROR
 Q:X=""
 S DGENDA=DA,ERROR=""
 S FORGN=$$FORGN(.X2) D SETARR(.DATA,FORGN,FILE,ATYPE,FIELD)
 Q $$UPD^DGENDBS(FILE,.DGENDA,.DATA,.ERROR)
 ;
SETARR(DATA,FORGN,FILE,ATYPE,FIELD) ;set up data array
 N CNT,CURFILE,CTRYFLD,FDFLG,ADDTYPE,T,FTYPE,CURFTYPE
 ; If foreign kill domestic fields and vice versa
 S FTYPE=$S(FORGN:"D",1:"F")
 F CNT=1:1 S T=$P($T(DTABLE+CNT),";;",3) Q:T="QUIT"  D
 . S CURFTYPE=$P(T,";",1),ADDTYPE=$P(T,";",2),CURFILE=$P(T,";",3),CTRYFLD=$P(T,";",4),CURFLD=$P(T,";",5)
 . I CURFTYPE=FTYPE,CURFILE=FILE,ADDTYPE=ATYPE,CTRYFLD=FIELD S DATA(CURFLD)="@"
 Q
FORGN(X2)  ; logic to determine if COUNTRY is US or Foreign
 Q $$FORIEN^DGADDUTL(X2(1))
 ;
DTABLE ;TABLE of Foreign and Domestic fields: structure -->>;DESCRIPTION;;(F)OREIGN/(D)OMESTIC;FILE;COUNTRY FIELD;FIELD
 ;;PROVINCE;;F;PERM;2;.1173;.1171
 ;;POSTAL CODE;;F;PERM;2;.1173;.1172
 ;;STATE;;D;PERM;2;.1173;.115
 ;;COUNTY;;D;PERM;2;.1173;.1117
 ;;ZIP+4;;D;PERM;2;.1173;.1112
 ;;PROVINCE;;F;TEMP;2;.1223;.1221
 ;;POSTAL CODE;;F;TEMP;2;.1223;.1222
 ;;STATE;;D;TEMP;2;.1223;.1215
 ;;COUNTY;;D;TEMP;2;.1223;.12111
 ;;ZIP+4;;D;TEMP;2;.1223;.12112
 ;;PROVINCE;;F;CONF;2;.14116;.14114
 ;;POSTAL CODE;;F;CONF;2;.14116;.14115
 ;;STATE;;D;CONF;2;.14116;.1415
 ;;COUNTY;;D;CONF;2;.14116;.14111
 ;;ZIP+4;;D;CONF;2;.14116;.1416
 ;;PROVINCE;;F;RESI;2;.11573;.11571
 ;;POSTAL CODE;;F;RESI;2;.11573;.11572
 ;;STATE;;D;RESI;2;.11573;.1155
 ;;COUNTY;;D;RESI;2;.11573;.1157
 ;;ZIP+4;;D;RESI;2;.11573;.1156
 ;;PROVINCE;;F;NOK;2;.221;.222
 ;;POSTAL CODE;;F;NOK;2;.221;.223
 ;;STATE;;D;NOK;2;.221;.217
 ;;ZIP+4;;D;NOK;2;.221;.2207
 ;;PROVINCE;;F;NOK2;2;.2101;.2102
 ;;POSTAL CODE;;F;NOK2;2;.2101;.2103
 ;;STATE;;D;NOK2;2;.2101;.2197
 ;;ZIP+4;;D;NOK2;2;.2101;.2203
 ;;PROVINCE;;F;EC;2;.3306;.3307
 ;;POSTAL CODE;;F;EC;2;.3306;.3308
 ;;STATE;;D;EC;2;.3306;.337
 ;;ZIP+4;;D;EC;2;.3306;.2201
 ;;PROVINCE;;F;EC2;2;.331012;.331013
 ;;POSTAL CODE;;F;EC2;2;.331012;.331014
 ;;STATE;;D;EC2;2;.331012;.3317
 ;;ZIP+4;;D;EC2;2;.331012;.2204
 ;;PROVINCE;;F;DES;2;.34012;.34013
 ;;POSTAL CODE;;F;DES;2;.34012;.34014
 ;;STATE;;D;DES;2;.34012;.347
 ;;ZIP+4;;D;DES;2;.34012;.2202
 ;;QUIT;;QUIT