Written by

Question Gary Koester · Apr 27, 2022

replacing characters

The doc name is formatted lname,fname. How do I replace the comma with a ^ so I get lname^fname.

<assign value='$ZCVT(source.{ibex_medical_chart.patient_info.admdoc.name},"i","XML")' property='target.{PV1:AdmittingDoctor(1).GivenName}' action='set' />

Product version: Caché 2017.1
$ZV: Cache for Windows (x86-64) 2017.2.2

Comments

Jeffrey Drumm · Apr 27, 2022
<assign value='$PIECE($ZCVT(source.{ibex_medical_chart.patient_info.admdoc.name},"i","XML"),",",1)' property='target.{PV1:AdmittingDoctor(1).FamilyName}' action='set' />
<assign value='$PIECE($ZCVT(source.{ibex_medical_chart.patient_info.admdoc.name},"i","XML"),",",2)' property='target.{PV1:AdmittingDoctor(1).GivenName}' action='set' />

Or a bit more efficiently:

<assign value='$ZCVT(source.{ibex_medical_chart.patient_info.admdoc.name},"i","XML")' property='tFullName' action='set' />
<assign value='$PIECE(tFullName,",",1)' property='target.{PV1:AdmittingDoctor(1).FamilyName}' action='set' />
<assign value='$PIECE(tFullName,",",2)' property='target.{PV1:AdmittingDoctor(1).GivenName}' action='set' />

Note that this isn't actually replacing the comma character so much as it's splitting the full name value supplied in the source path on that character and assigning the individually extracted values to their associated HL7 components in the Admitting Doctor field.

0
Matthew Waddingham · Apr 29, 2022

could consider  $Translate(Var,",","^") but I've not used it in the context in your example though

0