public App() { Component1 c1 = new Component1(); Component2 c2 = new Component2(); Component3 c3 = new Component3(); Component4 c4 = new Component4(); }
public App() { Component1 c1 = new Component1(); Component2 c2 = new Component2(); Component3 c3 = new Component3(); Window.Require("comp4", delegate() { Component4 c4 = new Component4(); }); }
public App() { Component1 c1 = new Component1(); Component2 c2 = new Component2(); Component3 c3 = new Component3(); Window.Require("comp4", delegate() { Component4 c4 = new Component4(); }); Window.Alert(Templates.DataTemplate); }
protected override void Initialize() { c4_1 = new Component4 { Key = "c41", Value = "c41_value", Description = "c41_description" }; c4_2 = new Component4 { Key = "c42", Value = "c42_value2", Description = "c42_description" }; c3_1 = new Component3 { Str1 = "c31", AuditedComponent = c4_1, NonAuditedComponent = c4_2 }; c3_2 = new Component3 { Str1 = "c32", AuditedComponent = c4_1, NonAuditedComponent = c4_2 }; var ele1 = new EmbeddableListEntity1(); // Revision 1 (ele1: initially 1 element in both collections) using (var tx = Session.BeginTransaction()) { ele1.ComponentList.Add(c3_1); ele1Id = (int)Session.Save(ele1); tx.Commit(); } // Revision (still 1) (ele1: removing non-existing element) using (var tx = Session.BeginTransaction()) { ele1.ComponentList.Remove(c3_2); tx.Commit(); } // Revision 2 (ele1: adding one element) using (var tx = Session.BeginTransaction()) { ele1.ComponentList.Add(c3_2); tx.Commit(); } // Revision 3 (ele1: adding one existing element) using (var tx = Session.BeginTransaction()) { ele1.ComponentList.Add(c3_1); tx.Commit(); } // Revision 4 (ele1: removing one existing element) using (var tx = Session.BeginTransaction()) { ele1.ComponentList.Remove(c3_2); tx.Commit(); } }
protected override void Initialize() { c4_1 = new Component4 { Key = "c41", Value = "c41_value", Description = "c41_description" }; c4_2 = new Component4 { Key = "c42", Value = "c42_value2", Description = "c42_description" }; c3_1 = new Component3 { Str1 = "c31", AuditedComponent = c4_1, NonAuditedComponent = c4_2 }; c3_2 = new Component3 { Str1 = "c32", AuditedComponent = c4_1, NonAuditedComponent = c4_2 }; var eme1 = new EmbeddableMapEntity(); var eme2 = new EmbeddableMapEntity(); // Revision 1 (eme1: initialy empty, eme2: initialy 1 mapping) using (var tx = Session.BeginTransaction()) { eme2.ComponentMap["1"] = c3_1; eme1Id = (int)Session.Save(eme1); eme2Id = (int)Session.Save(eme2); tx.Commit(); } // Revision 2 (eme1: adding 2 mappings, eme2: no changes) using (var tx = Session.BeginTransaction()) { eme1.ComponentMap["1"] = c3_1; eme1.ComponentMap["2"] = c3_2; tx.Commit(); } // Revision 3 (eme1: removing an existing mapping, eme2: replacing a value) using (var tx = Session.BeginTransaction()) { eme1.ComponentMap.Remove("1"); eme2.ComponentMap["1"] = c3_2; tx.Commit(); } // No revision (eme1: removing a non-existing mapping, eme2: replacing with the same value) using (var tx = Session.BeginTransaction()) { eme1.ComponentMap.Remove("3"); eme2.ComponentMap["1"] = c3_2; tx.Commit(); } }
protected override void Initialize() { c4_1 = new Component4 { Key = "c41", Value = "c41_value", Description = "c41_description" }; c4_2 = new Component4 { Key = "c42", Value = "c42_value2", Description = "c42_description" }; c3_1 = new Component3 { Str1 = "c31", AuditedComponent = c4_1, NonAuditedComponent = c4_2 }; c3_2 = new Component3 { Str1 = "c32", AuditedComponent = c4_1, NonAuditedComponent = c4_2 }; var ele1 = new EmbeddableListEntity1 { OtherData = "data", ComponentList = new List <Component3> { c3_1 } }; //Revision 1 (ele1: initially 1 element in both collections) using (var tx = Session.BeginTransaction()) { ele1Id = (int)Session.Save(ele1); tx.Commit(); } //Revision (still 1) (ele1: removing non-existing element) using (var tx = Session.BeginTransaction()) { ele1.ComponentList.Remove(c3_2); tx.Commit(); } //Revision 2 (ele1: updating singular property and removing non-existing element) using (var tx = Session.BeginTransaction()) { ele1.OtherData = "modified"; ele1.ComponentList.Remove(c3_2); tx.Commit(); } // Revision 3 (ele1: adding one element) using (var tx = Session.BeginTransaction()) { ele1.ComponentList.Add(c3_2); tx.Commit(); } // Revision 4 (ele1: adding one existing element) using (var tx = Session.BeginTransaction()) { ele1.ComponentList.Add(c3_1); tx.Commit(); } // Revision 5 (ele1: removing one existing element) using (var tx = Session.BeginTransaction()) { ele1.ComponentList.Remove(c3_2); tx.Commit(); } // Revision 6 (ele1: changing singular property only) using (var tx = Session.BeginTransaction()) { ele1.OtherData = "another modification"; tx.Commit(); } }
private static Organizer MakeOrganizer() { Organizer o = new Organizer(); o.ClassCode = new CS<x_ActClassDocumentEntryOrganizer>(x_ActClassDocumentEntryOrganizer.BATTERY); o.TemplateId = new LIST<II>(); o.TemplateId.Add(new II("2.16.840.1.113883.10.20.22.4.1")); o.Id = new SET<II>(new II(new Guid())); o.Code = new CD<string>( "11579-0", "2.16.840.1.113883.6.1", "LOINC", null, "Thyrotropin [Units/volume] in Serum or Plasma by Detection limit less than or equal to 0.05 mIU/L", null); o.StatusCode = new CS<ActStatus>(ActStatus.Completed); Observation obs = new Observation(); //It automatically adds class code obs.MoodCode = new CS<x_ActMoodDocumentObservation>(x_ActMoodDocumentObservation.Eventoccurrence); obs.TemplateId = new LIST<II>(); obs.TemplateId.Add(new II("2.16.840.1.113883.10.20.22.4.2")); obs.Id = new SET<II>(new II(new Guid())); obs.Code = new CD<string>( "3016-3", "2.16.840.1.113883.6.1", "LOINC", null, "Thyrotropin [Units/volume] in Serum or Plasma", null); obs.Text = new ED(); obs.Text.Reference = new TEL("#result1"); obs.StatusCode = new CS<ActStatus>(ActStatus.Completed); obs.EffectiveTime = new IVL<TS>(); obs.EffectiveTime.Value = new TS(DateTime.Today); obs.Value = new PQ(6m, "mIU/L"); obs.InterpretationCode = new SET<CE<string>>(); obs.InterpretationCode.Add( new CE<string>( "A", "2.16.840.1.113883.5.83", "ObservationInterpretation", null, "abnormal", null)); obs.InterpretationCode.Add( new CE<string>( "H", "2.16.840.1.113883.5.83", "ObservationInterpretation", null, "high", null)); obs.ReferenceRange = new List<ReferenceRange>(); obs.ReferenceRange.Add(new ReferenceRange( new ObservationRange( null, new ED("normal: 0.29–5.11 mIU/L"), null, null))); Component4 comp = new Component4(); comp.SetClinicalStatement(obs); o.Component = new List<Component4>(); o.Component.Add(comp); return o; }