public void UpdateHealthcard(HealthcardNumber hc, HealthcardDetail detail, IPersistenceContext context) { hc.Id = detail.Id; hc.AssigningAuthority = EnumUtils.GetEnumValue<InsuranceAuthorityEnum>(detail.AssigningAuthority, context); hc.VersionCode = detail.VersionCode; hc.ExpiryDate = detail.ExpiryDate; }
/// <summary> /// Formats the healthcard number according to the specified format string. /// </summary> /// <remarks> /// Valid format specifiers are as follows: /// %N - number /// %A - assigning authority /// %V - version code /// %X - expiry date /// </remarks> /// <param name="hc"></param> /// <param name="format"></param> /// <returns></returns> public static string Format(HealthcardDetail hc, string format) { string result = format; result = result.Replace("%N", hc.Id ?? ""); result = result.Replace("%A", hc.AssigningAuthority == null ? "" : hc.AssigningAuthority.Code); result = result.Replace("%V", hc.VersionCode ?? ""); result = result.Replace("%X", ClearCanvas.Desktop.Format.Date(hc.ExpiryDate)); return result.Trim(); }
/// <summary> /// Formats the healthcard according to the default format as specified in <see cref="FormatSettings"/> /// </summary> /// <param name="hc"></param> /// <returns></returns> public static string Format(HealthcardDetail hc) { return Format(hc, FormatSettings.Default.HealthcardDefaultFormat); }