P, Pioline (Cognizant) Thanks for posting your question in Microsoft Q&A. You can use Chained search to perform search operations on a resource within a referenced resource or Reverse chain search to search resources based on properties of resources they refer to.
Based on the description, you can try the following code snippet for your scenarios:
#1 GET [fhir-server]/Patient?identifier:system=[system]&identifier[code]=[code] (Patient.identifier has reference to Identifier)
#2 GET [fhir-server]/Claim?diagnosis.code=[code]
For other search examples, check out FHIR search examples which would be very helpful. I hope this helps and let me know if you have any questions.
If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.