public List <FormularyExcipientAPIModel> Convert(FormularyCreateModel sourceMember, ResolutionContext context) { if (sourceMember == null && !sourceMember.Ingredients.IsCollectionValid()) { return(null); } var excipients = context.Mapper.Map <List <FormularyExcipientAPIModel> >(sourceMember.Excipients); return(excipients); }
private List <string> AssignMedusaPreparationInstructions(FormularyCreateModel src) { if (src.ProductType.IsNotEmpty() && (string.Compare(src.ProductType, "amp", true) == 0)) { return(src.MedusaPreparationInstructionsEditable != null? new List <string> { src.MedusaPreparationInstructionsEditable }: null); } else if (src.MedusaPreparationInstructions != null) { return(src.MedusaPreparationInstructions.Select(rec => rec.Id).ToList()); } return(null); }
private List <FormularyLookupAPIModel> AssignTitrationTypes(FormularyCreateModel src) { if (src.ProductType.IsNotEmpty() && (string.Compare(src.ProductType, "amp", true) == 0)) { return(src.TitrationTypesEditableId != null? new List <FormularyLookupAPIModel> { ConvertCodeNameModelWithDefaultsToCodeDescAPI(src.TitrationTypesEditableId) }: null); } else if (src.TitrationTypes != null) { return(ConvertCodeNameModelsWithDefaultsToCodeDescAPI(src.TitrationTypes)); } return(null); }
private List <FormularyLocalRouteDetailAPIModel> GetLocalRoutes(FormularyCreateModel src) { var localRoutesAPI = new List <FormularyLocalRouteDetailAPIModel>(); if (src == null || (!src.LocalLicensedRoute.IsCollectionValid() && !src.LocalUnlicensedRoute.IsCollectionValid())) { return(null); } if (src.LocalLicensedRoute.IsCollectionValid()) { src.LocalLicensedRoute.Each(rec => { var routeAPIModel = new FormularyLocalRouteDetailAPIModel { RouteCd = rec.Id, RouteDesc = rec.Name, RouteFieldTypeCd = TerminologyConstants.ROUTEFIELDTYPE_NORMAL_CD, Source = rec.Source }; localRoutesAPI.Add(routeAPIModel); }); } if (src.LocalUnlicensedRoute.IsCollectionValid()) { src.LocalUnlicensedRoute.Each(rec => { var routeAPIModel = new FormularyLocalRouteDetailAPIModel { RouteCd = rec.Id, RouteDesc = rec.Name, RouteFieldTypeCd = TerminologyConstants.ROUTEFIELDTYPE_UNLICENSED_CD, Source = rec.Source }; localRoutesAPI.Add(routeAPIModel); }); } return(localRoutesAPI); }
public List <FormularyAdditionalCodeAPIModel> Resolve(FormularyCreateModel source, FormularyHeaderAPIModel destination, List <FormularyAdditionalCodeAPIModel> destMember, ResolutionContext context) { var additionalCodes = new List <FormularyAdditionalCodeAPIModel>(); if (destination == null) { return(additionalCodes); } if (source.FormularyClassificationCodes.IsCollectionValid()) { additionalCodes = context.Mapper.Map <List <FormularyAdditionalCodeAPIModel> >(source.FormularyClassificationCodes); additionalCodes.Each(rec => rec.CodeType = "Classification"); } if (source.FormularyIdentificationCodes.IsCollectionValid()) { var idenCodes = context.Mapper.Map <List <FormularyAdditionalCodeAPIModel> >(source.FormularyIdentificationCodes); idenCodes.Each(rec => rec.CodeType = "Identification"); additionalCodes.AddRange(idenCodes); } return(additionalCodes); }
public AMPFormularyCreateValidator(FormularyCreateModel model) { _model = model; }