Skip to content

Commit

Permalink
issue #2222 - allow construction of empty resources
Browse files Browse the repository at this point in the history
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
  • Loading branch information
lmsurpre committed Apr 8, 2021
1 parent d24601c commit 941010b
Show file tree
Hide file tree
Showing 148 changed files with 2 additions and 150 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ private Account(Builder builder) {
ValidationSupport.checkReferenceType(subject, "subject", "Patient", "Device", "Practitioner", "PractitionerRole", "Location", "HealthcareService", "Organization");
ValidationSupport.checkReferenceType(owner, "owner", "Organization");
ValidationSupport.checkReferenceType(partOf, "partOf", "Account");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ private ActivityDefinition(Builder builder) {
ValidationSupport.checkReferenceType(specimenRequirement, "specimenRequirement", "SpecimenDefinition");
ValidationSupport.checkReferenceType(observationRequirement, "observationRequirement", "ObservationDefinition");
ValidationSupport.checkReferenceType(observationResultRequirement, "observationResultRequirement", "ObservationDefinition");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ private AdverseEvent(Builder builder) {
ValidationSupport.checkReferenceType(subjectMedicalHistory, "subjectMedicalHistory", "Condition", "Observation", "AllergyIntolerance", "FamilyMemberHistory", "Immunization", "Procedure", "Media", "DocumentReference");
ValidationSupport.checkReferenceType(referenceDocument, "referenceDocument", "DocumentReference");
ValidationSupport.checkReferenceType(study, "study", "ResearchStudy");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ private AllergyIntolerance(Builder builder) {
ValidationSupport.checkReferenceType(encounter, "encounter", "Encounter");
ValidationSupport.checkReferenceType(recorder, "recorder", "Practitioner", "PractitionerRole", "Patient", "RelatedPerson");
ValidationSupport.checkReferenceType(asserter, "asserter", "Patient", "RelatedPerson", "Practitioner", "PractitionerRole");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ private Appointment(Builder builder) {
ValidationSupport.checkReferenceType(reasonReference, "reasonReference", "Condition", "Procedure", "Observation", "ImmunizationRecommendation");
ValidationSupport.checkReferenceType(slot, "slot", "Slot");
ValidationSupport.checkReferenceType(basedOn, "basedOn", "ServiceRequest");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ private AppointmentResponse(Builder builder) {
comment = builder.comment;
ValidationSupport.checkReferenceType(appointment, "appointment", "Appointment");
ValidationSupport.checkReferenceType(actor, "actor", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Device", "HealthcareService", "Location");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ private AuditEvent(Builder builder) {
agent = Collections.unmodifiableList(ValidationSupport.checkNonEmptyList(builder.agent, "agent", Agent.class));
source = ValidationSupport.requireNonNull(builder.source, "source");
entity = Collections.unmodifiableList(ValidationSupport.checkList(builder.entity, "entity", Entity.class));
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ private Basic(Builder builder) {
created = builder.created;
author = builder.author;
ValidationSupport.checkReferenceType(author, "author", "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", "Organization");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ private Binary(Builder builder) {
contentType = ValidationSupport.requireNonNull(builder.contentType, "contentType");
securityContext = builder.securityContext;
data = builder.data;
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ private BiologicallyDerivedProduct(Builder builder) {
storage = Collections.unmodifiableList(ValidationSupport.checkList(builder.storage, "storage", Storage.class));
ValidationSupport.checkReferenceType(request, "request", "ServiceRequest");
ValidationSupport.checkReferenceType(parent, "parent", "BiologicallyDerivedProduct");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ private BodyStructure(Builder builder) {
image = Collections.unmodifiableList(ValidationSupport.checkList(builder.image, "image", Attachment.class));
patient = ValidationSupport.requireNonNull(builder.patient, "patient");
ValidationSupport.checkReferenceType(patient, "patient", "Patient");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ private Bundle(Builder builder) {
link = Collections.unmodifiableList(ValidationSupport.checkList(builder.link, "link", Link.class));
entry = Collections.unmodifiableList(ValidationSupport.checkList(builder.entry, "entry", Entry.class));
signature = builder.signature;
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ private CapabilityStatement(Builder builder) {
rest = Collections.unmodifiableList(ValidationSupport.checkList(builder.rest, "rest", Rest.class));
messaging = Collections.unmodifiableList(ValidationSupport.checkList(builder.messaging, "messaging", Messaging.class));
document = Collections.unmodifiableList(ValidationSupport.checkList(builder.document, "document", Document.class));
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ private CarePlan(Builder builder) {
ValidationSupport.checkReferenceType(careTeam, "careTeam", "CareTeam");
ValidationSupport.checkReferenceType(addresses, "addresses", "Condition");
ValidationSupport.checkReferenceType(goal, "goal", "Goal");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ private CareTeam(Builder builder) {
ValidationSupport.checkReferenceType(encounter, "encounter", "Encounter");
ValidationSupport.checkReferenceType(reasonReference, "reasonReference", "Condition");
ValidationSupport.checkReferenceType(managingOrganization, "managingOrganization", "Organization");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ private CatalogEntry(Builder builder) {
additionalClassification = Collections.unmodifiableList(ValidationSupport.checkList(builder.additionalClassification, "additionalClassification", CodeableConcept.class));
relatedEntry = Collections.unmodifiableList(ValidationSupport.checkList(builder.relatedEntry, "relatedEntry", RelatedEntry.class));
ValidationSupport.checkReferenceType(referencedItem, "referencedItem", "Medication", "Device", "Organization", "Practitioner", "PractitionerRole", "HealthcareService", "ActivityDefinition", "PlanDefinition", "SpecimenDefinition", "ObservationDefinition", "Binary");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ private ChargeItem(Builder builder) {
ValidationSupport.checkReferenceType(service, "service", "DiagnosticReport", "ImagingStudy", "Immunization", "MedicationAdministration", "MedicationDispense", "Observation", "Procedure", "SupplyDelivery");
ValidationSupport.checkReferenceType(product, "product", "Device", "Medication", "Substance");
ValidationSupport.checkReferenceType(account, "account", "Account");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ private ChargeItemDefinition(Builder builder) {
applicability = Collections.unmodifiableList(ValidationSupport.checkList(builder.applicability, "applicability", Applicability.class));
propertyGroup = Collections.unmodifiableList(ValidationSupport.checkList(builder.propertyGroup, "propertyGroup", PropertyGroup.class));
ValidationSupport.checkReferenceType(instance, "instance", "Medication", "Substance", "Device");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ private Claim(Builder builder) {
ValidationSupport.checkReferenceType(originalPrescription, "originalPrescription", "DeviceRequest", "MedicationRequest", "VisionPrescription");
ValidationSupport.checkReferenceType(referral, "referral", "ServiceRequest");
ValidationSupport.checkReferenceType(facility, "facility", "Location");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ private ClaimResponse(Builder builder) {
ValidationSupport.checkReferenceType(requestor, "requestor", "Practitioner", "PractitionerRole", "Organization");
ValidationSupport.checkReferenceType(request, "request", "Claim");
ValidationSupport.checkReferenceType(communicationRequest, "communicationRequest", "CommunicationRequest");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ private ClinicalImpression(Builder builder) {
ValidationSupport.checkReferenceType(previous, "previous", "ClinicalImpression");
ValidationSupport.checkReferenceType(problem, "problem", "Condition", "AllergyIntolerance");
ValidationSupport.checkReferenceType(prognosisReference, "prognosisReference", "RiskAssessment");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ private CodeSystem(Builder builder) {
filter = Collections.unmodifiableList(ValidationSupport.checkList(builder.filter, "filter", Filter.class));
property = Collections.unmodifiableList(ValidationSupport.checkList(builder.property, "property", Property.class));
concept = Collections.unmodifiableList(ValidationSupport.checkList(builder.concept, "concept", Concept.class));
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ private Communication(Builder builder) {
ValidationSupport.checkReferenceType(recipient, "recipient", "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Group", "CareTeam", "HealthcareService");
ValidationSupport.checkReferenceType(sender, "sender", "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "HealthcareService");
ValidationSupport.checkReferenceType(reasonReference, "reasonReference", "Condition", "Observation", "DiagnosticReport", "DocumentReference");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ private CommunicationRequest(Builder builder) {
ValidationSupport.checkReferenceType(recipient, "recipient", "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Group", "CareTeam", "HealthcareService");
ValidationSupport.checkReferenceType(sender, "sender", "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "HealthcareService");
ValidationSupport.checkReferenceType(reasonReference, "reasonReference", "Condition", "Observation", "DiagnosticReport", "DocumentReference");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ private CompartmentDefinition(Builder builder) {
code = ValidationSupport.requireNonNull(builder.code, "code");
search = ValidationSupport.requireNonNull(builder.search, "search");
resource = Collections.unmodifiableList(ValidationSupport.checkList(builder.resource, "resource", Resource.class));
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ private Composition(Builder builder) {
ValidationSupport.checkReferenceType(encounter, "encounter", "Encounter");
ValidationSupport.checkReferenceType(author, "author", "Practitioner", "PractitionerRole", "Device", "Patient", "RelatedPerson", "Organization");
ValidationSupport.checkReferenceType(custodian, "custodian", "Organization");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ private ConceptMap(Builder builder) {
source = ValidationSupport.choiceElement(builder.source, "source", Uri.class, Canonical.class);
target = ValidationSupport.choiceElement(builder.target, "target", Uri.class, Canonical.class);
group = Collections.unmodifiableList(ValidationSupport.checkList(builder.group, "group", Group.class));
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ private Condition(Builder builder) {
ValidationSupport.checkReferenceType(encounter, "encounter", "Encounter");
ValidationSupport.checkReferenceType(recorder, "recorder", "Practitioner", "PractitionerRole", "Patient", "RelatedPerson");
ValidationSupport.checkReferenceType(asserter, "asserter", "Practitioner", "PractitionerRole", "Patient", "RelatedPerson");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ private Consent(Builder builder) {
ValidationSupport.checkReferenceType(performer, "performer", "Organization", "Patient", "Practitioner", "RelatedPerson", "PractitionerRole");
ValidationSupport.checkReferenceType(organization, "organization", "Organization");
ValidationSupport.checkReferenceType(source, "source", "Consent", "DocumentReference", "Contract", "QuestionnaireResponse");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ private Contract(Builder builder) {
ValidationSupport.checkReferenceType(author, "author", "Patient", "Practitioner", "PractitionerRole", "Organization");
ValidationSupport.checkReferenceType(relevantHistory, "relevantHistory", "Provenance");
ValidationSupport.checkReferenceType(legallyBinding, "legallyBinding", "Composition", "DocumentReference", "QuestionnaireResponse", "Contract");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ private Coverage(Builder builder) {
ValidationSupport.checkReferenceType(beneficiary, "beneficiary", "Patient");
ValidationSupport.checkReferenceType(payor, "payor", "Organization", "Patient", "RelatedPerson");
ValidationSupport.checkReferenceType(contract, "contract", "Contract");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ private CoverageEligibilityRequest(Builder builder) {
ValidationSupport.checkReferenceType(provider, "provider", "Practitioner", "PractitionerRole", "Organization");
ValidationSupport.checkReferenceType(insurer, "insurer", "Organization");
ValidationSupport.checkReferenceType(facility, "facility", "Location");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ private CoverageEligibilityResponse(Builder builder) {
ValidationSupport.checkReferenceType(requestor, "requestor", "Practitioner", "PractitionerRole", "Organization");
ValidationSupport.checkReferenceType(request, "request", "CoverageEligibilityRequest");
ValidationSupport.checkReferenceType(insurer, "insurer", "Organization");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ private DetectedIssue(Builder builder) {
mitigation = Collections.unmodifiableList(ValidationSupport.checkList(builder.mitigation, "mitigation", Mitigation.class));
ValidationSupport.checkReferenceType(patient, "patient", "Patient");
ValidationSupport.checkReferenceType(author, "author", "Practitioner", "PractitionerRole", "Device");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ private Device(Builder builder) {
ValidationSupport.checkReferenceType(owner, "owner", "Organization");
ValidationSupport.checkReferenceType(location, "location", "Location");
ValidationSupport.checkReferenceType(parent, "parent", "Device");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ private DeviceDefinition(Builder builder) {
ValidationSupport.checkReferenceType(manufacturer, "manufacturer", "Organization");
ValidationSupport.checkReferenceType(owner, "owner", "Organization");
ValidationSupport.checkReferenceType(parentDevice, "parentDevice", "DeviceDefinition");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ private DeviceMetric(Builder builder) {
calibration = Collections.unmodifiableList(ValidationSupport.checkList(builder.calibration, "calibration", Calibration.class));
ValidationSupport.checkReferenceType(source, "source", "Device");
ValidationSupport.checkReferenceType(parent, "parent", "Device");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ private DeviceRequest(Builder builder) {
ValidationSupport.checkReferenceType(reasonReference, "reasonReference", "Condition", "Observation", "DiagnosticReport", "DocumentReference");
ValidationSupport.checkReferenceType(insurance, "insurance", "Coverage", "ClaimResponse");
ValidationSupport.checkReferenceType(relevantHistory, "relevantHistory", "Provenance");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ private DeviceUseStatement(Builder builder) {
ValidationSupport.checkReferenceType(source, "source", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson");
ValidationSupport.checkReferenceType(device, "device", "Device");
ValidationSupport.checkReferenceType(reasonReference, "reasonReference", "Condition", "Observation", "DiagnosticReport", "DocumentReference", "Media");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ private DiagnosticReport(Builder builder) {
ValidationSupport.checkReferenceType(specimen, "specimen", "Specimen");
ValidationSupport.checkReferenceType(result, "result", "Observation");
ValidationSupport.checkReferenceType(imagingStudy, "imagingStudy", "ImagingStudy");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ private DocumentManifest(Builder builder) {
ValidationSupport.checkReferenceType(subject, "subject", "Patient", "Practitioner", "Group", "Device");
ValidationSupport.checkReferenceType(author, "author", "Practitioner", "PractitionerRole", "Organization", "Device", "Patient", "RelatedPerson");
ValidationSupport.checkReferenceType(recipient, "recipient", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Organization");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ private DocumentReference(Builder builder) {
ValidationSupport.checkReferenceType(author, "author", "Practitioner", "PractitionerRole", "Organization", "Device", "Patient", "RelatedPerson");
ValidationSupport.checkReferenceType(authenticator, "authenticator", "Practitioner", "PractitionerRole", "Organization");
ValidationSupport.checkReferenceType(custodian, "custodian", "Organization");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ private EffectEvidenceSynthesis(Builder builder) {
ValidationSupport.checkReferenceType(exposure, "exposure", "EvidenceVariable");
ValidationSupport.checkReferenceType(exposureAlternative, "exposureAlternative", "EvidenceVariable");
ValidationSupport.checkReferenceType(outcome, "outcome", "EvidenceVariable");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ private Encounter(Builder builder) {
ValidationSupport.checkReferenceType(account, "account", "Account");
ValidationSupport.checkReferenceType(serviceProvider, "serviceProvider", "Organization");
ValidationSupport.checkReferenceType(partOf, "partOf", "Encounter");
ValidationSupport.requireChildren(this);
}

/**
Expand Down
Loading

0 comments on commit 941010b

Please sign in to comment.