Exemplo n.º 1
0
 /// <summary>
 /// Creates an ImmunizationDefinition object from a PHSA model.
 /// </summary>
 /// <param name="model">The vaccine code object to convert.</param>
 /// <returns>The newly created ImmunizationDefinition object.</returns>
 public static ImmunizationDefinition FromPHSAModel(VaccineCode model)
 {
     return(new ImmunizationDefinition()
     {
         Name = model.VaccineCodeText,
         ImmunizationAgents = ImmunizationAgent.FromPHSACodesModel(model.VaccineCodes)
     });
 }
        /// <summary>
        /// Creates a List of ImmunizationAgents object from a PHSA model.
        /// </summary>
        /// <param name="immunizationAgentResponse">The list of PHSA models to convert.</param>
        /// <returns>A list of ImmunizationAgent objects.</returns>
        public static IEnumerable <ImmunizationAgent> FromPHSAModelList(IEnumerable <ImmunizationAgentResponse>?immunizationAgentResponse)
        {
            List <ImmunizationAgent> immunizationAgents = new List <ImmunizationAgent>();

            if (immunizationAgentResponse != null)
            {
                foreach (ImmunizationAgentResponse immunizationAgentModel in immunizationAgentResponse)
                {
                    immunizationAgents.Add(ImmunizationAgent.FromPHSAModel(immunizationAgentModel));
                }
            }

            return(immunizationAgents);
        }
 /// <summary>
 /// Creates a ImmunizationEvent object from a PHSA model.
 /// </summary>
 /// <param name="model">The immunization view object to convert.</param>
 /// <returns>The newly created ImmunizationEvent object.</returns>
 public static ImmunizationEvent FromPHSAModel(ImmunizationViewResponse model)
 {
     return(new ImmunizationEvent()
     {
         Id = model.SourceSystemId,
         DateOfImmunization = model.OccurrenceDateTime,
         ProviderOrClinic = model.ProviderOrClinic,
         Status = model.Status,
         Immunization = new ImmunizationDefinition()
         {
             Name = model.Name, ImmunizationAgents = ImmunizationAgent.FromPHSAModelList(model.ImmunizationAgents)
         },
         Forecast = model.ImmunizationForecast == null ? null : ImmunizationForecast.FromPHSAModel(model.ImmunizationForecast),
     });
 }