ENH: Want a new feature in merge_asof function, which includes the all the rows of the right data frame with duplicate values of the coulumn on which it is matched , in the merged dataframe
#### I want a new feature in merge_asof function of pandas?

I wish I could keep all the rows of the right data frame after merging if that row has duplicates values in the "on" coulumns which I am matching 

#### I have given an example as a code in the code block 

I have medical data, which has two data frames, one is the radiology scan or any other medical report and the other one is the OPD visit of the patient where the doctor makes the diagnosis or writes comments. The OPD data frame has multiple visits from one patient in a calendar year but has only one radiology_scan or medical report. The visit year might or might not be same, hence I am using merge_asof function to match the radiology visit with the nearest OPD visit. If the patient had multiple OPD visits in the same year as the scan year in radiology sheet, I want to preserve all the OPD visits of that year for that patient in the merged sheet. In merge_asof I am only able to get the first OPD visit form the patient , even if there are multiple in that year which matches the scan year or is near to it .  

#### Can you add any parameter in the function so that we can use the above feature 



#### I have used merge function

Merge function keeps all the data of the visit year if there are multiple visits in the matched year, but I cannot asof in it


```python
# import pandas as pd

radiology_scan = pd.DataFrame({"patient_id":['a001','a002','a003'],
                     "Visit_year": [2010, 2012, 2016], "scan_report": [1, 55,2]})



OPD_data = pd.DataFrame({"patient_id":['a001','a001','a002','a003','a004','a005'],
                      
                      "Visit_year": [2010 , 2010 , 2013, 2017, 2017,2018],
                      
                      "doctor_comments": ['diagnosis normal, xyz symptoms',
                                          'diagnosis normal, abc symptoms',
                                          'diagnosis abnormal, pqr symptoms',
                                          'diagnosis abnormal, apq symptoms',
                                          'diagnosis normal, xzy symptoms',
                                          'diagnosis abnormal, yzx symptoms' ]})
# here the patient a001 has two visits in opd data frame, when i merge it I want both the visits data, to be reflected 
# in the merged dataframe

x = pd.merge_asof(radiology_scan, OPD_data, on =  ["Visit_year"], by =   ["patient_id"] , direction="nearest")
# when using merge_asof only the first visit of the a001's OPD is seen in the merged data frame

y = pd.merge(radiology_scan, OPD_data, on =["Visit_year","patient_id" ], how = 'left' )
# merge function gives both visits of the matched visit year , but i cannot merge the nearest visits of other patients whose
# visit years from both the data frames don't match  ( as in merge_asof )

```
