Class PatientPumpObservationConverter
- Namespace
- adas_core.Infrastructure.Utils
- Assembly
- adas-core.Infrastructure.dll
Provides JSON conversion for PumpObservation instances and supports BSON serialization through the MongoDB.Bson.Serialization.IBsonSerializer interface.
public class PatientPumpObservationConverter : JsonConverter<PumpObservation>, IBsonSerializer
- Inheritance
-
JsonConverterJsonConverter<PumpObservation>PatientPumpObservationConverter
- Implements
-
IBsonSerializer
- Inherited Members
-
JsonConverter.CanReadJsonConverter.CanWrite
- Extension Methods
Properties
ValueType
Gets the type of the value.
public Type ValueType { get; }
Property Value
- Type
The type of the value.
Methods
Deserialize(BsonDeserializationContext, BsonDeserializationArgs)
Deserializes a BSON value into a .NET object using the provided deserialization context and arguments.
public object Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
Parameters
contextBsonDeserializationContextThe BSON deserialization context that provides access to the reader and configuration.
argsBsonDeserializationArgsThe deserialization arguments containing additional settings for the operation.
Returns
- object
The deserialized object.
Exceptions
- NotImplementedException
Thrown when the method is invoked, as the deserialization logic has not been implemented.
ReadJson(JsonReader, Type, PumpObservation?, bool, JsonSerializer)
Deserializes a JSON representation into a PumpObservation instance. This implementation is not yet provided and always throws an exception.
public override PumpObservation ReadJson(JsonReader reader, Type objectType, PumpObservation? existingValue, bool hasExistingValue, JsonSerializer serializer)
Parameters
readerJsonReaderThe Newtonsoft.Json.JsonReader to read JSON from.
objectTypeTypeThe type of the object to deserialize.
existingValuePumpObservationThe existing value of the object being read, or
nullif there is no existing value.hasExistingValueboolA value indicating whether
existingValuehas a value.serializerJsonSerializerThe Newtonsoft.Json.JsonSerializer used for deserialization.
Returns
- PumpObservation
A PumpObservation instance reconstructed from the JSON data.
Exceptions
- NotImplementedException
Thrown because the method has not been implemented yet.
Serialize(BsonSerializationContext, BsonSerializationArgs, object)
Serializes the specified value into BSON format using the provided serialization context and arguments. This method is not yet implemented and currently throws an exception when invoked.
public void Serialize(BsonSerializationContext context, BsonSerializationArgs args, object value)
Parameters
contextBsonSerializationContextThe BSON serialization context that provides the writer and configuration for the operation.
argsBsonSerializationArgsThe BSON serialization arguments that influence the serialization behavior.
valueobjectThe object to be serialized into BSON.
Exceptions
- NotImplementedException
Thrown because the method has not been implemented.
WriteJson(JsonWriter, object?, JsonSerializer)
Serializes the specified value to JSON, applying string enum conversion to the Event, Status, PumpMode, InfusingStatus, and AlarmMode properties. No output is written when the value is null.
public void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
Parameters
writerJsonWriterThe JSON writer to which the serialized object is written.
valueobjectThe object to serialize; if null, the method does nothing.
serializerJsonSerializerThe JSON serializer used as context for the conversion.
WriteJson(JsonWriter, PumpObservation?, JsonSerializer)
Serializes a PumpObservation instance to JSON. This override is not yet implemented and will always throw.
public override void WriteJson(JsonWriter writer, PumpObservation? value, JsonSerializer serializer)
Parameters
writerJsonWriterThe JSON writer used to emit the serialized output.
valuePumpObservationThe PumpObservation to serialize, or null if no value is available.
serializerJsonSerializerThe Newtonsoft.Json.JsonSerializer providing serialization context and options.
Exceptions
- NotImplementedException
Always thrown because the method has not been implemented.