The consistent JSON data structure of Nexus Transmit messages allows for easy filtering to isolate just events that should be saved back into the Case Management System. All messages have the same structure to the Activity.Type element which is the most common for filtering.
Sample code in C# to filter out the received messages based on Activity.Type
//Received message can be deserialized in one common model object
var message = JsonConvert.DeserializeObject(receivedMessage);
//Based on Activity.Type details can be filtered and mapped to respective type model
switch (message.Activity.Type)
{
case "Note":
var noteDetailsModel= (NoteDetailModel)message.Details;
return noteDetailsModel;
case "Office Visit":
var officeVisitDetailsModel = (OfficeVisitDetailModel)message.Details;
return officeVisitDetailsModel;
case "Drug Test":
var drugTestDetailsModel = (DrugTestDetailModel)message.Details;
return drugTestDetailsModel;
default: break; }