Adding DIagnosis data through REST

How can we add diagnosis for patient using rest? i see openmrs is calling /openmrs/ws/fhir2/R4/Condition?_summary=data for adding condition , but how is this condition data linked to a particular visit? can we add diagnosis using obs? if yes whats the payload it requires?