Class PatientTreatment
Provides custom JSON serialization and deserialization logic for PatientTreatment instances by inheriting from Newtonsoft.Json.JsonConverter.
public class PatientTreatment : JsonConverter
- Inheritance
-
JsonConverterPatientTreatment
- Inherited Members
-
JsonConverter.CanReadJsonConverter.CanWrite
- Extension Methods
Remarks
This converter overrides the default JSON conversion behavior to control how PatientTreatment objects are written to and read from JSON.
Fields
BoloPom
public bool BoloPom
Field Value
SingleDose
public bool SingleDose
Field Value
Properties
EndTime
public DateTime? EndTime { get; set; }
Property Value
FillerOrder
public Entity? FillerOrder { get; set; }
Property Value
Id
public ObjectId Id { get; set; }
Property Value
- ObjectId
MessageTime
public DateTime MessageTime { get; set; }
Property Value
Notes
public List<Note> Notes { get; set; }
Property Value
OrderControl
public OrderControlType OrderControl { get; set; }
Property Value
OrderStatus
public string OrderStatus { get; set; }
Property Value
OrderTime
public DateTime? OrderTime { get; set; }
Property Value
PatientId
public ObjectId PatientId { get; set; }
Property Value
- ObjectId
PlacerOrder
public Entity? PlacerOrder { get; set; }
Property Value
RequestedDosageForm
public Code? RequestedDosageForm { get; set; }
Property Value
RequestedGiveAmountMaximum
public double? RequestedGiveAmountMaximum { get; set; }
Property Value
RequestedGiveAmountMinimum
public double? RequestedGiveAmountMinimum { get; set; }
Property Value
RequestedGiveCodes
public List<Code> RequestedGiveCodes { get; set; }
Property Value
RequestedGiveCodesStatus
public List<CodeStatus> RequestedGiveCodesStatus { get; set; }
Property Value
RequestedGiveTreatment
public string RequestedGiveTreatment { get; set; }
Property Value
RequestedGiveUnits
public Code? RequestedGiveUnits { get; set; }
Property Value
Routes
public List<TreatmentRoute> Routes { get; set; }
Property Value
StartTime
public DateTime? StartTime { get; set; }
Property Value
SystemId
public string? SystemId { get; set; }
Property Value
Methods
CanConvert(Type)
Determines whether the converter can convert the specified type.
public override bool CanConvert(Type objectType)
Parameters
objectTypeTypeThe type to check for conversion support.
Returns
Exceptions
- NotImplementedException
Always thrown because the method is not yet implemented.
ReadJson(JsonReader, Type, object?, JsonSerializer)
Reads the JSON representation of the specified type. This conversion is not currently implemented and will always raise an exception.
public override object ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
Parameters
readerJsonReaderThe Newtonsoft.Json.JsonReader used to read the incoming JSON tokens.
objectTypeTypeThe target type of the object being deserialized.
existingValueobjectThe existing value of the object that is being populated, or null if none exists.
serializerJsonSerializerThe Newtonsoft.Json.JsonSerializer invoking this converter.
Returns
- object
An object of the specified type deserialized from the JSON.
Exceptions
- NotImplementedException
Always thrown because the method has not been implemented.
ToString()
Returns a string representation of the PatientTreatment instance, including its core identifiers, order details, timing fields, requested give codes, notes, and routes. Non-null or non-empty properties are appended to the output, and in case of an exception during formatting, an error message containing the exception detail is returned instead.
public override string ToString()
Returns
- string
A formatted string summarizing the PatientTreatment fields, or an error message if formatting fails.
WriteJson(JsonWriter, object?, JsonSerializer)
Serializes the specified value to JSON, converting the OrderControl property to its string representation via Newtonsoft.Json.Converters.StringEnumConverter. If the value is null, nothing is written to the JSON output.
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
Parameters
writerJsonWriterThe Newtonsoft.Json.JsonWriter to which the JSON representation of the value will be written.
valueobjectThe object to serialize. If null, the method performs no action.
serializerJsonSerializerThe Newtonsoft.Json.JsonSerializer used to perform the serialization of nested objects.