accessing medical records on mobile devices dzone

9

Click here to load reader

Upload: bharathvetri2012

Post on 04-Jun-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Accessing Medical Records on Mobile Devices DZone

8/13/2019 Accessing Medical Records on Mobile Devices DZone

http://slidepdf.com/reader/full/accessing-medical-records-on-mobile-devices-dzone 1/9

© 2011 Pegasus Imaging Corporation, DBA Accusoft Pegasus 1 | P a g e

Accessing Medical Records on Mobile DevicesPart I: Android

New Android mobile devices are coming to market at a very rapid pace. The emergenceof this new class of hardware creates an opportunity for doctors and medicalprofessionals to access patient data wherever they are. Instead of having to go to akiosk or lug around printouts or an oversized laptop, they can use a mobile phone or atablet device to access patient data. Accusoft Pegasus, a leader in Windows SDKs, hasmoved into the mobile space with exciting new offerings that give medical professionals

mobile access to a wide array of medical data. This whitepaper will focus on two recentproduct releases and how they can be used to enable access to medical records on Android devices: AIMTools and Barcode Xpress Mobile .

Use Case: Patient Medical RecordsThe use of barcoded bracelets for patients is now commonplace, and for obviousreasons: it provides positive identification, even if a patient is unable to do sothemselves. This enhances patient safety and greatly reduces the chance of a medicalerror arising from dosing (or worse, operating on) the wrong patient. The New EnglandJournal of Medicine re cently documented a study in an article titled, “Effect of Bar-Code

Technology on the Safety of Medication Administration ”. The results of the studyconfirmed the use of barcode technology for dosing and administering patientmedications led to a significant reduction in errors.

Many facilities encode patient bracelets with 1D barcodes, such as Code 128. Code 128is an alphanumeric symbology, which is well suited for encoding information like apatient ID or name. It can also be read easily and accurately by commonly availablelaser scanners.

Page 2: Accessing Medical Records on Mobile Devices DZone

8/13/2019 Accessing Medical Records on Mobile Devices DZone

http://slidepdf.com/reader/full/accessing-medical-records-on-mobile-devices-dzone 2/9

© 2011 Pegasus Imaging Corporation, DBA Accusoft Pegasus 2 | P a g e

Medical Bracelets using 1D Barcodes First, we’ll show a 1D Barcode on a bracelet containing just a patient ID, encoded usingthe Code 128 symbology.

Here’s the bracelet on a patient’s arm:

And here’s Bar code Xpress Mobile for Android reading the barcode and displaying the

patient ID:

Page 3: Accessing Medical Records on Mobile Devices DZone

8/13/2019 Accessing Medical Records on Mobile Devices DZone

http://slidepdf.com/reader/full/accessing-medical-records-on-mobile-devices-dzone 3/9

© 2011 Pegasus Imaging Corporation, DBA Accusoft Pegasus 3 | P a g e

Using the Decoded Data Once the barcode has been decoded, the data (“A32581239”) is available forconsumption by other programs. For example, suppose this patient ID is anindex to a patient record that contains images on the hospital’s server. We canretrieve these images using the index from the barcode that was read byBarcode Xpress for Android. Once retrieved, the images can be displayed on themobile device.

The Code Android applications interact with the hardware using an event driven interfacecalled an Activity. The Activity model provides callbacks where actions are to beperformed. The Activity provided with Barcode Xpress Mobile exposes a numberof callbacks for your use; one of them is called onBarcodeRecognition . Thiscallback is triggered when a barcode is recognized during scanning.

Let’s see how we can use this callback to retrieve a file. In a real worldimplementation, there would be security considerations, encryption, etc. – thiscode fragment is intended to demonstrate just the basic capabilities of thesystem.

Page 4: Accessing Medical Records on Mobile Devices DZone

8/13/2019 Accessing Medical Records on Mobile Devices DZone

http://slidepdf.com/reader/full/accessing-medical-records-on-mobile-devices-dzone 4/9

© 2011 Pegasus Imaging Corporation, DBA Accusoft Pegasus 4 | P a g e

public void onBarcodeRecognition(Bundle msgBundle){

// Set the state to show a successful decoding happened. scanState = R.id. display_results ;

// Extract the decoding results from the message bundle BXResult result = msgBundle.getParcelable( "Result" );

// The Patient ID is encoded in the barcodeString patientId = result.getDataString();

// Use the data to get the file try {

URL url = new URL("http://www.YOUR_SITE.com/?=" + patientId + ".jpg" );URLConnection urlConn = url.openConnection();InputStream is = urlConn.getInputStream();BufferedInputStream bis = new BufferedInputStream(is);ByteArrayBuffer bab = new ByteArrayBuffer(1024);int data = 0;while ((data = bis.read()) != -1) {

bab.append(( byte ) data);}FileOutputStream fos = new FileOutputStream( "/sdcard/" + patientId + ".jpg" );fos.write(bab.toByteArray());fos.close();

} catch (MalformedURLException e) {e.printStackTrace();

} catch (IOException e) {e.printStackTrace();

}

Page 5: Accessing Medical Records on Mobile Devices DZone

8/13/2019 Accessing Medical Records on Mobile Devices DZone

http://slidepdf.com/reader/full/accessing-medical-records-on-mobile-devices-dzone 5/9

© 2011 Pegasus Imaging Corporation, DBA Accusoft Pegasus 5 | P a g e

Viewing Medical Images on AndroidNow that your application has obtained the patient’s ID using the barcode, and retrievedimages associated with that ID, you need a way to view the images. Many of thelossless image formats used in medical imaging, including 8 through 16-bit grayscaleJPEG 2000 and Lossless JPEG, are not supported natively by the Android operatingsystem. In order to interactively view and work with these images, they would need tobe converted to a lossy supported format like JPEG.

That is, until now.

The Accusoft Pegasus AIMTools SDK allows developers to write apps that work with the

original image data without the need for conversion or round trips to a server. Thismeans that a native Android app can interact with all of the original image data, while de-compressing and converting the parts of the image important to the user of theapplication. Window leveling, zooming and other common operations can be performedlocally; there is no requirement to call back to the server. This significantly increases theapp’s responsiveness and dramatically improves the user’s experience.

The TouchExampleView Multitouch sample from the Android team forms the basis forthe viewer we need to display the i mage returned in the patient’s record. The samplecode used for the viewer can be obtained from Android here:

http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.htmlIn order to view a medical image in our app, we need to get a Bitmap of the originalimage data using JNI calls to the AIMTools native libraries. The getBitmapNative JNImethod initiates the calls to the AIMTools native libraries. As mentioned before,

AIMTools has the ability to crop, resize and adjust window level (brightness andcontrast) of the original image data. These settings are contained in the ConvertParams structure. The implementation is as follows:

Page 6: Accessing Medical Records on Mobile Devices DZone

8/13/2019 Accessing Medical Records on Mobile Devices DZone

http://slidepdf.com/reader/full/accessing-medical-records-on-mobile-devices-dzone 6/9

© 2011 Pegasus Imaging Corporation, DBA Accusoft Pegasus 6 | P a g e

/** Get a bitmap of an image (native function).*/

JNIEXPORT jobject JNICALL Java_com_accusoft_viewer_AIMImage_getBitmapNative (JNIEnv* env,jobject image,jobject convertParams)

{jobject bitmap = NULL;AIM_IMAGE *pAimImage;

/* Try to get AIM_IMAGE pointer from Java class field. */ pAimImage = getAimImageNative(env, image);if (pAimImage != NULL) {

AIM_BITMAP *pAimBitmap;AIM_IMAGE_CONVERT_PARAMS *pConvertParams = NULL;bool ok = true ;

/* Convert convert params to native. */ if (convertParams != NULL) {

pConvertParams = extractAimImageConvertParamsNative(env, convertParams);if (pConvertParams == NULL) {

ok = false ;}

}

if (ok) {/* Get native bitmap. */ ok = AIMImageGetBitmap(pAimImage, &pAimBitmap, pConvertParams);if (ok) {

bitmap = createAimBitmap(env, pAimBitmap);if (bitmap == NULL) {

AIMBitmapDestroy(pAimBitmap);}

}

if (pConvertParams != NULL) {free(pConvertParams);}

}} else {

LOGD("AIMImage.getBitmapNative(): Could not get AIM_IMAGE from AIMImage.\n" );}

return (bitmap);}

AIMImageGetBitmap is a C function calling directly into the native AIMTools library toreturn a bitmap: /*

* Get a bitmap of an image.** Returns true if bitmap was created.* The output bitmap '*ppBitmap' MUST be destroyed by the caller.* If image is a container, this function will return false.*/

Page 7: Accessing Medical Records on Mobile Devices DZone

8/13/2019 Accessing Medical Records on Mobile Devices DZone

http://slidepdf.com/reader/full/accessing-medical-records-on-mobile-devices-dzone 7/9

© 2011 Pegasus Imaging Corporation, DBA Accusoft Pegasus 7 | P a g e

bool AIMImageGetBitmap (AIM_IMAGE *pImage, /* Pointer to image. */ AIM_BITMAP **ppBitmap, /* Pointer to output bitmap. */ const AIM_IMAGE_CONVERT_PARAMS *pConvertParams) /* Pointer to

structure describing image conversion parameters (resize, crop, brightness, contrast). */ {

bool ok = false ;

if ((pImage != NULL) && (ppBitmap != NULL)) {/* Provide default values for output parameters. */ *ppBitmap = NULL;

if (pImage->SubImageQuantity == 0u ) {void *pOutputBuffer = NULL;size_t outputLength = 0u ;AIM_BITMAP *pBitmap = NULL;bool convertOK = true ;RGBQUAD colorTbl[ 272 ];

if (pConvertParams != NULL) {if ((pConvertParams->Brightness < AIM_IMAGE_BRIGHTNESS_MIN) ||

(pConvertParams->Brightness > AIM_IMAGE_BRIGHTNESS_MAX)) {convertOK = false ;

}if ((pConvertParams->Contrast < AIM_IMAGE_CONTRAST_MIN) ||

(pConvertParams->Contrast > AIM_IMAGE_CONTRAST_MAX)) {convertOK = false ;

}}if (convertOK) {

bool bitmapOK;REGION region;

bitmapOK = pImage->pExpander->GetBitmapFunc( pImage,&pOutputBuffer, &outputLength, &region,

colorTbl, pConvertParams);if (bitmapOK) {

pBitmap = AIMBitmapCreateFromDataDirect(pOutputBuffer,outputLength, &region);

if (pBitmap == NULL) {AIM_DEBUG(( "Error: AIMImageGetBitmap(): Error creating bitmap.\n" ));free(pOutputBuffer);

} else {ok = true ;

}} else {

AIM_DEBUG(( "Error: AIMImageGetBitmap(): Error extracting bitmap.\n" ));}

} else {AIM_DEBUG(( "Error: AIMImageGetBitmap(): Invalid conversion paraeters.\n" ));

}

*ppBitmap = pBitmap;} else {

AIM_DEBUG(( "Error: AIMImageGetBitmap(): Bad bitmap of image container.\n" ));}

} else {AIM_DEBUG(( "Error: AIMImageGetBitmap(): Argument error.\n" ));

}return (ok);

}

Page 8: Accessing Medical Records on Mobile Devices DZone

8/13/2019 Accessing Medical Records on Mobile Devices DZone

http://slidepdf.com/reader/full/accessing-medical-records-on-mobile-devices-dzone 8/9

© 2011 Pegasus Imaging Corporation, DBA Accusoft Pegasus 8 | P a g e

Conclusion Accessing patient records and viewing medical images are key components of acomplete mobile EMR/EHR solution. However, the Android environment does notnatively support viewing of JPEG 2000 and Lossless JPEG images. Mobile SDKs from

Accusoft Pegasus help you overcome this limitation and build the applications yourclients need in the medical space to maximize productivity.

You can find Accusoft Pegasus product downloads and features at www.accusoft.com .

Explore our barcode web demo at http://demos.accusoft.com/barcodexpressdemo totest our barcode recognition accuracy or download a trial version of our mobile barcodeSDK, Barcode Xpress Mobile, at http://www.accusoft.com/barcodemobiledemo.htm . The

AIMTools demo video and SDK download are available athttp://www.accusoft.com/aimtools.htm . Please contact [email protected] for moreinformation.

Coming Soon ….In Part 2, we will discuss how to access medical records using iOS devices such as

Apple’s iPad and iPhone products. Accusoft Pegasus has already released AIMToolsfor iOS, and will release Barcode Xpress Mobile for iOS in the coming months. We hopeyou’re as excited about these solutions as we are!

About Accusoft Pegasus Accusoft Pegasus provides imaging software development kits (SDKs) that acceleratedevelopment and viewers that facilitate collaboration. Our code works reliably behind thescenes when an application calls for capturing, processing, storing and viewing images.

Add barcode, compression, DICOM, image processing, OCR/ICR, forms processing,PDF, scanning, video, and image viewing to your applications. Technology is deliveredfor multiple 32-bit/64-bit platforms and development environments, including .NET,Silverlight, ASP.NET, iOS, Android, ActiveX, Java, Linux, Solaris, Mac OSX, and IBM

AIX. Customers receive superior technical support and customer service by trained, in-house teams dedicated to help meet their needs. Find unlimited full version trial SDKsand demos at www.accusoft.com .

Page 9: Accessing Medical Records on Mobile Devices DZone

8/13/2019 Accessing Medical Records on Mobile Devices DZone

http://slidepdf.com/reader/full/accessing-medical-records-on-mobile-devices-dzone 9/9

© 2011 Pegasus Imaging Corporation, DBA Accusoft Pegasus 9 | P a g e

About the Authors Rob Rimbold is a Senior Software Engineer with Accusoft Pegasus. He has over 20years of multi-discipline software development experience. Rob graduated with a BSCSfrom The University of Lowell, MA.

Scott Wilson is a Project Manager with Accusoft Pegasus. He has had over 20 years ofsoftware development and management experience. Scott graduated with a B.Sc. fromMcMaster University in Hamilton, Canada.

Steve Wilson is a Product Group Director with Accusoft Pegasus. Steve is responsiblefor leading his team to develop new products as well as increase the feature sets withinseveral Accusoft Pegasus product lines. He brings a strong technical background to themanagement team, as well as experience managing diverse offshore and onshoredevelopment teams. Steve earned a Bachelor of Science in Computer Science from theUniversity of South Florida.