Encounter notes from a form

Often there is a need to have a custom complex form in Profile for collecting a large amount of information from checkboxes, drop downs, edit boxes, etc. and sometimes including a final edit box to summarize.  Some of this information would be important to putting into the encounter notes so the next clinician can review a summary and not have to click through to parsing a complex form.  Of course double entry is an option but frowned upon and rightfully so as we humans have horrible consistency to errorless duplication.

Intrahealth has made this task very simple to implement.  When saving your form the forms event OnMGetTextForContact gets triggered.  And in most cases that event macro can be a single line of code to get the expected behaviour.

An example:

Profile.Variable("TextForContact").Value = Controls_("memNotes").Text

This takes the text contents of a memo/text field and will instantly insert it into the Encounter the form was launched from.
No complex macro coding to hook the encounter editor or other complexities are needed.

It wouldn't be much more complex if you wanted multiple values from a form to be inserted into the notes.  You simply set the Value to a composed string from multiple controls values, like composing a paragraph of sentences into a single string.

That's it. Sweet simple, and powerful.


Building a custom Profile application...outside/on-top of Profile

We have seen in many places within Profile the ability to build custom actions and sometimes large solutions.  However to achieve this is still within the confine of the Profile application using dialog boxes, report windows, macros, forms, etc. 

What if we want to create a more modern looking full blown application that can still interact with Profile's rich objects.

Since Profile is mostly written in .Net it is easier than ever to include an assembly and call methods within those assemblies but you are only getting a very small fraction of functionality.  Of course you can write an application to talk directly to the database, but most customers are cloud hosted so the database is not directly accessible, not to mention the immense effort to reverse engineer their database design, which I must add is done very well and is complex.

There are many cases in which you would want to create a rich interface that tightly integrates with Profile where you don't have access to the database directly and not have the time to build an API web service.

An example that perhaps most can visualize is an appointment sign-in kiosk.  This could be sitting at the front desk signed into a clerical account and the kiosk app is launched as a full-screen Windows application (WPF/Winforms).  A touch screen keyboard presents the user with the ability to search for their appointment by last name, or a swipe reader attached to swipe your health card.  This action would show your appointment and you can sign in and maybe even get a number for in the lobby to be called.  As a developer the application seems very straight forward but to have real-time appointment information becomes the big challenge.

In my example I didn't create a kiosk but a proof of concept to demonstrate some of the principles needed.

All the source code needed is available on my github at  https://github.com/DigitalOxCanada/ProfileWpfApp1

So below shows the WPF App after being called from inside Profile.  The yellow highlighted data was declared inside the WPF app code, the green highlighted data was declared inside the calling macro in Profile.  When you click the Click Me button it calls a macro directly inside Profile which is responsible of throwing up that Hello message box.

This might not seem overly impressive but from a developer standpoint this is a very powerful approach.  There is automatic databinding on the controls and you get the use of a full rich Visual Studio editing experience with colour syntax highlighting and auto-completion.

I hope this opens the doors for those that can think a bit outside of the box.  I know when I discovered I could do this a bunch of ideas came to mind that would be so much nicer to develop this way.

To share some of my ideas:

  • Sign-in Kiosk
  • Appointment SMS reminders
  • User Auditing
  • Family hierarchy management (Genetics)
  • Data Scraping
  • etc.  (can't give you all my great ideas now can I ?!)

Let me know if you found this useful.  The in-depth technical details will be on the github repository.

Profile Required fields....almost

Required fields are a big part of developing powerful and effective forms in Profile.  At first glance of the richness of forms you would think it was easy to mark a field as a required field to save the form.  This feature is missing completely and left up to writing the behaviour manually inside the save macro event.  Although it's not overly difficult to write the code there is quite the detail to get it correct and some forms have some dependent or hierarchical conditions.

Required fields at its simplest is to have a mandatory field be checked or filled in with a value in order to save the form.  To perform this action in macro is to check if the fields control has a value and if not cancel the save action with a warning message beside the control that has failed the mandatory check.

sub main()

	'not successful validation
	Profile.Variable("CanSave").Value = False
	Profile.Variable("ShowMessage").Value = True

	'check of both radio buttons are not checked
	if Controls_("rbAbuseInLast12Months").Checked = false and Controls_("rbAbuseInLast12Months2").Checked = false then
		Profile.Variable("ControlName").Value = "lblAbuseInLast12Months"
		Profile.Variable("ErrorMessage").Value = "Must be specified"
		exit sub
	end if

	'successful validation
	Profile.Variable("ShowMessage").Value = False
	Profile.Variable("CanSave").Value = True

end sub

So imagine a form with 100 fields and the majority have mandatory conditions, this will be quite the bit of code to write and mostly tedious.

At the most simplest usage of a required field, Intrahealth could implement this feature fairly easily.  But the dependent or hierarchical nature of forms would quickly make this much more difficult to solve without coding.

However, in the latest version of Profile (8.4.x) they have taken a step towards solving the more complicated scenarios at least in the GUI part of the form.  There are 2 new properties to take notice of; ControlsToEnable, ControlsToEnableReverse

Here is an example inside a form.  If the user checks N/A then all the other options should disable, if the user checks the option other then the other textbox becomes available.  

Normally this would all happen in macro code on each of the checked events of the controls where code would make that happen.

So we set the ControlsToEnable property of the N/A checkbox to the 4 other checkboxes.  We also set the property ControlsToEnableReverse to true because in this scenario we want the other 4 controls to disable when checked.  The default is enable when checked so the logic for this first part is reversed.


 And the Other checkbox ControlsToEnable property to edOther (the name of the edit control) we effectively create a 2 tier logic without a line of code.  We leave the ControlsToEnableReverse as false because we want the default behaviour of enabling the textbox when the Other checkbox is checked.

First time viewing form N/A checked disables all other controls Checking Other enables the editbox for editing.


As there are multiple scenarios of logic this 2 new properties can do quite a bit and without the need for many lines of code that is more prone to human error.

However this is all done in the GUI only and as of yet I see now way for this logic to affect the forms save event for required fields.  

This is a very nice and welcome addition to form design and we hope to see more.


Developing a website? There is a lot to think about.

When it comes to design or building a website there are many technical aspects to be covered.

I put together a presentation that points out some of the points to discuss when taking on the endeavor of web development.

  • Domain Name​
  • Hosting provider​
  • Site Design​
  • Server OS​
  • Web Server Software​
  • Administration and Upkeep​
  • How to promote it?​

View the presentation for each point in more detail.  

Web Design Part 1.pptx (82.88 kb)

Please feel free to reach out to us for any discussions or even better if you would like to work with us. :)