Hi Dmytro -- and the HPD community,
I (ITI planning co-chair) have no experience with HPD, and there are few on the ITI committee that do. I would have expected the hpd implementers list to have been the best place to find the answer, but it seems the community is dwindling. Would sure be good if the community using this specification would support each other.
Further note, HPD is still in "Trial Implementation", and this lack of knowledge and support does not look favorably toward making it normative. So the community interested in continued use of HPD needs to step forward.
To answer your question, I followed the trail of specifications (noticing that HPD has some wrong reference guidance), I end up at
where a bare colon is not allowed. There is indication that other characters may be escaped, so if you need a colon then you put it in escaped.
John Moehrke 🔥 Architect: Healthcare Informatics Standards - Interoperability, Privacy, and Security
IHE Co-Chair IT Infrastructure Planning and Technical
HL7 Co-Chair Security WG, FHIR FMG, FHIR facilitator, and FHIR Foundation founding member