VRDR .NET
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
VRDR.BaseMessage Class Reference

Class BaseMessage is the base class of all messages. More...

Inheritance diagram for VRDR.BaseMessage:
VRDR.AcknowledgementMessage VRDR.CauseOfDeathCodingMessage VRDR.DeathRecordAliasMessage VRDR.DeathRecordSubmissionMessage VRDR.DeathRecordVoidMessage VRDR.DemographicsCodingMessage VRDR.ExtractionErrorMessage VRDR.StatusMessage

Public Member Functions

string ToXML (bool prettyPrint=false)
 Helper method to return a XML string representation of this DeathRecordSubmissionMessage. More...
 
string ToXml (bool prettyPrint=false)
 Helper method to return a XML string representation of this DeathRecordSubmissionMessage. More...
 
string ToJSON (bool prettyPrint=false)
 Helper method to return a JSON string representation of this DeathRecordSubmissionMessage. More...
 
string ToJson (bool prettyPrint=false)
 Helper method to return a JSON string representation of this DeathRecordSubmissionMessage. More...
 

Static Public Member Functions

static operator Bundle (BaseMessage message)
 Allow explicit casting of a message into a bundle More...
 
static T Parse< T > (StreamReader source, bool permissive=false)
 Parse an XML or JSON serialization of a FHIR Bundle and construct the appropriate subclass of BaseMessage. The new object is checked to ensure it the same or a subtype of the type parameter. More...
 
static T Parse< T > (Bundle bundle)
 Construct the appropriate subclass of BaseMessage based on a FHIR Bundle. The new object is checked to ensure it the same or a subtype of the type parameter. More...
 
static T Parse< T > (string source, bool permissive=false)
 Parse an XML or JSON serialization of a FHIR Bundle and construct the appropriate subclass of BaseMessage. The new object is checked to ensure it the same or a subtype of the type parameter. More...
 
static BaseMessage Parse (string source, bool permissive=false)
 Parse an XML or JSON serialization of a FHIR Bundle and construct the appropriate subclass of BaseMessage. Clients can use the typeof operator to determine the type of message object returned. More...
 
static BaseMessage ParseGenericMessage (string source, bool permissive=false)
 Parse an XML or JSON serialization of a FHIR Bundle and construct a generic BaseMessage. More...
 
static Bundle ParseGenericBundle (string source, bool permissive=false)
 Parse an XML or JSON serialization of a FHIR Bundle. More...
 
static BaseMessage Parse (Bundle bundle)
 Construct the appropriate subclass of BaseMessage based on a FHIR Bundle. Clients can use the typeof operator to determine the type of message object returned. More...
 
static BaseMessage Parse (StreamReader source, bool permissive=false)
 Parse an XML or JSON serialization of a FHIR Bundle and construct the appropriate subclass of BaseMessage. Clients can use the typeof operator to determine the type of message object returned. More...
 
static DeathRecord GetDeathRecordFromMessage (BaseMessage message)
 Convert message to message type and extract the death record More...
 

Protected Member Functions

 BaseMessage (Bundle messageBundle, bool ignoreMissingEntries=false, bool ignoreBundleType=false)
 Construct a BaseMessage from a FHIR Bundle. This constructor will also validate that the Bundle represents a FHIR message of the correct type. More...
 
findEntry< T > (bool ignoreMissingEntries=false)
 Find the first Entry within the message Bundle that contains a Resource of the specified type and return that resource. More...
 
 BaseMessage (String messageType)
 Constructor that creates a new, empty message for the specified message type.
 
void ExtractBusinessIdentifiers (DeathRecord from)
 Extract the business identifiers for the message from the supplied death record. More...
 
void UpdateMessageBundleRecord ()
 Update the record bundle in this message based on the MessageBundleRecord property (for whichever subclass we're instantiated as). Important if we're managing a death record that might have changed.
 
void SetSingleStringValue (string key, string value)
 Helper method to set a single string value on the Record portion of the Message
 

Protected Attributes

Parameters Record
 A Parameters entry that contains business identifiers for all messages plus additional information for Coding messages.
 
MessageHeader Header
 MessageHeader that contains the message header.
 

Properties

Bundle MessageBundle [get, protected set]
 Bundle that contains the message.
 
virtual Bundle MessageBundleRecord [get]
 The record bundle that should go into the message bundle for this message More...
 
DateTimeOffset? MessageTimestamp [get, set]
 Message timestamp More...
 
string MessageId [get, set]
 Message Id More...
 
string MessageType [get, set]
 Message Type More...
 
string MessageSource [get, set]
 Message Source More...
 
string MessageDestination [get, set]
 Message Destination More...
 
List< string > MessageDestinations [get, set]
 Message Destinations More...
 
uint? CertNo [get, set]
 Jurisdiction-assigned death certificate number
 
string StateAuxiliaryId [get, set]
 Jurisdiction-assigned auxiliary identifier
 
uint? DeathYear [get, set]
 The year in which the death occurred
 
string JurisdictionId [get, set]
 Two character identifier of the jurisdiction in which the death occurred
 
string NCHSIdentifier [get]
 NCHS identifier. Format is 4-digit year, two character jurisdiction id, six character/digit certificate id.
 

Detailed Description

Class BaseMessage is the base class of all messages.

Constructor & Destructor Documentation

◆ BaseMessage()

VRDR.BaseMessage.BaseMessage ( Bundle  messageBundle,
bool  ignoreMissingEntries = false,
bool  ignoreBundleType = false 
)
inlineprotected

Construct a BaseMessage from a FHIR Bundle. This constructor will also validate that the Bundle represents a FHIR message of the correct type.

Parameters
messageBundlea FHIR Bundle that will be used to initialize the BaseMessage
ignoreMissingEntriesif true, then missing bundle entries will not result in an exception
ignoreBundleTypeif true, then an incorrect bundle type will not result in an exception

Member Function Documentation

◆ ExtractBusinessIdentifiers()

void VRDR.BaseMessage.ExtractBusinessIdentifiers ( DeathRecord  from)
inlineprotected

Extract the business identifiers for the message from the supplied death record.

Parameters
fromthe death record to extract the identifiers from

◆ findEntry< T >()

T VRDR.BaseMessage.findEntry< T > ( bool  ignoreMissingEntries = false)
inlineprotected

Find the first Entry within the message Bundle that contains a Resource of the specified type and return that resource.

Parameters
ignoreMissingEntriesif true, then missing entries will not result in an exception
Template Parameters
Tthe class of the FHIR resource to return, must match with specified type:
Returns
The first matching Bundle entry
Type Constraints
T :Resource 

◆ GetDeathRecordFromMessage()

static DeathRecord VRDR.BaseMessage.GetDeathRecordFromMessage ( BaseMessage  message)
inlinestatic

Convert message to message type and extract the death record

Parameters
messagebase message
Returns
The death record inside the base message

◆ operator Bundle()

static VRDR.BaseMessage.operator Bundle ( BaseMessage  message)
explicitstatic

Allow explicit casting of a message into a bundle

Parameters
messagethe death record to extract the bundle from

◆ Parse() [1/3]

static BaseMessage VRDR.BaseMessage.Parse ( Bundle  bundle)
inlinestatic

Construct the appropriate subclass of BaseMessage based on a FHIR Bundle. Clients can use the typeof operator to determine the type of message object returned.

Parameters
bundleA FHIR Bundle
Returns
The message object of the appropriate message type

◆ Parse() [2/3]

static BaseMessage VRDR.BaseMessage.Parse ( StreamReader  source,
bool  permissive = false 
)
inlinestatic

Parse an XML or JSON serialization of a FHIR Bundle and construct the appropriate subclass of BaseMessage. Clients can use the typeof operator to determine the type of message object returned.

Parameters
sourcethe XML or JSON serialization of a FHIR Bundle
permissiveif the parser should be permissive when parsing the given string
Returns
The deserialized message object

◆ Parse() [3/3]

static BaseMessage VRDR.BaseMessage.Parse ( string  source,
bool  permissive = false 
)
inlinestatic

Parse an XML or JSON serialization of a FHIR Bundle and construct the appropriate subclass of BaseMessage. Clients can use the typeof operator to determine the type of message object returned.

Parameters
sourcethe XML or JSON serialization of a FHIR Bundle
permissiveif the parser should be permissive when parsing the given string
Returns
The deserialized message object

◆ Parse< T >() [1/3]

static T VRDR.BaseMessage.Parse< T > ( Bundle  bundle)
inlinestatic

Construct the appropriate subclass of BaseMessage based on a FHIR Bundle. The new object is checked to ensure it the same or a subtype of the type parameter.

Template Parameters
Tthe expected message type
Parameters
bundleA FHIR Bundle
Returns
The message object of the appropriate message type
Exceptions
MessageParseExceptionThrown when source does not represent the same or a subtype of the type parameter.
Type Constraints
T :BaseMessage 

◆ Parse< T >() [2/3]

static T VRDR.BaseMessage.Parse< T > ( StreamReader  source,
bool  permissive = false 
)
inlinestatic

Parse an XML or JSON serialization of a FHIR Bundle and construct the appropriate subclass of BaseMessage. The new object is checked to ensure it the same or a subtype of the type parameter.

Template Parameters
Tthe expected message type
Parameters
sourcethe XML or JSON serialization of a FHIR Bundle
permissiveif the parser should be permissive when parsing the given string
Returns
The deserialized message object
Exceptions
MessageParseExceptionThrown when source does not represent the same or a subtype of the type parameter.
Type Constraints
T :BaseMessage 

◆ Parse< T >() [3/3]

static T VRDR.BaseMessage.Parse< T > ( string  source,
bool  permissive = false 
)
inlinestatic

Parse an XML or JSON serialization of a FHIR Bundle and construct the appropriate subclass of BaseMessage. The new object is checked to ensure it the same or a subtype of the type parameter.

Template Parameters
Tthe expected message type
Parameters
sourcethe XML or JSON serialization of a FHIR Bundle
permissiveif the parser should be permissive when parsing the given string
Returns
the deserialized message object
Exceptions
MessageParseExceptionthrown when source does not represent the same or a subtype of the type parameter.
Type Constraints
T :BaseMessage 

◆ ParseGenericBundle()

static Bundle VRDR.BaseMessage.ParseGenericBundle ( string  source,
bool  permissive = false 
)
inlinestatic

Parse an XML or JSON serialization of a FHIR Bundle.

Parameters
sourcethe XML or JSON serialization of a FHIR Bundle
permissiveif the parser should be permissive when parsing the given string
Returns
The deserialized bundle object

◆ ParseGenericMessage()

static BaseMessage VRDR.BaseMessage.ParseGenericMessage ( string  source,
bool  permissive = false 
)
inlinestatic

Parse an XML or JSON serialization of a FHIR Bundle and construct a generic BaseMessage.

Parameters
sourcethe XML or JSON serialization of a FHIR Bundle
permissiveif the parser should be permissive when parsing the given string
Returns
The deserialized base message object

◆ ToJSON()

string VRDR.BaseMessage.ToJSON ( bool  prettyPrint = false)
inline

Helper method to return a JSON string representation of this DeathRecordSubmissionMessage.

Parameters
prettyPrintcontrols whether the returned string is formatted for human readability (true) or compact (false)
Returns
a string representation of this DeathRecordSubmissionMessage in JSON format

◆ ToJson()

string VRDR.BaseMessage.ToJson ( bool  prettyPrint = false)
inline

Helper method to return a JSON string representation of this DeathRecordSubmissionMessage.

Parameters
prettyPrintcontrols whether the returned string is formatted for human readability (true) or compact (false)
Returns
a string representation of this DeathRecordSubmissionMessage in JSON format

◆ ToXML()

string VRDR.BaseMessage.ToXML ( bool  prettyPrint = false)
inline

Helper method to return a XML string representation of this DeathRecordSubmissionMessage.

Parameters
prettyPrintcontrols whether the returned string is formatted for human readability (true) or compact (false)
Returns
a string representation of this DeathRecordSubmissionMessage in XML format

◆ ToXml()

string VRDR.BaseMessage.ToXml ( bool  prettyPrint = false)
inline

Helper method to return a XML string representation of this DeathRecordSubmissionMessage.

Parameters
prettyPrintcontrols whether the returned string is formatted for human readability (true) or compact (false)
Returns
a string representation of this DeathRecordSubmissionMessage in XML format

Property Documentation

◆ MessageBundleRecord

virtual Bundle VRDR.BaseMessage.MessageBundleRecord
getprotected

The record bundle that should go into the message bundle for this message

the MessageBundleRecord

◆ MessageDestination

string VRDR.BaseMessage.MessageDestination
getset

Message Destination

the message destinations, in csv format to support multiple endpoints. Acts as a wrapper for MessageDestinations while still maintaining backwards compatibility.

◆ MessageDestinations

List<string> VRDR.BaseMessage.MessageDestinations
getset

Message Destinations

the message destinations in list-based format.

◆ MessageId

string VRDR.BaseMessage.MessageId
getset

Message Id

the message id.

◆ MessageSource

string VRDR.BaseMessage.MessageSource
getset

Message Source

the message source.

◆ MessageTimestamp

DateTimeOffset? VRDR.BaseMessage.MessageTimestamp
getset

Message timestamp

the message timestamp.

◆ MessageType

string VRDR.BaseMessage.MessageType
getset

Message Type

the message type.


The documentation for this class was generated from the following file: