/
Resources Validation

Resources Validation

We want to validate the request payloads to add consistency to the FHIR data.

FHIR provides the /validate request to check if the payload is valid for FHIR. This is not enough for our system, we can only use this for POST and GET requests, it not works for PUT or PATH. And for example, it doesnā€™t control the telecom value. I want to focus on telecom value because this is critical information needed to communicate with the patients.

For that reason, we also want to add more validation and check the information received from the requests.

In this case, we are going to focus on telecom, probably in the future we want to validate other fields.

At this point, I also want to focus only on the Patient resource.

Ā 

Why donā€™t we apply the same validation to Organization resources?

I found some cases that could be very complex to validate. For example, if the Organization does communications through SMS using Africaā€™s talking or through Whatsapp using the Facebook API, it will use a token to do the communication, and when we talk about SMS or Whatsapp we expect to use phone numbers.

So, to control this, we have to make an implementation considering the information about the projects and communication providers required for the organization. It supposes a considerable effort with small benefits since the Organization resource is managed by the openHIM and FHIR admins also if some data is wrong, all communications will fail and it will be easily identifiable

Ā 

Patientā€™s telecom information

To talk about the validation of telecom we have to know how this information is stored:

  • telecom property contains a ContactPoint value and this has the system property with the next values: phone, fax, email, pager, url, sms, and other.

  • In our project, we set the system property to other when we want to store Whatsapp or other social media identifiers in the value property. and the value will have the next format {{socialMediaName}}|{{socialMediaID, phoneNumber, emailā€¦}}'. Just now, we are only using Whatsapp, so, this validation will be continuously evolving depending on the new communication providers.

Just now, we use this flow to check the validation:

Sometimes, phone number is used as Identifier, so, when the telecom value is a phone and the identifier match it, then, if we have to convert the phone number to e.164 we will do the same with the identifier.

Related content