public Dosage setAsNeeded(Type value) throws FHIRFormatError { 
      if (value != null && !(value instanceof BooleanType || value instanceof CodeableConcept))
        throw new FHIRFormatError("Not the right type for Dosage.asNeeded[x]: "+value.fhirType());
      this.asNeeded = value;
      return this;
    }
public Dosage setAsNeeded ( Type value ) throws FHIRFormatError { if ( value != null && ! ( value instanceof BooleanType || value instanceof CodeableConcept ) ) throw new FHIRFormatError ( "Not the right type for Dosage.asNeeded[x]: " + value . fhirType ( ) ) ; this . asNeeded = value ; return this ; }
@param value {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).)