public void DeletePatientAllergies_Test() { DeleteAllergiesByPatientIdDataRequest request = new DeleteAllergiesByPatientIdDataRequest { Context = context, ContractNumber = contractNumber, PatientId = "5458fdef84ac050ea472df8e", UserId = userId, Version = version }; DeleteAllergiesByPatientIdDataResponse response = cm.DeletePatientAllergies(request); Assert.IsTrue(response.Success); }
public void DeletePatientAllergies_Test() { DeleteAllergiesByPatientIdDataRequest request = new DeleteAllergiesByPatientIdDataRequest { Context = context, ContractNumber = contractNumber, PatientId = "5458fdef84ac050ea472df8e", UserId = userId, Version = version }; //[Route("/{Context}/{Version}/{ContractNumber}/PatientAllergy/Patient/{PatientId}/Delete", "DELETE")] DeleteAllergiesByPatientIdDataResponse response = client.Delete <DeleteAllergiesByPatientIdDataResponse>( string.Format("{0}/{1}/{2}/{3}/PatientAllergy/Patient/{4}/Delete?UserId={5}", url, context, version, contractNumber, request.PatientId, request.UserId)); Assert.IsNotNull(response); }
public DeleteAllergiesByPatientIdDataResponse Delete(DeleteAllergiesByPatientIdDataRequest request) { DeleteAllergiesByPatientIdDataResponse response = new DeleteAllergiesByPatientIdDataResponse { Version = request.Version }; try { RequireUserId(request); response = Manager.DeletePatientAllergies(request); } catch (Exception ex) { RaiseException(response, ex); } return(response); }
public DeleteAllergiesByPatientIdDataResponse DeletePatientAllergies(DeleteAllergiesByPatientIdDataRequest request) { DeleteAllergiesByPatientIdDataResponse response = null; try { response = new DeleteAllergiesByPatientIdDataResponse(); var repo = AllergyRepositoryFactory.GetAllergyRepository(request, RepositoryType.PatientAllergy); GetPatientAllergiesDataRequest getAllPatientNotesDataRequest = new GetPatientAllergiesDataRequest { Context = request.Context, ContractNumber = request.ContractNumber, PatientId = request.PatientId, UserId = request.UserId, Version = request.Version }; List <PatientAllergyData> patientAllergies = repo.FindByPatientId(getAllPatientNotesDataRequest) as List <PatientAllergyData>; List <string> deletedIds = null; if (patientAllergies != null) { deletedIds = new List <string>(); patientAllergies.ForEach(u => { DeletePatientAllergyDataRequest deletePADataRequest = new DeletePatientAllergyDataRequest { Context = request.Context, ContractNumber = request.ContractNumber, Id = u.Id, UserId = request.UserId, Version = request.Version }; repo.Delete(deletePADataRequest); deletedIds.Add(deletePADataRequest.Id); }); response.DeletedIds = deletedIds; } response.Success = true; return(response); } catch (Exception ex) { throw ex; } }