1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
public static int storeRespirationMeasurement(int lifetouch_id, double respiration_rate, long timestamp_in_ms, boolean acknowledgment_message)
{
ContentValues RespirationMeasurement = new ContentValues();
RespirationMeasurement.put(TableLifetouchRespirationRate.COLUMN_LIFETOUCH_ID, lifetouch_id);
RespirationMeasurement.put(TableLifetouchRespirationRate.COLUMN_RESPIRATION_RATE, respiration_rate);
RespirationMeasurement.put(TableLifetouchRespirationRate.COLUMN_TIMESTAMP, timestamp_in_ms);
RespirationMeasurement.put(TableLifetouchRespirationRate.COLUMN_SESSION_NUMBER, session_number);
RespirationMeasurement.put(TableLifetouchRespirationRate.COLUMN_ACKNOWLEDGMENT_MESSAGE, acknowledgment_message);
try
{
respirationRateUri = parent_context.getContentResolver().insert(IsansysPatientGatewayContentProvider.CONTENT_URI_RESPIRATION_RATES, RespirationMeasurement);
Log.d("storeRespirationMeasurement : New", respirationRateUri.toString());
String database_row_id_as_string = respirationRateUri.toString().substring(respirationRateUri.toString().lastIndexOf('/') + 1);
int database_row_id = Integer.parseInt(database_row_id_as_string);
return database_row_id;
}
catch (Exception e)
{
Log.d("storeRespirationMeasurement Exception", e.toString());
return 0;
}
}
public static void updateRespirationMeasurement(int database_row_id, boolean acknowledgment_message )
{
String strFilter = "_id=" + database_row_id;
ContentValues args = new ContentValues();
args.put(TableLifetouchRespirationRate.COLUMN_ACKNOWLEDGMENT_MESSAGE, acknowledgment_message);
parent_context.getContentResolver().update(IsansysPatientGatewayContentProvider.CONTENT_URI_RESPIRATION_RATES, args, strFilter, null);
} |
Partager