当前位置: 首页>>代码示例>>C#>>正文


C# Resource.GetType方法代码示例

本文整理汇总了C#中Hl7.Fhir.Model.Resource.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Resource.GetType方法的具体用法?C# Resource.GetType怎么用?C# Resource.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hl7.Fhir.Model.Resource的用法示例。


在下文中一共展示了Resource.GetType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Cast

 public string Cast(Resource resource)
 {
     return ModelInfo.GetResourceNameForType(resource.GetType());
 }
开发者ID:raysearchlabs,项目名称:spark,代码行数:4,代码来源:BsonIndexDocumentBuilder.cs

示例2: NextKey

 public static string NextKey(this IGenerator generator, Resource resource)
 {
     string name = resource.GetType().Name;
     return generator.NextKey(name);
 }
开发者ID:Ravenheart,项目名称:spark,代码行数:5,代码来源:IGenerator.cs

示例3: SerializeResource

 internal static void SerializeResource(Resource value, IFhirWriter writer, bool summary)
 {
     if(value.GetType() == typeof(Hl7.Fhir.Model.AdverseReaction))
         AdverseReactionSerializer.SerializeAdverseReaction((Hl7.Fhir.Model.AdverseReaction)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Alert))
         AlertSerializer.SerializeAlert((Hl7.Fhir.Model.Alert)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.AllergyIntolerance))
         AllergyIntoleranceSerializer.SerializeAllergyIntolerance((Hl7.Fhir.Model.AllergyIntolerance)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.CarePlan))
         CarePlanSerializer.SerializeCarePlan((Hl7.Fhir.Model.CarePlan)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Condition))
         ConditionSerializer.SerializeCondition((Hl7.Fhir.Model.Condition)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Conformance))
         ConformanceSerializer.SerializeConformance((Hl7.Fhir.Model.Conformance)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Coverage))
         CoverageSerializer.SerializeCoverage((Hl7.Fhir.Model.Coverage)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Device))
         DeviceSerializer.SerializeDevice((Hl7.Fhir.Model.Device)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.DeviceCapabilities))
         DeviceCapabilitiesSerializer.SerializeDeviceCapabilities((Hl7.Fhir.Model.DeviceCapabilities)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.DeviceLog))
         DeviceLogSerializer.SerializeDeviceLog((Hl7.Fhir.Model.DeviceLog)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.DeviceObservation))
         DeviceObservationSerializer.SerializeDeviceObservation((Hl7.Fhir.Model.DeviceObservation)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.DiagnosticOrder))
         DiagnosticOrderSerializer.SerializeDiagnosticOrder((Hl7.Fhir.Model.DiagnosticOrder)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.DiagnosticReport))
         DiagnosticReportSerializer.SerializeDiagnosticReport((Hl7.Fhir.Model.DiagnosticReport)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Document))
         DocumentSerializer.SerializeDocument((Hl7.Fhir.Model.Document)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.DocumentReference))
         DocumentReferenceSerializer.SerializeDocumentReference((Hl7.Fhir.Model.DocumentReference)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Encounter))
         EncounterSerializer.SerializeEncounter((Hl7.Fhir.Model.Encounter)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.FamilyHistory))
         FamilyHistorySerializer.SerializeFamilyHistory((Hl7.Fhir.Model.FamilyHistory)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Group))
         GroupSerializer.SerializeGroup((Hl7.Fhir.Model.Group)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.ImagingStudy))
         ImagingStudySerializer.SerializeImagingStudy((Hl7.Fhir.Model.ImagingStudy)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Immunization))
         ImmunizationSerializer.SerializeImmunization((Hl7.Fhir.Model.Immunization)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.ImmunizationProfile))
         ImmunizationProfileSerializer.SerializeImmunizationProfile((Hl7.Fhir.Model.ImmunizationProfile)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.List))
         ListSerializer.SerializeList((Hl7.Fhir.Model.List)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Location))
         LocationSerializer.SerializeLocation((Hl7.Fhir.Model.Location)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Media))
         MediaSerializer.SerializeMedia((Hl7.Fhir.Model.Media)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Medication))
         MedicationSerializer.SerializeMedication((Hl7.Fhir.Model.Medication)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.MedicationAdministration))
         MedicationAdministrationSerializer.SerializeMedicationAdministration((Hl7.Fhir.Model.MedicationAdministration)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.MedicationDispense))
         MedicationDispenseSerializer.SerializeMedicationDispense((Hl7.Fhir.Model.MedicationDispense)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.MedicationPrescription))
         MedicationPrescriptionSerializer.SerializeMedicationPrescription((Hl7.Fhir.Model.MedicationPrescription)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.MedicationStatement))
         MedicationStatementSerializer.SerializeMedicationStatement((Hl7.Fhir.Model.MedicationStatement)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Message))
         MessageSerializer.SerializeMessage((Hl7.Fhir.Model.Message)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Observation))
         ObservationSerializer.SerializeObservation((Hl7.Fhir.Model.Observation)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.OperationOutcome))
         OperationOutcomeSerializer.SerializeOperationOutcome((Hl7.Fhir.Model.OperationOutcome)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Order))
         OrderSerializer.SerializeOrder((Hl7.Fhir.Model.Order)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.OrderResponse))
         OrderResponseSerializer.SerializeOrderResponse((Hl7.Fhir.Model.OrderResponse)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Organization))
         OrganizationSerializer.SerializeOrganization((Hl7.Fhir.Model.Organization)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Other))
         OtherSerializer.SerializeOther((Hl7.Fhir.Model.Other)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Patient))
         PatientSerializer.SerializePatient((Hl7.Fhir.Model.Patient)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Practitioner))
         PractitionerSerializer.SerializePractitioner((Hl7.Fhir.Model.Practitioner)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Procedure))
         ProcedureSerializer.SerializeProcedure((Hl7.Fhir.Model.Procedure)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Profile))
         ProfileSerializer.SerializeProfile((Hl7.Fhir.Model.Profile)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Provenance))
         ProvenanceSerializer.SerializeProvenance((Hl7.Fhir.Model.Provenance)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Query))
         QuerySerializer.SerializeQuery((Hl7.Fhir.Model.Query)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Questionnaire))
         QuestionnaireSerializer.SerializeQuestionnaire((Hl7.Fhir.Model.Questionnaire)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.RelatedPerson))
         RelatedPersonSerializer.SerializeRelatedPerson((Hl7.Fhir.Model.RelatedPerson)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.SecurityEvent))
         SecurityEventSerializer.SerializeSecurityEvent((Hl7.Fhir.Model.SecurityEvent)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Specimen))
         SpecimenSerializer.SerializeSpecimen((Hl7.Fhir.Model.Specimen)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Substance))
         SubstanceSerializer.SerializeSubstance((Hl7.Fhir.Model.Substance)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.Supply))
         SupplySerializer.SerializeSupply((Hl7.Fhir.Model.Supply)value, writer, summary);
     else if(value.GetType() == typeof(Hl7.Fhir.Model.ValueSet))
         ValueSetSerializer.SerializeValueSet((Hl7.Fhir.Model.ValueSet)value, writer, summary);
//.........这里部分代码省略.........
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:101,代码来源:FhirSerializer.cs

示例4: CloneResource

 private Resource CloneResource(Resource input)
 {
     return (Resource)FhirParser.ParseFromXml(FhirSerializer.SerializeResourceToXml(input), input.GetType());
 }
开发者ID:Condeti,项目名称:spark,代码行数:4,代码来源:IndexService.cs

示例5: IndexResourceRecursively

        private IndexValue IndexResourceRecursively(Resource resource, IKey key, string rootPartName = "root")
        {
            var searchParametersForResource = _fhirModel.FindSearchParameters(resource.GetType());

            if(searchParametersForResource != null)
            {
                var result = new IndexValue(rootPartName);

                AddMetaParts(resource, key, result);

                foreach (var par in searchParametersForResource)
                {
                    var newIndexPart = new IndexValue(par.Code); 
                    foreach (var path in par.GetPropertyPath())
                        _resourceVisitor.VisitByPath(resource,
                            obj => 
                            {
                                if (obj is Element)
                                {
                                    newIndexPart.Values.AddRange(_elementIndexer.Map(obj as Element));
                                }
                            }
                            , path);
                    if (newIndexPart.Values.Any())
                    {
                        result.Values.Add(newIndexPart);
                    }
                }

                if (resource is DomainResource)
                    AddContainedResources((DomainResource)resource, result);

                return result;
            }
            return null;
        }
开发者ID:Condeti,项目名称:spark,代码行数:36,代码来源:IndexService.cs

示例6: GetCollectionNameForResource

        public static string GetCollectionNameForResource(Resource r)
        {
            if (r == null) return null;

            return GetCollectionNameForResource(r.GetType());
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:6,代码来源:ResourceLocation.cs


注:本文中的Hl7.Fhir.Model.Resource.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。