### ----------------------------------------------------
### -- FHIR
### -- Licenses: Artistic-2.0
### -- Authors: Hugh Simpson
### -- File: lib/FHIR/DomainModel.rakumod
### ----------------------------------------------------
### -- Chunk 1 of 8
#!/usr/bin/env perl6
use v6.d;

use FHIR::Base;

unit module DomainModel;

class Extension { ... }
class Meta { ... }
class Coding { ... }
class Attachment { ... }
class Quantity { ... }
class Identifier { ... }
class ContactDetail { ... }
class ContactPoint { ... }
class ElementDefinition { ... }
class Dosage { ... }
class TestReport_Setup_Action_Assert { ... }
class TestReport_Setup_Action_Operation { ... }
class TestScript_Setup_Action_Assert { ... }
class TestScript_Setup_Action_Operation { ... }
class ExampleScenario_Instance_ContainedInstance { ... }
class ExampleScenario_Process_Step { ... }
class ExampleScenario_Process { ... }
class Observation_ReferenceRange { ... }
class QuestionnaireResponse_Item { ... }
class GraphDefinition_Link { ... }
class MedicinalProductIngredient_SpecifiedSubstance_Strength { ... }
class ValueSet_Compose_Include_Concept_Designation { ... }
class Address  { ... }
class Age  { ... }
class CodeableConcept  { ... }
class Contributor  { ... }
class Count  { ... }
class DataRequirement  { ... }
class Distance  { ... }
class Expression  { ... }
class HumanName  { ... }
class Money  { ... }
class ParameterDefinition  { ... }
class Ratio  { ... }
class Reference  { ... }
class Timing  { ... }
class TriggerDefinition  { ... }
class FHIRSignature  { ... }

role PrimitiveElement is export { }
role PrimitiveElementId does PrimitiveElement is export { has Str $.id  }
role PrimitiveElementExtension does PrimitiveElement is export { has Array[::Extension] $.extension }
role PhantomValue is export { }

class Resource is FHIR is export {
  method resourceType(--> 'Resource') {}
  has Id $.id;
  has Meta $.meta;
  has FHIRCode $.language;
  has UriStr $.implicitRules;
}

class Element is FHIR is export {
  has Str $.id;
  has Extension @.extension;
}

INIT {
    initialise-FHIR-model-base Resource, Element;
}

class UsageContext is Element is export {
  has Coding $.code is required;
  has ChoiceField $.value is required where CodeableConcept|Quantity|Range|Reference;
}

class Annotation is Element is export {
  has DateTime $.time;
  has Markdown $.text is required;
  has ChoiceField $.author where Reference|Str;
}

class Period is Element is export {
  has DateTime $.end;
  has DateTime $.start;
}

class BackboneElement is Element is export {
  has Extension @.modifierExtension;
}

class RelatedArtifact is Element is export {
  has UrlStr $.url;
  has FHIRCode $.type is required;
  has Str $.label;
  has Str $.display;
  has Markdown $.citation;
  has Attachment $.document;
  has Canonical $.resource;
}

class SampledData is Element is export {
  has Str $.data;
  has Quantity $.origin is required;
  has Real $.period is required;
  has Real $.factor;
  has Real $.lowerLimit;
  has Real $.upperLimit;
  has PositiveInt $.dimensions is required;
}
class Parameters_Parameter is FHIR is export {
  has Str $.id;
  has Str $.name is required;
  has Parameters_Parameter @.part;
  has ChoiceField $.value where Address|Age|Annotation|Attachment|Base64Binary|Bool|Canonical|FHIRCode|CodeableConcept|Coding|ContactDetail|ContactPoint|Contributor|Count|DataRequirement|Distance|Dosage|Real|Duration|Expression|Date|DateTime|HumanName|Id|Identifier|Int|Instant|Markdown|Money|OID|ParameterDefinition|Period|PositiveInt|Quantity|Range|Ratio|Reference|RelatedArtifact|SampledData|FHIRSignature|Str|Timing|TriggerDefinition|Uuid|UnsignedInt|UriStr|UrlStr|UsageContext|DateTime;
  has Resource $.resource;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class Parameters is Resource is export {
  method resourceType(--> 'Parameters') {}
  has Parameters_Parameter @.parameter;
}

class Attachment is Element is export {
  has UrlStr $.url;
  has Base64Binary $.data;
  has UnsignedInt $.size;
  has Base64Binary $.hash;
  has Str $.title;
  has FHIRCode $.language;
  has DateTime $.creation;
  has FHIRCode $.contentType;
}
class DataRequirement_Sort is FHIR is export {
  has Str $.id;
  has Str $.path is required;
  has Extension @.extension;
  has FHIRCode $.direction is required;
}

class DataRequirement_CodeFilter is FHIR is export {
  has Str $.id;
  has Str $.path;
  has Coding @.code;
  has Canonical $.valueSet;
  has Extension @.extension;
  has Str $.searchParam;
}

class DataRequirement_DateFilter is FHIR is export {
  has Str $.id;
  has Str $.path;
  has ChoiceField $.value where Duration|DateTime|Period;
  has Extension @.extension;
  has Str $.searchParam;
}

class DataRequirement is Element is export {
  has FHIRCode $.type is required;
  has PositiveInt $.limit;
  has Canonical @.profile;
  has ChoiceField $.subject where CodeableConcept|Reference;
  has Str @.mustSupport;
  has DataRequirement_Sort @.sort;
  has DataRequirement_CodeFilter @.codeFilter;
  has DataRequirement_DateFilter @.dateFilter;
}

class Range is Element is export {
  has Quantity $.low;
  has Quantity $.high;
}

class Money is Element is export {
  has Real $.value;
  has FHIRCode $.currency;
}
class Bundle_Link is FHIR is export {
  has Str $.id;
  has UriStr $.url is required;
  has Str $.relation is required;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class Bundle_Entry_Search is FHIR is export {
  has Str $.id;
  has FHIRCode $.mode;
  has Real $.score;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class Bundle_Entry_Request is FHIR is export {
  has Str $.id;
  has UriStr $.url is required;
  has FHIRCode $.method is required;
  has Str $.ifMatch;
  has Extension @.extension;
  has Str $.ifNoneMatch;
  has Str $.ifNoneExist;
  has DateTime $.ifModifiedSince;
  has Extension @.modifierExtension;
}

class Bundle_Entry_Response is FHIR is export {
  has Str $.id;
  has Str $.etag;
  has Str $.status is required;
  has Resource $.outcome;
  has UriStr $.location;
  has Extension @.extension;
  has DateTime $.lastModified;
  has Extension @.modifierExtension;
}
class Bundle_Entry is FHIR is export {
  has Str $.id;
  has Bundle_Link @.link;
  has UriStr $.fullUrl;
  has Resource $.resource;
  has Extension @.extension;
  has Extension @.modifierExtension;
  has Bundle_Entry_Search $.search;
  has Bundle_Entry_Request $.request;
  has Bundle_Entry_Response $.response;
}

class Bundle is Resource is export {
  method resourceType(--> 'Bundle') {}
  has FHIRCode $.type is required;
  has UnsignedInt $.total;
  has DateTime $.timestamp;
  has FHIRSignature $.signature;
  has Identifier $.identifier;
  has Bundle_Link @.link;
  has Bundle_Entry @.entry;
}

class Reference is Element is export {
  has UriStr $.type;
  has Str $.display;
  has Str $.reference;
  has Identifier $.identifier;
}

class Expression is Element is export {
  has Id $.name;
  has FHIRCode $.language is required;
  has UriStr $.reference;
  has Str $.expression;
  has Str $.description;
}

class Contributor is Element is export {
  has FHIRCode $.type is required;
  has Str $.name is required;
  has ContactDetail @.contact;
}

class Address is Element is export {
  has FHIRCode $.use;
  has FHIRCode $.type;
  has Str $.text;
  has Str @.line;
  has Str $.city;
  has Str $.state;
  has Period $.period;
  has Str $.country;
  has Str $.district;
  has Str $.postalCode;
}

class Narrative is Element is export {
  has XHTML $.div is required;
  has FHIRCode $.status is required;
}

class Quantity is Element is export {
  has Str $.unit;
  has FHIRCode $.code;
  has Real $.value;
  has UriStr $.system;
  has FHIRCode $.comparator;
}

class ContactDetail is Element is export {
  has Str $.name;
  has ContactPoint @.telecom;
}

class ContactPoint is Element is export {
  has FHIRCode $.use;
  has PositiveInt $.rank;
  has Str $.value;
  has FHIRCode $.system;
  has Period $.period;
}

class CodeableConcept is Element is export {
  has Str $.text;
  has Coding @.coding;
}

class Coding is Element is export {
  has FHIRCode $.code;
  has UriStr $.system;
  has Str $.version;
  has Str $.display;
  has Bool $.userSelected;
}

class ParameterDefinition is Element is export {
  has FHIRCode $.use is required;
  has Int $.min;
  has Str $.max;
  has FHIRCode $.name;
  has FHIRCode $.type is required;
  has Canonical $.profile;
  has Str $.documentation;
}

class Ratio is Element is export {
  has Quantity $.numerator;
  has Quantity $.denominator;
}

class Binary is Resource is export {
  method resourceType(--> 'Binary') {}
  has Base64Binary $.data;
  has FHIRCode $.contentType is required;
  has Reference $.securityContext;
}

class Extension is Element is export {
  has Str $.url is required;
  has ChoiceField $.value where Address|Age|Annotation|Attachment|Base64Binary|Bool|Canonical|FHIRCode|CodeableConcept|Coding|ContactDetail|ContactPoint|Contributor|Count|DataRequirement|Distance|Dosage|Real|Duration|Expression|Date|DateTime|HumanName|Id|Identifier|Int|Instant|Markdown|Money|OID|ParameterDefinition|Period|PositiveInt|Quantity|Range|Ratio|Reference|RelatedArtifact|SampledData|FHIRSignature|Str|Timing|TriggerDefinition|Uuid|UnsignedInt|UriStr|UrlStr|UsageContext|DateTime;
}

class FHIRSignature is Element is export {
  has Reference $.who is required;
  has Coding @.type is required;
  has DateTime $.when is required;
  has Base64Binary $.data;
  has FHIRCode $.sigFormat;
  has Reference $.onBehalfOf;
  has FHIRCode $.targetFormat;
}

class DomainResource is Resource is export {
  method resourceType(--> 'DomainResource') {}
  has Narrative $.text;
  has Resource @.contained;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class Identifier is Element is export {
  has FHIRCode $.use;
  has CodeableConcept $.type;
  has Str $.value;
  has UriStr $.system;
  has Period $.period;
  has Reference $.assigner;
}

class Meta is Element is export {
  has Coding @.tag;
  has UriStr $.source;
  has Canonical @.profile;
  has Coding @.security;
  has Id $.versionId;
  has DateTime $.lastUpdated;
}

class TriggerDefinition is Element is export {
  has FHIRCode $.type is required;
  has Str $.name;
  has DataRequirement @.data;
  has ChoiceField $.timing where Date|DateTime|Reference|Timing;
  has Expression $.condition;
}

class HumanName is Element is export {
  has FHIRCode $.use;
  has Str $.text;
  has Str @.given;
  has Str $.family;
  has Str @.prefix;
  has Str @.suffix;
  has Period $.period;
}

class PaymentNotice is DomainResource is export {
  method resourceType(--> 'PaymentNotice') {}
  has Reference $.payee;
  has FHIRCode $.status is required;
  has Money $.amount is required;
  has Reference $.request;
  has DateTime $.created is required;
  has Reference $.payment is required;
  has Reference $.response;
  has Reference $.provider;
  has Reference $.recipient is required;
  has Identifier @.identifier;
  has Date $.paymentDate;
  has CodeableConcept $.paymentStatus;
}
class AllergyIntolerance_Reaction is FHIR is export {
  has Str $.id;
  has Annotation @.note;
  has DateTime $.onset;
  has FHIRCode $.severity;
  has Extension @.extension;
  has CodeableConcept $.substance;
  has Str $.description;
  has CodeableConcept @.manifestation is required;
  has CodeableConcept $.exposureRoute;
  has Extension @.modifierExtension;
}

class AllergyIntolerance is DomainResource is export {
  method resourceType(--> 'AllergyIntolerance') {}
  has FHIRCode $.type;
  has CodeableConcept $.code;
  has Annotation @.note;
  has Reference $.patient is required;
  has FHIRCode @.category;
  has ChoiceField $.onset where Age|DateTime|Period|Range|Str;
  has Reference $.recorder;
  has Reference $.asserter;
  has Reference $.encounter;
  has Identifier @.identifier;
  has FHIRCode $.criticality;
  has DateTime $.recordedDate;
  has CodeableConcept $.clinicalStatus;
  has DateTime $.lastOccurrence;
  has CodeableConcept $.verificationStatus;
  has AllergyIntolerance_Reaction @.reaction;
}

class EventDefinition is DomainResource is export {
  method resourceType(--> 'EventDefinition') {}
  has UriStr $.url;
  has Str $.name;
  has DateTime $.date;
  has Str $.title;
  has Str $.usage;
  has CodeableConcept @.topic;
  has FHIRCode $.status is required;
  has ContactDetail @.author;
  has ContactDetail @.editor;
  has Str $.version;
  has ContactDetail @.contact;
  has Markdown $.purpose;
  has TriggerDefinition @.trigger is required;
  has Str $.subtitle;
  has ContactDetail @.reviewer;
  has ContactDetail @.endorser;
  has Str $.publisher;
  has Markdown $.copyright;
  has Identifier @.identifier;
  has ChoiceField $.subject where CodeableConcept|Reference;
  has UsageContext @.useContext;
  has Markdown $.description;
  has Bool $.experimental;
  has CodeableConcept @.jurisdiction;
  has Date $.approvalDate;
  has Date $.lastReviewDate;
  has Period $.effectivePeriod;
  has RelatedArtifact @.relatedArtifact;
}

class Evidence is DomainResource is export {
  method resourceType(--> 'Evidence') {}
  has UriStr $.url;
  has Str $.name;
  has DateTime $.date;
  has Annotation @.note;
  has Str $.title;
  has CodeableConcept @.topic;
  has FHIRCode $.status is required;
  has ContactDetail @.author;
  has ContactDetail @.editor;
  has Str $.version;
  has ContactDetail @.contact;
  has Reference @.outcome;
  has Str $.subtitle;
  has ContactDetail @.reviewer;
  has ContactDetail @.endorser;
  has Str $.publisher;
  has Markdown $.copyright;
  has Identifier @.identifier;
  has Str $.shortTitle;
  has UsageContext @.useContext;
  has Markdown $.description;
  has CodeableConcept @.jurisdiction;
  has Date $.approvalDate;
  has Date $.lastReviewDate;
  has Period $.effectivePeriod;
  has RelatedArtifact @.relatedArtifact;
  has Reference @.exposureVariant;
  has Reference $.exposureBackground is required;
}
class Substance_Instance is FHIR is export {
  has Str $.id;
  has DateTime $.expiry;
  has Quantity $.quantity;
  has Extension @.extension;
  has Identifier $.identifier;
  has Extension @.modifierExtension;
}

class Substance_Ingredient is FHIR is export {
  has Str $.id;
  has Ratio $.quantity;
  has Extension @.extension;
  has ChoiceField $.substance is required where CodeableConcept|Reference;
  has Extension @.modifierExtension;
}

class Substance is DomainResource is export {
  method resourceType(--> 'Substance') {}
  has CodeableConcept $.code is required;
  has FHIRCode $.status;
  has CodeableConcept @.category;
  has Identifier @.identifier;
  has Str $.description;
  has Substance_Instance @.instance;
  has Substance_Ingredient @.ingredient;
}

class ServiceRequest is DomainResource is export {
  method resourceType(--> 'ServiceRequest') {}
  has CodeableConcept $.code;
  has Annotation @.note;
  has FHIRCode $.status is required;
  has FHIRCode $.intent is required;
  has Reference @.basedOn;
  has Reference $.subject is required;
  has Reference @.replaces;
  has CodeableConcept @.category;
  has FHIRCode $.priority;
  has Reference @.specimen;
  has CodeableConcept @.bodySite;
  has Reference $.encounter;
  has Reference $.requester;
  has Reference @.performer;
  has Reference @.insurance;
  has Identifier @.identifier;
  has DateTime $.authoredOn;
  has CodeableConcept @.reasonCode;
  has Identifier $.requisition;
  has CodeableConcept @.orderDetail;
  has ChoiceField $.quantity where Quantity|Range|Ratio;
  has ChoiceField $.asNeeded where Bool|CodeableConcept;
  has Bool $.doNotPerform;
  has CodeableConcept @.locationCode;
  has ChoiceField $.occurrence where DateTime|Period|Timing;
  has CodeableConcept $.performerType;
  has Reference @.supportingInfo;
  has UriStr @.instantiatesUri;
  has Reference @.reasonReference;
  has Reference @.relevantHistory;
  has Reference @.locationReference;
  has Str $.patientInstruction;
  has Canonical @.instantiatesCanonical;
}
class AdverseEvent_SuspectEntity_Causality is FHIR is export {
  has Str $.id;
  has Reference $.author;
  has CodeableConcept $.method;
  has Extension @.extension;
  has CodeableConcept $.assessment;
  has Extension @.modifierExtension;
  has Str $.productRelatedness;
}
class AdverseEvent_SuspectEntity is FHIR is export {
  has Str $.id;
  has Reference $.instance is required;
  has Extension @.extension;
  has Extension @.modifierExtension;
  has AdverseEvent_SuspectEntity_Causality @.causality;
}

class AdverseEvent is DomainResource is export {
  method resourceType(--> 'AdverseEvent') {}
  has DateTime $.date;
  has CodeableConcept $.event;
  has Reference @.study;
  has Reference $.subject is required;
  has CodeableConcept $.outcome;
  has CodeableConcept @.category;
  has DateTime $.detected;
  has Reference $.location;
  has CodeableConcept $.severity;
  has Reference $.recorder;
  has FHIRCode $.actuality is required;
  has Reference $.encounter;
  has Identifier $.identifier;
  has CodeableConcept $.seriousness;
  has Reference @.contributor;
  has DateTime $.recordedDate;
  has Reference @.referenceDocument;
  has Reference @.resultingCondition;
  has Reference @.subjectMedicalHistory;
  has AdverseEvent_SuspectEntity @.suspectEntity;
}
class Patient_Link is FHIR is export {
  has Str $.id;
  has FHIRCode $.type is required;
  has Reference $.other is required;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class Patient_Contact is FHIR is export {
  has Str $.id;
  has HumanName $.name;
  has FHIRCode $.gender;
  has Period $.period;
  has ContactPoint @.telecom;
  has Address $.address;
  has Extension @.extension;
  has CodeableConcept @.relationship;
  has Reference $.organization;
  has Extension @.modifierExtension;
}

class Patient_Communication is FHIR is export {
  has Str $.id;
  has CodeableConcept $.language is required;
  has Extension @.extension;
  has Bool $.preferred;
  has Extension @.modifierExtension;
}

class Patient is DomainResource is export {
  method resourceType(--> 'Patient') {}
  has HumanName @.name;
  has Attachment @.photo;
  has Bool $.active;
  has FHIRCode $.gender;
  has ContactPoint @.telecom;
  has Address @.address;
  has Date $.birthDate;
  has Identifier @.identifier;
  has ChoiceField $.deceased where Bool|DateTime;
  has CodeableConcept $.maritalStatus;
  has ChoiceField $.multipleBirth where Bool|Int;
  has Reference @.generalPractitioner;
  has Reference $.managingOrganization;
  has Patient_Link @.link;
  has Patient_Contact @.contact;
  has Patient_Communication @.communication;
}
class Practitioner_Qualification is FHIR is export {
  has Str $.id;
  has CodeableConcept $.code is required;
  has Period $.period;
  has Reference $.issuer;
  has Extension @.extension;
  has Identifier @.identifier;
  has Extension @.modifierExtension;
}

class Practitioner is DomainResource is export {
  method resourceType(--> 'Practitioner') {}
  has HumanName @.name;
  has Attachment @.photo;
  has Bool $.active;
  has FHIRCode $.gender;
  has ContactPoint @.telecom;
  has Address @.address;
  has Date $.birthDate;
  has Identifier @.identifier;
  has CodeableConcept @.communication;
  has Practitioner_Qualification @.qualification;
}
class MedicinalProductInteraction_Interactant is FHIR is export {
  has Str $.id;
  has ChoiceField $.item is required where CodeableConcept|Reference;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class MedicinalProductInteraction is DomainResource is export {
  method resourceType(--> 'MedicinalProductInteraction') {}
  has CodeableConcept $.type;
  has CodeableConcept $.effect;
  has Reference @.subject;
  has CodeableConcept $.incidence;
  has CodeableConcept $.management;
  has Str $.description;
  has MedicinalProductInteraction_Interactant @.interactant;
}
class OperationOutcome_Issue is FHIR is export {
  has Str $.id;
  has FHIRCode $.code is required;
  has CodeableConcept $.details;
  has FHIRCode $.severity is required;
  has Str @.location;
  has Extension @.extension;
  has Str @.expression;
  has Str $.diagnostics;
  has Extension @.modifierExtension;
}

class OperationOutcome is DomainResource is export {
  method resourceType(--> 'OperationOutcome') {}
  has OperationOutcome_Issue @.issue is required;
}
class DetectedIssue_Evidence is FHIR is export {
  has Str $.id;
  has CodeableConcept @.code;
  has Reference @.detail;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class DetectedIssue_Mitigation is FHIR is export {
  has Str $.id;
  has DateTime $.date;
  has CodeableConcept $.action is required;
  has Reference $.author;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class DetectedIssue is DomainResource is export {
  method resourceType(--> 'DetectedIssue') {}
  has CodeableConcept $.code;
  has FHIRCode $.status is required;
  has Reference $.author;
  has Str $.detail;
  has Reference $.patient;
  has FHIRCode $.severity;
  has UriStr $.reference;
  has Identifier @.identifier;
  has Reference @.implicated;
  has ChoiceField $.identified where DateTime|Period;
  has DetectedIssue_Evidence @.evidence;
  has DetectedIssue_Mitigation @.mitigation;
}
class StructureDefinition_Mapping is FHIR is export {
  has Str $.id;
  has UriStr $.uri;
  has Str $.name;
  has Str $.comment;
  has Id $.identity is required;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class StructureDefinition_Context is FHIR is export {
  has Str $.id;
  has FHIRCode $.type is required;
  has Extension @.extension;
  has Str $.expression is required;
  has Extension @.modifierExtension;
}

class StructureDefinition_Snapshot is FHIR is export {
  has Str $.id;
  has ElementDefinition @.element is required;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class StructureDefinition_Differential is FHIR is export {
  has Str $.id;
  has ElementDefinition @.element is required;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class StructureDefinition is DomainResource is export {
  method resourceType(--> 'StructureDefinition') {}
  has UriStr $.url is required;
  has Str $.name is required;
  has DateTime $.date;
  has FHIRCode $.kind is required;
  has UriStr $.type is required;
  has Str $.title;
  has FHIRCode $.status is required;
  has Str $.version;
  has ContactDetail @.contact;
  has Markdown $.purpose;
  has Coding @.keyword;
  has Bool $.abstract is required;
  has Str $.publisher;
  has Markdown $.copyright;
  has Identifier @.identifier;
  has UsageContext @.useContext;
  has FHIRCode $.derivation;
  has Markdown $.description;
  has FHIRCode $.fhirVersion;
  has Bool $.experimental;
  has CodeableConcept @.jurisdiction;
  has Canonical $.baseDefinition;
  has Str @.contextInvariant;
  has StructureDefinition_Mapping @.mapping;
  has StructureDefinition_Context @.context;
  has StructureDefinition_Snapshot $.snapshot;
  has StructureDefinition_Differential $.differential;
}
class RiskEvidenceSynthesis_SampleSize is FHIR is export {
  has Str $.id;
  has Extension @.extension;
  has Str $.description;
  has Int $.numberOfStudies;
  has Extension @.modifierExtension;
  has Int $.numberOfParticipants;
}

class RiskEvidenceSynthesis_RiskEstimate_PrecisionEstimate is FHIR is export {
  has Str $.id;
  has Real $.to;
  has CodeableConcept $.type;
  has Real $.from;
  has Real $.level;
  has Extension @.extension;
  has Extension @.modifierExtension;
}
class RiskEvidenceSynthesis_RiskEstimate is FHIR is export {
  has Str $.id;
  has CodeableConcept $.type;
  has Real $.value;
  has Extension @.extension;
  has Str $.description;
  has CodeableConcept $.unitOfMeasure;
  has Int $.numeratorCount;
  has Int $.denominatorCount;
  has Extension @.modifierExtension;
  has RiskEvidenceSynthesis_RiskEstimate_PrecisionEstimate @.precisionEstimate;
}

class RiskEvidenceSynthesis_Certainty_CertaintySubcomponent is FHIR is export {
  has Str $.id;
  has CodeableConcept $.type;
  has Annotation @.note;
  has CodeableConcept @.rating;
  has Extension @.extension;
  has Extension @.modifierExtension;
}
class RiskEvidenceSynthesis_Certainty is FHIR is export {
  has Str $.id;
  has Annotation @.note;
  has CodeableConcept @.rating;
  has Extension @.extension;
  has Extension @.modifierExtension;
  has RiskEvidenceSynthesis_Certainty_CertaintySubcomponent @.certaintySubcomponent;
}

class RiskEvidenceSynthesis is DomainResource is export {
  method resourceType(--> 'RiskEvidenceSynthesis') {}
  has UriStr $.url;
  has Str $.name;
  has DateTime $.date;
  has Annotation @.note;
  has Str $.title;
  has CodeableConcept @.topic;
  has FHIRCode $.status is required;
  has ContactDetail @.author;
  has ContactDetail @.editor;
  has Str $.version;
  has ContactDetail @.contact;
  has Reference $.outcome is required;
  has ContactDetail @.reviewer;
  has ContactDetail @.endorser;
  has Reference $.exposure;
  has Str $.publisher;
  has Markdown $.copyright;
  has CodeableConcept $.studyType;
  has Identifier @.identifier;
  has UsageContext @.useContext;
  has Reference $.population is required;
  has Markdown $.description;
  has CodeableConcept @.jurisdiction;
  has Date $.approvalDate;
  has CodeableConcept $.synthesisType;
  has Date $.lastReviewDate;
  has Period $.effectivePeriod;
  has RelatedArtifact @.relatedArtifact;
  has RiskEvidenceSynthesis_SampleSize $.sampleSize;
  has RiskEvidenceSynthesis_RiskEstimate $.riskEstimate;
  has RiskEvidenceSynthesis_Certainty @.certainty;
}
class MedicationRequest_Substitution is FHIR is export {
  has Str $.id;
  has CodeableConcept $.reason;
  has Extension @.extension;
  has ChoiceField $.allowed is required where Bool|CodeableConcept;
  has Extension @.modifierExtension;
}

class MedicationRequest_DispenseRequest_InitialFill is FHIR is export {
  has Str $.id;
  has Quantity $.quantity;
  has Duration $.duration;
  has Extension @.extension;
  has Extension @.modifierExtension;
}
class MedicationRequest_DispenseRequest is FHIR is export {
  has Str $.id;
  has Quantity $.quantity;
  has Extension @.extension;
  has Reference $.performer;
  has Period $.validityPeriod;
  has Duration $.dispenseInterval;
  has Extension @.modifierExtension;
  has UnsignedInt $.numberOfRepeatsAllowed;
  has Duration $.expectedSupplyDuration;
  has MedicationRequest_DispenseRequest_InitialFill $.initialFill;
}

class MedicationRequest is DomainResource is export {
  method resourceType(--> 'MedicationRequest') {}
  has Annotation @.note;
  has FHIRCode $.status is required;
  has FHIRCode $.intent is required;
  has Reference $.subject is required;
  has Reference @.basedOn;
  has CodeableConcept @.category;
  has FHIRCode $.priority;
  has Reference $.recorder;
  has Reference $.encounter;
  has Reference $.requester;
  has Reference $.performer;
  has Reference @.insurance;
  has Identifier @.identifier;
  has DateTime $.authoredOn;
  has CodeableConcept @.reasonCode;
  has ChoiceField $.reported where Bool|Reference;
  has CodeableConcept $.statusReason;
  has Bool $.doNotPerform;
  has Reference @.eventHistory;
  has ChoiceField $.medication is required where CodeableConcept|Reference;
  has CodeableConcept $.performerType;
  has Reference @.detectedIssue;
  has Reference @.reasonReference;
  has UriStr @.instantiatesUri;
  has Identifier $.groupIdentifier;
  has Dosage @.dosageInstruction;
  has Reference $.priorPrescription;
  has CodeableConcept $.courseOfTherapyType;
  has Reference @.supportingInformation;
  has Canonical @.instantiatesCanonical;
  has MedicationRequest_Substitution $.substitution;
  has MedicationRequest_DispenseRequest $.dispenseRequest;
}
class StructureMap_Structure is FHIR is export {
  has Str $.id;
  has Canonical $.url is required;
  has FHIRCode $.mode is required;
  has Str $.alias;
  has Extension @.extension;
  has Str $.documentation;
  has Extension @.modifierExtension;
}

class StructureMap_Group_Input is FHIR is export {
  has Str $.id;
  has Id $.name is required;
  has Str $.type;
  has FHIRCode $.mode is required;
  has Extension @.extension;
  has Str $.documentation;
  has Extension @.modifierExtension;
}

class StructureMap_Group_Rule_Source is FHIR is export {
  has Str $.id;
  has Int $.min;
  has Str $.max;
  has Str $.type;
  has Str $.check;
  has Id $.context is required;
  has Str $.element;
  has FHIRCode $.listMode;
  has Id $.variable;
  has Extension @.extension;
  has Str $.condition;
  has Str $.logMessage;
  has ChoiceField $.defaultValue where Address|Age|Annotation|Attachment|Base64Binary|Bool|Canonical|FHIRCode|CodeableConcept|Coding|ContactDetail|ContactPoint|Contributor|Count|DataRequirement|Distance|Dosage|Real|Duration|Expression|Date|DateTime|HumanName|Id|Identifier|Int|Instant|Markdown|Money|OID|ParameterDefinition|Period|PositiveInt|Quantity|Range|Ratio|Reference|RelatedArtifact|SampledData|FHIRSignature|Str|Timing|TriggerDefinition|Uuid|UnsignedInt|UriStr|UrlStr|UsageContext|DateTime;
  has Extension @.modifierExtension;
}

class StructureMap_Group_Rule_Dependent is FHIR is export {
  has Str $.id;
  has Id $.name is required;
  has Str @.variable is required;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class StructureMap_Group_Rule_Target_Parameter is FHIR is export {
  has Str $.id;
  has ChoiceField $.value is required where Bool|Real|Id|Int|Str;
  has Extension @.extension;
  has Extension @.modifierExtension;
}
class StructureMap_Group_Rule_Target is FHIR is export {
  has Str $.id;
  has Id $.context;
  has Str $.element;
  has Id $.variable;
  has FHIRCode @.listMode;
  has Extension @.extension;
  has FHIRCode $.transform;
  has Id $.listRuleId;
  has FHIRCode $.contextType;
  has Extension @.modifierExtension;
  has StructureMap_Group_Rule_Target_Parameter @.parameter;
}
class StructureMap_Group_Rule is FHIR is export {
  has Str $.id;
  has Id $.name is required;
  has StructureMap_Group_Rule @.rule;
  has Extension @.extension;
  has Str $.documentation;
  has Extension @.modifierExtension;
  has StructureMap_Group_Rule_Source @.source is required;
  has StructureMap_Group_Rule_Dependent @.dependent;
  has StructureMap_Group_Rule_Target @.target;
}
class StructureMap_Group is FHIR is export {
  has Str $.id;
  has Id $.name is required;
  has Id $.extends;
  has FHIRCode $.typeMode is required;
  has Extension @.extension;
  has Str $.documentation;
  has Extension @.modifierExtension;
  has StructureMap_Group_Input @.input is required;
  has StructureMap_Group_Rule @.rule is required;
}

class StructureMap is DomainResource is export {
  method resourceType(--> 'StructureMap') {}
  has UriStr $.url is required;
  has Str $.name is required;
  has DateTime $.date;
  has Str $.title;
  has FHIRCode $.status is required;
  has Canonical @.import;
  has Str $.version;
  has ContactDetail @.contact;
  has Markdown $.purpose;
  has Str $.publisher;
  has Markdown $.copyright;
  has Identifier @.identifier;
  has UsageContext @.useContext;
  has Markdown $.description;
  has Bool $.experimental;
  has CodeableConcept @.jurisdiction;
  has StructureMap_Structure @.structure;
  has StructureMap_Group @.group is required;
}
class Subscription_Channel is FHIR is export {
  has Str $.id;
  has FHIRCode $.type is required;
  has Str @.header;
  has FHIRCode $.payload;
  has UrlStr $.endpoint;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class Subscription is DomainResource is export {
  method resourceType(--> 'Subscription') {}
  has DateTime $.end;
  has Str $.error;
  has FHIRCode $.status is required;
  has Str $.reason is required;
  has ContactPoint @.contact;
  has Str $.criteria is required;
  has Subscription_Channel $.channel is required;
}
class TestReport_Participant is FHIR is export {
  has Str $.id;
  has UriStr $.uri is required;
  has FHIRCode $.type is required;
  has Str $.display;
  has Extension @.extension;
  has Extension @.modifierExtension;
}

class TestReport_Test_Action is FHIR is export {
  has Str $.id;
  has TestReport_Setup_Action_Assert $.assert;
  has Extension @.extension;
  has TestReport_Setup_Action_Operation $.operation;
  has Extension @.modifierExtension;
}
class TestReport_Test is FHIR is export {
  has Str $.id;
  has Str $.name;
  has Extension @.extension;
  has Str $.description;
  has Extension @.modifierExtension;
  has TestReport_Test_Action @.action is required;
}

class TestReport_Teardown_Action is FHIR is export {
  has Str $.id;
  has Extension @.extension;
  has TestReport_Setup_Action_Operation $.operation is required;
  has Extension @.modifierExtension;
}
class TestReport_Teardown is FHIR is export {
  has Str $.id;
  has Extension @.extension;
  has Extension @.modifierExtension;
  has TestReport_Teardown_Action @.action is required;
}

class TestReport_Setup_Action_Assert is FHIR is