Index: VWGUIRegistration/tag/2.0/VWREG_03182017_P4T4_0.KID
===================================================================
--- VWGUIRegistration/tag/2.0/VWREG_03182017_P4T4_0.KID	(revision 1794)
+++ VWGUIRegistration/tag/2.0/VWREG_03182017_P4T4_0.KID	(revision 1794)
@@ -0,0 +1,662 @@
+KIDS Distribution saved on Mar 19, 2017@10:24
+Minor updates: VWREGITT, Patient field .363, help
+**KIDS**:VWREG_03182017*2.04T4*0^
+
+**INSTALL NAME**
+VWREG_03182017*2.04T4*0
+"BLD",633,0)
+VWREG_03182017*2.04T4*0^^0^3170319^n
+"BLD",633,1,0)
+^^8^8^3170319^^
+"BLD",633,1,1,0)
+Minor corrections:
+"BLD",633,1,2,0)
+1 The executable - linked the Template Management help to the main help
+"BLD",633,1,3,0)
+2 Completed the delete template from the regit.txt file.
+"BLD",633,1,4,0)
+  NOTE: Does NOT delete the template from the Fileman Input Template file
+"BLD",633,1,5,0)
+        to avoid <UNDEF> consequences
+"BLD",633,1,6,0)
+3 Removed security from PATIENT file FIELD .363 PRIMARY LONG ID:
+"BLD",633,1,7,0)
+  Original build did not remove the security, which was at no access
+"BLD",633,1,8,0)
+  (^).
+"BLD",633,4,0)
+^9.64PA^2^1
+"BLD",633,4,2,0)
+2
+"BLD",633,4,2,2,0)
+^9.641^2^1
+"BLD",633,4,2,2,2,0)
+PATIENT  (File-top level)
+"BLD",633,4,2,2,2,1,0)
+^9.6411^.363^1
+"BLD",633,4,2,2,2,1,.363,0)
+PRIMARY LONG ID
+"BLD",633,4,2,222)
+y^y^p^^^^n^^n
+"BLD",633,4,2,224)
+
+"BLD",633,4,"APDD",2,2)
+
+"BLD",633,4,"APDD",2,2,.363)
+
+"BLD",633,4,"B",2,2)
+
+"BLD",633,6.3)
+1
+"BLD",633,"KRN",0)
+^9.67PA^779.2^20
+"BLD",633,"KRN",.4,0)
+.4
+"BLD",633,"KRN",.401,0)
+.401
+"BLD",633,"KRN",.402,0)
+.402
+"BLD",633,"KRN",.403,0)
+.403
+"BLD",633,"KRN",.5,0)
+.5
+"BLD",633,"KRN",.84,0)
+.84
+"BLD",633,"KRN",3.6,0)
+3.6
+"BLD",633,"KRN",3.8,0)
+3.8
+"BLD",633,"KRN",9.2,0)
+9.2
+"BLD",633,"KRN",9.8,0)
+9.8
+"BLD",633,"KRN",9.8,"NM",0)
+^9.68A^1^1
+"BLD",633,"KRN",9.8,"NM",1,0)
+VWREGITT^^0^B38020021
+"BLD",633,"KRN",9.8,"NM","B","VWREGITT",1)
+
+"BLD",633,"KRN",19,0)
+19
+"BLD",633,"KRN",19.1,0)
+19.1
+"BLD",633,"KRN",101,0)
+101
+"BLD",633,"KRN",409.61,0)
+409.61
+"BLD",633,"KRN",771,0)
+771
+"BLD",633,"KRN",779.2,0)
+779.2
+"BLD",633,"KRN",870,0)
+870
+"BLD",633,"KRN",8989.51,0)
+8989.51
+"BLD",633,"KRN",8989.52,0)
+8989.52
+"BLD",633,"KRN",8994,0)
+8994
+"BLD",633,"KRN","B",.4,.4)
+
+"BLD",633,"KRN","B",.401,.401)
+
+"BLD",633,"KRN","B",.402,.402)
+
+"BLD",633,"KRN","B",.403,.403)
+
+"BLD",633,"KRN","B",.5,.5)
+
+"BLD",633,"KRN","B",.84,.84)
+
+"BLD",633,"KRN","B",3.6,3.6)
+
+"BLD",633,"KRN","B",3.8,3.8)
+
+"BLD",633,"KRN","B",9.2,9.2)
+
+"BLD",633,"KRN","B",9.8,9.8)
+
+"BLD",633,"KRN","B",19,19)
+
+"BLD",633,"KRN","B",19.1,19.1)
+
+"BLD",633,"KRN","B",101,101)
+
+"BLD",633,"KRN","B",409.61,409.61)
+
+"BLD",633,"KRN","B",771,771)
+
+"BLD",633,"KRN","B",779.2,779.2)
+
+"BLD",633,"KRN","B",870,870)
+
+"BLD",633,"KRN","B",8989.51,8989.51)
+
+"BLD",633,"KRN","B",8989.52,8989.52)
+
+"BLD",633,"KRN","B",8994,8994)
+
+"BLD",633,"QDEF")
+^^^^NO^^^^NO^^NO
+"BLD",633,"QUES",0)
+^9.62^^
+"BLD",633,"REQB",0)
+^9.611^^
+"FIA",2)
+PATIENT
+"FIA",2,0)
+^DPT(
+"FIA",2,0,0)
+2I
+"FIA",2,0,1)
+y^y^p^^^^n^^n
+"FIA",2,0,10)
+
+"FIA",2,0,11)
+
+"FIA",2,0,"RLRO")
+
+"FIA",2,2)
+1
+"FIA",2,2,.363)
+
+"MBREQ")
+0
+"QUES","XPF1",0)
+Y
+"QUES","XPF1","??")
+^D REP^XPDH
+"QUES","XPF1","A")
+Shall I write over your |FLAG| File
+"QUES","XPF1","B")
+YES
+"QUES","XPF1","M")
+D XPF1^XPDIQ
+"QUES","XPF2",0)
+Y
+"QUES","XPF2","??")
+^D DTA^XPDH
+"QUES","XPF2","A")
+Want my data |FLAG| yours
+"QUES","XPF2","B")
+YES
+"QUES","XPF2","M")
+D XPF2^XPDIQ
+"QUES","XPI1",0)
+YO
+"QUES","XPI1","??")
+^D INHIBIT^XPDH
+"QUES","XPI1","A")
+Want KIDS to INHIBIT LOGONs during the install
+"QUES","XPI1","B")
+NO
+"QUES","XPI1","M")
+D XPI1^XPDIQ
+"QUES","XPM1",0)
+PO^VA(200,:EM
+"QUES","XPM1","??")
+^D MG^XPDH
+"QUES","XPM1","A")
+Enter the Coordinator for Mail Group '|FLAG|'
+"QUES","XPM1","B")
+
+"QUES","XPM1","M")
+D XPM1^XPDIQ
+"QUES","XPO1",0)
+Y
+"QUES","XPO1","??")
+^D MENU^XPDH
+"QUES","XPO1","A")
+Want KIDS to Rebuild Menu Trees Upon Completion of Install
+"QUES","XPO1","B")
+NO
+"QUES","XPO1","M")
+D XPO1^XPDIQ
+"QUES","XPZ1",0)
+Y
+"QUES","XPZ1","??")
+^D OPT^XPDH
+"QUES","XPZ1","A")
+Want to DISABLE Scheduled Options, Menu Options, and Protocols
+"QUES","XPZ1","B")
+NO
+"QUES","XPZ1","M")
+D XPZ1^XPDIQ
+"QUES","XPZ2",0)
+Y
+"QUES","XPZ2","??")
+^D RTN^XPDH
+"QUES","XPZ2","A")
+Want to MOVE routines to other CPUs
+"QUES","XPZ2","B")
+NO
+"QUES","XPZ2","M")
+D XPZ2^XPDIQ
+"RTN")
+1
+"RTN","VWREGITT")
+0^1^B38020021
+"RTN","VWREGITT",1,0)
+VWREGITT ;Portland\Jim Bell, BFP,LLC Input Template Management 2016
+"RTN","VWREGITT",2,0)
+ ;2.0**LOCAL** Copyright April 2016 ad infinitum;;;;;Build 1
+"RTN","VWREGITT",3,0)
+ ;*****************************************************************
+"RTN","VWREGITT",4,0)
+ ;* Licensed under GNU 2.0 or greater - see license.txt file      *
+"RTN","VWREGITT",5,0)
+ ;* Program/application is for the management of input templates  *
+"RTN","VWREGITT",6,0)
+ ;* owned by the user (DUZ).                                      *
+"RTN","VWREGITT",7,0)
+ ;* REMINDER: All template fields pertain only to the Patient File*
+"RTN","VWREGITT",8,0)
+ ;*  (#2)!                                                        *
+"RTN","VWREGITT",9,0)
+ ;*****************************************************************
+"RTN","VWREGITT",10,0)
+ Q  ;No fall through
+"RTN","VWREGITT",11,0)
+ ;
+"RTN","VWREGITT",12,0)
+AUTH(TUSER,TNUM) ;Can user edit or is IT CONTROL
+"RTN","VWREGITT",13,0)
+ N TMO
+"RTN","VWREGITT",14,0)
+ S TMO=$O(^DIC(19,"B","VW REG IT CONTROL",0)) I $D(^VA(200,TUSER,203,"B",TMO)) Q 1
+"RTN","VWREGITT",15,0)
+ S TMO=$O(^DIC(19,"B","VW PATIENT REGISTRATION",0))
+"RTN","VWREGITT",16,0)
+ I TMO,$P(^DIE(TNUM,0),"^",5)=TUSER Q 1
+"RTN","VWREGITT",17,0)
+ Q 0
+"RTN","VWREGITT",18,0)
+ ;
+"RTN","VWREGITT",19,0)
+INR() Q $O(RESULT(" "),-1)+1
+"RTN","VWREGITT",20,0)
+ ;
+"RTN","VWREGITT",21,0)
+CF(FIELD) ;If a computed field, 0, else 1
+"RTN","VWREGITT",22,0)
+ I $P($G(^DD(2,FIELD,0)),"^",2)["C" Q 0
+"RTN","VWREGITT",23,0)
+ Q 1
+"RTN","VWREGITT",24,0)
+ ;
+"RTN","VWREGITT",25,0)
+EGF(RESULT,TNAME) ;Get fields for client editing via TName
+"RTN","VWREGITT",26,0)
+ ;*************************
+"RTN","VWREGITT",27,0)
+ ;* Incoming___TNAME(IEN) *
+"RTN","VWREGITT",28,0)
+ ;*************************
+"RTN","VWREGITT",29,0)
+ K RESULT  ;N TNUM,TNAME,PF,SF
+"RTN","VWREGITT",30,0)
+ S TNUM=+$P(TNAME,"(",2)
+"RTN","VWREGITT",31,0)
+ S TNAME=$P(TNAME,"(")
+"RTN","VWREGITT",32,0)
+ I 'TNUM!('$D(^DIE(TNUM))) S RESULT(0)="Template name or number not found in Template file" Q
+"RTN","VWREGITT",33,0)
+ ;Check for authorization
+"RTN","VWREGITT",34,0)
+ I '$$AUTH(DUZ,TNUM) S RESULT(0)="Sorry, you are not authorized to edit this template." Q
+"RTN","VWREGITT",35,0)
+ S RESULT(0)="Editing "_TNAME_"("_TNUM_")"
+"RTN","VWREGITT",36,0)
+ S PF=$G(^DIE(TNUM,"DR",1,2))
+"RTN","VWREGITT",37,0)
+ F I=1:1:$L(PF,";") D:$P(PF,";",I) 
+"RTN","VWREGITT",38,0)
+ . S RESULT($$INR)=$P(^DD(2,$P(PF,";",I),0),"^")_"("_$P(PF,";",I)_")"
+"RTN","VWREGITT",39,0)
+ . S SDD=+$P(^DD(2,$P(PF,";",I),0),"^",2) D:SDD
+"RTN","VWREGITT",40,0)
+ .. S SDN=1 F  S SDN=$O(^DIE(TNUM,"DR",SDN)) Q:'SDN  S:$O(^(SDN,0))=SDD SF=^(SDD) D
+"RTN","VWREGITT",41,0)
+ ... F J=1:1:$L(SF,";") D:$P(SF,";",J)
+"RTN","VWREGITT",42,0)
+ .... S SFF=$P(^DIE(TNUM,"DR",SDN,SDD),";",J)
+"RTN","VWREGITT",43,0)
+ .... S RESULT($$INR)="  SF  "_$P(^DD(SDD,SFF,0),"^")_"("_SFF_";"_SDD_")"
+"RTN","VWREGITT",44,0)
+ Q
+"RTN","VWREGITT",45,0)
+ ;
+"RTN","VWREGITT",46,0)
+SFLDS ;Get sub-fields and dics
+"RTN","VWREGITT",47,0)
+ K MULT N N,X,I,Y
+"RTN","VWREGITT",48,0)
+ S Y="",N=0 F  S N=$O(TDATA(N)) Q:'+N  D
+"RTN","VWREGITT",49,0)
+ . Q:TDATA(N)'["  SF"  ;Still a major field
+"RTN","VWREGITT",50,0)
+ . F I=N:1:$O(TDATA(" "),-1) S X=TDATA(I) Q:X'["  SF"  S MULT(+$P(X,";",2),+$P(X,"(",2))=""
+"RTN","VWREGITT",51,0)
+ Q
+"RTN","VWREGITT",52,0)
+ ;
+"RTN","VWREGITT",53,0)
+FIELDS() ;
+"RTN","VWREGITT",54,0)
+ N FLDLIST,N,X,FLD K MULT
+"RTN","VWREGITT",55,0)
+ S FLDLIST=""
+"RTN","VWREGITT",56,0)
+ S N=0 F  S N=$O(TDATA(N)) Q:'+N  D:TDATA(N)'["  SF"
+"RTN","VWREGITT",57,0)
+ . S FLD=+$P(TDATA(N),"(",2)
+"RTN","VWREGITT",58,0)
+ . Q:'$$CF(+$P(TDATA(N),"(",2))  ;Computed field
+"RTN","VWREGITT",59,0)
+ . S FLDLIST=FLDLIST_FLD_";"
+"RTN","VWREGITT",60,0)
+ ;Collate thru for multiple fields:entry looks like "  SF  "
+"RTN","VWREGITT",61,0)
+ S N=0 F  S N=$O(TDATA(N)) Q:'+N  D:TDATA(N)["  SF"
+"RTN","VWREGITT",62,0)
+ . S X=$P(TDATA(N),"  ",3)
+"RTN","VWREGITT",63,0)
+ . S SDD=+$P(X,";",2)
+"RTN","VWREGITT",64,0)
+ . S SFL=+$P(X,"(",2)
+"RTN","VWREGITT",65,0)
+ . S MULT(SDD,SFL)=""
+"RTN","VWREGITT",66,0)
+ S N=0 F  S N=$O(MULT(N)) Q:'+N  D  S SUB(N)=MF
+"RTN","VWREGITT",67,0)
+ . S MF="",N2=0 F  S N2=$O(MULT(N,N2)) Q:'+N2  S MF=MF_N2_";"
+"RTN","VWREGITT",68,0)
+ K MULT
+"RTN","VWREGITT",69,0)
+ Q FLDLIST
+"RTN","VWREGITT",70,0)
+ ;
+"RTN","VWREGITT",71,0)
+RTF(RESULT) ;Send a refresh of regit.txt to client
+"RTN","VWREGITT",72,0)
+ K AR,RESULT
+"RTN","VWREGITT",73,0)
+ D LTF
+"RTN","VWREGITT",74,0)
+ M RESULT=AR
+"RTN","VWREGITT",75,0)
+ K AR
+"RTN","VWREGITT",76,0)
+ Q
+"RTN","VWREGITT",77,0)
+ ;
+"RTN","VWREGITT",78,0)
+LTF ;Load the regit.txt file into AR()
+"RTN","VWREGITT",79,0)
+ S HD=$$GET^XPAR("ALL","VW GUI REG TEMPLATE DIRECTORY")
+"RTN","VWREGITT",80,0)
+ S FILE="regit.txt"
+"RTN","VWREGITT",81,0)
+ S P4=1
+"RTN","VWREGITT",82,0)
+ S P5=""
+"RTN","VWREGITT",83,0)
+ S X=$$FTG^%ZISH(HD,FILE,$NA(AR(1)),P4,P5)
+"RTN","VWREGITT",84,0)
+ Q
+"RTN","VWREGITT",85,0)
+ ;
+"RTN","VWREGITT",86,0)
+FTF ;File the AR() to regit.txt
+"RTN","VWREGITT",87,0)
+ ZSY "cp "_HD_"regit.txt "_HD_"regitbu.txt"
+"RTN","VWREGITT",88,0)
+ S P4=1,P5="",FILE="regit.txt"
+"RTN","VWREGITT",89,0)
+ S X=$$GTF^%ZISH($NA(AR(1)),1,HD,FILE)
+"RTN","VWREGITT",90,0)
+ Q
+"RTN","VWREGITT",91,0)
+ ;
+"RTN","VWREGITT",92,0)
+ITCNTRL(USER) ;Check for control capability and user authorization
+"RTN","VWREGITT",93,0)
+ N ITCNTRL
+"RTN","VWREGITT",94,0)
+ S ITCNTRL=$O(^DIC(19,"B","VW REG IT CONTROL",0))
+"RTN","VWREGITT",95,0)
+ I 'ITCNTRL D  Q 0
+"RTN","VWREGITT",96,0)
+ . S VAL=0
+"RTN","VWREGITT",97,0)
+ . S RESULT(0)="-1^VW REGISTRATION does not appear to be complete."
+"RTN","VWREGITT",98,0)
+ . S RESULT(1)="Please contact your Supervisor or IT support."
+"RTN","VWREGITT",99,0)
+ . S RESULT(2)="Thank you,"
+"RTN","VWREGITT",100,0)
+ . S RESULT(3)="The Management"
+"RTN","VWREGITT",101,0)
+ I '$D(^VA(200,USER,203,"B",ITCNTRL)) D  Q 0
+"RTN","VWREGITT",102,0)
+ . S RESULT(0)="-1^User does not have authorization to modify/create"
+"RTN","VWREGITT",103,0)
+ . S RESULT(1)="input templates. Please contact your Supervisor or"
+"RTN","VWREGITT",104,0)
+ . S RESULT(2)="IT support. Or, questions can be referred to Jim"
+"RTN","VWREGITT",105,0)
+ . S RESULT(3)="Bell at jbellco65@gmail.com"
+"RTN","VWREGITT",106,0)
+ . S RESULT(4)="Thank you."
+"RTN","VWREGITT",107,0)
+ Q 1
+"RTN","VWREGITT",108,0)
+ ;
+"RTN","VWREGITT",109,0)
+EN(RESULT,TDATA) ;
+"RTN","VWREGITT",110,0)
+ ;************************************************
+"RTN","VWREGITT",111,0)
+ ;* Call from Client                             *
+"RTN","VWREGITT",112,0)
+ ;* TDATA Array:                                 *
+"RTN","VWREGITT",113,0)
+ ;*   0____Template Name^DUZ^ACTION^WRITEACCESS  *
+"RTN","VWREGITT",114,0)
+ ;*   1-n__Field name(number)                    *
+"RTN","VWREGITT",115,0)
+ ;************************************************
+"RTN","VWREGITT",116,0)
+ ; -- testing --
+"RTN","VWREGITT",117,0)
+ ;M ^DIZ("TDATA",$J)=TDATA
+"RTN","VWREGITT",118,0)
+ ;Q
+"RTN","VWREGITT",119,0)
+ ; -- end testing --
+"RTN","VWREGITT",120,0)
+ ;
+"RTN","VWREGITT",121,0)
+ N TNAME,TNUM,ITCNTRL,ACTION,FIELDS,CALLER
+"RTN","VWREGITT",122,0)
+ S CALLER=""
+"RTN","VWREGITT",123,0)
+ S X="TDATA" F  S X=$Q(@X) Q:X=""  S @X=$$UP^XLFSTR(@X)  ;Upcase everyTHING
+"RTN","VWREGITT",124,0)
+ I '$L($G(HD)) S HD=$$GET^XPAR("ALL","VW GUI REG TEMPLATE DIRECTORY")
+"RTN","VWREGITT",125,0)
+ S WHO=$P(TDATA(0),"^",2)
+"RTN","VWREGITT",126,0)
+ S ITCNTRL=$$ITCNTRL(WHO)  ;1=full action;0=create/edit own template(s)
+"RTN","VWREGITT",127,0)
+ S TNUM=+$P($P(TDATA(0),"^"),"(",2)
+"RTN","VWREGITT",128,0)
+ S TNAME=$P($P(TDATA(0),"^"),"(")
+"RTN","VWREGITT",129,0)
+ I TNAME["Editing" S SPEC("Editing ")="",TNAME=$$REPLACE^XLFSTR(TNAME,.SPEC)
+"RTN","VWREGITT",130,0)
+ S ACTION=$P(TDATA(0),"^",3)
+"RTN","VWREGITT",131,0)
+ S WRITEACC=$S($P(TDATA(0),"^",4)="SELF":$P(^VA(200,DUZ,0),"^",4),1:"")
+"RTN","VWREGITT",132,0)
+ S FIELDS=$$FIELDS
+"RTN","VWREGITT",133,0)
+ I '$L(ACTION) S RESULT(0)="-1^No action sent. I don't know what to do." Q
+"RTN","VWREGITT",134,0)
+ D @ACTION
+"RTN","VWREGITT",135,0)
+ Q
+"RTN","VWREGITT",136,0)
+ ;
+"RTN","VWREGITT",137,0)
+CREATE ;Create a new input template
+"RTN","VWREGITT",138,0)
+ ;******************************
+"RTN","VWREGITT",139,0)
+ ;* Check for computed fields  *
+"RTN","VWREGITT",140,0)
+ ;******************************
+"RTN","VWREGITT",141,0)
+ K RESULT N %DT,X,Y
+"RTN","VWREGITT",142,0)
+ S %DT="TS",X="NOW" D ^%DT S FDATE=Y
+"RTN","VWREGITT",143,0)
+ S X=TNAME,DIC="^DIE(",DIC(0)="LZ" D FILE^DICN
+"RTN","VWREGITT",144,0)
+ S $P(^DIE(+Y,0),"^",2)=FDATE,$P(^(0),"^",3)="",$P(^(0),"^",4)=2,$P(^(0),"^",5)=DUZ
+"RTN","VWREGITT",145,0)
+ S $P(^DIE(+Y,0),"^",6)=WRITEACC
+"RTN","VWREGITT",146,0)
+C2 S ^DIE(+Y,"DR",1,2)=FIELDS
+"RTN","VWREGITT",147,0)
+ ;Do mult fields here
+"RTN","VWREGITT",148,0)
+ S N=0 F  S N=$O(SUB(N)) Q:'+N  D
+"RTN","VWREGITT",149,0)
+ . S UP=^DD(N,0,"UP")
+"RTN","VWREGITT",150,0)
+ . I UP=2 S ^DIE(+Y,"DR",$O(^DIE(+Y,"DR"," "),-1)+1,N)=SUB(N)
+"RTN","VWREGITT",151,0)
+ . E  S ^DIE(+Y,"DR",$O(^DIE(+Y,"DR"," "),-1),N)=SUB(N)
+"RTN","VWREGITT",152,0)
+ I $P(^DIE(+Y,0),"^")=$P(TDATA(0),"^") S RESULT(0)=$P(Y,"^",2)_" filed"
+"RTN","VWREGITT",153,0)
+ Q:CALLER="EDIT"
+"RTN","VWREGITT",154,0)
+ S TNUM=+Y,TNAME=$P(Y,"^",2)
+"RTN","VWREGITT",155,0)
+ K AR
+"RTN","VWREGITT",156,0)
+ D LTF  ;Get the regit.txt file loaded into AR()
+"RTN","VWREGITT",157,0)
+ S LAST=$O(AR(" "),-1)
+"RTN","VWREGITT",158,0)
+ S AR(LAST)=TNAME_"("_TNUM_")"
+"RTN","VWREGITT",159,0)
+ S AR(LAST+1)="[ID]"
+"RTN","VWREGITT",160,0)
+ ;M ^DIZ("TDATA","AR",$J)=AR  ;Testing
+"RTN","VWREGITT",161,0)
+ D FTF  ;File AR() to regit.txt
+"RTN","VWREGITT",162,0)
+ K ^DIZ("TDATA",$J)
+"RTN","VWREGITT",163,0)
+ Q
+"RTN","VWREGITT",164,0)
+ ;
+"RTN","VWREGITT",165,0)
+EDIT ;Edit existing. Check for allowability
+"RTN","VWREGITT",166,0)
+ S Y=TNUM_"^"_TNAME
+"RTN","VWREGITT",167,0)
+EL L -^DIE(TNUM):1 G EL:'$T
+"RTN","VWREGITT",168,0)
+ S S=1 F  S S=$O(^DIE(TNUM,"DR",S)) Q:'+S  D
+"RTN","VWREGITT",169,0)
+ . S SUBD=0 F  S SUBD=$O(^DIE(TNUM,"DR",S,SUBD)) Q:'+SUBD  K ^DIE(TNUM,"DR",S,SUBD)
+"RTN","VWREGITT",170,0)
+ S CALLER="EDIT"
+"RTN","VWREGITT",171,0)
+ D C2
+"RTN","VWREGITT",172,0)
+ L +^DIE(TNUM)
+"RTN","VWREGITT",173,0)
+ S DA=TNUM,DIK="^DIE(" D IX^DIK  ;Re-index record just in case...
+"RTN","VWREGITT",174,0)
+ S RESULT(0)=Y_" modification filed..."
+"RTN","VWREGITT",175,0)
+ Q
+"RTN","VWREGITT",176,0)
+ ;
+"RTN","VWREGITT",177,0)
+DELETE ;********************************************
+"RTN","VWREGITT",178,0)
+ K AR
+"RTN","VWREGITT",179,0)
+ N I,J,X
+"RTN","VWREGITT",180,0)
+ S X="TDATA" F  S X=$Q(@X) Q:X=""  D
+"RTN","VWREGITT",181,0)
+ . Q:'$L($P(@X,"^",3))  ;No entry
+"RTN","VWREGITT",182,0)
+ . K @X
+"RTN","VWREGITT",183,0)
+ M AR=TDATA K TDATA
+"RTN","VWREGITT",184,0)
+ D FTF
+"RTN","VWREGITT",185,0)
+ I X S RESULT(0)="Template menu list updated."
+"RTN","VWREGITT",186,0)
+ E  S RESULT(0)="Template list not updated. Advise Template manager to manually update "_HD_"regit.txt"
+"RTN","VWREGITT",187,0)
+ Q
+"RTN","VWREGITT",188,0)
+ 
+"SEC","^DD",2,2,.363,9)
+
+"VER")
+8.0^22.2
+"^DD",2,2,.363,0)
+PRIMARY LONG ID^F^^.36;3^K:$L(X)>15!($L(X)<1) X
+"^DD",2,2,.363,1,0)
+^.1
+"^DD",2,2,.363,1,391,0)
+2^AHL7^MUMPS
+"^DD",2,2,.363,1,391,1)
+N NX,REG,VAFHDFN S VAFHDFN=DA,NX=X,X="VAFHDD" X ^%ZOSF("TEST") I $T S REG=$$EN^VAFHREG() D:REG=0 SET^VAFHUTL2 S X=NX,DA=VAFHDFN
+"^DD",2,2,.363,1,391,2)
+N NX,REG,VAFHDFN S VAFHDFN=DA,NX=X,X="VAFHDD" X ^%ZOSF("TEST") I $T S REG=$$EN^VAFHREG() D:REG=0 KILL^VAFHUTL2(DA,NX) S:REG'=0 VAFHMRG="",VAFHBEF=NX S X=NX,DA=VAFHDFN
+"^DD",2,2,.363,1,391,"%D",0)
+^^3^3^2960624^^^
+"^DD",2,2,.363,1,391,"%D",1,0)
+This x-ref is used to catch changes to the Primary Long ID
+"^DD",2,2,.363,1,391,"%D",2,0)
+It will cause an A34 (Merge) HL7 message to be fired.
+"^DD",2,2,.363,1,391,"%D",3,0)
+The A34 message will not be generated during patient registration.
+"^DD",2,2,.363,1,391,"DT")
+2960603
+"^DD",2,2,.363,3)
+Answer must be 1-15 characters in length.
+"^DD",2,2,.363,5,1,0)
+2.0361^.03^3
+"^DD",2,2,.363,21,0)
+^^7^7^2911214^^^^
+"^DD",2,2,.363,21,1,0)
+This field contains the patient's long ID associated with
+"^DD",2,2,.363,21,2,0)
+the patient's PRIMARY ELIGIBILITY CODE.  For most patients
+"^DD",2,2,.363,21,3,0)
+this is the Social Security Number.
+"^DD",2,2,.363,21,4,0)
+ 
+"^DD",2,2,.363,21,5,0)
+No user input is needed for this field. It is automatically
+"^DD",2,2,.363,21,6,0)
+updated when the PRIMARY ELIGIBILITY CODE field is entered
+"^DD",2,2,.363,21,7,0)
+and edited.
+"^DD",2,2,.363,"DT")
+2960603
+**END**
+**END**
