private static OutputQuantityValue CalculateQuantity(DoseInstruction doseInstruction) { OutputQuantityValue result = new OutputQuantityValue(); if (doseInstruction != null) { result.Unit = SimplifyUnit(doseInstruction.DoseQuantity.Unit); result.Value = doseInstruction.DoseQuantity.Value; } return(result); }
private static string CalculateFrequency(DoseInstruction doseInstruction) { string result = string.Empty; if (doseInstruction != null) { string unitString = GetEnumMemberValue(doseInstruction.Frequency.Unit); string timesInterval = doseInstruction.Frequency.Value.ToString() + " " + unitString; if (doseInstruction.Frequency.FrequencyType == FrequencyType.None) { result = timesInterval; } else if (doseInstruction.Frequency.FrequencyType == FrequencyType.Every) { result = "Every " + timesInterval; } } return(result); }