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

Home > padding string in BPL

Question
Lewis Greitzer · Aug 28, 2017

padding string in BPL

Hi folks, I'm trying to pad my patient MRN to 10 characters before I do a SQL lookup in my BPL. I've tried various approaches, and have not been successful.

When I add a "code" statement with the following code, I get an error as below.

set context.NewID = "0000000000"
set $EXTRACT(context.NewID,10-len(context.PatientID)) = context.PatientID
 
ERROR <Ens>ErrException: <OBJECT DISPATCH>zS8+5 ^CHSLI.BPLQueryDatabaseforPatientID.Thread1.1 *Property 'NewID'
in class 'CHSLI.BPLQueryDatabaseforPatientID.Context'
must be MultiDimensional -- logged as '-'
number - @'
set $EXTRACT(context.NewID,10-len(context.PatientID)) = context.PatientID'

Any ideas/help would be appreciated.

Thanks.

#Business Process (BPL) #Caché

Source URL:https://community.intersystems.com/post/padding-string-bpl