Need to show file from Realted Patient Notes under Documents -> Lab Reports


I am trying to customize the Patient notes feature, where when the provider adds a Realted Patient Note for Image result, I take 2-3 fields as input and create a Report pdf for the image result uploaded.

Now, I want this PDF to be automatically shown under the Documents → Lab Reports category, but I am unable to figure out how the file naming and assignment to the category happens.

ANy pointers?