How to use the io-ts.recursion function in io-ts

To help you get started, we’ve selected a few io-ts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tangdrew / fhir-ts / packages / fhir-types / src / R4 / CapabilityStatement.ts View on Github external
_name?: Element;
  /** The defined operation/query */
  definition: primitives.R4.canonical;
  /** Extension of definition element */
  _definition?: Element;
  /** Specific details about operation behavior */
  documentation?: primitives.R4.markdown;
  /** Extension of documentation element */
  _documentation?: Element;
}
/**
 * Definition of a resource operation
 */
export const CapabilityStatementRestResourceOperation: t.Type<
  CapabilityStatementRestResourceOperation
> = t.recursion(
  "CapabilityStatementRestResourceOperation",
  () =>
    t.intersection([
      t.type({
        /** Name by which the operation/query is invoked */
        name: primitives.R4.string,
        /** The defined operation/query */
        definition: primitives.R4.canonical
      }),
      t.partial({
        /** Unique id for inter-element referencing */
        id: primitives.R4.string,
        /** Extension of id element */
        _id: Element,
        /** Additional content defined by implementations */
        extension: t.array(Extension),
github tangdrew / fhir-ts / packages / fhir-types / src / R4 / CoverageEligibilityRequest.ts View on Github external
focal?: boolean;
  /** Extension of focal element */
  _focal?: Element;
  /** Insurance information */
  coverage: Reference;
  /** Additional provider contract number */
  businessArrangement?: string;
  /** Extension of businessArrangement element */
  _businessArrangement?: Element;
}
/**
 * Patient insurance information
 */
export const CoverageEligibilityRequestInsurance: t.Type<
  CoverageEligibilityRequestInsurance
> = t.recursion(
  "CoverageEligibilityRequestInsurance",
  () =>
    t.intersection([
      t.type({
        /** Insurance information */
        coverage: Reference
      }),
      t.partial({
        /** Unique id for inter-element referencing */
        id: primitives.R4.string,
        /** Extension of id element */
        _id: Element,
        /** Additional content defined by implementations */
        extension: t.array(Extension),
        /** Extensions that cannot be ignored even if unrecognized */
        modifierExtension: t.array(Extension),
github tangdrew / fhir-ts / packages / fhir-types / src / R4 / Organization.ts View on Github external
extension?: Extension[];
  /** Extensions that cannot be ignored even if unrecognized */
  modifierExtension?: Extension[];
  /** The type of contact */
  purpose?: CodeableConcept;
  /** A name associated with the contact */
  name?: HumanName;
  /** Contact details (telephone, email, etc.)  for a contact */
  telecom?: ContactPoint[];
  /** Visiting or postal addresses for the contact */
  address?: Address;
}
/**
 * Contact for the organization for a certain purpose
 */
export const OrganizationContact: t.Type = t.recursion<
  OrganizationContact
>("OrganizationContact", () =>
  t.intersection([
    t.type({}),
    t.partial({
      /** Unique id for inter-element referencing */
      id: primitives.R4.string,
      /** Extension of id element */
      _id: Element,
      /** Additional content defined by implementations */
      extension: t.array(Extension),
      /** Extensions that cannot be ignored even if unrecognized */
      modifierExtension: t.array(Extension),
      /** The type of contact */
      purpose: CodeableConcept,
      /** A name associated with the contact */
github tangdrew / fhir-ts / packages / fhir-types / src / R4 / BiologicallyDerivedProduct.ts View on Github external
temperature?: primitives.R4.decimal;
  /** Extension of temperature element */
  _temperature?: Element;
  /** farenheit | celsius | kelvin */
  scale?: primitives.R4.code;
  /** Extension of scale element */
  _scale?: Element;
  /** Storage timeperiod */
  duration?: Period;
}
/**
 * Product storage
 */
export const BiologicallyDerivedProductStorage: t.Type<
  BiologicallyDerivedProductStorage
> = t.recursion(
  "BiologicallyDerivedProductStorage",
  () =>
    t.intersection([
      t.type({}),
      t.partial({
        /** Unique id for inter-element referencing */
        id: primitives.R4.string,
        /** Extension of id element */
        _id: Element,
        /** Additional content defined by implementations */
        extension: t.array(Extension),
        /** Extensions that cannot be ignored even if unrecognized */
        modifierExtension: t.array(Extension),
        /** Description of storage */
        description: primitives.R4.string,
        /** Extension of description element */
github tangdrew / fhir-ts / packages / fhir-types / src / R4 / ImmunizationRecommendation.ts View on Github external
_seriesdosesPositiveInt?: Element;
  /** Recommended number of doses for immunity */
  seriesdosesString?: string;
  /** Extension of seriesdosesString element */
  _seriesdosesString?: Element;
  /** Past immunizations supporting recommendation */
  supportingImmunization?: Reference[];
  /** Patient observations supporting recommendation */
  supportingPatientInformation?: Reference[];
}
/**
 * Vaccine administration recommendations
 */
export const ImmunizationRecommendationRecommendation: t.Type<
  ImmunizationRecommendationRecommendation
> = t.recursion(
  "ImmunizationRecommendationRecommendation",
  () =>
    t.intersection([
      t.type({
        /** Vaccine recommendation status */
        forecastStatus: CodeableConcept
      }),
      t.partial({
        /** Unique id for inter-element referencing */
        id: primitives.R4.string,
        /** Extension of id element */
        _id: Element,
        /** Additional content defined by implementations */
        extension: t.array(Extension),
        /** Extensions that cannot be ignored even if unrecognized */
        modifierExtension: t.array(Extension),
github tangdrew / fhir-ts / packages / fhir-types / src / R4 / MeasureReport.ts View on Github external
_id?: Element;
  /** Additional content defined by implementations */
  extension?: Extension[];
  /** Extensions that cannot be ignored even if unrecognized */
  modifierExtension?: Extension[];
  /** What stratifier component of the group */
  code: CodeableConcept;
  /** The stratum component value, e.g. male */
  value: CodeableConcept;
}
/**
 * Stratifier component values
 */
export const MeasureReportGroupStratifierStratumComponent: t.Type<
  MeasureReportGroupStratifierStratumComponent
> = t.recursion(
  "MeasureReportGroupStratifierStratumComponent",
  () =>
    t.intersection([
      t.type({
        /** What stratifier component of the group */
        code: CodeableConcept,
        /** The stratum component value, e.g. male */
        value: CodeableConcept
      }),
      t.partial({
        /** Unique id for inter-element referencing */
        id: primitives.R4.string,
        /** Extension of id element */
        _id: Element,
        /** Additional content defined by implementations */
        extension: t.array(Extension),
github tangdrew / fhir-ts / packages / fhir-types / src / R4 / StructureMap.ts View on Github external
_type?: Element;
  /** source | target */
  mode: primitives.R4.code;
  /** Extension of mode element */
  _mode?: Element;
  /** Documentation for this instance of data */
  documentation?: string;
  /** Extension of documentation element */
  _documentation?: Element;
}
/**
 * Named instance provided when invoking the map
 */
export const StructureMapGroupInput: t.Type<
  StructureMapGroupInput
> = t.recursion("StructureMapGroupInput", () =>
  t.intersection([
    t.type({
      /** Name for this instance of data */
      name: primitives.R4.id,
      /** source | target */
      mode: primitives.R4.code
    }),
    t.partial({
      /** Unique id for inter-element referencing */
      id: primitives.R4.string,
      /** Extension of id element */
      _id: Element,
      /** Additional content defined by implementations */
      extension: t.array(Extension),
      /** Extensions that cannot be ignored even if unrecognized */
      modifierExtension: t.array(Extension),
github tangdrew / fhir-ts / packages / fhir-types / src / R4 / EffectEvidenceSynthesis.ts View on Github external
_level?: Element;
  /** Lower bound */
  from?: primitives.R4.decimal;
  /** Extension of from element */
  _from?: Element;
  /** Upper bound */
  to?: primitives.R4.decimal;
  /** Extension of to element */
  _to?: Element;
}
/**
 * How precise the estimate is
 */
export const EffectEvidenceSynthesisEffectEstimatePrecisionEstimate: t.Type<
  EffectEvidenceSynthesisEffectEstimatePrecisionEstimate
> = t.recursion(
  "EffectEvidenceSynthesisEffectEstimatePrecisionEstimate",
  () =>
    t.intersection([
      t.type({}),
      t.partial({
        /** Unique id for inter-element referencing */
        id: primitives.R4.string,
        /** Extension of id element */
        _id: Element,
        /** Additional content defined by implementations */
        extension: t.array(Extension),
        /** Extensions that cannot be ignored even if unrecognized */
        modifierExtension: t.array(Extension),
        /** Type of precision estimate */
        type: CodeableConcept,
        /** Level of confidence interval */
github tangdrew / fhir-ts / packages / fhir-types / src / R4 / RiskAssessment.ts View on Github external
_relativeRisk?: Element;
  /** Timeframe or age range */
  whenPeriod?: Period;
  /** Timeframe or age range */
  whenRange?: Range;
  /** Explanation of prediction */
  rationale?: string;
  /** Extension of rationale element */
  _rationale?: Element;
}
/**
 * Outcome predicted
 */
export const RiskAssessmentPrediction: t.Type<
  RiskAssessmentPrediction
> = t.recursion("RiskAssessmentPrediction", () =>
  t.intersection([
    t.type({}),
    t.partial({
      /** Unique id for inter-element referencing */
      id: primitives.R4.string,
      /** Extension of id element */
      _id: Element,
      /** Additional content defined by implementations */
      extension: t.array(Extension),
      /** Extensions that cannot be ignored even if unrecognized */
      modifierExtension: t.array(Extension),
      /** Possible outcome for the subject */
      outcome: CodeableConcept,
      /** Likelihood of specified outcome */
      probabilityDecimal: primitives.R4.decimal,
      /** Extension of probabilityDecimal element */
github tangdrew / fhir-ts / packages / fhir-types / src / R4 / Claim.ts View on Github external
id?: string;
  /** Extension of id element */
  _id?: Element;
  /** Additional content defined by implementations */
  extension?: Extension[];
  /** Extensions that cannot be ignored even if unrecognized */
  modifierExtension?: Extension[];
  /** Category of recipient */
  type: CodeableConcept;
  /** Recipient reference */
  party?: Reference;
}
/**
 * Recipient of benefits payable
 */
export const ClaimPayee: t.Type = t.recursion(
  "ClaimPayee",
  () =>
    t.intersection([
      t.type({
        /** Category of recipient */
        type: CodeableConcept
      }),
      t.partial({
        /** Unique id for inter-element referencing */
        id: primitives.R4.string,
        /** Extension of id element */
        _id: Element,
        /** Additional content defined by implementations */
        extension: t.array(Extension),
        /** Extensions that cannot be ignored even if unrecognized */
        modifierExtension: t.array(Extension),