I tried what you suggested:
codePhrase.setTerminologyId(new TerminologyId(“http://snomed.info/sct”));
codePhrase.setCodeString(“192008”);
codedText.setDefiningCode(codePhrase);
codedText.setValue(“Congenital syphilitic hepatomegaly”);
and I got the same error:
Exception in thread “main” org.ehrbase.client.exception.WrongStatusCodeException: Wrong Status code. Expected: [200, 201, 204]. Got: 422. Error message: {“error”:“Unprocessable Entity”,“message”:“/content[openEHR-EHR-OBSERVATION.externalterm.v0]/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value: Failed to validate DvCodedText{defining_code=http://snomed.info/sct::192008, value=Congenital syphilitic hepatomegaly}, : The value 192008 does not match any option from value set http://hl7.org/fhir/ValueSet/condition-code”}