public string ToString(string format) { while (format.Contains("{")) { // Get the first tag int sPos = format.IndexOf("{"), ePos = format.IndexOf("}", sPos); string tag = format.Substring(sPos + 1, ePos - sPos - 1); // Get enumerated value AddressPartType adpt = PartTypeMap[tag]; string partString = ""; foreach (ADXP adxp in Part.FindAll(o => o.Type == adpt)) { partString += adxp.Value + " "; } format = format.Replace("{" + tag + "}", partString); } return(format.Remove(format.Length - 1)); }
public static Extension CreateADExtension(AddressPart part) { AddressPartType v3PartType = (AddressPartType)Enum.Parse(typeof(AddressPartType), part.PartType.ToString()); string wireCode = MARC.Everest.Connectors.Util.ToWireFormat(v3PartType); return(new Extension() { Url = GetExtensionNameUrl("addressPart"), Extension = new List <Extension>() { new Extension() { Url = GetExtensionNameUrl("v3-addressPartTypes"), Value = new Coding(typeof(AddressPartType).GetValueSetDefinition(), wireCode) }, new Extension() { Url = GetExtensionNameUrl("addressPart-value"), Value = new FhirString(part.AddressValue), } } }); }
/// <summary> /// Create a new instance of ADXP using the values specified /// </summary> /// <param name="type">The address part type</param> /// <param name="value">The value of the type</param> public ADXP(String value, AddressPartType type) : base() { Type = type; Value = value; }
public AddressPartClass(AddressPartType inType, String inAddress) { type = inType; address = inAddress; }