void Create_NoModObservation(ProfileGenerator p) { StructureDefinition profile = CreateObservation("NoModObservation"); SnapshotCreator.Create(profile); p.AddProfile(profile); }
void Create_Fixed(ProfileGenerator p) { StructureDefinition profile = CreateObservation("Fixed"); { ElementDefinition e = profile.Differential.Element.GetOrCreateElement("Observation.identifier"); e.Min = 0; e.Max = "1"; e.Fixed = new Identifier("fixedIdentifierSystem", "fixedIdentifierValue"); } { ElementDefinition e = profile.Differential.Element.GetOrCreateElement("Observation.status"); e.Fixed = new Code("cancelled"); e.Min = 1; e.Max = "1"; } { ElementDefinition e = profile.Differential.Element.GetOrCreateElement("Observation.code"); e.Min = 0; e.Max = "1"; e.Fixed = new CodeableConcept("codeSystem", "codeCode", "codeDisplay", "codeText"); } SnapshotCreator.Create(profile); p.AddProfile(profile); profile.SaveJson($@"c:\Temp\{profile.Name}.json"); }
void Create_CardinalityModObservation(ProfileGenerator p) { StructureDefinition profile = CreateObservation("CardinalityModObservation"); { ElementDefinition e = profile.Differential.Element.GetOrCreateElement("Observation.identifier"); e.Min = 0; e.Max = "1"; }; SnapshotCreator.Create(profile); p.AddProfile(profile); }
void Create_Fixed2(ProfileGenerator p) { StructureDefinition profile = CreateObservation("Fixed2"); { ElementDefinition e = profile.Differential.Element.GetOrCreateElement("Observation.effective[x]"); e.Fixed = new Period(new FhirDateTime(1002, 1, 2), new FhirDateTime(1003, 4, 5)); } { ElementDefinition e = profile.Differential.Element.GetOrCreateElement("Observation.value[x]"); e.Fixed = new FhirBoolean(true); } SnapshotCreator.Create(profile); p.AddProfile(profile); }
void Create_Fixed1(ProfileGenerator p) { StructureDefinition profile = CreateObservation("Fixed1"); { ElementDefinition e = profile.Differential.Element.GetOrCreateElement("Observation.effective[x]"); e.Fixed = new FhirDateTime(1002, 1, 2, 3, 4, 5, new TimeSpan(0)); } { ElementDefinition e = profile.Differential.Element.GetOrCreateElement("Observation.value[x]"); e.Fixed = new Quantity(10, "things", "www.things.com"); } SnapshotCreator.Create(profile); p.AddProfile(profile); }
void Create_SlicedMultiple(ProfileGenerator p) { StructureDefinition profile = CreateObservation("SlicedMultiple"); { ElementDefinition e = profile.Differential.Element.GetOrCreateElement("Observation.component"); e.Slicing = new ElementDefinition.SlicingComponent { ElementId = "ObservationComponentSlice", Ordered = false, Rules = ElementDefinition.SlicingRules.Open }; e.Slicing.Discriminator.Add(new ElementDefinition.DiscriminatorComponent { Type = ElementDefinition.DiscriminatorType.Value, Path = "code" }); } { ElementDefinition e = new ElementDefinition { ElementId = "Observation.component:Slice1", Path = "Observation.component", SliceName = "Slice1" }; profile.Differential.Element.Add(e); } { ElementDefinition e = new ElementDefinition { Path = "Observation.component.code", ElementId = "Observation.component:Slice1.code", Fixed = new CodeableConcept("http://www.test.com/SliceSystem", "Slice1Code") }; profile.Differential.Element.Add(e); } { ElementDefinition e = new ElementDefinition { ElementId = "Observation.component:Slice2", Path = "Observation.component", SliceName = "Slice2" }; profile.Differential.Element.Add(e); } { ElementDefinition e = new ElementDefinition { Path = "Observation.component.code", ElementId = "Observation.component:Slice2.code", Fixed = new CodeableConcept("http://www.test.com/SliceSystem", "Slice2Code") }; profile.Differential.Element.Add(e); } SnapshotCreator.Create(profile); p.AddProfile(profile); profile.SaveJson($@"c:\Temp\SlicedMultiple.json"); }