Click here to Skip to main content
12,632,032 members (28,661 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


4 bookmarked

Smart Doc Assist

, 15 Oct 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
Ultrabook app for doctors


Persona in mind while designing this application is a busy meditational practitioner such as a Doctor. He consults his patients at various locations such as different hospitals, clinics, institutes. He does not have much time at his disposal. This app can provide him one point for managing data of his interest. Once he consults a patient at any location, app stores that data on cloud which can be accessed at later. Using this app he can use templates of human body and sketch during consultation on his Ultrabook. He can share all this digital information with his patients. App uses following features of Ultrabook to improve doctor’s productivity and takes consulting experience of patients to next level. 



Interactive diagram

Touch aware interactive diagram with drawing tools can be used by doctors to explain in detail.

Clod Sync

App makes use of cloud ready platform to save important data securely on cloud.

Audio – Video recording

App makes use of inbuilt camera and mic in ultrabook to record important things during consultation that can be reviewed later.

Data Sharing

App can make use of inbuilt sharing capabilities in Ultrabook like SMS, NFC.

Location awareness

Automatically saves place where patient consultation is done.


A toast message pops up when appointment exceeds allotted time.

Writing the application

Landing page of the application provides an overview of appointments for today & tomorrow. It also shows booking status of appointments for the next week. Doctor can manage appointments from landing page of the application itself. Landing page makes use of rich UI rendering of Ultrabook to show data in user friendly way. Double touch on available appointment slot can be used to book an appointment for patient. Once a patient is added in database, all his details will be available for re-use.

With this app doctor does not have to keep track of time during appointment. If appointment exceeds allotted time, a toast notification pops up as a reminder.

Here is a code snippet for Toast Notification – 

Var templateContent = ToastContentFactory.CreateToastImageAndText01();

templateContent.TextBodyWrap.Text = "Next appointment starts in X mins";
templateContent.Image.Src = toastImageSrc;
templateContent.Image.Alt = "Patient image";

IToastNotificationContent toastContent = templateContent;
output.Text = toastContent.GetContent();

ToastNotification toast = toastContent.CreateNotification();

A single touch on appointment in calendar opens consultation page for doctor. Doctor can refer to patient history from this page. He can save his comments in the notes field provided. If he needs to explain a complicated topic he can use interactive diagram for explanation. Interactive diagram would look something like this – 

Interactive diagram opens pre-loaded images of body part in full featured image editor. Interactive diagram supports various touch based events such as pinch, stretch and rotate. Pinch and stretch can zoom to specific details of diagram. Image can be rotated with two or more fingers.  Changes done in image can be saved. If changes saved, it will be specific for the patient and can be accessed in future.

Consultation page also has options of audio recording OR video recording. It can also use camera to capture images if needed. Following are some sample codes for this.

Code snippet for capturing image – 
	CameraCaptureUI dialog = new CameraCaptureUI();
	Size aspectRatio = new Size(16, 9);
	dialog.PhotoSettings.CroppedAspectRatio = aspectRatio;

        StorageFile file = await    dialog.CaptureFileAsync(CameraCaptureUIMode.Photo);
	if (file != null)
		BitmapImage bitmapImage = new BitmapImage();
		using(IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read))
		Scenario1Image.Source = bitmapImage;
		Scenario1ResetButton.Visibility = Visibility.Visible;
		photoFile = file.Path;
catch (Exception ex)

 Code snippet for showing captured image – 
StorageFile file = await StorageFile.GetFileFromPathAsync(filePath);
BitmapImage bitmapImage = new BitmapImage();

using(IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read))

Image.Source = bitmapImage;

Code snippet for capturing video – 

	CameraCaptureUI dialog = new CameraCaptureUI();
	dialog.VideoSettings.Format = CameraCaptureUIVideoFormat.Mp4;

	StorageFile file = await dialog.CaptureFileAsync(CameraCaptureUIMode.Video);
	if (file != null)
		IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
		Scenario2Video.SetSource(fileStream, "video/mp4");
		Scenario2ResetButton.Visibility = Visibility.Visible;
		videoFile = file.Path;
catch (Exception ex)
Code snippet for showing captured video –

StorageFile file = await StorageFile.GetFileFromPathAsync(filePath);
IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
Video.SetSource(fileStream, "video/mp4");

Code snippet for audio capture and playback – 
mediaCaptureMgr = new Windows.Media.Capture.MediaCapture();
var settings = new MediaCaptureInitializationSettings();
settings.StreamingCaptureMode = StreamingCaptureMode.Audio;
await mediaCaptureMgr.InitializeAsync(settings);

// start recording
var recordStorageFile = await Windows.Storage.KnownFolders.VideosLibrary.CreateFileAsync(fileName);
var recordProfile = Windows.Media.MediaProperties.MediaEncodingProfile.CreateM4a(Windows.Media.MediaProperties.AudioEncodingQuality.Auto);
await mediaCaptureMgr.StartRecordToStorageFileAsync(recordProfile, recordStorageFile);

// stop recording and preview
await mediaCaptureMgr.StopRecordAsync();
var stream = await recordStorageFile.OpenAsync(Windows.Storage.FileAccessMode.Read);
playbackElement.AutoPlay = true;
playbackElement.SetSource(stream, recordStorageFile.FileType);

Consultation page also provides option to save next appointment for the patient. Doctor’s calendar on home page will automatically get updated. App will also send a reminder SMS to patient prior to next appointment.

Here is code snippet of how app will send a SMS -

// Get the default SMS device
curDevice = await SmsDevice.GetDefaultAsync();
{   // Create a text message                                       
	SmsTextMessage msg = new SmsTextMessage();
	msg.To = SendToText.Text;
	msg.Body = SendMessageText.Text;

	// Send the message asynchronously
	OutputStatus.Text = "Sending message ...";
	await curDevice.SendMessageAsync(msg);
	OutputStatus.Text = "Text message sent";
catch (Exception err)
	OutputStatus.Text = err.Message;

While consultation for patient is saved, it also automatically saves place where this consultation was done. It can be referred to if needed in patient’s history. To make geolocation work, doctor will once save co-ordinates of all his consultation places.

Code snippet for geolocation support – 

 // Here is the code that can be used to save various locations where doctor provides consultancy.

Geolocator geo = new Geolocator();
Geoposition pos = await geo.GetGeopositionAsync();

textblock4.Text = "Latitude: " + pos.Coordinate.Latitude.ToString();
textblock5.Text = "Longitude: " + pos.Coordinate.Longitude.ToString(
textblock6.Text = "Accuracy: " + pos.Coordinate.Accuracy.ToString();

// Once consulting locations are saved, this is how current position can be calculated and saved in patient’s consultation history record.

Dispatcher.InvokeAsync(CoreDispatcherPriority.Normal, (s, a) =>
	Geoposition pos = (a.Context as IPositionChangedEventArgs).Position;

	textblock1.Text = "Latitude: " + pos.Coordinate.Latitude.ToString();
	textblock2.Text = "Longitude: " + pos.Coordinate.Longitude.ToString();
	textblock3.Text = "Accuracy: " + pos.Coordinate.Accuracy.ToString();
}, this, e);

// pos status can have various values like Ready, Initializing, NoData, Disabled, NotInitialized, NotAvailable.


Doctor can capture different form of electronic data during consultation. This data can be shared with patient using e-mail OR there is a new kid for sharing data – NFC. NFC can be used to share if patient also has a device that supports NFC. NFC is a new revolutionary way to share data between devices.  We just need to tap devices with each other and NFC takes care of sharing data between. Those devices can of different types like a mobile and a tablet. Those devices can have different operating systems underneath, but NFC makes data sharing possible in between them. For this purpose a new namespace Windows.Networking.Proximity is introduced in Windows. In NFC our device can trigger the proximity event to start data sharing OR our device can start sharing data with others. We will consider second scenario.

NFC supports 3 different modes. In this case we will consider Peer-to-Peer Mode.

1. Card emulation Mode:  This mode allows a NFC device to work as a contact-less smart card (i.e. a credit card). This feature can be used in applications for payments, e-ticketing and so on.

2. Peer-to-Peer Mode: This mode enables two NFC devices to exchange data using a bidirectional half duplex communication. From the point of view of the users, this mode simplifies information sharing: they just have to tap together their NFC devices with no need for any prior setup.   

3. Reader/Writer Mode: This mode allows an active NFC device to read from/write to a passive NFC tag. Typical examples are applications for smart posters. 

Here is a code snippet for sharing data using NFC (Near Field Communication) –

var proximityDevice = ProximityDevice.GetDefault();
if (proximityDevice != null)
    proximityDevice.DeviceArrived += ProximityDeviceArrived;     proximityDevice.DeviceDeparted += 	    ProximityDeviceDeparted;    
    WriteMessageText("Proximity device initialized.\n");
    WriteMessageText("Failed to initialized proximity device.\n");
void PublishMessage()
    publishedMessageId = proximityDevice.PublishMessage("Windows.SampleMessageType", publishText);
    DisplayStatus("Message published, tap another device to transmit.", StatusOutputText);
void SubscribeForMessage()
    subscribedMessageId = proximityDevice.SubscribeForMessage("Windows.SampleMessageType", MessageReceived);
    DisplayStatus("Subscribed for proximity message, enter proximity to receive.", StatusOutputText);

Once device connections are established, just publish and subscribe message needs to be done, to send and receive data respectively.

Points of Interest

Ultrabook provides really exciting features like touch aware, NFC opening up new horizons for apps to be developed. And implementing them in program is super easy.


v1.0 | Initial release | 10.15.2012.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Manoj Attal
Software Developer (Senior) PTC Software (India) Pvt Ltd.
India India
Manoj is from Pune, India. He is working on Microsoft technology stack like C#, Silverlight, SharePoint, Windows Phone.

You may also be interested in...

Comments and Discussions

QuestionWhich flavour? Pin
Chris Maunder15-Oct-12 9:20
adminChris Maunder15-Oct-12 9:20 
AnswerRe: Which flavour? Pin
Manoj Attal16-Oct-12 0:11
memberManoj Attal16-Oct-12 0:11 
GeneralRe: Which flavour? Pin
Chris Maunder16-Oct-12 3:28
adminChris Maunder16-Oct-12 3:28 
GeneralRe: Which flavour? Pin
Manoj Attal16-Oct-12 3:31
memberManoj Attal16-Oct-12 3:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.161208.1 | Last Updated 15 Oct 2012
Article Copyright 2012 by Manoj Attal
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid