Stream: implementers
Topic: issues with Cyrillic encoding in FhirServer
Igor Novikov (Feb 27 2019 at 07:12):
Hi, Grahame,
We do use Cyrillic encoding Windows-1251 in our project (works with FHIR Server (windows) (http://www.healthintersections.com.au/FhirServer)), but there is a function RemoveAccents located in library\support\FHIR.Support.Utilities.pas, which automatically converts string to 20127 encoding, but it makes high bytes look like '?’.
Can you correct this function so that when using Cyrillic (ru/rus) there is no conversion to the 20127 encoding?
Grahame Grieve (Mar 01 2019 at 05:40):
hmm. got some test cases for me?
Grahame Grieve (Mar 01 2019 at 05:45):
I guess I would be better to use this: https://docs.microsoft.com/en-us/windows/desktop/api/winnls/nf-winnls-normalizestring
Igor Novikov (Mar 01 2019 at 06:11):
go: http://**/r3#upload
put sample:
{"resourceType":"Patient","language":"ru","identifier":[{"use":"usual","type":{"coding":[{"system":"http://hl7.org/fhir/v2/0203","code":"PT"}]},"system":"http://mesh.ru/PATIENTS.PATIENTS_ID","value":".330052","assigner":{"display":"ncpMD"}},{"system":"https://fhir.ncp.ru/NamingSystem/rus-snils","value":"024-406-708 20"}],"active":true,"name":[{"use":"usual","text":"СЕРГЕЕВ В. Н.","family":"СЕРГЕЕВ","given":["Валерий","Николаевич"]}],"telecom":[{"system":"phone","value":"с.т.7-913-999-77-74; д.т.:260-77-39; с.т.:8952-926-88-87 жена","use":"home","rank":2},{"system":"phone","value":"79139997774","use":"mobile","rank":1}],"gender":"male","birthDate":"1968-11-27","deceasedBoolean":false,"address":[{"use":"home","type":"postal","text":" Россия, Новосибирская обл., г. Новосибирск, ул. Гаранина, д. 22, кв. 23","line":["street Гаранина","home 22","room 23"],"city":"г. Новосибирск","district":"","state":"Новосибирская обл","country":"RU"},{"use":"temp","type":"postal","text":"Новосибирская обл., г. Новосибирск, ул. Гаранина, д. 22, кв. 23","line":["street Гаранина","home 22","room 23"],"city":"г. Новосибирск","district":"","state":"Новосибирская обл","country":"RU"}],"communication":[{"language":{"coding":[{"system":"urn:ietf:bcp:47","code":"ru","display":"Russian"}],"text":"Русский"},"preferred":true}],"managingOrganization":{"reference":"Organization/b6655adb-c3cf-4a89-a56d-4e27e4e5b924"}}
MSSQL: select * from IndexEntries where ResourceKey = <NewID> in "Value"/"Value2" see symbols "?" instead of cyrillic (bytes > 127)
Grahame Grieve (Mar 01 2019 at 11:40):
what should this look like with accents removed?
Валерий Николаевич СЕРГЕЕВ
Grahame Grieve (Mar 01 2019 at 11:41):
Валерии Николаевич СЕРГЕЕВ ?
Grahame Grieve (Mar 01 2019 at 11:41):
is there other cyrillic accent characters?
Grahame Grieve (Mar 01 2019 at 11:41):
or does the concept not apply?
Grahame Grieve (Mar 01 2019 at 12:06):
my test cases:
Grahame Grieve (Mar 01 2019 at 12:06):
Assert.AreEqual('Grahame Grieve', RemoveAccents('Grahame Grieve'));
Assert.AreEqual('aaeeiiooouuu AAEEIIOOOUUU', RemoveAccents('aáeéiíoóöuúü AÁEÉIÍOÓÖUÚÜ'));
Assert.AreEqual('Валерии Николаевич СЕРГЕЕВ', RemoveAccents('Валерий Николаевич СЕРГЕЕВ'));
Grahame Grieve (Mar 02 2019 at 06:17):
ok I think it's fixed (and released but i haven't upgraded test.fhir.org yet)
Igor Novikov (Mar 02 2019 at 07:36):
I checked the new version of the project - it works correctly, thank you ..
Grahame Grieve (Mar 02 2019 at 07:58):
Great
Last updated: Apr 12 2022 at 19:14 UTC