/// <summary> /// Creates a patient structure /// </summary> /// <param name="id">The unique identifier</param> /// <param name="name">The name of the patient</param> /// <param name="addr">The primary address</param> /// <param name="telecom">A primary telecom</param> /// <returns>A constructed patient structure</returns> public static Patient CreatePatient( II id, EN name, AD addr, TEL telecom ) { // Instantiate the object var retVal = new Patient(); // Populate address retVal.Addr = BAG<AD>.CreateBAG(addr); // Confidentiality Code retVal.ConfidentialityCode = "N"; // Effective Time of the types // High is populated as "Not Applicable" retVal.EffectiveTime = new IVL<TS>( (TS)DateTime.Now, new TS() { NullFlavor = NullFlavor.NotApplicable } ); // Telecom address retVal.Telecom = BAG<TEL>.CreateBAG(telecom); // Populate the ID retVal.Id = SET<II>.CreateSET(id); // Status Code retVal.StatusCode = RoleStatus.Active; // Return result return retVal; }
/// <summary> /// Create a name set /// </summary> public NameSet CreateNameSet(EN legalName, List <IResultDetail> dtls) { NameSet retVal = new NameSet(); NameSet.NameSetUse internalNameUse = 0; var lnu = legalName.Use == null || legalName.Use.IsNull || legalName.Use.IsEmpty ? EntityNameUse.Search : (EntityNameUse)legalName.Use[0]; if ((lnu == EntityNameUse.Legal || lnu == EntityNameUse.OfficialRecord) && legalName.Use.Count > 1 && (legalName.Use[1] == EntityNameUse.OfficialRecord | legalName.Use[1] == EntityNameUse.Legal)) { internalNameUse = NameSet.NameSetUse.OfficialRecord; } else if (!m_nameUseMap.TryGetValue(lnu, out internalNameUse)) { return(null); } retVal.Use = internalNameUse; // Create the parts foreach (ENXP namePart in legalName.Part) { retVal.Parts.Add(new NamePart() { Value = namePart.Value, Type = namePart.Type.HasValue ? m_namePartTypeMap[namePart.Type] : NamePart.NamePartType.None }); } return(retVal); }
public void ENXPQualifierTest() { string xml = "<name use=\"L\"><given>Neville</given><given qualifier=\"IN\">H.</given><family>Nuclear</family></name>"; EN x = (EN)R1SerializationHelper.ParseString(xml, typeof(EN)); Assert.IsTrue(x.Validate()); }
public void R2ENQualifierSerializationTest() { EN inti = new EN( EntityNameUse.Legal, new ENXP[] { new ENXP("Sir", EntityNamePartType.Prefix) { Qualifier = new SET <CS <EntityNamePartQualifier> >(EntityNamePartQualifier.Nobility) }, new ENXP("Dr", EntityNamePartType.Prefix) { Qualifier = new SET <CS <EntityNamePartQualifier> >(EntityNamePartQualifier.Academic) }, new ENXP("John", EntityNamePartType.Given), new ENXP("Jacob", EntityNamePartType.Given), new ENXP("Jingleheimer", EntityNamePartType.Family), new ENXP("-", EntityNamePartType.Delimiter), new ENXP("Schmidt", EntityNamePartType.Family), new ENXP("III", EntityNamePartType.Suffix) } ); string expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" use=""L""><part type=""TITLE"" value=""Sir"" qualifier=""NB PFX""/><part type=""TITLE"" value=""Dr"" qualifier=""AC PFX""/><part type=""GIV"" value=""John""/><part type=""GIV"" value=""Jacob""/><part type=""FAM"" value=""Jingleheimer""/><part type=""DEL"" value=""-""/><part type=""FAM"" value=""Schmidt""/><part qualifier=""SFX"" value=""III""/></test>"; string actualXml = R2SerializationHelper.SerializeAsString(inti); R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml); }
public void R2ENQualifierParseTest() { EN inti = new EN( EntityNameUse.Legal, new ENXP[] { new ENXP("Sir", EntityNamePartType.Title) { Qualifier = new SET <CS <EntityNamePartQualifier> >(EntityNamePartQualifier.Nobility) }, new ENXP("Dr", EntityNamePartType.Title) { Qualifier = new SET <CS <EntityNamePartQualifier> >(EntityNamePartQualifier.Academic) }, new ENXP("John", EntityNamePartType.Given), new ENXP("Jacob", EntityNamePartType.Given), new ENXP("Jingleheimer", EntityNamePartType.Family), new ENXP("-", EntityNamePartType.Delimiter), new ENXP("Schmidt", EntityNamePartType.Family), new ENXP("III", EntityNamePartType.Title) } ); string actualXml = R2SerializationHelper.SerializeAsString(inti); var int2 = R2SerializationHelper.ParseString <EN>(actualXml); Assert.AreEqual(inti, int2); }
private void UpdateCards() { foreach (PlayingCard C in Cards) { C.UnityCard.transform.SetParent(null, false); } for (int i = 0; i < TheCardGameState.Players.Length; i++) { foreach (Entities.Entity E in TheCardGameState.Players[i].mGraveyard.Cards) { UpdateCard(E, null); } foreach (Effects.EffectNode EN in TheCardGameState.SharedEffects.Nodes) { UpdateCard(EN.GetEntity(), SharedEffects.transform); } foreach (Effects.EffectNode EN in TheCardGameState.Players[i].mEffects.Nodes) { UpdateCard(EN.GetEntity(), Effects[i].transform); } foreach (Entities.Entity E in TheCardGameState.Players[i].mHand.Cards) { UpdateCard(E, Hands[i].transform); } for (int k = 0; k < TheCardGameState.Players[i].mBoard.RangeZones.Length; k++) { foreach (Entities.Entity E in TheCardGameState.Players[i].mBoard.RangeZones[k].List.Cards) { UpdateCard(E, BoardAreas[i][k].transform); } } } }
public void Update() { foreach (EffectNode EN in Nodes) { EN.Update(TheCardGameState); } }
public ImprimirFacturaVentas(EN.ENCliente cli, EN.ENVentasRealizadas realizada) { InitializeComponent(); TTextBoxNumFac.Text = realizada.Facturado; TLabelNombre.Text = "Nombre: " + cli.Nombre + " Apellidos: " + cli.Apellidos; TLabelDNI.Text = "DNI: " + cli.DNI + " Telf: " + cli.Telefono; TLabelDirec.Text = "Dirección: " + cli.Direccion; TTextBoxMarca.Text = realizada.Marca.ToString(); TTextBoxModelo.Text = realizada.Modelo.ToString(); TTextBoxMatricula.Text = realizada.Matricula.ToString(); if (realizada.Garantia != "" && realizada.Garantia != "0") { TCheckBoxGarantia.Checked = true; TTextBoxMeses.Text = realizada.Garantia; } else { TCheckBoxGarantia.Checked = false; TTextBoxMeses.Text = "Meses"; } TLabelFecha.Text = DateTime.Today.ToShortDateString(); TTextBoxPTotal.Text = realizada.PrecioVenta; int iva = Int32.Parse(realizada.PrecioVenta); iva = (iva * 18) / 100; TTextBoxTIva.Text = iva.ToString(); int sinIVA = Int32.Parse(realizada.PrecioVenta); sinIVA = sinIVA - iva; TTextBoxTPSinIva.Text = sinIVA.ToString(); }
public void EXComplexTest02() { EN name = new EN(EntityNameUse.License, new ENXP[] {}); name.NullFlavor = null; Assert.IsFalse(name.Validate()); }
public GestionFacturacion(EN.ENReservas enRe) { InitializeComponent(); enRes = enRe; TimeSpan ts = enRe.FechaFin - enRe.FechaInicio; enVe.Matricula = enRe.Matricula; enVe.ObtenerDatosVehiculos(); enCli.DNI = enRe.Cliente; enCli.RellenarCliente(); enFa.Categoria = enVe.Categoria; enFa.Conductores = enRe.Conductores; enFa.Cliente = enRe.Cliente; enFa.Tarifa = enCli.Tarifa; enFa.Tiempo = ts.Days + 1; enFa.Vehiculo = enRe.Matricula; enFa.ObtenerPrecio(); TTextBoxCategoria.Text = enVe.Categoria; TTextBoxVehiculo.Text = enRe.Matricula; TTextBoxConductores.Text = enRe.Conductores.ToString(); TTextBoxTiempo.Text = ( ts.Days + 1).ToString(); TTextBoxTarifa.Text = enCli.Tarifa; TLabelCliente.Text = "Nombre: " + enCli.Nombre + " Apellidos: " + enCli.Apellidos; TLabelDirec.Text = "Dirección: " + enCli.Direccion; TLabelTelf.Text = "Teléfono: " + enCli.Telefono; TLabelDNI.Text = "DNI: " + enCli.DNI; TLabelTar.Text = "Tarifa aplicada: " + enCli.Tarifa; TTextBoxPTotal.Text = enFa.PrecioTotal.ToString(); TTextBoxTIva.Text = enFa.IVA.ToString(); TTextBoxTPSinIva.Text = enFa.PrecioSinIVA.ToString(); }
private List <Actions.ActionOrder> GetAvailableActions(TurnInfo turnInfo, CardGameState gameState) { List <Actions.ActionOrder> availableActions = new List <Actions.ActionOrder>(); foreach (Entity E in mHand.Cards) { availableActions.AddRange(E.GetAIActions(gameState, turnInfo)); } foreach (Effects.EffectNode EN in mEffects.Nodes) { availableActions.AddRange(EN.GetEntity().GetAIActions(gameState, turnInfo)); } foreach (Effects.EffectNode EN in gameState.SharedEffects.Nodes) { availableActions.AddRange(EN.GetEntity().GetAIActions(gameState, turnInfo)); } foreach (CardZone CZ in mBoard.RangeZones) { foreach (Entity E in CZ.List.Cards) { availableActions.AddRange(E.GetAIActions(gameState, turnInfo)); } } return(availableActions); }
public LabeledDrug() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.code = new CEImpl(); this.name = new ENImpl <EntityName>(); }
public Place() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.name = new ENImpl <EntityName>(); this.addr = new ADImpl(); }
public void ENNullPartNullFlavorTest() { EN en = new EN(); en.NullFlavor = null; en.Part.Clear(); Assert.IsFalse(en.Validate()); }
public virtual void TestParseNullNode() { XmlNode node = CreateNode("<something nullFlavor=\"NI\" />"); EN <EntityName> en = (EN <EntityName>) new EnElementParser().Parse(CreateContext(), node, this.xmlResult); Assert.IsNull(en.Value, "entity name"); Assert.AreEqual(Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor.NO_INFORMATION, en.NullFlavor, "null flavor"); }
public void ENPartNullFlavorTest() { EN en = new EN(); en.NullFlavor = NullFlavor.Other; en.Part.AddRange(GenerateNames()); Assert.IsFalse(en.Validate()); }
public void ENNullFlavorTest() { EN en = new EN(); en.NullFlavor = NullFlavor.NotAsked; en.Part.Clear(); Assert.IsTrue(en.Validate()); }
public void ENPartTest() { EN en = new EN(); en.Part.AddRange(GenerateNames()); en.NullFlavor = null; Assert.IsTrue(en.Validate()); }
public Material() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.code = new CE_R2Impl <Code>(); this.name = new ENImpl <EntityName>(); this.lotNumberText = new STImpl(); }
public static CardColor InferFromEffect(MultiLanguageString[] effect) { return(effect?.Append(null).First() switch { MultiLanguageString mls when mls.EN.StartsWith("[Spark]") => CardColor.Yellow, MultiLanguageString mls when mls.EN.StartsWith("[Blocker") => CardColor.Green, MultiLanguageString mls when mls.EN.StartsWith("[Cancel") => CardColor.Green, _ => CardColor.Blue });
private void OnTriggerExit2D(Collider2D other) { EN enemy = other.GetComponent <EN>(); if (enemy != null) { enemy.DamageSpriteF(false); } }
/// <summary> /// Example 69 /// Creates a patient structure /// </summary> /// <param name="id">The unique identifier</param> /// <param name="name">The name of the patient</param> /// <param name="addr">The primary address</param> /// <param name="telecom">A primary telecom</param> /// <returns>A constructed patient structure</returns> public Patient CreatePatient( II id, EN name, AD addr, TEL telecom ) { try { // Instantiate the object var retVal = new Patient(); // Populate address retVal.Addr = BAG <AD> .CreateBAG(addr); // Confidentiality Code retVal.ConfidentialityCode = "N"; // Effective Time of the types // High is populated as "Not Applicable" retVal.EffectiveTime = new IVL <TS>( (TS)DateTime.Now, new TS() { NullFlavor = NullFlavor.NotApplicable } ); // Telecom address retVal.Telecom = BAG <TEL> .CreateBAG(telecom); // Populate the ID retVal.Id = SET <II> .CreateSET(id); // Status Code retVal.StatusCode = RoleStatus.Active; // Set entity choice retVal.SetPatientEntityChoiceSubject( new Person() { AdministrativeGenderCode = AdministrativeGender.Male, Name = BAG <EN> .CreateBAG(name), BirthTime = DateTime.Now } ); // cannot return result for unit test purposes return(retVal); } catch { Console.WriteLine("Unit tests must not return a value, but Patient must be returned.."); return(new Patient()); } }
public void UpdatePersistance() { // Copy list since elements might remove themselves. List <EffectNode> TempNodes = new List <EffectNode>(Nodes); foreach (EffectNode EN in TempNodes) { EN.UpdatePersistance(TheCardGameState); } }
private void OnTriggerStay2D(Collider2D other) { EN enemy = other.GetComponent <EN>(); if (enemy != null && !canDoDamage) { enemy.TakeDamage(10); enemy.DamageSpriteF(true); } }
public ManufacturedProduct() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.id = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.manufacturedMaterialTypeId = new IIImpl(); this.manufacturedMaterialTemplateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.manufacturedMaterialCode = new CEImpl(); this.manufacturedMaterialName = new ENImpl <EntityName>(); this.manufacturedMaterialLotNumberText = new STImpl(); }
public void WI2102VerifyGraphPart() { string expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""><family partType=""FAM"">Smith</family><validTime><low value=""20090101""/></validTime></test>"; EN instance = new EN(); instance.Part.Add(new ENXP("Smith", EntityNamePartType.Family)); instance.ValidTimeLow = (TS)"20090101"; string actualXml = R1SerializationHelper.SerializeAsString(instance); R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml); }
public ManufacturedProduct() { this.typeId = new IIImpl(); this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.id = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.manufacturedMaterialTypeId = new IIImpl(); this.manufacturedMaterialTemplateId = new LISTImpl <II, Identifier>(typeof(IIImpl)); this.manufacturedMaterialCode = new CE_R2Impl <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Domainvalue.VaccineAdministered>(); this.manufacturedMaterialName = new ENImpl <EntityName>(); this.manufacturedMaterialLotNumberText = new STImpl(); }
public void WI2102VerifyParsePart() { EN instance = new EN(); instance.Part.Add(new ENXP("Smith", EntityNamePartType.Family)); instance.ValidTimeLow = (TS)"20090101"; string actualXml = R1SerializationHelper.SerializeAsString(instance); var inti = R1SerializationHelper.ParseString <EN>(actualXml); Assert.AreEqual(instance, inti); }
public void ENToString() { EN enInstance = new EN( EntityNameUse.Legal, new ENXP[] { new ENXP("James", EntityNamePartType.Given), new ENXP("T", EntityNamePartType.Given), new ENXP("Kirk", EntityNamePartType.Family) }); //Console.Write(enInstance.ToString("|" + "{GIV}{FAM}" + "|")); Assert.AreEqual(enInstance.ToString("{GIV}{FAM}"), "James T Kirk"); }
/// <summary> /// After data has been read, extract operator records from the collected data. /// </summary> private void ExtractOperatorRecords() { foreach (String key in HD.Keys) { OperatorRecord rec = new OperatorRecord(); List <String> hd = HD[key].Fields; Tuple <RadioService, String> serviceType = GetRadioServiceType(hd[6]); rec.CallSign = key; rec.RadioService = serviceType.Item1; rec.RadioServiceDescription = serviceType.Item2; rec.LicenseKey = hd[1]; rec.Frequency = hd[2]; rec.Granted = ParseNullableDate(hd[7]); rec.Expiration = ParseNullableDate(hd[8]); rec.Cancelled = ParseNullableDate(hd[9]); rec.Effective = ParseNullableDate(hd[42]); if (EN.ContainsKey(key)) { List <String> en = EN[key].Fields; rec.Organization = Util.ToTitleCase(en[7]); rec.FirstName = Util.ToTitleCase(en[8]); rec.MiddleInitial = Util.ToTitleCase(en[9]); rec.LastName = Util.ToTitleCase(en[10]); rec.Suffix = Util.ToTitleCase(en[11]); rec.Address = Util.ToTitleCase(en[15])?.Replace("Th ", "th "); } if (AM.ContainsKey(key)) { List <String> am = AM[key].Fields; Tuple <OperatorClass, String> ocType = GetOperatorClassType(am[5]); rec.OperatorClass = ocType.Item1; rec.OperatorClassDescription = ocType.Item2; rec.Group = am[6]; } if (LM.ContainsKey(key)) { List <String> lm = LM[key].Fields; rec.LicenseEligibility = lm[6]; } if (HS.ContainsKey(key)) { rec.History.AddRange(HS[key].OrderBy(x => x.Date).ToList()); } Operators.Add(rec); } }
public void ENExampleTest04() { EN name = new EN ( EntityNameUse.Legal, new ENXP[] {} ); name.NullFlavor = NullFlavor.Other; Console.WriteLine(name.ToString("{FAM}, {GIV}")); // should output James Kirk Tieberius Assert.IsTrue(name.Validate()); }
public void FormatPatient() { // Create a formatter with a graph aide XmlIts1Formatter fmtr = new XmlIts1Formatter(); // Gets or sets a list of aide formatters // that assist in the formatting of this instance fmtr.GraphAides.Add(new DatatypeFormatter()); // Format to a string StringWriter sw = new StringWriter(); XmlStateWriter xmlSw = new XmlStateWriter( XmlWriter.Create(sw, new XmlWriterSettings() { Indent = true }) ); // Call our method here... var patient = Utils.CreatePatient( Guid.NewGuid(), EN.CreateEN(EntityNameUse.Legal, new ENXP("John", EntityNamePartType.Given), new ENXP("Smith", EntityNamePartType.Family) ), AD.CreateAD(PostalAddressUse.HomeAddress, "123 Main Street West", "Hamilton", "Ontario", "Canada" ), "*****@*****.**" ); // Format to the formatter. // Details results in a result code // that indicates the outcome of the graph. var details = fmtr.Graph(xmlSw, patient); // Flush and close xmlSw.Close(); // Output to console Console.WriteLine("XML: "); Console.WriteLine(sw.ToString()); Console.WriteLine("Validation:"); foreach (var dtl in details.Details) { Console.WriteLine("{0} : {1}", dtl.Type, dtl.Message); } }
public FacturaVentas(EN.ENVentasRealizadas realizada) { InitializeComponent(); realizadas = realizada; realizadas.Matricula = realizada.Matricula; realizadas.ObtenerDatosVentas(realizada.DNI); enCli.DNI = realizada.DNI; enCli.RellenarCliente(); TTextBoxMatricula.Text = realizadas.Matricula; TTextBoxMarca.Text = realizadas.Marca; TTextBoxModelo.Text = realizadas.Modelo; if (realizadas.Garantia != "" && realizadas.Garantia != "0") { TCheckBoxGarantia.Checked = true; TTextBoxMeses.Text = realizadas.Garantia; } else { TCheckBoxGarantia.Checked = false; TTextBoxMeses.Text = "Meses"; } TTextBoxFecha.Text = realizadas.Fecha; TLabelCliente.Text = "Nombre: " + enCli.Nombre + " Apellidos: " + enCli.Apellidos; TLabelDirec.Text = "Dirección: " + enCli.Direccion; TLabelTelf.Text = "Teléfono: " + enCli.Telefono; TLabelDNI.Text = "DNI: " + enCli.DNI; TLabelTar.Text = "Tarifa aplicada: " + enCli.Tarifa; TTextBoxPTotal.Text = realizadas.PrecioVenta; int iva = Int32.Parse(realizadas.PrecioVenta); iva = (iva * 18) / 100; TTextBoxTIva.Text = iva.ToString(); int sinIVA = Int32.Parse(realizadas.PrecioVenta); sinIVA = sinIVA - iva; TTextBoxTPSinIva.Text = sinIVA.ToString(); if (realizadas.Facturado == "0") { checkBox1.Checked = false; } else { checkBox1.Checked = true; } }
public AltaReservas(EN.ENReservas enRe, string texto) { InitializeComponent(); editar = editar2 = true; DataSet dsCli = new DataSet(); EN.ENVehiculo enVe = new EN.ENVehiculo(); EN.ENReservas enRes = new EN.ENReservas(); DataSet dsRes = new DataSet(); enCliente.DNI = enRe.Cliente; aux = enRe; dsCli = enCliente.ObtenerDatosClienteConDni(enRe.Cliente.ToString()); enVe.Matricula = enRe.Matricula; enVe.ObtenerDatosVehiculos(); string nombre = dsCli.Tables["Cliente"].Rows[0][1].ToString(); string apellidos = dsCli.Tables["Cliente"].Rows[0][2].ToString(); string dni = dsCli.Tables["Cliente"].Rows[0][0].ToString(); string telf = dsCli.Tables["Cliente"].Rows[0][3].ToString(); string direc = dsCli.Tables["Cliente"].Rows[0][5].ToString(); provincias = dsCli.Tables["Cliente"].Rows[0][6].ToString(); ciudades = dsCli.Tables["Cliente"].Rows[0][7].ToString(); string sexo = dsCli.Tables["Cliente"].Rows[0][9].ToString(); enCliente.Sexo = sexo; TLabelNombre.Text = "Nombre: " + nombre + "Apellidos: " + apellidos; TLabelDNI.Text = "DNI: " + dni + "Telf: " + telf; TLabelDirec.Text = "Direccion: " + direc; TButtonBuscarCliente.Visible = false; TLabelNombre.Visible = true; TLabelDirec.Visible = true; TLabelDNI.Visible = true; TRectangleShapeCliente.Visible = true; TButtonEditar.Visible = true; TButtonReserva.Text = texto; TComboBoxConductores.SelectedIndex = TComboBoxConductores.FindStringExact(enRe.Conductores.ToString()); TDateTimePickerFechaFin.Value = enRe.FechaFin; TDateTimePickerFechaInicio.Value = enRe.FechaInicio; TComboBoxCategoria.Items.Add(enVe.Categoria); TComboBoxCategoria.SelectedIndex = 0; TComboBoxMarca.Items.Add(enVe.Marca); TComboBoxMarca.SelectedIndex = 0; TComboBoxModelo.Items.Add(enVe.Modelo); TComboBoxModelo.SelectedIndex = 0; TComboBoxMatricula.Items.Add(enVe.Matricula); TComboBoxMatricula.SelectedIndex = 0; }
public ImprimirFactura(EN.ENCliente cli, EN.ENVehiculo ve, EN.ENFacturacion enFa, int numFac) { InitializeComponent(); TLabelNombre.Text = "Nombre: " + cli.Nombre + " Apellidos: " + cli.Apellidos; TLabelDNI.Text = "DNI: " + cli.DNI + " Telf: " + cli.Telefono; TLabelDirec.Text = "Dirección: " + cli.Direccion; TLabelFecha.Text = "Fecha factura: " + enFa.DiaFacturacion.ToShortDateString(); TTextBoxMarca.Text = ve.Marca.ToString(); TTextBoxModelo.Text = ve.Modelo.ToString(); TTextBoxMatricula.Text = ve.Matricula.ToString(); TTextBoxConductores.Text = enFa.Conductores.ToString(); TTextBoxCategoria.Text = ve.Categoria; TTextBoxNumFac.Text = numFac.ToString(); TTextBoxTiempo.Text = enFa.Tiempo.ToString(); TTextBoxTarifa.Text = enFa.Tarifa; TTextBoxTPSinIva.Text = enFa.PrecioSinIVA.ToString(); TTextBoxTIva.Text = enFa.IVA.ToString(); TTextBoxPTotal.Text = enFa.PrecioTotal.ToString(); }
public ImprimirReserva( EN.ENCliente cli, EN.ENReservas re, EN.ENVehiculo ve, int numRes,double precio,string tar) { InitializeComponent(); TLabelNombre.Text = "Nombre: " + cli.Nombre + " Apellidos: " + cli.Apellidos; TLabelDNI.Text = "DNI: " + cli.DNI + " Telf: " + cli.Telefono; TLabelDirec.Text = "Dirección: " + cli.Direccion; TTextBoxNumRes.Text = numRes.ToString(); TTextBoxMarca.Text = ve.Marca.ToString(); TTextBoxModelo.Text = ve.Modelo.ToString(); TTextBoxMatricula.Text = ve.Matricula.ToString(); TTextBoxConductores.Text = re.Conductores.ToString(); TTextBoxFechaInicio.Text = re.FechaInicio.ToShortDateString(); TTextBoxFechaFin.Text = re.FechaFin.ToShortDateString(); TTextBoxCategoria.Text = ve.Categoria; TTextBoxPrecio.Text = precio.ToString(); TLabelTarifa.Text = tar; TLabelCategoria.Select(); }
public void EXComplexTest02() { EN name = new EN(EntityNameUse.License, new ENXP[]{}); name.NullFlavor = null; Assert.IsFalse(name.Validate()); }
public void EXComplexTest01() { EN name = new EN(EntityNameUse.License, new ENXP[] { // add a Title name-part to the name new ENXP("Dr.", EntityNamePartType.Title) { // assign qualifiers to the 'Title' name-part Qualifier = new SET<CS<EntityNamePartQualifier>>() { EntityNamePartQualifier.Academic, EntityNamePartQualifier.Prefix } }, // add the first name as 'Given' name-part new ENXP("John", EntityNamePartType.Given), // add an initial as 'Given' name-part new ENXP("G", EntityNamePartType.Given) { // assign the Initial qualifier to the name-part Qualifier = new SET<CS<EntityNamePartQualifier>>() { EntityNamePartQualifier.Initial } }, // add a middle name as 'Given' name-part new ENXP("Jacob", EntityNamePartType.Given) { // assign the 'Middle' qualifier to the middle name Qualifier = new SET<CS<EntityNamePartQualifier>>() { EntityNamePartQualifier.Middle } }, // add part of the last name as 'Family' name-part new ENXP("Jingleheimer", EntityNamePartType.Family), // hyphens in a name must be a 'Delimiter' name-part new ENXP("-", EntityNamePartType.Delimiter), // add part of the last name as 'Family' name-part new ENXP("Schmidt", EntityNamePartType.Family), // add inherited suffix name-part with qualifiers 'Birth' and 'Suffix' new ENXP("II") { Qualifier = new SET<CS<EntityNamePartQualifier>>() { EntityNamePartQualifier.Birth, EntityNamePartQualifier.Suffix } } //end final ENXP } // end ENXP[] array ); // close parameters for EN Assert.IsTrue(name.Validate()); } // end EXComplexTest01
public void WI2102VerifyGraphFull() { string expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""><family partType=""FAM"">Smith</family><validTime><low value=""20090101""/><high value=""20100101""/></validTime></test>"; EN instance = new EN(); instance.Part.Add(new ENXP("Smith", EntityNamePartType.Family)); instance.ValidTimeLow = (TS)"20090101"; instance.ValidTimeHigh = (TS)"20100101"; string actualXml = R1SerializationHelper.SerializeAsString(instance); R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml); }
public void R2ENQualifierParseTest() { EN inti = new EN( EntityNameUse.Legal, new ENXP[] { new ENXP("Sir", EntityNamePartType.Title) { Qualifier = new SET<CS<EntityNamePartQualifier>>(EntityNamePartQualifier.Nobility) }, new ENXP("Dr", EntityNamePartType.Title) { Qualifier = new SET<CS<EntityNamePartQualifier>>(EntityNamePartQualifier.Academic) }, new ENXP("John", EntityNamePartType.Given), new ENXP("Jacob", EntityNamePartType.Given), new ENXP("Jingleheimer", EntityNamePartType.Family), new ENXP("-", EntityNamePartType.Delimiter), new ENXP("Schmidt", EntityNamePartType.Family), new ENXP("III", EntityNamePartType.Title) } ); string actualXml = R2SerializationHelper.SerializeAsString(inti); var int2 = R2SerializationHelper.ParseString<EN>(actualXml); Assert.AreEqual(inti, int2); }
public GestionClientes(EN.ENCliente enCliente, string nombrebotonguardar,string provincias,string ciudades) { InitializeComponent(); //////////Para rellenar TListBoxCoches con los coches que ha alquilado el cliente. DataSet vehi = new DataSet(); EN.ENReservas enVehi = new EN.ENReservas(); string dnicadena = "FK_Cliente ='" + enCliente.DNI + "'"; vehi = enVehi.ObtenerReservas(dnicadena); if (vehi.Tables["Reservas"].Rows.Count > 0) { TTextBoxNumeroReservas.Text = vehi.Tables["Reservas"].Rows.Count.ToString(); for (int i = 0; i < vehi.Tables["Reservas"].Rows.Count; i++) { // MessageBox.Show(vehi.Tables["Reservas"].Rows[i][2].ToString()); TListBoxCoches.Items.Add(vehi.Tables["Reservas"].Rows[i][2].ToString()); } } else TTextBoxNumeroReservas.Text = "0"; TGroupBoxCliente.Size = new Size(581, 334); TLabelVehiculosAlquiler.Visible = true; TListBoxCoches.Visible = true; TLabelNumeroReserva.Visible = true; TTextBoxNumeroReservas.Visible = true; TTextBoxNumeroReservas.Enabled = false; TListBoxCoches.Enabled = false; ///////////// TTextBoxDNI.Enabled = false; DataSet dscli = new DataSet(); dscli = enCliente.ObtenerDatosClienteConDni(enCliente.DNI); TTextBoxNombre.Text = enCliente.Nombre = dscli.Tables["Cliente"].Rows[0][1].ToString(); TTextBoxApellidos.Text = enCliente.Apellidos = dscli.Tables["Cliente"].Rows[0][2].ToString(); TTextBoxDNI.Text = enCliente.DNI = dscli.Tables["Cliente"].Rows[0][0].ToString(); enCliente.Telefono = int.Parse(dscli.Tables["Cliente"].Rows[0][3].ToString()); TTextBoxTelefono.Text = enCliente.Telefono.ToString(); TTextBoxEmail.Text = enCliente.Email = dscli.Tables["Cliente"].Rows[0][4].ToString();; TTextBoxDireccion.Text = enCliente.Direccion = dscli.Tables["Cliente"].Rows[0][5].ToString(); /* if (provincias != null && ciudades != null) { TComboBoxProvincias.Items.Add(provincias); TComboBoxProvincias.SelectedIndex = 0; TComboBoxCiudades.Items.Add(ciudades); TComboBoxCiudades.SelectedIndex = 0; }*/ enCliente.Provincia = dscli.Tables["Cliente"].Rows[0][6].ToString(); enCliente.Ciudad = dscli.Tables["Cliente"].Rows[0][7].ToString(); TComboBoxProvincias.Items.Add(enCliente.Provincia); TComboBoxProvincias.SelectedIndex = 0; TComboBoxCiudades.Items.Add(enCliente.Ciudad); TComboBoxCiudades.SelectedIndex = 0; textoProvincia = TComboBoxProvincias.Text; enCliente.Tarifa = dscli.Tables["Cliente"].Rows[0][8].ToString(); TComboBoxTarifa.Items.Add(enCliente.Tarifa); TComboBoxTarifa.SelectedIndex = 0; enCliente.Sexo = dscli.Tables["Cliente"].Rows[0][9].ToString(); if (enCliente.Sexo == "V") TRadioButtonH.Checked = true; else if (enCliente.Sexo == "M") TRadioButtonM.Checked = true; TButtonGuardarCliente.Text = nombrebotonguardar; // importante le cambiamos el nombre al boton para saber que venimos del formulario buscar, y estamos editando no guardando uno nuevo TButtonGuardarCliente.Size = new Size(120, 33); //////////////////////////////////////////////// EN.ENProveedores provi = new EN.ENProveedores(); //PAra arreglar el problema de los combobox y que el de ciudad vaya a la primera sin pulsar primero provincia DataSet dsProv = new DataSet(); dsProv = provi.ObtenerListaProvincias(); //ObtenerProvincias(dsProv) numProvincia = new DataSet(); numProvincia = dsProv; ///////////////////////////////////////////////// }
/// <summary> /// Search for a patient based on name /// </summary> public void Search(String patientName) { // Attempt to split the name string firstName = String.Empty, lastName = String.Empty; Regex re = new Regex(@"^(.*?)[,](.*?)$"); var match = re.Match(patientName + ","); if (!match.Success) return; // Next, get the parts if (match.Groups.Count > 1) lastName = match.Groups[1].Value.Replace(",", ""); if(match.Groups.Count > 2) firstName = match.Groups[2].Value.Replace(",", ""); // Now search PRPA_IN201305UV02 pdQuery = new PRPA_IN201305UV02( Guid.NewGuid(), DateTime.Now, PRPA_IN201305UV02.GetInteractionId(), ProcessingID.Production, "I", AcknowledgementCondition.Always, new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Receiver( new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Device( SET<II>.CreateSET(new II("1.3.6.1.4.1.33349.3.1.1.20.4", "CR-FAKE")) ) ), new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Sender( new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Device( SET<II>.CreateSET(new II("1.2.3.4.5.4", "Sample")) ) ), new MARC.Everest.RMIM.UV.NE2008.QUQI_MT021001UV01.ControlActProcess<MARC.Everest.RMIM.UV.NE2008.PRPA_MT201306UV02.QueryByParameter>( "EVN" ) { Id = SET<II>.CreateSET(Guid.NewGuid()), EffectiveTime = new IVL<TS>(DateTime.Now), Code = Util.Convert<CD<String>>(PRPA_IN201305UV02.GetTriggerEvent()), queryByParameter = new MARC.Everest.RMIM.UV.NE2008.PRPA_MT201306UV02.QueryByParameter( Guid.NewGuid(), "New", new MARC.Everest.RMIM.UV.NE2008.PRPA_MT201306UV02.ParameterList() ) } ); // Build name EN searchName = new EN(EntityNameUse.Search, new ENXP[]{}); foreach(var s in lastName.Split(' ')) searchName.Part.Add(new ENXP(s, EntityNamePartType.Family)); if(!String.IsNullOrEmpty(firstName)) foreach(var s in firstName.Split(' ')) searchName.Part.Add(new ENXP(s, EntityNamePartType.Given)); // Query parameters pdQuery.controlActProcess.queryByParameter.ParameterList.LivingSubjectName.Add(new MARC.Everest.RMIM.UV.NE2008.PRPA_MT201306UV02.LivingSubjectName( SET<EN>.CreateSET(searchName), "livingSubject.Name" )); // Send if(!this.m_clientConnector.IsOpen()) this.m_clientConnector.Open(); this.m_clientConnector.BeginSend(pdQuery, this.OnBeginSend, null); }
/// <summary> /// Example 68 /// Creates a patient structure /// </summary> /// <param name="id">The unique identifier</param> /// <param name="name">The name of the patient</param> /// <param name="addr">The primary address</param> /// <param name="telecom">A primary telecom</param> /// <returns>A constructed patient structure</returns> public Patient CreatePatient( II id, EN name, AD addr, TEL telecom ) { // Instantiate the object var retVal = new Patient(); // return a value in a unit test // will result in Not Runnable return retVal; }
public void ENExampleTest01() { EN name = new EN ( EntityNameUse.Legal, new ENXP[] { // add name-parts to name new ENXP("James", EntityNamePartType.Given), new ENXP("Tiberius", EntityNamePartType.Given), new ENXP("Kirk", EntityNamePartType.Family), } ); name.NullFlavor = null; Console.WriteLine(name.ToString("{FAM}, {GIV}")); // should output James Kirk Tieberius Assert.IsTrue(name.Validate()); }
public void ENToString() { EN enInstance = new EN( EntityNameUse.Legal, new ENXP[] { new ENXP("James", EntityNamePartType.Given), new ENXP("T", EntityNamePartType.Given), new ENXP("Kirk", EntityNamePartType.Family) }); //Console.Write(enInstance.ToString("|" + "{GIV}{FAM}" + "|")); Assert.AreEqual(enInstance.ToString("{GIV}{FAM}") ,"James T Kirk"); }
public void WI2102VerifyParseFull() { EN instance = new EN(); instance.Part.Add(new ENXP("Smith", EntityNamePartType.Family)); instance.ValidTimeLow = (TS)"20090101"; instance.ValidTimeHigh = (TS)"20100101"; string actualXml = R1SerializationHelper.SerializeAsString(instance); var inti = R1SerializationHelper.ParseString<EN>(actualXml); Assert.AreEqual(instance, inti); }
/// <summary> /// Example 69 /// Creates a patient structure /// </summary> /// <param name="id">The unique identifier</param> /// <param name="name">The name of the patient</param> /// <param name="addr">The primary address</param> /// <param name="telecom">A primary telecom</param> /// <returns>A constructed patient structure</returns> public Patient CreatePatient( II id, EN name, AD addr, TEL telecom ) { try { // Instantiate the object var retVal = new Patient(); // Populate address retVal.Addr = BAG<AD>.CreateBAG(addr); // Confidentiality Code retVal.ConfidentialityCode = "N"; // Effective Time of the types // High is populated as "Not Applicable" retVal.EffectiveTime = new IVL<TS>( (TS)DateTime.Now, new TS() { NullFlavor = NullFlavor.NotApplicable } ); // Telecom address retVal.Telecom = BAG<TEL>.CreateBAG(telecom); // Populate the ID retVal.Id = SET<II>.CreateSET(id); // Status Code retVal.StatusCode = RoleStatus.Active; // Set entity choice retVal.SetPatientEntityChoiceSubject( new Person() { AdministrativeGenderCode = AdministrativeGender.Male, Name = BAG<EN>.CreateBAG(name), BirthTime = DateTime.Now } ); // cannot return result for unit test purposes return retVal; } catch { Console.WriteLine("Unit tests must not return a value, but Patient must be returned.."); return new Patient(); } }
public void R2ENBasicSerializationTest() { EN inti = new EN( EntityNameUse.Legal, new ENXP[] { new ENXP("Sir", EntityNamePartType.Title), new ENXP("Dr", EntityNamePartType.Title), new ENXP("John", EntityNamePartType.Given), new ENXP("Jacob", EntityNamePartType.Given), new ENXP("Jingleheimer", EntityNamePartType.Family), new ENXP("-", EntityNamePartType.Delimiter), new ENXP("Schmidt", EntityNamePartType.Family), new ENXP("III", EntityNamePartType.Suffix) } ); string expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" use=""L""><part type=""TITLE"" value=""Sir""/><part type=""TITLE"" value=""Dr""/><part type=""GIV"" value=""John""/><part type=""GIV"" value=""Jacob""/><part type=""FAM"" value=""Jingleheimer""/><part type=""DEL"" value=""-""/><part type=""FAM"" value=""Schmidt""/><part qualifier=""SFX"" value=""III""/></test>"; string actualXml = R2SerializationHelper.SerializeAsString(inti); R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml); }