dbo.SXAGNLetterTemplateInstance 
Default Table Name  SXAGNLetterTemplateInstance 
Definition  The purpose of this table is to save generated letters that can be retrieved and audited at a later time. 

dbo.SXAGNLetterTemplateInstance Columns 
ColumnName  Domain  Datatype  NULL  Definition 
Build    int  NO  Identifies the build number and patch level of the software that inserted/updated this row. The format is the Build number followed by 3 digits for the patch level which is typically 000. The build number is tied to specific versions of the software, e.g. Sunrise 15.3 is Build 5021, Sunrise 16.3 is Build 5503. 
TouchedBy    varchar(50)  NO  Information about the user that last updated the row. This will typically be the UserID (IDCode from CV3User table) and may be prefixed with an environment identifier followed by an underscore, e.g. b96d2bf5_jongmore. 
TouchedWhenUTC    datetimeoffset(3)  NO  The date and time that the row was last updated including the time zone offset from UTC, for example 2015-01-30 04:55:04.372 -05:00. The date and time is based on the Enterprise Time Zone. 
CreatedBy    varchar(50)  NO  Information about the user that created the row. This will typically be the UserID (IDCode from CV3User table) and may be prefixed with an environment identifier followed by an underscore, e.g. b96d2bf5_jongmore. 
CreatedWhenUTC    datetimeoffset(3)  NO  The date and time that the row was created including the time zone offset from UTC, for example 2015-01-30 04:55:04.372 -05:00. The date and time is based on the Enterprise Time Zone. 
MSRowVersion    timestamp  NO  Optimistic lock identifier using rowversion datatype. 
Active    bit  NO  Denotes whether the row is active or not, 0 means the row has been soft deleted or deactivated. 
MSReplrowguid    uniqueidentifier  NO  Unique GUID used to support merge replication. 
LetterTemplateInstanceID(PK)    bigint  NO  Auto generated unique primary key value. 
LetterTemplateVersionID(FK)    int  NO  A foreign key to the LetterTemplateVersionID column in the SXAGNLetterTemplateVersion table. 
Content    varbinary(max)  NO  PHI: Value contains the content of the letter instance 
FileExtension    varchar(10)  NO  Value contains the file name of the letter instance 
IsPreview    bit  NO  Value is true if this letter is preview, otherwise false 
PatientMRN    varchar(20)  NO  PHI: Patient Medical Record Number 
VisitNumber    varchar(20)  NO  PHI: Publicly facing visit identifier 
EpisodeReceivableAssetID    bigint  YES  Publicly facing episode identifier 
WorksheetReceivableAssetID    bigint  YES  Publicly facing worksheet identifier 
ApplicationID    int  NO  Value contains the identifier of the application generating the letter. 
OpenXMLContent    varbinary(max)  YES  PHI: OpenXML version of the document 
ContextValue    varchar(20)  YES  PHI: Original value used for looking up visual workflow data 

dbo.SXAGNLetterTemplateInstance Primary and Unique Keys 
Key Name  Key Type  Keys 
SXAGNLetterTemplateInstancePK  PrimaryKey  LetterTemplateInstanceID