public void RegisterAllergyDocumentInSearchIndex(DTO.Allergy allergy, string contractNumber, IAppDomainRequest request) { try { var np = Mapper.Map <IdNamePair>(allergy); //new AllergyLuceneStrategy<IdNamePair, IdNamePair> { Contract = contractNumber }.AddUpdateLuceneIndex(np); EndpointUtil.RegisterAllergyDocument(request, np); } catch (Exception ex) { throw new WebServiceException("AD:RegisterAllergyDocumentInSearchIndex()::" + ex.Message, ex.InnerException); } }
public DTO.Allergy InitializeAllergy(PostInitializeAllergyRequest request) { DTO.Allergy allergy = null; try { AllergyData data = EndpointUtil.InitializeAllergy(request); if (data != null) { allergy = Mapper.Map <DTO.Allergy>(data); } return(allergy); } catch (Exception ex) { throw ex; } }
public List <PatientAllergy> UpdatePatientAllergies(PostPatientAllergiesRequest request) { List <PatientAllergy> patientAllergies = null; try { // Update Allergy collection for any newly initialized allergies & then register in search index. if (request.PatientAllergies != null && request.PatientAllergies.Count > 0) { request.PatientAllergies.ForEach(p => { if (p.IsNewAllergy) { PostAllergyRequest req = new PostAllergyRequest { Allergy = new DTO.Allergy { Id = p.AllergyId, TypeIds = p.AllergyTypeIds, Name = p.AllergyName }, ContractNumber = request.ContractNumber, UserId = request.UserId, Version = request.Version }; AllergyData allergyData = EndpointUtil.UpdateAllergy(req); DTO.Allergy newAllergy = Mapper.Map <DTO.Allergy>(allergyData); // Register newly initialized allergies in search index. SearchManager.RegisterAllergyDocumentInSearchIndex(newAllergy, req.ContractNumber, request); } }); } List <PatientAllergyData> data = EndpointUtil.UpdatePatientAllergies(request); if (data != null && data.Count > 0) { patientAllergies = new List <PatientAllergy>(); data.ForEach(a => patientAllergies.Add(Mapper.Map <PatientAllergy>(a))); } return(patientAllergies); } catch (Exception ex) { throw ex; } }