Skip to content

Instantly share code, notes, and snippets.

View shubhamsgit's full-sized avatar
🌍
Contributing to OpenSource

Shubham Sharma shubhamsgit

🌍
Contributing to OpenSource
View GitHub Profile

Google Summer of Code 2023 Final Work Submission Report

Project Information

Overview

@shubhamsgit
shubhamsgit / SampleTest.kt
Last active July 18, 2023 15:08
Sample Test for Appointment Repository
@Test
fun createTimeSlotWithQuery_success_returnsTimeSlot() {
val startDate = "2023-07-15T10:00:00Z"
val endDate = "2023-07-15T11:00:00Z"
val appointmentBlockGet = appointmentBlockGet
enqueueMockResponse("mocked_responses/AppointmentRepository/TimeSlotCreate-success.json")
val result: TimeSlot = appointmentRepository.createTimeSlot(startDate, endDate, appointmentBlockGet).toBlocking().first()
assertEquals(result.endDate, endDate)
@shubhamsgit
shubhamsgit / EncounterRepository.kt
Created June 5, 2023 15:04
SDK Function for fetching encounters from server and storing them locally
fun getAllEncountersByPatientUuidAndSaveLocally(uuid: String): Observable<List<Encounter>> {
val encounterList: MutableList<Encounter> = mutableListOf()
if (!NetworkUtils.isOnline()) throw Exception("Must be online to fetch encounters")
restApi.getAllEncountersForPatientByPatientUuid(uuid).execute().run {
if (isSuccessful && this.body() != null) {
val encounterResources: List<Resource> = this.body()!!.results
for (encounterResource in encounterResources) {
getEncounterByUuid(encounterResource.uuid!!).subscribeOn(Schedulers.io())
#include<bits/stdc++.h>
using namespace std;
int findnum(int x1, int y1){ //function that returns the element with an index
int sum1=1;
for(int i=0;i<(x1-1);i++){
sum1=sum1+(2+i);
}