Exemplo n.º 1
0
        /// <summary>
        /// Equalses the specified coded concept dto.
        /// </summary>
        /// <param name="codedConceptDto">The coded concept dto.</param>
        /// <returns>A <see cref="System.Boolean"/></returns>
        public virtual bool Equals(CodedConceptDto codedConceptDto)
        {
            if (ReferenceEquals(null, codedConceptDto))
            {
                return(false);
            }
            if (ReferenceEquals(this, codedConceptDto))
            {
                return(true);
            }
            if (GetType() != codedConceptDto.GetType())
            {
                return(false);
            }

            var otherIsTransient = Equals(codedConceptDto.CodedConceptCode, ( long )0);
            var thisIsTransient  = Equals(CodedConceptCode, ( long )0);

            if (otherIsTransient && thisIsTransient)
            {
                return(ReferenceEquals(codedConceptDto, this));
            }

            return(codedConceptDto.CodedConceptCode.Equals(CodedConceptCode));
        }
        /// <summary>
        /// Withes the coded concept dto.
        /// </summary>
        /// <param name="codedConceptBuilder">The coded concept builder.</param>
        /// <param name="codedConceptDto">The coded concept dto.</param>
        /// <returns>A <see cref="Rem.Domain.Core.CommonModule.CodedConceptBuilder"/></returns>
        public static CodedConceptBuilder WithCodedConceptDto( this CodedConceptBuilder codedConceptBuilder, CodedConceptDto codedConceptDto )
        {
            codedConceptBuilder.WithCodedConceptCode ( codedConceptDto.CodedConceptCode )
                .WithCodeSystemIdentifier ( codedConceptDto.CodeSystemIdentifier )
                .WithCodeSystemName ( codedConceptDto.CodeSystemName )
                .WithCodeSystemVersionNumber ( codedConceptDto.CodeSystemVersionNumber )
                .WithDisplayName ( codedConceptDto.DisplayName )
                .WithNullFlavorIndicator ( codedConceptDto.NullFlavorIndicator )
                .WithOriginalDescription ( codedConceptDto.OriginalDescription );

            return codedConceptBuilder;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProblemDto"/> class.
        /// </summary>
        /// <param name="problemDto">The problem dto.</param>
        public ProblemDto( ProblemDto problemDto )
            : base(problemDto)
        {
            _clinicalCaseKey = problemDto._clinicalCaseKey;

            if ( problemDto._problemStatus != null )
            {
                _problemStatus = new LookupValueDto ();
                var diagnosisStatus = problemDto._problemStatus;
                _problemStatus.WellKnownName = diagnosisStatus.WellKnownName;
                _problemStatus.Key = diagnosisStatus.Key;
                _problemStatus.Name = diagnosisStatus.Name;
            }

            if ( problemDto._problemCodeCodedConcept != null )
            {
                _problemCodeCodedConcept = new CodedConceptDto ();
                var problemCode = problemDto._problemCodeCodedConcept;
                _problemCodeCodedConcept.CodedConceptCode = problemCode.CodedConceptCode;
                _problemCodeCodedConcept.Key = problemCode.Key;
                _problemCodeCodedConcept.CodeSystemIdentifier = problemCode.CodeSystemIdentifier;
                _problemCodeCodedConcept.CodeSystemName = problemCode.CodeSystemName;
                _problemCodeCodedConcept.CodeSystemVersionNumber = problemCode.CodeSystemVersionNumber;
                _problemCodeCodedConcept.DisplayName = problemCode.DisplayName;
                _problemCodeCodedConcept.NullFlavorIndicator = problemCode.NullFlavorIndicator;
            }

            if ( problemDto._problemType != null )
            {
                _problemType = new LookupValueDto ();
                var diagnosisType = problemDto._problemType;
                _problemType.WellKnownName = diagnosisType.WellKnownName;
                _problemType.Key = diagnosisType.Key;
                _problemType.Name = diagnosisType.Name;
            }
        }
Exemplo n.º 4
0
 private void MedicationFormStrengthRequestCompleted( ReceivedResponses receivedResponses )
 {
     var response = receivedResponses.Get<MedicationFormStrengthResponse> ();
     DTSInfo = response.DTSInfo;
     _dtsMedicationCode = GetCodedConceptDto ( response.MainCode );
     RaisePropertyChanged ( () => DtsMedicationCode );
     if ( Medication != null && Medication.MedicationCodeCodedConcept != null )
     {
         var origDrugConcept =
             response.DTSInfo.Drugs.FirstOrDefault ( d => d.Code == Medication.MedicationCodeCodedConcept.CodedConceptCode );
         if ( origDrugConcept == null )
         {
             response.DTSInfo.SelectedStrength =
                 response.DTSInfo.Strengths.FirstOrDefault ( s => s.Code == Medication.MedicationCodeCodedConcept.CodedConceptCode );
             response.DTSInfo.SelectedForm =
                 response.DTSInfo.Forms.FirstOrDefault ( f => f.Code == Medication.MedicationCodeCodedConcept.CodedConceptCode );
         }
         else
         {
             response.DTSInfo.SelectedStrength =
                 response.DTSInfo.Strengths.FirstOrDefault (
                     s => origDrugConcept.Associations.SelectMany ( a => a.Value ).Contains ( s.Code ) );
             response.DTSInfo.SelectedForm =
                 response.DTSInfo.Forms.FirstOrDefault ( f => origDrugConcept.Associations.SelectMany ( a => a.Value ).Contains ( f.Code ) );
         }
         Medication.RootMedicationCodedConcept = GetCodedConceptDto ( response.MainCode );
     }
     else if ( Medication != null )
     {
         Medication.MedicationCodeCodedConcept = GetCodedConceptDto ( response.MainCode );
         Medication.RootMedicationCodedConcept = GetCodedConceptDto ( response.MainCode );
     }
     IsLoading = false;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Equalses the specified coded concept dto.
        /// </summary>
        /// <param name="codedConceptDto">The coded concept dto.</param>
        /// <returns>A <see cref="System.Boolean"/></returns>
        public virtual bool Equals( CodedConceptDto codedConceptDto )
        {
            if ( ReferenceEquals ( null, codedConceptDto ) )
            {
                return false;
            }
            if ( ReferenceEquals ( this, codedConceptDto ) )
            {
                return true;
            }
            if ( GetType () != codedConceptDto.GetType () )
            {
                return false;
            }

            var otherIsTransient = Equals ( codedConceptDto.CodedConceptCode, ( long )0 );
            var thisIsTransient = Equals ( CodedConceptCode, ( long )0 );

            if ( otherIsTransient && thisIsTransient )
            {
                return ReferenceEquals ( codedConceptDto, this );
            }

            return codedConceptDto.CodedConceptCode.Equals ( CodedConceptCode );
        }