Save encounter workflow - validation

Hi all,

I have been working on implementing our save encounter workflow (https://wiki.ohie.org/display/documents/Save+encounter+workflow). I’m running into some questions that I’d like to get the groups input on. I’m wondering how exactly the XDS.b metadata should be validated according to our workflow. I have written some pseudo code to show how I have been thinking of doing this. This can be found at the bottom of the link above and I’ve also copied this below:

// This refers to metadata that comes from the XDS.b envelope

get SubmissionSet.patientId

create PIX query using id and assigningAuthority

do PIX query

if success and assigning authority isn’t already ECID

change patientId to ECID from PIX query response

if not success

reject submission set

for each SubmissionSet.author

create CSD query using author.authorInstitution and/or author.authorPerson

do CSD query

if not success

	reject submission set

for each CDA document in submission set

get DocumentEntry.patientId

create PIX query using id and assigningAuthority

do PIX query

if success and assigning authority isn't already ECID

	change patientId to ECID from PIX query response

if not success

	reject submission set

for each SubmissionSet.author

	create CSD query using author.authorInstitution and/or author.authorPerson

	do CSD query

	if not success

		reject submission set

What do people think about this? Does it make sense? Should we be doing something different? Is there anything missing. I have left out the terminology validation for now as we don’t know how exactly that will happen for now.

Let me know what you think.

Cheers,

Ryan

···


Ryan Crichton

Lead Developer, Jembi Health Systems | SOUTH AFRICA

Mobile: +27845829934 | Skype: ryan.graham.crichton
E-mail: ryan@jembi.org