示例#1
0
        public async Task <Confidentiality> AddConfidentiality(Confidentiality c)
        {
            var result = await peopleDbContext.Confidentialities.AddAsync(c);

            await peopleDbContext.SaveChangesAsync();

            return(result.Entity);
        }
示例#2
0
        public async Task <Confidentiality> UpdateConfidentiality(Confidentiality c)
        {
            var result = await peopleDbContext.Confidentialities
                         .FirstOrDefaultAsync(e => e.ConfidentialityId == c.ConfidentialityId);

            if (result != null)
            {
                result.Label = c.Label;
                await peopleDbContext.SaveChangesAsync();

                return(result);
            }

            return(null);
        }
示例#3
0
        public void TestFindCodedValueWithChildrenAndParent()
        {
            VocabularyDomain vocabularyDomain = this.factory
                                                .CreateVocabularyDomain(typeof(Confidentiality));

            CreateCodedValue(vocabularyDomain, OID, CODE, "parent", ILOG.J2CsMapping.Collections.Generics.Arrays.AsList("child1", "child2", "child3"));

            Confidentiality code = (Confidentiality)Ca.Infoway.Messagebuilder.Terminology.CodeResolverRegistry.Lookup <Confidentiality>(
                typeof(Confidentiality), CODE, OID);

            CodedValue codedValue = this.dao.FindCodedValue(code);

            NUnit.Framework.Assert.IsNotNull(codedValue);
            NUnit.Framework.Assert.IsFalse((codedValue.Children.Count == 0));
            NUnit.Framework.Assert.AreEqual(3, codedValue.Children.Count);
            NUnit.Framework.Assert.IsFalse((codedValue.Parents.Count == 0));
        }
示例#4
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            ((Fhir.R4.Models.BackboneElement) this).SerializeJson(writer, options, false);

            if (Code != null)
            {
                writer.WritePropertyName("code");
                Code.SerializeJson(writer, options);
            }

            if (Group != null)
            {
                writer.WritePropertyName("group");
                Group.SerializeJson(writer, options);
            }

            if (Confidentiality != null)
            {
                writer.WritePropertyName("confidentiality");
                Confidentiality.SerializeJson(writer, options);
            }

            if ((Strength != null) && (Strength.Count != 0))
            {
                writer.WritePropertyName("strength");
                writer.WriteStartArray();

                foreach (MedicinalProductIngredientSpecifiedSubstanceStrength valStrength in Strength)
                {
                    valStrength.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
示例#5
0
        public override int GetHashCode()
        {
            var hashCode = 724792092;

            hashCode = hashCode * -1521134295 + IdThreat.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ThreatName);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ThreatDescription);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ThreatSource);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ThreatObject);

            hashCode = hashCode * -1521134295 + Confidentiality.GetHashCode();
            hashCode = hashCode * -1521134295 + Integrity.GetHashCode();
            hashCode = hashCode * -1521134295 + Availability.GetHashCode();
            return(hashCode);
        }
示例#6
0
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(Identification != null ? Identification.ToStepValue() : "$");
            parameters.Add(Name != null ? Name.ToStepValue() : "$");
            parameters.Add(Description != null ? Description.ToStepValue() : "$");
            parameters.Add(Location != null ? Location.ToStepValue() : "$");
            parameters.Add(Purpose != null ? Purpose.ToStepValue() : "$");
            parameters.Add(IntendedUse != null ? IntendedUse.ToStepValue() : "$");
            parameters.Add(Scope != null ? Scope.ToStepValue() : "$");
            parameters.Add(Revision != null ? Revision.ToStepValue() : "$");
            parameters.Add(DocumentOwner != null ? DocumentOwner.ToStepValue() : "$");
            parameters.Add(Editors != null ? Editors.ToStepValue() : "$");
            parameters.Add(CreationTime != null ? CreationTime.ToStepValue() : "$");
            parameters.Add(LastRevisionTime != null ? LastRevisionTime.ToStepValue() : "$");
            parameters.Add(ElectronicFormat != null ? ElectronicFormat.ToStepValue() : "$");
            parameters.Add(ValidFrom != null ? ValidFrom.ToStepValue() : "$");
            parameters.Add(ValidUntil != null ? ValidUntil.ToStepValue() : "$");
            parameters.Add(Confidentiality.ToStepValue());
            parameters.Add(Status.ToStepValue());

            return(string.Join(", ", parameters.ToArray()));
        }
示例#7
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as DocumentManifest;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (MasterIdentifier != null)
                {
                    dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy();
                }
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Subject != null)
                {
                    dest.Subject = new List <Hl7.Fhir.Model.ResourceReference>(Subject.DeepCopy());
                }
                if (Recipient != null)
                {
                    dest.Recipient = new List <Hl7.Fhir.Model.ResourceReference>(Recipient.DeepCopy());
                }
                if (Type != null)
                {
                    dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
                }
                if (Author != null)
                {
                    dest.Author = new List <Hl7.Fhir.Model.ResourceReference>(Author.DeepCopy());
                }
                if (CreatedElement != null)
                {
                    dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy();
                }
                if (SourceElement != null)
                {
                    dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Hl7.Fhir.Model.Code)StatusElement.DeepCopy();
                }
                if (Supercedes != null)
                {
                    dest.Supercedes = (Hl7.Fhir.Model.ResourceReference)Supercedes.DeepCopy();
                }
                if (DescriptionElement != null)
                {
                    dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy();
                }
                if (Confidentiality != null)
                {
                    dest.Confidentiality = (Hl7.Fhir.Model.CodeableConcept)Confidentiality.DeepCopy();
                }
                if (Content != null)
                {
                    dest.Content = new List <Hl7.Fhir.Model.ResourceReference>(Content.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
示例#8
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as DocumentReference;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (MasterIdentifier != null)
                {
                    dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy();
                }
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (Type != null)
                {
                    dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
                }
                if (Class != null)
                {
                    dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy();
                }
                if (FormatElement != null)
                {
                    dest.FormatElement = new List <Hl7.Fhir.Model.FhirUri>(FormatElement.DeepCopy());
                }
                if (Author != null)
                {
                    dest.Author = new List <Hl7.Fhir.Model.ResourceReference>(Author.DeepCopy());
                }
                if (Custodian != null)
                {
                    dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy();
                }
                if (Authenticator != null)
                {
                    dest.Authenticator = (Hl7.Fhir.Model.ResourceReference)Authenticator.DeepCopy();
                }
                if (CreatedElement != null)
                {
                    dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy();
                }
                if (IndexedElement != null)
                {
                    dest.IndexedElement = (Hl7.Fhir.Model.Instant)IndexedElement.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.DocumentReference.DocumentReferenceStatus>)StatusElement.DeepCopy();
                }
                if (DocStatus != null)
                {
                    dest.DocStatus = (Hl7.Fhir.Model.CodeableConcept)DocStatus.DeepCopy();
                }
                if (RelatesTo != null)
                {
                    dest.RelatesTo = new List <Hl7.Fhir.Model.DocumentReference.DocumentReferenceRelatesToComponent>(RelatesTo.DeepCopy());
                }
                if (DescriptionElement != null)
                {
                    dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy();
                }
                if (Confidentiality != null)
                {
                    dest.Confidentiality = new List <Hl7.Fhir.Model.CodeableConcept>(Confidentiality.DeepCopy());
                }
                if (Content != null)
                {
                    dest.Content = new List <Hl7.Fhir.Model.Attachment>(Content.DeepCopy());
                }
                if (Context != null)
                {
                    dest.Context = (Hl7.Fhir.Model.DocumentReference.DocumentReferenceContextComponent)Context.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
示例#9
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Composition;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy();
                }
                if (DateElement != null)
                {
                    dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
                }
                if (Type != null)
                {
                    dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
                }
                if (Class != null)
                {
                    dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy();
                }
                if (TitleElement != null)
                {
                    dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.Composition.CompositionStatus>)StatusElement.DeepCopy();
                }
                if (Confidentiality != null)
                {
                    dest.Confidentiality = (Hl7.Fhir.Model.Coding)Confidentiality.DeepCopy();
                }
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (Author != null)
                {
                    dest.Author = new List <Hl7.Fhir.Model.ResourceReference>(Author.DeepCopy());
                }
                if (Attester != null)
                {
                    dest.Attester = new List <Hl7.Fhir.Model.Composition.CompositionAttesterComponent>(Attester.DeepCopy());
                }
                if (Custodian != null)
                {
                    dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy();
                }
                if (Event != null)
                {
                    dest.Event = (Hl7.Fhir.Model.Composition.CompositionEventComponent)Event.DeepCopy();
                }
                if (Encounter != null)
                {
                    dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy();
                }
                if (Section != null)
                {
                    dest.Section = new List <Hl7.Fhir.Model.Composition.SectionComponent>(Section.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
示例#10
0
        public override ExtrinsicObject ToRegistryObject()
        {
            var document = new ExtrinsicObject
            {
                Id          = EntryUuid,
                Home        = HomeCommunityId,
                Status      = AvailabilityStatus,
                Description = XmlUtil.LocalString(Comments),
                Name        = XmlUtil.LocalString(Title),
                MimeType    = MimeType,
                ObjectType  = DocumentEntryType
            };

            document.Classifications.Add(new Classification
            {
                ClassificationScheme = XdsClassification.Document,
                ClassifiedObject     = EntryUuid,
            });

            if (Author != null)
            {
                var authorAttribute = Author.ToClassification(XdsClassification.DocumentAuthor, EntryUuid);
                document.Classifications.Add(authorAttribute);
            }
            if (Class != null && !string.IsNullOrEmpty(Class.Value))
            {
                document.Classifications.Add(Class.ToClassification(EntryUuid));
            }

            if (Confidentiality != null && Confidentiality.Any(c => !string.IsNullOrEmpty(c.Value)))
            {
                document.Classifications.AddRange(
                    Confidentiality.Select(c => c.ToClassification(EntryUuid)));
            }
            if (CreationTime != null)
            {
                document.Slots.Add(XmlUtil.SingleSlot("creationTime", _hl7CreationTime.Encode()));
            }

            if (EventCodes != null && EventCodes.Any(fc => !string.IsNullOrEmpty(fc.Value)))
            {
                document.Classifications.AddRange(EventCodes.Select(fc => fc.ToClassification(EntryUuid)));
            }

            if (Format != null && !string.IsNullOrEmpty(Format.Value))
            {
                document.Classifications.Add(Format.ToClassification(EntryUuid));
            }

            if (!string.IsNullOrEmpty(Hash))
            {
                document.Slots.Add(XmlUtil.SingleSlot("hash", Hash));
            }

            if (HealthCareFacilityType != null && !string.IsNullOrEmpty(HealthCareFacilityType.Value))
            {
                document.Classifications.Add(HealthCareFacilityType.ToClassification(EntryUuid));
            }

            if (!string.IsNullOrEmpty(LanguageCode))
            {
                document.Slots.Add(XmlUtil.SingleSlot("languageCode", LanguageCode));
            }

            if (LegalAuthenticator != null)
            {
                document.Slots.Add(XmlUtil.SingleSlot("legalAuthenticator", LegalAuthenticator.Hl7Person.Encode()));
            }

            string patientId = PatientId != null?PatientId.ToString() : "";

            if (!string.IsNullOrEmpty(patientId))
            {
                document.ExternalIdentifiers.Add(new ExternalIdentifier
                {
                    IdentificationScheme = XdsIdentification.DocumentPatientId,
                    RegistryObject       = EntryUuid,
                    Name  = XmlUtil.LocalString("XDSFolder.patientId"),
                    Value = patientId
                });
            }

            if (PracticeSetting != null && !string.IsNullOrEmpty(PracticeSetting.Value))
            {
                document.Classifications.Add(PracticeSetting.ToClassification(EntryUuid));
            }

            if (!string.IsNullOrEmpty(RepositoryUniqueId))
            {
                document.Slots.Add(XmlUtil.SingleSlot("repositoryUniqueId", RepositoryUniqueId));
            }

            if (ServiceStartTime != null)
            {
                document.Slots.Add(XmlUtil.SingleSlot("serviceStartTime", _hl7ServiceStartTime.Encode()));
            }

            if (ServiceStopTime != null)
            {
                document.Slots.Add(XmlUtil.SingleSlot("serviceStopTime", _hl7ServiceStopTime.Encode()));
            }

            if (Size != null)
            {
                document.Slots.Add(XmlUtil.SingleSlot("size", Size.Value.ToString()));
            }

            if (SourcePatientId != null)
            {
                document.Slots.Add(XmlUtil.SingleSlot("sourcePatientId", SourcePatientId.Hl7Identifier.Encode()));
            }

            if (SourcePatientInfo != null && SourcePatientInfo.Any())
            {
                document.Slots.Add(new Slot
                {
                    Name   = "sourcePatientInfo",
                    Values = SourcePatientInfo
                });
            }

            if (Type != null)
            {
                document.Classifications.Add(Type.ToClassification(EntryUuid));
            }

            if (!string.IsNullOrEmpty(Uri))
            {
                document.Slots.Add(XmlUtil.SingleSlot("URI", Uri));
            }

            if (!string.IsNullOrEmpty(UniqueId))
            {
                document.ExternalIdentifiers.Add(new ExternalIdentifier
                {
                    IdentificationScheme = XdsIdentification.DocumentUniqueId,
                    RegistryObject       = EntryUuid,
                    Name  = XmlUtil.LocalString("XDSFolder.uniqueId"),
                    Value = UniqueId
                });
            }
            if (ReferenceIds != null && ReferenceIds.Any())
            {
                document.Slots.Add(new Slot
                {
                    Name   = "urn:ihe:iti:xds:2013:referenceIdList",
                    Values = ReferenceIds.Select(id => id.Hl7Identifier.Encode()).ToList()
                });
            }
            if (LimitedMetadata)
            {
                document.Classifications.Add(new Classification
                {
                    ClassificationScheme = XdsClassification.DocumentLimitedMetadata,
                    ClassifiedObject     = EntryUuid
                });
            }

            return(document);
        }
示例#11
0
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (MasterIdentifier != null)
            {
                result.AddRange(MasterIdentifier.Validate());
            }
            if (Identifier != null)
            {
                Identifier.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (Subject != null)
            {
                result.AddRange(Subject.Validate());
            }
            if (Type != null)
            {
                result.AddRange(Type.Validate());
            }
            if (Subtype != null)
            {
                result.AddRange(Subtype.Validate());
            }
            if (Author != null)
            {
                Author.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (Custodian != null)
            {
                result.AddRange(Custodian.Validate());
            }
            if (Authenticator != null)
            {
                result.AddRange(Authenticator.Validate());
            }
            if (CreatedElement != null)
            {
                result.AddRange(CreatedElement.Validate());
            }
            if (IndexedElement != null)
            {
                result.AddRange(IndexedElement.Validate());
            }
            if (StatusElement != null)
            {
                result.AddRange(StatusElement.Validate());
            }
            if (DocStatus != null)
            {
                result.AddRange(DocStatus.Validate());
            }
            if (Supercedes != null)
            {
                result.AddRange(Supercedes.Validate());
            }
            if (DescriptionElement != null)
            {
                result.AddRange(DescriptionElement.Validate());
            }
            if (Confidentiality != null)
            {
                result.AddRange(Confidentiality.Validate());
            }
            if (PrimaryLanguageElement != null)
            {
                result.AddRange(PrimaryLanguageElement.Validate());
            }
            if (MimeTypeElement != null)
            {
                result.AddRange(MimeTypeElement.Validate());
            }
            if (Format != null)
            {
                result.AddRange(Format.Validate());
            }
            if (SizeElement != null)
            {
                result.AddRange(SizeElement.Validate());
            }
            if (HashElement != null)
            {
                result.AddRange(HashElement.Validate());
            }
            if (LocationElement != null)
            {
                result.AddRange(LocationElement.Validate());
            }
            if (Service != null)
            {
                result.AddRange(Service.Validate());
            }
            if (Context != null)
            {
                result.AddRange(Context.Validate());
            }

            return(result);
        }
示例#12
0
      public override IDeepCopyable CopyTo(IDeepCopyable other)
      {
        var dest = other as SpecifiedSubstanceComponent;

        if (dest == null)
        {
          throw new ArgumentException("Can only copy to an object of the same type", "other");
        }

        base.CopyTo(dest);
        if(Code != null) dest.Code = (Hl7.Fhir.Model.DataType)Code.DeepCopy();
        if(Group != null) dest.Group = (Hl7.Fhir.Model.CodeableConcept)Group.DeepCopy();
        if(Confidentiality != null) dest.Confidentiality = (Hl7.Fhir.Model.CodeableConcept)Confidentiality.DeepCopy();
        if(Strength != null) dest.Strength = new List<Hl7.Fhir.Model.Ingredient.StrengthComponent>(Strength.DeepCopy());
        return dest;
      }
示例#13
0
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (Identifier != null)
            {
                result.AddRange(Identifier.Validate());
            }
            if (VersionIdentifier != null)
            {
                result.AddRange(VersionIdentifier.Validate());
            }
            if (CreatedElement != null)
            {
                result.AddRange(CreatedElement.Validate());
            }
            if (Type != null)
            {
                result.AddRange(Type.Validate());
            }
            if (Subtype != null)
            {
                result.AddRange(Subtype.Validate());
            }
            if (TitleElement != null)
            {
                result.AddRange(TitleElement.Validate());
            }
            if (StatusElement != null)
            {
                result.AddRange(StatusElement.Validate());
            }
            if (Confidentiality != null)
            {
                result.AddRange(Confidentiality.Validate());
            }
            if (Subject != null)
            {
                result.AddRange(Subject.Validate());
            }
            if (Author != null)
            {
                Author.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (Attester != null)
            {
                Attester.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (Custodian != null)
            {
                result.AddRange(Custodian.Validate());
            }
            if (Event != null)
            {
                result.AddRange(Event.Validate());
            }
            if (Encounter != null)
            {
                result.AddRange(Encounter.Validate());
            }
            if (ReplacesElement != null)
            {
                result.AddRange(ReplacesElement.Validate());
            }
            if (Provenance != null)
            {
                Provenance.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (Stylesheet != null)
            {
                result.AddRange(Stylesheet.Validate());
            }
            if (Representation != null)
            {
                result.AddRange(Representation.Validate());
            }
            if (Section != null)
            {
                Section.ForEach(elem => result.AddRange(elem.Validate()));
            }

            return(result);
        }