static void Main(string[] args) { Book book1 = new Book(); book1.title = "The Great Gatsby"; book1.numberOfPages = 300; Magazine mag1 = new Magazine(); mag1.title = "Hello"; mag1.numberOfPages = 20; CD cd1 = new CD(); cd1.title = "The Lion King Soundtrack"; cd1.numberOfTracks = 12; ItemsCatalogue myIC = new ItemsCatalogue(); myIC.Add(book1); myIC.Add(mag1); myIC.Add(cd1); Console.WriteLine(myIC.listOfItems.Count); //This is bad as you cannot access any of //the books properties with casting // Book retrievedBook = myIC.listOfItems.First() as Book; //int numberOfPages = retrievedBook.numberOfPages; GenericCatalogue<Book> gIC = new GenericCatalogue<Book>(); gIC.Add(book1); Console.WriteLine(gIC.listOfItems.First().numberOfPages); Console.ReadLine(); }
private void btnRender_Click(object sender, EventArgs e) { // Create an empty CD object. CD<String> cd = new CD<String>(); // Set properties provided by form input. if (!String.IsNullOrEmpty(txtCode.Text)) cd.Code = txtCode.Text; if (!String.IsNullOrEmpty(txtCodeSystem.Text)) cd.CodeSystem = txtCodeSystem.Text; if (!String.IsNullOrEmpty(txtCodeSystemName.Text)) cd.CodeSystemName = txtCodeSystemName.Text; if (!String.IsNullOrEmpty(txtCodeSystemVersion.Text)) cd.CodeSystemVersion = txtCodeSystemVersion.Text; if (!String.IsNullOrEmpty(txtDisplayName.Text)) cd.DisplayName = txtDisplayName.Text; if (!String.IsNullOrEmpty(txtOriginalText.Text)) cd.OriginalText = txtOriginalText.Text; // Get the CD in XML format using the FormatterHelper class. string cdXmlStr = FormatterHelper.FormatDataType(cd, "CD"); // Display the generated xml. txtXml.Text = cdXmlStr; }
public Program() { Computer comp = new Computer(); comp = new Disk( comp ); comp = new Monitor( comp ); comp = new CD( comp ); comp = new CD( comp ); Console.WriteLine( comp.Description() ); }
public object OnCD(ISession session, CD e) { try { "{0} CD {1}".Log4Info(session.Channel.EndPoint, e.Name); List<Resource> result = new List<Resource>(); CurrentFolder folder = GetFolder(session); if (e.Name == @"\") { folder.Root(); } else if (e.Name == "..") { folder.Previous(); } else if (!string.IsNullOrEmpty(e.Name)) { string name = folder.Path + e.Name; if (System.IO.Directory.Exists(name)) folder.Add(e.Name); } else { } if (folder.SubFolder) { result.Add(new Resource { Name = @"\", Type = ResourceType.Folder }); result.Add(new Resource { Name = @"..", Type = ResourceType.Folder }); } foreach (string f in System.IO.Directory.GetDirectories(folder.Path)) { System.IO.DirectoryInfo info = new System.IO.DirectoryInfo(f); result.Add(new Resource { Name = info.Name, Type = ResourceType.Folder }); } foreach (string f in System.IO.Directory.GetFiles(folder.Path)) { System.IO.FileInfo info = new System.IO.FileInfo(f); result.Add(new Resource { Name = info.Name, Type = ResourceType.File, Size = ((double)info.Length / (double)1024).ToString("0.00/KB") }); } return result; } catch (Exception e_) { return new Error { Message = e_.Message }; } }
public void UpdateEventTest() { int oldCollectionSize = data.events.Count; int randomIndex = new Random().Next(0, oldCollectionSize - 1); CD cd = new CD() { id = 1234, title = "Nevermind", group = "Nirvana" }; CDState cdState = new CDState() { cd = cd, dateOfPurchase = new DateTimeOffset(new DateTime(2013, 11, 03)) }; Customer customer = new Customer() { name = "Kamil", surname = "Filipczak", emailAddress = "*****@*****.**", age = 51 }; Event evt = new Event() { cdState = cdState, customer = customer }; dataRepository.UpdateEvent(randomIndex, evt); int newCollectionSize = data.events.Count; //check if number of events is not changed Assert.AreEqual(oldCollectionSize, newCollectionSize); //check if properties are the same Assert.AreEqual(evt.cdState, data.events[randomIndex].cdState); Assert.AreEqual(evt.customer, data.events[randomIndex].customer); }
public List <PatientAllergies> FillAllergies(IEntryCollection entryCollection) { List <PatientAllergies> alleryies = new List <PatientAllergies>(); foreach (IEntry entryitem in entryCollection) { IAct entryact = entryitem.AsAct; IEntryRelationship entryRelationship = entryact.EntryRelationship[0]; IObservation entryobservation = entryRelationship.AsObservation; IIVL_TS effectivetime = entryact.EffectiveTime; IParticipant2 allergyParticipant = entryobservation.Participant[0]; IParticipantRole participantRole = allergyParticipant.ParticipantRole; IPlayingEntity playingEntity = participantRole.AsPlayingEntity; ICE code = playingEntity.Code; IPNCollection name = playingEntity.Name; string substance = name != null && name.Count() > 0 ? name[0].Text : code.DisplayName; PatientAllergies ptallergies = new PatientAllergies(); ptallergies.substance = substance; IEntryRelationship entryRelationshipMFST = entryobservation.EntryRelationship.Where(r => r.TypeCode.ToString() == "MFST").FirstOrDefault(); if (entryRelationshipMFST != null && entryRelationshipMFST.AsObservation.Value != null) { IANY Reactionvaluecollection = entryRelationshipMFST.AsObservation.Value.FirstOrDefault(); CD valuesReaction = (CD)Reactionvaluecollection; ptallergies.reaction = valuesReaction.DisplayName; } ptallergies.rxNorm = code.Code; IEntryRelationship entryRelationshipSUBJ = entryobservation.EntryRelationship.Where(r => r.TypeCode.ToString() == "SUBJ").FirstOrDefault(); if (entryRelationshipSUBJ != null && entryRelationshipSUBJ.AsObservation.Value != null) { IANY Statusvaluecollection = entryRelationshipSUBJ.AsObservation.Value.FirstOrDefault(); ICE values = (ICE)Statusvaluecollection; ptallergies.status = values.DisplayName; } if (effectivetime != null && effectivetime.Value != null) { ptallergies.allergyDate = effectivetime.AsDateTime.ToString(); } alleryies.Add(ptallergies); } return(alleryies); }
public void AddCDStateNegativeTest() { int oldListSize = data.cdStates.Count; CD cd = new CD() { id = 1234, title = "Nevermind", group = "Nirvana" }; service.AddCDState(cd); int newListSize = data.cdStates.Count; //check if size of new and old collection is different Assert.AreEqual(oldListSize, newListSize); //check if collection contains added event Assert.IsFalse(data.cdStates.Any(x => x.cd.Equals(cd))); }
public CD readByID(int id) // needs id parameter? can't read by id if you don't supply an id... { int readId = id; if (!cdlist.Exists(x => x.id == readId)) // if id does not exist, create a throwaway object { // verifies deletion CD temp = new CD(); return(temp); } for (int i = 0; i < cdlist.Count; i++) { if (cdlist[i].id == readId) { return(cdlist[i]); } } return(cdlist[0]); // returns default value }
public virtual void TestParseMaximumValidTranslation() { XmlNode node = CreateNode("<something code=\"BARNEY\" codeSystem=\"1.2.3.4.5\">" + "<translation code=\"FRED\" codeSystem=\"1.2.3.4.5\" />" + "<translation code=\"WILMA\" codeSystem=\"1.2.3.4.5\" />" + "<translation code=\"BETTY\" codeSystem=\"1.2.3.4.5\" />" + "<translation code=\"BAM_BAM\" codeSystem=\"1.2.3.4.5\" />" + "<translation code=\"FRED\" codeSystem=\"1.2.3.4.5\" />" + "<translation code=\"WILMA\" codeSystem=\"1.2.3.4.5\" />" + "<translation code=\"BETTY\" codeSystem=\"1.2.3.4.5\" />" + "<translation code=\"BAM_BAM\" codeSystem=\"1.2.3.4.5\" />" + "<translation code=\"FRED\" codeSystem=\"1.2.3.4.5\" />" + "<translation code=\"WILMA\" codeSystem=\"1.2.3.4.5\" /></something>"); CD cd = (CD)this.parser.Parse(ParseContextImpl.Create("CD", typeof(MockCharacters), SpecificationVersion.V02R02, null, null , Ca.Infoway.Messagebuilder.Xml.ConformanceLevel.OPTIONAL, null, null, false), node, this.xmlResult); Assert.IsTrue(this.xmlResult.IsValid()); Assert.IsNotNull(cd.Value, "main enum found"); Assert.IsFalse(cd.Translations.IsEmpty(), "translation enums found"); Assert.IsTrue(cd.Translations.Count == 10, "translation enums found"); Assert.AreEqual(0, this.xmlResult.GetHl7Errors().Count, "error message count"); Assert.AreEqual("BARNEY", cd.Value.CodeValue, "main code"); Assert.AreEqual("FRED", cd.Translations[0].Value.CodeValue, "translation"); Assert.AreEqual("WILMA", cd.Translations[9].Value.CodeValue, "translation"); }
public Encounter() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.id = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.code = new CDImpl(); this.text = new EDImpl <EncapsulatedData>(); this.statusCode = new CSImpl(); this.effectiveTime = new IVLTSCDAR1Impl(); this.dischargeDispositionCode = new CEImpl(); this.priorityCode = new CEImpl(); this.specimen = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Specimen>(); this.performer = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Performer2_1>(); this.author = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Author_1>(); this.informant = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Informant12>(); this.participant = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Encounteractivities.IParticipant2Choice>(); this.entryRelationship = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Encounteractivities.IEntryRelationshipChoice>(); this.reference = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Reference>(); this.precondition = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Precondition>(); }
public void CDCodeCodeSystemCodeSystemNameDisplayNameTranslationTest() { CD <String> cd = new CD <String>(); cd.Code = "284196006"; cd.CodeSystem = "2.16.840.1.113883.6.96"; cd.CodeSystemName = "SNOMED CT"; cd.DisplayName = "Burn of skin"; cd.NullFlavor = null; cd.Translation = new SET <CD <string> >(); cd.Translation.Add( new CD <string>() { Code = "15376812", CodeSystem = "2.16.840.1.113883.3.232.99.1", CodeSystemName = "3M HDD", DisplayName = "BurnOfSkinSCT", }); Assert.IsTrue(cd.Validate()); }
public void AddItem_AssociatesItemWithCategory_ArtistList() { //Arrange string description = "Walk the dog."; Artist newArtist = new Artist(description); List <Artist> newList = new List <Artist> { newArtist }; string name = "Work"; CD newCD = new CD(name); newCD.AddArtist(newArtist); //Act List <Artist> result = newCD.GetArtist(); //Assert CollectionAssert.AreEqual(newList, result); }
private string GetTrackTitleText(CD cd, Track track) { string text = ""; if (cd.Sampler) { text = string.Format("{0}. {1} - {2}", track.TrackNumber, track.Artist, track.Title); } else { text = string.Format("{0}. {1}", track.TrackNumber, track.Title); } if (track.Length > 0) { text += string.Format(" [{0}]", Misc.GetShortTimeString(track.Length)); } return(text); }
// Use this for initialization void Start() { Hardware = GameObject.Find("Hardware"); Puter = GameObject.Find("System"); cd = GetComponent <CD>(); com = Puter.GetComponent <Computer>(); clk = Puter.GetComponent <Clock>(); boot = Puter.GetComponent <Boot>(); os = Puter.GetComponent <OS>(); sc = Puter.GetComponent <SoundControl>(); def = Puter.GetComponent <Defalt>(); hcf = Hardware.GetComponent <HardwareCFile>(); if (Game == true) { native_height = Customize.cust.native_height; native_width = Customize.cust.native_width; } AfterStart(); }
public async Task <IActionResult> Editar(int id, CD cd) { if (id != cd.Id) { return(BadRequest()); } try { await _cdService.UpdateAsync(cd); return(RedirectToAction(nameof(Index))); } catch (NotFoundException e) { return(NotFound()); } catch (DbConcurrencyException) { return(BadRequest()); } }
public Act() { this.negationInd = new BLImpl(); this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.id = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.code = new CDImpl(); this.text = new EDImpl <EncapsulatedData>(); this.effectiveTime = new IVLTSCDAR1Impl(); this.priorityCode = new CEImpl(); this.languageCode = new CSImpl(); this.specimen = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Specimen>(); this.performer = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Performer2_1>(); this.author = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Author_1>(); this.informant = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Informant12>(); this.participant = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Participant2_2>(); this.entryRelationship = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.EntryRelationship_2>(); this.reference = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Reference>(); this.precondition = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Precondition>(); }
public HomeModule() { Get["/"] = _ => { List <CD> allCDs = CD.GetAll(); return(View["index.cshtml", allCDs]); }; Post["/"] = _ => { string artist = Request.Form["artist-name"]; string albumTitle = Request.Form["album-title"]; if (artist != "" & albumTitle != "") { CD newCD = new CD(artist, albumTitle); List <CD> allCDs = CD.GetAll(); return(View["index.cshtml", allCDs]); } else { return(View["new_cd_form.cshtml"]); } }; Get["/CD/new"] = _ => { return(View["new_cd_form.cshtml"]); }; Get["/CD/{id}"] = parameters => { return(View["album.cshtml", CD.Find(int.Parse(parameters.id))]); }; Get["/CD/search"] = _ => { return(View["search_by_artist.cshtml"]); }; Post["/CD/search_results"] = _ => { string searchArtistName = Request.Form["artist-name"]; List <Artist> matchingArtists = Artist.GetMatchingArtists(searchArtistName); return(View["search_results.cshtml", matchingArtists]); }; }
private void EditTrackField(int column, Field field, MyMusicListItem musicItem) { #if false int cdId = DataBase.GetCDIDByTrackID(musicItem.ID); CD cd = DataBase.GetCDById(cdId); int trackIndex = cd.FindTrackIndexByTrackID(musicItem.ID); object newValue = musicItem.Items[column]; if (FieldHelper.IsCDField(field)) { cd.SetValueToField(field, newValue); } else { cd.SetTrackValueToField(trackIndex, field, newValue); } //cd.Save(DataBase, cd.Tracks[trackIndex]); Big3.Hitbase.SoundEngine.SoundFileInformation.WriteMP3Tags(cd, musicItem.ID); Big3.Hitbase.SoundFilesManagement.SynchronizeCatalogWorker.Instance.ScanFile(cd.Tracks[trackIndex].Soundfile); #endif SoundFileInformation sfi = SoundFileInformation.GetSoundFileInformation(musicItem.Soundfile); object newValue = musicItem.Items[column]; if (newValue != null) { sfi.SetField(field, newValue.ToString()); } else { sfi.SetField(field, ""); } Big3.Hitbase.SoundEngine.SoundFileInformation.WriteMP3Tags(sfi, field); Big3.Hitbase.SoundFilesManagement.SynchronizeCatalogWorker.Instance.ScanFile(musicItem.Soundfile); }
public static PullSoundStreamBase CreateFileStream(string filename, int tracknumber, bool preScan, List <KeyValuePair <string, object> > tag) { Logger.Log(String.Format("Trying to open file {0}", filename)); filename = filename.Trim(); PullSoundStreamBase self; if (Path.GetExtension(filename).ToUpper() == ".CUE") { // case for CUE sheet CD cd = CUEReader.ReadFromFile(filename, false); self = CreateStreamCue(cd.tracks[tracknumber - 1], preScan); } else { self = CreateFileStreamPrimitive(filename, preScan); // case for Internal CUESheet if (tracknumber > 0) { if (tag == null) { tag = Tags.MetaTag.readTagByFilename(filename, false); } if (tag == null) { throw new FormatException(); } KeyValuePair <string, object> cue = tag.Find((match) => match.Key == "CUESHEET"); if (cue.Key != null) { CD cd = CUEReader.ReadFromString(cue.Value.ToString(), filename, false); self = ApplyTrackRange(self, cd.tracks[tracknumber - 1]); } } } return(self); }
public void AddCDNegativeTest() { int oldDictSize = data.cds.Count; CD cd = new CD() { id = 1526, title = "Nevermind", group = "Nirvana" }; service.AddCD(cd); int newDictSize = data.cds.Count; //check if size of new and old dictionary is the same Assert.AreEqual(oldDictSize, newDictSize); //check if dictionary data is not changed Assert.AreNotEqual(data.cds[1526].group, cd.group); Assert.AreNotEqual(data.cds[1526].title, cd.title); }
public Supply() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.id = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.code = new CDImpl(); this.text = new EDImpl <EncapsulatedData>(); this.statusCode = new CSImpl(); this.effectiveTime = new LISTImpl <SXCMTSCDAR1, MbDate>(typeof(SXCMTSCDAR1Impl)); this.priorityCode = new LISTImpl <CE, Code>(typeof(CEImpl)); this.repeatNumber = new IVLImpl <INT, Interval <int?> >(); this.independentInd = new BLImpl(); this.quantity = new PQImpl(); this.expectedUseTime = new IVLTSCDAR1Impl(); this.specimen = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Specimen>(); this.performer = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Performer2_1>(); this.informant = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Informant12>(); this.participant = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Participant2_2>(); this.reference = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Reference>(); this.precondition = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Precondition>(); }
public Encounter() { this.classCode = new CSImpl(); this.moodCode = new CSImpl(); this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.id = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.code = new CDImpl(); this.text = new EDImpl <EncapsulatedData>(); this.statusCode = new CSImpl(); this.effectiveTime = new IVLTSCDAR1Impl(); this.priorityCode = new CEImpl(); this.specimen = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Basemodel.Specimen>(); this.performer = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Merged.Performer2>(); this.author = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Basemodel.Author>(); this.informant = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Merged.Informant12>(); this.participant = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Merged.Participant2>(); this.entryRelationship = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Basemodel.EntryRelationship>(); this.reference = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Basemodel.Reference>(); this.precondition = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Basemodel.Precondition>(); }
public void Dispose() { if (!disposed) { if (AttachedCore != this) { throw new Exception(); } if (SaveRamModified) { _disposedSaveRam = CloneSaveRam(); } KillMemCallbacks(); if (CD != null) { CD.Dispose(); } AttachedCore = null; disposed = true; } }
public static hgRect CalcRectwScan(List <CD> list, CD add, Vector3 ileftBase) //for wordwrap { hgRect r = new hgRect(); Vector3 leftBase = ileftBase; for (int i = 0; i < list.Count; i++) { CD.GetNextRightVertexUV(list, i, null, ref leftBase, -1); r.Sample(list[i].outer_v); } if (add != null) { List <CD> tlist = new List <CD>(); tlist.Add(add); CD.GetNextRightVertexUV(tlist, 0, null, ref leftBase, -1); r.Sample(add.outer_v); } return(r); }
public void AddCDTest() { int oldDictSize = data.cds.Count; CD cd = new CD() { id = 1234, title = "Nevermind", group = "Nirvana" }; dataRepository.AddCD(cd); int newDictSize = data.cds.Count; //check if size of new and old dictionary is different Assert.AreNotEqual(oldDictSize, newDictSize); //check if dictionary contains object Assert.IsTrue(data.cds.ContainsKey(1234)); Assert.IsTrue(data.cds.ContainsValue(cd)); }
private string GetCoverFilename() { string filename; if (CoverType == CoverType.PersonGroup) { filename = Misc.GetCDCoverFilename(Misc.FilterFilenameChars(PersonGroup.Name) + ".jpg"); } else { if (CD != null) { filename = CD.GetCDCoverFilename(CoverType); } else { filename = Big3.Hitbase.DataBaseEngine.CD.GetCDCoverFilename(Artist, Title, CoverType); } } return(filename); }
public void UpdateCDTest() { CD cd = new CD() { id = 1526, title = "Nevermind", group = "Nirvana" }; int oldDictSize = data.cds.Count; dataRepository.UpdateCD(cd.id, cd); //check if number of cds is not changed Assert.AreEqual(oldDictSize, data.cds.Count); //check if properties are the same Assert.AreEqual(cd.id, data.cds[cd.id].id); Assert.AreEqual(cd.title, data.cds[cd.id].title); Assert.AreEqual(cd.group, data.cds[cd.id].group); }
//private SqlConnection _con; //ADICIONAR CD public bool AdicionarCD(CD cdobj) { banco.ConexaoSQL(); //testeConexao.AbrirConexao(); int i; using (SqlCommand command = new SqlCommand("IncluirCD", banco._con)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@Nome", cdobj.Nome); command.Parameters.AddWithValue("@Autor", cdobj.Autor); command.Parameters.AddWithValue("@Data_Criacao", cdobj.Data_Criacao); banco._con.Open(); i = command.ExecuteNonQuery(); } banco._con.Close(); return(i >= 1); }
public Prescription() { this.id = new IIImpl(); this.code = new CDImpl(); this.statusCode = new CSImpl(); this.confidentialityCode = new CVImpl(); this.definitionSubstanceAdministrationDefinition = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_4.Pharmacy.Merged.Protocols>(); this.reason = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_4.Pharmacy.Merged.PrescribedBecauseOf>(); this.preconditionVerificationEventCriterion = new BLImpl(false); this.derivedFromSourceDispense = new BLImpl(false); this.coverageCoverage = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_4.Pharmacy.Merged.CoverageExtensions_2>(); this.pertinentInformationQuantityObservationEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_4.Pharmacy.Merged.PrescriptionPatientMeasurements>(); this.component1DosageInstruction = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_4.Pharmacy.Porx_mt980040ca.AdministrationInstructions>(); this.fulfillment1MedicationDispense = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_4.Pharmacy.Merged.PrescriptionDispenses>(); this.subjectOf1DetectedIssueEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_4.Pharmacy.Porx_mt980030ca.Issues>(); this.subjectOf2DetectedIssueIndicator = new BLImpl(false); this.subjectOf3Annotation = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_4.Common.Coct_mt120600ca.Notes>(); this.subjectOf4AnnotationIndicator = new BLImpl(false); this.subjectOf6ControlActEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_4.Pharmacy.Merged.StatusChanges>(); this.subjectOf7RefusalToFill = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_4.Pharmacy.Merged.RefusalToFills>(); }
void RunCD(CD cd) { cd.CountLeft--; cd.CountElapsed++; if (cd.OnCd != null) { if (cd.IsCountDown) { cd.OnCd(cd.CountLeft, cd.Id); } else { cd.OnCd(cd.CountElapsed, cd.Id); } } if (cd.CountLeft <= 0) { RemoveCD(cd); } }
public static void Main() { ICatálogoLivro ctlv = (ICatálogoLivro) new CatálogoManager(); ICatálogo c = (ICatálogo)ctlv; string[] lista = c.Listar(Item.Livro); int idx = new Random().Next(0, CatálogoManager.NúmeroDeLivros - 1); Livro livro = ctlv.ObterInfo(lista[idx]); Console.WriteLine("{0} - {1}", livro.Título, livro.Autor); lista = c.Listar(Item.CD); ICatálogoCD ctcd = (ICatálogoCD)c; idx = new Random().Next(0, CatálogoManager.NúmeroDeCDs - 1); CD cd = ctcd.ObterInfo(lista[idx]); Console.WriteLine("{0} - {1}", cd.Título, cd.Banda); }
public QueryDefinition() { this.amendedSinceDateTimeValue = new TSImpl(); this.careCompositionIdValue = new List <II>(); this.careCompositionTypeValue = new List <CV>(); this.eHRRepositoryIdValue = new IIImpl(); this.effectiveTimeRangeValue = new IVLImpl <TS, Interval <PlatformDate> >(); this.eventCategoryValue = new List <CV>(); this.eventLocationIdValue = new IIImpl(); this.eventLocationTypeValue = new CVImpl(); this.healthConditionValue = new List <CD>(); this.includeNotesIndicatorValue = new BLImpl(); this.indicationValue = new CDImpl(); this.mostRecentByTypeIndicatorValue = new BLImpl(); this.protocolIdValue = new List <II>(); this.recordIdValue = new List <II>(); this.recordTypeValue = new List <CD>(); this.requestingProviderIdValue = new IIImpl(); this.responsibleProviderIdValue = new IIImpl(); this.responsibleProviderTypeValue = new CVImpl(); }
public void AddEventTest() { int oldListSize = data.events.Count; CD cd = new CD() { id = 1234, title = "Nevermind", group = "Nirvana" }; CDState cdState = new CDState() { cd = cd, dateOfPurchase = new DateTimeOffset(new DateTime(2013, 11, 03)) }; Customer customer = new Customer() { name = "Kamil", surname = "Filipczak", emailAddress = "*****@*****.**", age = 51 }; Event evt = new Event() { cdState = cdState, customer = customer }; dataRepository.AddEvent(evt); int newListSize = data.events.Count; //check if size of new and old collection is different Assert.AreNotEqual(oldListSize, newListSize); //check if collection contains added event Assert.IsTrue(data.events.Contains(evt)); }
//出卡 async private void putCardOut() { updateTitle(); string error = null; Loading.show1("正在激活社保卡,请稍候..."); await TaskMore.Run(new Action(() => { //激活 error = WeiWang.setStart(ssid); //打印凭条 List <string> printDatas = new List <string>(); printDatas.Add(" 肇庆市社会保障卡业务回执单"); printDatas.Add("业务类型:自助换卡"); printDatas.Add("交易流水号:" + serialNumber); printDatas.Add("终端名称:" + deviceMsg["data"]["deviceName"].ToString()); printDatas.Add("终端编号:" + deviceMsg["data"]["deviceId"].ToString()); printDatas.Add("所属区域:" + deviceMsg["data"]["areaName"].ToString()); printDatas.Add("所属网点:" + deviceMsg["data"]["branch"].ToString()); printDatas.Add("网点编号:" + deviceMsg["data"]["orgCode"].ToString()); printDatas.Add("交易时间:" + System.DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss")); printDatas.Add("交易结果:换卡成功"); printDatas.Add("卡号:" + CD.hidenBankNum(bankcarNum)); printDatas.Add("领卡人:" + CD.hidenName(ReadIDCar.name)); Print.print(printDatas); //出卡 MS2.PutCardOut(); })).ConfigureAwait(true); if (error != null) { ShowTip.show(false, null, "社保卡激活失败:" + error); } I_GetSSCar_old getSSCar = I_GetSSCar_old.getObject(); getSSCar.Goin(); BackExit.LetNextClickToMain(); CD.business1.showBackAndExitBtn(); }
public void CDCastCDtoStringTest() { CD<String>CDtoString = new CD<String>(); CDtoString.Code = "TEST"; // Test passes if the string representation of the CD<String>is "TEST" Assert.AreEqual("TEST", (string)CDtoString); }
public void CDCastStringToCDTest() { CD<String> StringToCD = new CD<String>(); // Cast a string to the CD. StringToCD = "TEST"; // Test passes if the Code attribute of the CD<String>is the same as the string it was passed. Assert.AreEqual("TEST", StringToCD.Code.ToString()); }
public void CDCodeQualifierTest() { CD<String> cd = new CD<String>(); cd.Code = null; CR<String> severity = new CR<String>(); severity.Name = new CD<string>(); severity.Value = new CD<string>(); severity.Name.Code = "23543256"; severity.Name.CodeSystem = "13.21.432.45"; severity.Value.Code = "2345235"; severity.Value.CodeSystem = "23.132532.532"; cd.Qualifier = new LIST<CR<string>>(); cd.Qualifier.Add(severity); Assert.IsFalse(cd.Validate()); }
public void CDContentDifferentEqualityTest() { CD<String> a = new CD<string>( "12345", "1.2.3.4.5.6", "Dummy Code System", "2011" ), b = new CD<String>( "12345", "1.2.3.4.5.7", "Dummy Code System", "2011" ); Assert.IsFalse(a.Equals(b)); b.Code = "12346"; b.CodeSystem = "1.2.3.4.5"; Assert.IsFalse(a.Equals(b)); }
public void R2CDSimpleCodeParseTest() { var cdi = new CD<String>("784.0", "2.16.840.1.113883.6.42", "ICD-9", null, new ST("Headache"), new ED("gen. headache")); string actualXml = R2SerializationHelper.SerializeAsString(cdi); var cd2 = R2SerializationHelper.ParseString<CD<String>>(actualXml); Assert.AreEqual(cdi, cd2); }
public void CDNullFlavorTranslationTest() { CD<String> cd = new CD<String>(); cd.NullFlavor = MARC.Everest.DataTypes.NullFlavor.NoInformation; cd.Translation = new SET<CD<string>>(); cd.Translation.Add( new CD<string>() { Code = "15376812", CodeSystem = "2.16.840.1.113883.3.232.99.1", CodeSystemName = "3M HDD", DisplayName = "BurnOfSkinSCT", }); Assert.IsFalse(cd.Validate()); }
public void CDNullFlavorTest() { CD<String> cd = new CD<String>(); cd.Code = null; cd.CodeSystem = null; cd.CodeSystemName = null; cd.DisplayName = null; cd.NullFlavor = MARC.Everest.DataTypes.NullFlavor.NoInformation; Assert.IsTrue(cd.Validate()); }
public void CDCodeSystemTest() { CD<String> cd = new CD<String>(); cd.Code = null; cd.CodeSystem = "2.16.840.1.113883.6.96"; cd.CodeSystemName = null; cd.DisplayName = null; cd.NullFlavor = null; Assert.IsFalse(cd.Validate()); }
public void CDCodeSystemNameCodeTest() { CD<String> cd = new CD<String>(); cd.Code = "284196006"; cd.CodeSystem = null; cd.CodeSystemName = "SNOMED CT"; cd.DisplayName = null; cd.NullFlavor = null; Assert.IsFalse(cd.Validate()); }
public void CDDisplayNameTest() { CD<String> cd = new CD<String>(); cd.Code = null; cd.CodeSystem = null; cd.CodeSystemName = null; cd.DisplayName = "Burn of skin"; cd.NullFlavor = null; Assert.IsFalse(cd.Validate()); }
public void CDCodeCodeSystemCodeSystemNameDisplayNameNullFlavorTest() { CD<String> cd = new CD<String>(); cd.Code = "284196006"; cd.CodeSystem = "2.16.840.1.113883.6.96"; cd.CodeSystemName = "SNOMED CT"; cd.DisplayName = "Burn of skin"; cd.NullFlavor = MARC.Everest.DataTypes.NullFlavor.NoInformation; Assert.IsFalse(cd.Validate()); }
public void CDCodeCodeSystemCodeSystemNameDisplayNameTest() { CD<String> cd = new CD<String>(); cd.Code = "284196006"; cd.CodeSystem = "2.16.840.1.113883.6.96"; cd.CodeSystemName = "SNOMED CT"; cd.DisplayName = "Burn of skin"; cd.NullFlavor = null; Assert.IsTrue(cd.Validate()); }
public void CDParseCDofTTest() { CD<MARC.Everest.DataTypes.NullFlavor> parseCD= new CD<MARC.Everest.DataTypes.NullFlavor>(); // Set the Code to NullFlavor.NoInformation, and add a qualifier and a translation. parseCD.Code = MARC.Everest.DataTypes.NullFlavor.NoInformation; parseCD.Qualifier = new LIST<CR<MARC.Everest.DataTypes.NullFlavor>>() { new CR<MARC.Everest.DataTypes.NullFlavor>() { Name = new CV<MARC.Everest.DataTypes.NullFlavor>(MARC.Everest.DataTypes.NullFlavor.NotApplicable) } }; parseCD.Translation = new SET<CD<MARC.Everest.DataTypes.NullFlavor>>(CD<MARC.Everest.DataTypes.NullFlavor>.Comparator) { new CD<MARC.Everest.DataTypes.NullFlavor>(MARC.Everest.DataTypes.NullFlavor.NotAsked) }; // Parse the CD<NullFlavor> into a CD. CD<String> result = Util.FromWireFormat(parseCD, typeof(CD<String> )) as CD<String>; // The test passes if the parsed CD<String>has a code of "NI", 1 qualifier and 1 Translation. Assert.AreEqual("NI", result.Code.ToString()); Assert.AreEqual(1, parseCD.Qualifier.Count); Assert.AreEqual(1, parseCD.Translation.Count); }
public void CDCodeCodeSystemCodeSystemNameDisplayNameTranslationTest() { CD<String> cd = new CD<String>(); cd.Code = "284196006"; cd.CodeSystem = "2.16.840.1.113883.6.96"; cd.CodeSystemName = "SNOMED CT"; cd.DisplayName = "Burn of skin"; cd.NullFlavor = null; cd.Translation = new SET<CD<string>>(); cd.Translation.Add( new CD<string>() { Code = "15376812", CodeSystem = "2.16.840.1.113883.3.232.99.1", CodeSystemName = "3M HDD", DisplayName = "BurnOfSkinSCT", }); Assert.IsTrue(cd.Validate()); }
public void CDCastCDtoCDofTTest() { CD<String>castCD = new CD<String>(); CD<MARC.Everest.DataTypes.NullFlavor> test = new CD<MARC.Everest.DataTypes.NullFlavor>(); castCD.Code = "NI"; // Cast CD<String>to CD<NullFlavor>. This should translate "NI" to NullFlavor.NoInformation. test = Util.Convert<CD<NullFlavor>>(castCD); // The test passes if the Code attribute of the CD<NullFlavor> is the same as NullFlavor.NoInformation. Assert.AreEqual(MARC.Everest.DataTypes.NullFlavor.NoInformation, (NullFlavor)test.Code); }
public void CDTypeMismatchEqualityTest() { CD<NullFlavor> a = new CD<NullFlavor>( NullFlavor.NotApplicable, "1.2.3.4.5.6", "Dummy Code System", "2011" ); Assert.IsFalse(a.Equals("12345")); }
public void R2CDQualifierNestedCodeSerializationTest() { string expectedXml = @"<test xmlns=""urn:hl7-org:v3"" code=""64572001:{116676008=72704001,363698007=(12611008:272741003=7771000)}"" codeSystem=""2.16.840.1.113883.6.96"" codeSystemName=""Snomed-CT""><originalText value=""Some original text""/></test>"; var cdi = new CD<String>("64572001", "2.16.840.1.113883.6.96", "Snomed-CT", null, new ST("disease"), new ED("Some original text")); cdi.Qualifier = new LIST<CR<string>>(); cdi.Qualifier.Add(new CR<string>( new CV<String>("116676008", "2.16.840.1.113883.6.96", "SNOMED-CT", null, "associated morphology", null), new CD<String>("72704001", "2.16.840.1.113883.6.96", "SNOMED-CT", null, "fracture", null) )); cdi.Qualifier.Add(new CR<String>( new CV<String>("363698007", "2.16.840.1.113883.6.96", "SNOMED-CT", null, "finding site", null), new CD<String>("12611008", "2.16.840.1.113883.6.96", "SNOMED-CT", null, "bone structure of tibia", null) { Qualifier = LIST<CR<String>>.CreateList( new CR<String>( new CV<String>("272741003","2.16.840.1.113883.6.96", "SNOMED-CT", null, "laterality", null), new CD<String>("7771000","2.16.840.1.113883.6.96", "SNOMED-CT", null, "left", null) ) ) } )); string actualXml = R2SerializationHelper.SerializeAsString(cdi); R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml); }
public void SetSectionCode(String codeSystemValue, String codeValue, String displayNameValue) { code = new CD<string>(codeValue, codeSystemValue, null, null, displayNameValue, null); code.OriginalText = null; }
public void R2CDNullFlavorTranslationSerializationTest() { string expectedXml = @"<test xmlns=""urn:hl7-org:v3"" nullFlavor=""OTH"" codeSystem=""2.16.840.1.113883.6.96""><originalText value=""Burnt ear with iron. Burnt other ear calling for ambulance""/><translation code=""burn"" codeSystem=""2.16.840.1.113883.19.5.2""/></test>"; var cdi = new CD<String>(null, "2.16.840.1.113883.6.96") { NullFlavor = NullFlavor.Other, OriginalText = new ED("Burnt ear with iron. Burnt other ear calling for ambulance"), Translation = SET<CD<String>>.CreateSET( new CD<String>("burn", "2.16.840.1.113883.19.5.2") ) }; string actualXml = R2SerializationHelper.SerializeAsString(cdi); R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml); }
public void R2CDQualifierCodeParseTest() { var cdi = new CD<String>("128045006", "2.16.840.1.113883.6.96", "SNOMED-CT", null, null, new ED("Cellulitis of the foot")); cdi.Qualifier = new LIST<CR<string>>(); cdi.Qualifier.Add(new CR<string>( new CV<String>("363698007", "2.16.840.1.113883.6.96", "SNOMED-CT", null, null, null), new CD<String>("56459004", "2.16.840.1.113883.6.96", "SNOMED-CT", null, null, null) )); string actualXml = R2SerializationHelper.SerializeAsString(cdi); var cd2 = R2SerializationHelper.ParseString<CD<String>>(actualXml); Assert.AreEqual(cdi, cd2); }
public void CDTranslationTranslationTest() { CD<String> cd = new CD<String>(); cd.Code = "284196006"; cd.CodeSystem = "2.16.840.1.113883.6.96"; cd.CodeSystemName = "SNOMED CT"; cd.DisplayName = "Burn of skin"; cd.NullFlavor = null; cd.Translation = new SET<CD<string>>(); cd.Translation.Add( new CD<string>() { Code = "15376812", CodeSystem = "2.16.840.1.113883.3.232.99.1", CodeSystemName = "3M HDD", DisplayName = "BurnOfSkinSCT", NullFlavor = null, Translation = new SET<CD<string>>( new CD<string>() { Code = "284196006", CodeSystem = "2.16.840.1.113883.6.96", CodeSystemName = "SNOMED CT", DisplayName = "Burn of skin" }, CD<String>.Comparator) }); }
public void CDContentSameEqualityTest() { CD<String> a = new CD<string>( "12345", "1.2.3.4.5.6", "Dummy Code System", "2011" ), b = new CD<String>( "12345","1.2.3.4.5.6", "Dummy Code System", "2011" ); Assert.IsTrue(a.Equals(b)); Assert.IsTrue(b.Equals(a)); }
public void CDQualifierCodeNullFlavorTest() { CD<String> cd = new CD<String>(); cd.Code = "284196006"; cd.NullFlavor = MARC.Everest.DataTypes.NullFlavor.NoInformation; CR<String> severity = new CR<String>(); severity.Name = new CD<string>(); severity.Value = new CD<string>(); cd.Qualifier = new LIST<CR<string>>(); cd.Qualifier.Add(severity); severity.Name.Code = "246112005"; severity.Name.CodeSystem = "2.16.840.1.113883.6.96"; severity.Name.CodeSystemName = "SNOMED CT"; severity.Name.DisplayName = "Severity"; severity.Value.Code = "24484000"; severity.Value.CodeSystem = "2.16.840.1.113883.6.96"; severity.Value.CodeSystemName = "SNOMED CT"; severity.Value.DisplayName = "Severe"; CR<String> findingsite = new CR<String>(); findingsite.Name = new CD<string>(); findingsite.Value = new CD<string>(); cd.Qualifier.Add(findingsite); findingsite.Name.Code = "363698007"; findingsite.Name.CodeSystem = "2.16.840.1.113883.6.96"; findingsite.Name.CodeSystemName = "SNOMED CT"; findingsite.Name.DisplayName = "Finding site"; findingsite.Value.Code = "113185004"; findingsite.Value.CodeSystem = "2.16.840.1.113883.6.96"; findingsite.Value.CodeSystemName = "SNOMED CT"; findingsite.Value.DisplayName = "Skin between Fourth and Fifth Toes"; CR<String> laterality = new CR<String>(); laterality.Name = new CD<string>(); laterality.Value = new CD<string>(); findingsite.Value.Qualifier = new LIST<CR<string>>(); findingsite.Value.Qualifier.Add(laterality); laterality.Name.Code = "272741003"; laterality.Name.CodeSystem = "2.16.840.1.113883.6.96"; laterality.Name.CodeSystemName = "SNOMED CT"; laterality.Name.DisplayName = "Laterality"; laterality.Value.Code = "7771000"; laterality.Value.CodeSystem = "2.16.840.1.113883.6.96"; laterality.Value.CodeSystemName = "SNOMED CT"; laterality.Value.DisplayName = "Left"; Assert.IsFalse(cd.Validate()); }
public void CDQualifierCodeNullFlavorNullCheckTest() { CD<String> cd = new CD<String>(); cd.Code = null; cd.NullFlavor = null; CR<String> warning = new CR<String>(); warning.Name = new CD<string>(); warning.Value = new CD<string>(); warning.Value.Code = null; warning.Value.CodeSystem = null; warning.Name.Code = null; warning.Name.CodeSystem = null; cd.Qualifier = new LIST<CR<string>>(); cd.Qualifier.Add(warning); cd.Validate(); Assert.IsFalse(cd.Validate()); }
public void R2CDQualifierNestedCodeParseTest() { var cdi = new CD<String>("64572001", "2.16.840.1.113883.6.96", "SNOMED-CT", null, null, new ED("Some original text")); cdi.Qualifier = new LIST<CR<string>>(); cdi.Qualifier.Add(new CR<string>( new CV<String>("116676008", "2.16.840.1.113883.6.96", "SNOMED-CT", null, null, null), new CD<String>("72704001", "2.16.840.1.113883.6.96", "SNOMED-CT", null, null, null) )); cdi.Qualifier.Add(new CR<String>( new CV<String>("363698007", "2.16.840.1.113883.6.96", "SNOMED-CT", null, null, null), new CD<String>("12611008", "2.16.840.1.113883.6.96", "SNOMED-CT", null, null, null) { Qualifier = LIST<CR<String>>.CreateList( new CR<String>( new CV<String>("272741003", "2.16.840.1.113883.6.96", "SNOMED-CT", null, null, null), new CD<String>("7771000", "2.16.840.1.113883.6.96", "SNOMED-CT", null, null, null) ) ) } )); string actualXml = R2SerializationHelper.SerializeAsString(cdi); var cd2 = R2SerializationHelper.ParseString<CD<String>>(actualXml); Assert.AreEqual(cdi, cd2); }
public void R2CDNullFlavorParseTest() { var cdi = new CD<String>(null, "2.16.840.1.113883.6.96", null, null, null, new ED("Burnt ear with iron. Burnt other ear calling for ambulance")); cdi.NullFlavor = NullFlavor.Other; string actualXml = R2SerializationHelper.SerializeAsString(cdi); var cd2 = R2SerializationHelper.ParseString<CD<String>>(actualXml); Assert.AreEqual(cdi, cd2); }