DoseSpot: The Innovative E-Prescribing Solution for Healthcare Providers

Have you ever heard about E-Prescription?? No. Then you are on the right page to know about it.

E-Prescription is where you get a medical prescription right on your device just by online consulting with the doctor. Isn’t that much easier ? But for that, we will introduce you to the platforms working for these kinds of services. 

E-Prescribing Software sSolutions

  1. RXNT EHR
  2. Rcopia
  3. Surescripts E-Prescribing
  4. DoseSpot

And one of them which we worked on is the DoseSpot platform

What is DoseSpot?

DoseSpot is an integration that allows e-Prescribing services. DoseSpot is a platform for medical healthcare services or in-practice management and is designed affordably for IT HealthCare industries. Through this, we can send the prescription to the patient.

Features of DoseSpot

  • UI is easy to use
  • Prescribe medication electronically
  • Preview saved medication history
  • Notifications for prescription Status

How DoseSpot Work?

The below image is just a brief idea about how DoseSpot works.Dosespot

  • Embedded DoseSpot within DoseSpot app
  • This is an IFrame/Web control
  • Get into DoseSpot Login Page
  • Fetch the Patient List
  • Patient Details
  • Coverage Details
  • Add prescription
  • Medication History
  • Add prescription for the patient–approve send and patient receives the prescription

DoseSpot Implementation on Patient Side(Android)

As we had a brief introduction about DoseSpot, let’s check the implementation on the patient side. This guide is intended for developers as a detailed reference for the behavior of the RESTful APIs provided by the DoseSpot App. The purpose and usage of each operation, request and response details, and examples can be found in this document.

To implement DoseSpot on the patient side we need to create the profile while using DoseSpot Apis.

In order to grant access from your DoseSpot Staging environment to the RESTful API. This is enabled at the clinic level, so if you need to use multiple Staging clinics be sure to make that clear to your Integration Specialist. 

After we create an account on DoseSpot through the admin console they provide us the clinic Id.

Under clinic Id, we need to create a clinician to get the clinician Id. Once we get the clinic Id from the console they provide us with the patient Id.

Example.

For Create Patient – 12XXXX

For Physician – 13XXXX

Clinic_id – 11XXX

Clinical Key :- xxxxxxxxxxxxxxxxxxxxx

To create a patient on an android platform we use the APIs provided by the DoseSpot.

The endpoints shown for each operation in this guide should be appended to the base URL.

Note: The production base URL is different and will be provided after passing the Surescripts certification in the staging environment.

Authentication 

Every RESTful API request in DoseSpot needs to be authenticated.  To authenticate, you must create an access token using Basic Authentication. Before creating an access token, the following parameters are required

  • ClinicId
  • ClinicKey
  • UserId
  • Encrypted ClinicId
  • Encrypted UserId

To create  Encrypted ClinicId, and Encrypted UserId DoseSpot provide the required format accordingly. After we create this ids we can access the DoseSpot token

Creating an Access Token Perform an HTTP POST 

To create the token a BasicAuth header must be used in this request. Username must be set to ClinicId and Password to Encrypted ClinicId.

The body of this request must use the x-www-form-urlencoded content type and the following key-value pairs: Key Value grant_type password Username UserId Password Encrypted UserId Note: Use the exact string “password” without quotation marks.

Each time a token is needed, new Encrypted ClinicId and Encrypted UserId values must be generated. In the Staging environment, tokens are currently set to expire after 10 minutes.

Using retrofit we can have an example of the access token :

var okHttpClient = OkHttpClient().newBuilder().addInterceptor(object : Interceptor {

   @Throws(IOException::class)

   override fun intercept(chain: Interceptor.Chain): Response {

       val originalRequest: Request = chain.request()

       val builder: Request.Builder = originalRequest.newBuilder().header(

           "Authorization",

           Credentials.basic(

              CLINIC_USER_ID_DOSESPOT,  ENCRYPTED_CLINIC_USER_ID           )

       )

       val newRequest: Request = builder.build()

       return chain.proceed(newRequest)

   }

}).addInterceptor(HttpLoggingInterceptor().apply {

   level =

       if (BuildConfig.DEBUG) HttpLoggingInterceptor.Level.BODY else HttpLoggingInterceptor.Level.NONE

}).build()

val gson = GsonBuilder()

   .setLenient()

   .create();

private val retrofit = Retrofit.Builder()

   .baseUrl(DOSESPOT_BASE_URL)

   .client(okHttpClient)

   .addConverterFactory(GsonConverterFactory.create(gson))

   .build()

fun create(service: Class<T>): T {

   return retrofit.create(service)

}

@FormUrlEncoded

@POST("/endpoint")

fun getDoseSpotToken(

   @Field("grant_type") grant_type: String?,

   @Field("Username") Username: Int?,

   @Field("Password") title: String?

): Call<DoseSpotTokenResponseModel>?

val call = BasicAuthClient<RepositoryInterface>().create(RepositoryInterface::class.java)

   .getDoseSpotToken(

       PASSWORD,

      PATIENT_USER_ID_DOSESPOT,

      encryptedUserId

   )

call?.enqueue(object : Callback<DoseSpotTokenResponseModel> {

   override fun onFailure(call: Call<DoseSpotTokenResponseModel>, t: Throwable) {

    

       log.v(tags, toString())

   }

   override fun onResponse(

       call: Call<DoseSpotTokenResponseModel>,

       response: Response<DoseSpotTokenResponseModel>

   ) {

       if (response.isSuccessful) {

           response.body()?.let {

            val DOSE_SPOT_ACCESS_TOKENit.access_token

           }

         

       } else {

            log.v(tags, "else-${response.errorBody().toString()}")

       }

   }

})

From the above part we can now use DoseSpot access token for other apis of DoseSpot

Create Profile of Patient 

Now to create a patient profile on DoseSpot we need to follow the instruction given by DoseSpot for the apis

private val client = OkHttpClient.Builder().addInterceptor(HttpLoggingInterceptor().apply {

   level =

       if (BuildConfig.DEBUG) HttpLoggingInterceptor.Level.BODY else HttpLoggingInterceptor.Level.NONE

})

   .addInterceptor(

       OAuthInterceptor(

           "Bearer ", DOSE_SPOT_ACCESS_TOKEN        

       )).build()

val gson = GsonBuilder()

   .setLenient()

   .create()

private val retrofit = Retrofit.Builder()

   .baseUrl(DOSESPOT_BASE_URL)

   .client(client)

   .addConverterFactory(GsonConverterFactory.create(gson))

   .build()

fun create(service: Class<T>): T {

   return retrofit.create(service)

}

@FormUrlEncoded

@POST("/endpoint")

fun getDoseProfileId(

   @Field("FirstName") firstName: String?,

   @Field("LastName") lastName: String?,

   @Field("DateOfBirth") dateOfBirth: String,

   @Field("Gender") gender: Int,

   @Field("Address1") address1: String?,

   @Field("City") city: String?,

   @Field("State") state: String?,

   @Field("ZipCode") zipCode: String?,

   @Field("PrimaryPhone") primaryPhone: String?,

   @Field("PrimaryPhoneType") primaryPhoneType: Int?,

   @Field("Active") active: Boolean?,

   @Field("Height") height: Int?,

   @Field("HeightMetric") heightMetric: Int?,

   @Field("Weight") weight: Int?,

   @Field("WeightMetric") weightMetric: Int?,

): Call<DoseSpotProfileIDResponseModel>?

val call = AuthClient<RepositoryInterface>().create(RepositoryInterface::class.java)

   .getDoseProfileId(

      first_name,

       last_name,

       dateOfBirth.toString(),

       gender,

       address1,

       city,

       state,

       zipCode,

       primaryPhone,

       primaryPhoneType,

       true,

       height,

       1,

       weight?.toInt(),

       1

   )

call?.enqueue(object : Callback<DoseSpotProfileIDResponseModel?> {

   override fun onResponse(

       call: Call<DoseSpotProfileIDResponseModel?>,

       response: Response<DoseSpotProfileIDResponseModel?>

   ) {

   

       if (response.isSuccessful) {

           logE(Tags, "dosespot id-" + response.body()?.id)

           if (response.body()?.id != -1 && response.body()?.id != null) {

                              PATIENT_DOSESPOT_ID=response.body()?.id.toString().trim()

               

                     

       } else {

 log.v(Tags, "error" + dosespot_profile_error)

           }

       }

   }

   override fun onFailure(call: Call<DoseSpotProfileIDResponseModel?>, t: Throwable) {

     

       log.v(Tags, "failure" + t.message)

   }

})

Thus we got a successful response from dosespot to create a profile. Now physicians can send the prescription to the patient directly through a physician login portal 
coma

Conclusion

In this blog, we saw what is DoseSpot, Features of DoseSpot and its Implementation. This completes the guide to the implementation of DoseSpot on the Android platform.

Keep Reading

Keep Reading

Struggling with EHR integration? Learn about next-gen solutions in our upcoming webinar on Mar 6, at 11 AM EST.

Register Now

Let's create something together!