text: import { setPropertiesFromJSON } from '../../json-helper';
  
  import ObservationComponent from '../finding/ObservationComponent';
  
  /**
   * Generated class for shr.environment.ExposureRoute.
   * @extends ObservationComponent
   */
  class ExposureRoute extends ObservationComponent {
  
    /**
     * Get the value (aliases codeableConcept).
     * @returns {CodeableConcept} The shr.core.CodeableConcept
     */
    get value() {
      return this._codeableConcept;
    }
  
    /**
     * Set the value (aliases codeableConcept).
     * This field/value is required.
     * @param {CodeableConcept} value - The shr.core.CodeableConcept
     */
    set value(value) {
      this._codeableConcept = value;
    }
  
    /**
     * Set the value (aliases codeableConcept) and return 'this' for chaining.
     * This field/value is required.
     * @param {CodeableConcept} value - The shr.core.CodeableConcept
     * @returns {ExposureRoute} this.
     */
    withValue(value) {
      this.value = value; return this;
    }
  
    /**
     * Get the CodeableConcept.
     * @returns {CodeableConcept} The shr.core.CodeableConcept
     */
    get codeableConcept() {
      return this._codeableConcept;
    }
  
    /**
     * Set the CodeableConcept.
     * This field/value is required.
     * @param {CodeableConcept} codeableConcept - The shr.core.CodeableConcept
     */
    set codeableConcept(codeableConcept) {
      this._codeableConcept = codeableConcept;
    }
  
    /**
     * Set the CodeableConcept and return 'this' for chaining.
     * This field/value is required.
     * @param {CodeableConcept} codeableConcept - The shr.core.CodeableConcept
     * @returns {ExposureRoute} this.
     */
    withCodeableConcept(codeableConcept) {
      this.codeableConcept = codeableConcept; return this;
    }
  
    /**
     * Deserializes JSON data to an instance of the ExposureRoute class.
     * The JSON must be valid against the ExposureRoute JSON schema, although this is not validated by the function.
     * @param {object} json - the JSON data to deserialize
     * @returns {ExposureRoute} An instance of ExposureRoute populated with the JSON data
     */
    static fromJSON(json={}) {
      const inst = new ExposureRoute();
      setPropertiesFromJSON(inst, json);
      return inst;
    }
    /**
     * Serializes an instance of the ExposureRoute class to a JSON object.
     * The JSON is expected to be valid against the ExposureRoute JSON schema, but no validation checks are performed.
     * @returns {object} a JSON object populated with the data from the element
     */
    toJSON() {
      const inst = { 'EntryType': { 'Value' : 'http://standardhealthrecord.org/spec/shr/environment/ExposureRoute' } };
      if (this.value != null) {
        inst['Value'] = typeof this.value.toJSON === 'function' ? this.value.toJSON() : this.value;
      }
      if (this.valueAbsentReason != null) {
        inst['ValueAbsentReason'] = typeof this.valueAbsentReason.toJSON === 'function' ? this.valueAbsentReason.toJSON() : this.valueAbsentReason;
      }
      if (this.observationCode != null) {
        inst['ObservationCode'] = typeof this.observationCode.toJSON === 'function' ? this.observationCode.toJSON() : this.observationCode;
      }
      if (this.interpretation != null) {
        inst['Interpretation'] = typeof this.interpretation.toJSON === 'function' ? this.interpretation.toJSON() : this.interpretation;
      }
      if (this.referenceRange != null) {
        inst['ReferenceRange'] = this.referenceRange.map(f => f.toJSON());
      }
      return inst;
    }
  }
  export default ExposureRoute;
  