ObservationComponent constructor

ObservationComponent({
  1. CodeableConcept? code,
  2. Quantity? valueQuantity,
  3. CodeableConcept? valueCodeableConcept,
  4. String? valueString,
  5. bool? valueBoolean,
  6. int? valueInteger,
  7. Range? valueRange,
  8. Ratio? valueRatio,
  9. SampledData? valueSampledData,
  10. Time? valueTime,
  11. DateTime? valueDateTime,
  12. Period? valuePeriod,
  13. CodeableConcept? dataAbsentReason,
  14. FixedList<CodeableConcept>? interpretation,
  15. FixedList<ObservationReferenceRange>? referenceRange,
})

Constructs a new ObservationComponent with various optional measurement values and attributes.

Implementation

ObservationComponent({
  CodeableConcept? code,
  Quantity? valueQuantity,
  CodeableConcept? valueCodeableConcept,
  String? valueString,
  bool? valueBoolean,
  int? valueInteger,
  Range? valueRange,
  Ratio? valueRatio,
  SampledData? valueSampledData,
  Time? valueTime,
  DateTime? valueDateTime,
  Period? valuePeriod,
  CodeableConcept? dataAbsentReason,
  FixedList<CodeableConcept>? interpretation,
  FixedList<ObservationReferenceRange>? referenceRange,
}) : this.fromJson(
        JsonObject({
          if (code != null) 'code': code.json,
          if (valueQuantity != null) 'valueQuantity': valueQuantity.json,
          if (valueCodeableConcept != null)
            'valueCodeableConcept': valueCodeableConcept.json,
          if (valueString != null) 'valueString': JsonString(valueString),
          if (valueBoolean != null) 'valueBoolean': JsonBoolean(valueBoolean),
          if (valueInteger != null) 'valueInteger': JsonNumber(valueInteger),
          if (valueRange != null) 'valueRange': valueRange.json,
          if (valueRatio != null) 'valueRatio': valueRatio.json,
          if (valueSampledData != null)
            'valueSampledData': valueSampledData.json,
          if (valueTime != null)
            'valueTime': JsonString(valueTime.toString()),
          if (valueDateTime != null)
            'valueDateTime': JsonString(valueDateTime.toIso8601String()),
          if (valuePeriod != null) 'valuePeriod': valuePeriod.json,
          if (dataAbsentReason != null)
            'dataAbsentReason': dataAbsentReason.json,
          if (interpretation != null)
            'interpretation':
                JsonArray(interpretation.map((e) => e.json).toList()),
          if (referenceRange != null)
            'referenceRange':
                JsonArray(referenceRange.map((e) => e.json).toList()),
        }),
      );