示例#1
0
		public PatientDirection(PatientDirection patientDirection)
			: this(patientDirection.Code, patientDirection.AnatomicalOrientationType) {}
示例#2
0
		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,
		                               components.Select(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;
		}
示例#3
0
		/// <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;
		}