I have to use data caching for populating messages quite a lot. I build a database table with an auto increment field as the identifier and populate individual fields. I also have a date/time field and a single character field which is set to 1 when the data has been processed. You can use these fields when you want to clear data from the table.
The problem you may find if you store an HL7 segment in Sqlite is reserved characters like quotes etc. I have experimented with storing entire HL7 messages by first pulling out the unique identifiers (so you can retrieve the record you want) and converting the message to base 10 encoding.
This is a schema I have used to store fields from messages:
CREATE TABLE PAS_ARCHIVE (
id INTEGER PRIMARY KEY,
tpref VARCHAR,
trans VARCHAR,
caseno CHAR(2),
intno VARCHAR,
distno VARCHAR,
surname VARCHAR,
forename1 VARCHAR,
forename2 VARCHAR,
dob VARCHAR,
sex CHAR(1),
title VARCHAR,
homephone VARCHAR,
workphone VARCHAR,
dod VARCHAR,
addr1 VARCHAR,
addr2 VARCHAR,
addr3 VARCHAR,
addr4 VARCHAR,
postcode VARCHAR,
dataddrmove VARCHAR,
pmicomment VARCHAR,
nhsno VARCHAR,
userid VARCHAR,
patsurnameretain CHAR(1),
gpcodeint VARCHAR,
dategptransfer VARCHAR,
religcode VARCHAR,
marstat VARCHAR,
ethnic VARCHAR,
nokname VARCHAR,
relcode VARCHAR,
nokaddr1 VARCHAR,
nokaddr2 VARCHAR,
nokaddr3 VARCHAR,
nokaddr4 VARCHAR,
nokpcode VARCHAR,
nokhomephone VARCHAR,
nokworkphone VARCHAR,
pderror VARCHAR(3),
pferror VARCHAR(3),
sp1 VARCHAR,
sp2 VARCHAR,
sp3 VARCHAR,
sp4 VARCHAR,
processed INTEGER(1),
datetime DATETIME);