/// <summary> /// Validates this imaging examination result /// </summary> /// <param name="path">The path to this object as a string</param> /// <param name="messages">the validation messages to date, these may be added to within this method</param> public void Validate(string path, List <ValidationMessage> messages) { var vb = new ValidationBuilder(path, messages); if (vb.ArgumentRequiredCheck("ExaminationResultName", ExaminationResultName)) { if (ExaminationResultName != null) { ExaminationResultName.ValidateMandatory(vb.Path + "ExaminationResultName", messages); } } vb.ArgumentRequiredCheck("ResultDateTime", ResultDateTime); if (Modality != null) { Modality.Validate(vb.Path + "Modality", messages); } if (AnatomicalSite != null && AnatomicalSite.Any()) { AnatomicalSite.ForEach(anatomicalSite => anatomicalSite.Validate(vb.Path + "AnatomicalSite", messages)); } if (ExaminationRequestDetails != null) { ExaminationRequestDetails.ForEach(ExaminationRequestDetail => ExaminationRequestDetail.Validate(vb.Path + "ExaminationRequestDetails", messages)); } if (ResultGroup != null && ResultGroup.Any()) { ResultGroup.ForEach(imagingResultGroup => imagingResultGroup.Validate(vb.Path + "ResultGroup", messages)); } }
/// <summary> /// Validates this specimen detail /// </summary> /// <param name="path">The path to this object as a string</param> /// <param name="messages">the validation messages, these may be added to within this method</param> public void Validate(string path, List <ValidationMessage> messages) { var validationBuilder = new ValidationBuilder(path, messages); validationBuilder.ArgumentRequiredCheck("CollectionDateTime", CollectionDateTime); if (AnatomicalSite != null && AnatomicalSite.Any()) { AnatomicalSite.ForEach(anatomicalSite => anatomicalSite.Validate(path + ".AnatomicalSite", messages)); } if (PhysicalDetails != null && PhysicalDetails.Any()) { PhysicalDetails.ForEach(physicalDetail => physicalDetail.Validate(path + ".PhysicalDetails", messages)); if (PhysicalDetails.Count > 1) { validationBuilder.AddValidationMessage(path + ".physicalDetails", null, "Only one physical details item can be specified"); } } if (SpecimenTissueType != null) { SpecimenTissueType.Validate(path + ".SpecimenTissueType", messages); } if (CollectionProcedure != null) { CollectionProcedure.Validate(path + ".CollectionProcedure", messages); } if (SamplingPreconditions != null) { SamplingPreconditions.Validate(path + ".SamplingPreconditions", messages); } if (SpecimenIdentifier != null) { SpecimenIdentifier.Validate(path + ".SpecimenIdentifier", messages); } if (ParentSpecimenIdentifier != null) { ParentSpecimenIdentifier.Validate(path + ".ParentSpecimenIdentifier", messages); } if (ContainerIdentifier != null) { ContainerIdentifier.Validate(path + ".ContainerIdentifier", messages); } }