# Class PatientTreatment

Namespace
  adas_core.Domain.Models

Assembly
  adas-core.Domain.dll

Provides custom JSON serialization and deserialization logic for PatientTreatment instances by inheriting from Newtonsoft.Json.JsonConverter.

    public class PatientTreatment : JsonConverter

Inheritance
  object
  JsonConverter
  PatientTreatment

Inherited Members
  JsonConverter.CanRead
  JsonConverter.CanWrite
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## 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

bool

### SingleDose

    public bool SingleDose

#### Field Value

bool

## Properties

### EndTime

    public DateTime? EndTime { get; set; }

#### Property Value

DateTime?

### FillerOrder

    public Entity? FillerOrder { get; set; }

#### Property Value

Entity

### Id

    public ObjectId Id { get; set; }

#### Property Value

ObjectId

### MessageTime

    public DateTime MessageTime { get; set; }

#### Property Value

DateTime

### Notes

    public List<Note> Notes { get; set; }

#### Property Value

List<Note>

### OrderControl

    public OrderControlType OrderControl { get; set; }

#### Property Value

OrderControlType

### OrderStatus

    public string OrderStatus { get; set; }

#### Property Value

string

### OrderTime

    public DateTime? OrderTime { get; set; }

#### Property Value

DateTime?

### PatientId

    public ObjectId PatientId { get; set; }

#### Property Value

ObjectId

### PlacerOrder

    public Entity? PlacerOrder { get; set; }

#### Property Value

Entity

### RequestedDosageForm

    public Code? RequestedDosageForm { get; set; }

#### Property Value

Code

### RequestedGiveAmountMaximum

    public double? RequestedGiveAmountMaximum { get; set; }

#### Property Value

double?

### RequestedGiveAmountMinimum

    public double? RequestedGiveAmountMinimum { get; set; }

#### Property Value

double?

### RequestedGiveCodes

    public List<Code> RequestedGiveCodes { get; set; }

#### Property Value

List<Code>

### RequestedGiveCodesStatus

    public List<CodeStatus> RequestedGiveCodesStatus { get; set; }

#### Property Value

List<CodeStatus>

### RequestedGiveTreatment

    public string RequestedGiveTreatment { get; set; }

#### Property Value

string

### RequestedGiveUnits

    public Code? RequestedGiveUnits { get; set; }

#### Property Value

Code

### Routes

    public List<TreatmentRoute> Routes { get; set; }

#### Property Value

List<TreatmentRoute>

### StartTime

    public DateTime? StartTime { get; set; }

#### Property Value

DateTime?

### SystemId

    public string? SystemId { get; set; }

#### Property Value

string

## Methods

### CanConvert(Type)

Determines whether the converter can convert the specified type.

    public override bool CanConvert(Type objectType)

#### Parameters

`objectType` Type

  The type to check for conversion support.

#### Returns

bool

  true if the converter can convert the specified type; otherwise, false.

#### 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

`reader` JsonReader

  The Newtonsoft.Json.JsonReader used to read the incoming JSON tokens.

`objectType` Type

  The target type of the object being deserialized.

`existingValue` object

  The existing value of the object that is being populated, or null if none exists.

`serializer` JsonSerializer

  The 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

`writer` JsonWriter

  The Newtonsoft.Json.JsonWriter to which the JSON representation of the value will be written.

`value` object

  The object to serialize. If null, the method performs no action.

`serializer` JsonSerializer

  The Newtonsoft.Json.JsonSerializer used to perform the serialization of nested objects.