public PatientDirection(string code, AnatomicalOrientationType anatomicalOrientationType) { PatientDirection[] components; if (anatomicalOrientationType == AnatomicalOrientationType.Quadruped) { components = ParseQuadrupedDirection(code); } else { anatomicalOrientationType = AnatomicalOrientationType.Biped; // assume orientation type is BIPED components = ParseBipedDirection(code); } // set the parsed components _primaryComponent = components.Length > 0 ? components[0] : null; _secondaryComponent = components.Length > 1 ? components[1] : null; _tertiaryComponent = components.Length > 2 ? components[2] : null; _isValid = components.Length > 0; _code = code ?? string.Empty; _description = string.Join(SR.LabelPatientDirectionSeparator, CollectionUtils.Map <PatientDirection, string>(components, d => d.Description).ToArray()); _componentCount = components.Length; // consider orientation type to be NONE if direction is empty or unspecified (and not just empty because of parse error) _anatomicalOrientationType = string.IsNullOrEmpty(code) || Primary.IsUnspecified ? AnatomicalOrientationType.None : anatomicalOrientationType; }
/// <summary> /// Initializes a standard component direction. /// </summary> private PatientDirection(string code, string description, AnatomicalOrientationType anatomicalOrientationType) { _primaryComponent = this; _secondaryComponent = null; _tertiaryComponent = null; _isValid = true; _code = code; _description = description; _componentCount = 1; _anatomicalOrientationType = anatomicalOrientationType; }
public override int GetHashCode() { return(0x78df6aF ^ Code.GetHashCode() ^ AnatomicalOrientationType.GetHashCode()); }
public PatientDirection(string code, AnatomicalOrientationType anatomicalOrientationType) { PatientDirection[] components; if (anatomicalOrientationType == AnatomicalOrientationType.Quadruped) { components = ParseQuadrupedDirection(code); } else { anatomicalOrientationType = AnatomicalOrientationType.Biped; // assume orientation type is BIPED components = ParseBipedDirection(code); } // set the parsed components _primaryComponent = components.Length > 0 ? components[0] : null; _secondaryComponent = components.Length > 1 ? components[1] : null; _tertiaryComponent = components.Length > 2 ? components[2] : null; _isValid = components.Length > 0; _code = code ?? string.Empty; _description = string.Join(SR.LabelPatientDirectionSeparator, CollectionUtils.Map<PatientDirection, string>(components, d => d.Description).ToArray()); _componentCount = components.Length; // consider orientation type to be NONE if direction is empty or unspecified (and not just empty because of parse error) _anatomicalOrientationType = string.IsNullOrEmpty(code) || Primary.IsUnspecified ? AnatomicalOrientationType.None : anatomicalOrientationType; }
/// <summary> /// Constructor. /// </summary> public PatientOrientation(string row, string column, AnatomicalOrientationType anatomicalOrientationType) : this(new PatientDirection(row, anatomicalOrientationType), new PatientDirection(column, anatomicalOrientationType)) { }