Published on InterSystems Developer Community (https://community.intersystems.com)

Home > modifying patient address in DTL

Question
Kyle M · Sep 17, 2020

modifying patient address in DTL

Hi

Newbie question. Could you please help me implement the following using DTL only - no programming. 

We have a problem where our system sends longer addresses e.g. block of flats in an unexpected format

e.g. address below:

 

Flat 22 Kings Court

49 Kings Road

Gateshead

NE10  8AW

 

Would be sent as

Flat 22^Kings Court^Gateshead^""^NE10  8AW^GBR^HOME^49 Kings Road^

 

With Road being sent right at the end after the post code and country etc. Shorter addresses are OK.

I need to have a logic which would clean it up and move these values around to have the following:

 Flat 22 Kings Court^49 Kings Road^Gateshead^""^NE10  8AW^GBR^HOME^^

 

something like:

IF PID;11(1).8 is populated then concatenate PID 11.1 and PID 11.2 (sending both values in PID11.1)

Move PID 11.8 to PID.2

Keep PID 3, PID 4, PID 5 as is

 

ELSE (PID 11.8 blank)

just pass on the address like below with no changes

129 Princess Road^Gateshead^^^NW10 6TR

#DTL #HL7 #HealthShare

Source URL:https://community.intersystems.com/post/modifying-patient-address-dtl