|
|
-
This document contains general guidelines for using the PeakFlow data type. It does not cover all the information that is stored in the type – see the PeakFlow documentation for more information.
The PeakFlow data type is used to store peak flow measurements obtained as part of ongoing peak flow tracking.
A measurement can store values for pef, fev1, or fev6. In addition, there may be information useful to interpret the measurement (such as measurement context, notes about the measurement, etc.) in the MeasurementPlags property.
The Peak Flow data type is versioned on top of the previous Spirometry data type, which has been deprecated. Current data that was stored as Spirometry measuments may now be accessed as PeakFlow measurements.
|
-
This document contains general guidelines for using the Exercise and AerobicSession data types. It does not cover all the information that is stored in the type – see the Exercise and AerobicSession documentation for more information. The Exercise data type is a replacement for the AerobicSession type. In most cases, when a HealthVault data type is updated, applications can use simply switch from using the old data type to updated one. Because of the nature of the changes between the two types, some applications may need to contain code that handles both types of data. More information about scenarios where that is necessary is contained later in the document. The Exercise type The Exercise type records the completion of an exercise. The simplest Exercise record contains the exercise activity and the date and time of the activity: DateTime exerciseDateTime = DateTime.Now; ApproximateDateTime exerciseDataTimeApprox = new ApproximateDateTime( new ApproximateDate(exerciseDateTime.Year, exerciseDateTime.Month, exerciseDateTime.Day), new ApproximateTime(exerciseDateTime.Hour, exerciseDateTime.Minute, exerciseDateTime.Second)); CodableValue activity = new CodableValue("Lacrosse", new CodedValue("Lacrosse", "exercise-activities)); Exercise exercise = new Exercise(exerciseDataTimeApprox, activity); The Exercise type also supports setting the Title, Distance, and Duration of the exercise. Adding exercise details In addition to this very basic information, an application may store details about the exercise session in the Details collection. Each detail describes the type of the detail and the value of the detail. The value is stored as a StructuredMeasurement, storing a value and the units of the value. StructuredMeasurement averageHeartrate = new StructuredMeasurement(); averageHeartrate.Value = averageHeartrateInt; averageHeartrate.Units = new CodableValue("BPM"); The type (or kind) of detail is stored as a coded value. CodedValue averageHeartrateDetailKind = new CodedValue(ExerciseDetail.AverageHeartrate_BPM, "exercise-details"); A list of the kinds of information that can be stored in details is in the exercise-details vocabulary. To make it easier for applications to code data correctly, the ExerciseDetail class defines a set of static strings that correspond to entries in the exercise-details vocabulary. The name of the constant encodes both the detail that is being stored and the units of the detail. The measurement and the kind are stored in the ExerciseDetail instance: ExerciseDetail averageHeartrateDetail = new ExerciseDetail(averageHeartrateDetailKind, averageHeartrate); Finally, that instance is inserted into the Details dictionary on the exercise instance. exercise.Details.Add(ExerciseDetail.AverageHeartrate_BPM, averageHeartrateDetail); Loading exercise details Applications that are interested in a specific detail can simply look for it in the details dictionary: if (exercise.Details.ContainsKey(ExerciseDetail.AverageHeartrate_BPM)) { double value = exercise.Details[ExerciseDetail.AverageHeartrate_BPM].Value.Value; } Segments Some exercises are composed of segments, such as the laps in a race or the legs of a triathlon. An application that wishes to store such data can store ExerciseSegment instances in the Segments collection. The ExerciseSegment class stores the same set of values as the Exercise class, and it also stores an offset that stores the offset of the start of the segment from the start of the exercise. ExerciseSamples data type Some heart rate monitors and cycling computers collect samples (such as heart rate, altitude, position, etc.) at regular intervals during an exercise session. The set of samples for a given type of measurement is stored in the ExerciseSamples data type, and these are associated with an Exercise session through the related items or client items. ExerciseSamples altitudeSamples = new ExerciseSamples(); altitudeSamples.Name = new CodableValue(ExerciseSamples.Altitude_meters, new CodedValue(ExerciseSamples.Altitude_meters, "exercise-sample-names")); altitudeSamples.Unit = new CodableValue("Meters", new CodedValue("Meters", "exercise-units")); altitudeSamples.SamplingInterval = samplingInterval; This sets up the ExerciseSamples instance. The coding for the kind of information stored in a sample is similar to the coding for an exercise detail. In this case, we’re storing altitude expressed in meters. Next, we need to store the actual samples, which is handled by the ExerciseSampleData property. Each sample may store either one or two double values, depending on the type of information that is being stored (currently, position data is the only sample kind that stores two values). The application should use either the SingleValuedSamples or TwoValuedSamples collection based on the kind of data that is stored. This code adds a series of altitude values: double offsetInSeconds = 0.0; foreach (double altitude in altitudeSampleList) { ExerciseSampleOneValue altitudeSample = new ExerciseSampleOneValue(offsetInSeconds, altitude); offsetInSeconds += samplingInterval; altitudeSamples.ExerciseSamplesData.SingleValuedSamples.Add(altitudeSample); } In this case, because altitude is a single-valued sample, we create an instance of ExerciseSampleOneValue() to store the altitude value and the offsetInSeconds from the start of the sample set, and store it in the SingleValuedSamples collection. The ExerciseSamples data type also supports data that is collected at irregular intervals, such as positions stored when a user presses a button on a device. It is recommended that ExerciseSample instances are related to Exercise instances using related items. Fetching ExerciseSample data To provide efficient storage of the sample data, it is stored in the OtherData section of the object, which is not fetched by default. This allows an application to examine a ExerciseSamples instance to see if it is interesting before incurring the overhead of fetching the data. For example, the following code will look for and process any altitude samples that it finds… HealthRecordSearcher searcher = PersonInfo.SelectedRecord.CreateSearcher(); HealthRecordFilter filter = new HealthRecordFilter(ExerciseSamples.TypeId); searcher.Filters.Add(filter); HealthRecordItemCollection samplesList = searcher.GetMatchingItems()[0]; foreach (ExerciseSamples samples in samplesList) { if (samples.Name.Text == ExerciseSamples.Altitude_meters) { // query again to load the sample data ExerciseSamples fullSample = (ExerciseSamples) PersonInfo.SelectedRecord.GetItem(samples.Key.Id, HealthRecordItemSections.Core | HealthRecordItemSections.OtherData); ProcessAltitudeSample(fullSample); } } After the right kind of sample is found, the object is queried, this time including the sample data itself. ExerciseSample encoding HealthVault Connection Center may apply a compress/encode step (using gzip and base64 encode) to the comma-separated data. This can be detected by looking for a ContentEncoding that is not null. The current version (0903 release) of the ExerciseSamples data type does not directly support this format. Applications wishing to read sample data that is generated from devices connected through Connection Center can use the following method: foreach (ExerciseSamples sample in samples) { ProcessCompressedAndEncodedData(sample); foreach (ExerciseSampleOneValue sampleItem in sample.ExerciseSamplesData.SingleValuedSamples) { int k = 12; } } // Handle unpacking/decompressing data if it is in that format. private void ProcessCompressedAndEncodedData(ExerciseSamples sample) { if (sample.OtherData.ContentEncoding == null) { return; } // Only valid encoding here is base64, so we go with that... byte[] buffer = Convert.FromBase64String(sample.OtherData.Data); if (buffer.Length < 2) { return; } // look at the bytes to see if they are the proper gzip header... if ((buffer[0] != 31) || (buffer[1] != 139)) { return; // nothing we can do } // gzip decompress... using (MemoryStream bufferStream = new MemoryStream(buffer)) { using (GZipStream decompress = new GZipStream(bufferStream, CompressionMode.Decompress)) { using (StreamReader reader = new StreamReader(decompress)) { string result = reader.ReadToEnd(); sample.OtherData.Data = result; sample.OtherData.ContentEncoding = null; sample.OtherData.ContentType = "text/csv"; } } } } Exercise and AerobicSession Exercise is a new version of the AerobicSession data type, and therefore the two types interoperate through versioning when queries are performed. Existing applications that query for AerobicSession instances will see Exercise instances translated into AerobicSession instances, and vice versa. There are two important caveats to this: - The sample data is only accessible through the type that actually stored the data, so if your application needs access to sample data, it will need to deal with both types natively.
- The transforms between the two types may perform well enough for your application if there is lots of data present. This would be another reason to deal with both types natively.
To deal with both types natively, the application will need to be authorized for both types. When a query is performed, a collection containing both AerobicSession and Exercise instances will be returned, and the application may then process instances of each type separately. Calories and Energy In the AerobicSession data type, there are two properties – Energy and EnergyFromFat – that have ambiguous definitions. The descriptions say that they store the food energy consumed, which leads some developers to store amounts measured in calories, but the remarks say that the unit is kilojoules, so other developers convert calories to kilojoules and store that number. The Exercise class defines analogous measures using calories (using the CaloriesBurned_calories and FatCaloriesBurned_calories detail types), but this presented a problem during versioning – if we version the new details to the Energy and EnergyFromFat properties in AerobicSession, some of the data that versions forward will be incorrect. We therefore decided to add two “shadow details” to Exercise. The EnergyOld_kj and EnergyFromFatOld_kj details version with the properties in AerobicSession, so applications that deal with exercise may want to look at these values, with the caveat that the number in it may be measured in kJ or in calories. Upgrading Aerobic Sessions to Exercises To improve performance and reduce application complexity when an application may have to deal with data of either type, it is permissible for applications to upgrade existing AerobicSession instances to Exercise instances. This can be done in the following manner by an application authorized to access both types: - Perform a query to fetch all AerobicSession instances as Exercise instances. This can be accomplished by adding the Exercise type ID to the HealthRecordFilter.View.TypeVersionFormat collection.
- Loop over each Exercise instance.
- Fetch the instance as an AerobicSession. If the instance has sample data associated with it, create a separate ExerciseSamples instance for each sample set in the AerobicSession. Add the instance ID of the new ExerciseSamples object to the Exercise instance related items collection.
- Add the instance id of the AerobicSession object to the Exercise instance related item collection.
- Save the new Exercise instance.
- Delete the AerobicSession instance.
|
-
This document contains general guidelines for using the Pregnancy data type. It does not cover all the information that is stored in the type – see the Pregnancy member documentation for more information.
The Pregnancy data type stores details about a pregnancy, from conception through labor and delivery.
Initially, the Pregnancy instance will likely contain only a few details, such as the estimated due date for the pregnancy. More information may be added as the pregnancy progresses, and when there is a resolution to the pregnancy, a delivery instance is added for each of the fetuses.
The delivery information may contain a Baby instance containing information about the baby. The information stored in the Baby instance may be copied to a new health record for the child when such a record is created.
The pregnancy instance is not intended to store information pertaining to the mother’s health during the pregnancy. If the mother has (for example) gestational diabetes during her pregnancy, that would be stored in a condition in her health record.
The following is an example of the pregnancy record that would be created for the birth of twins…
Pregnancy pregnancy = new Pregnancy();
// information that may be available early in the pregnancy pregnancy.DueDate = new ApproximateDate(2008, 10, 31); pregnancy.LastMenstrualPeriod = new HealthServiceDate(2008, 1, 25); pregnancy.ConceptionMethod = new CodableValue("Artificial insemination: In vitro fertilization (IVF)", new CodedValue("InVitroFertilization", "conception-methods", "wc", "1")); pregnancy.FetusCount = 2;
// information available at time of delivery... pregnancy.GestationalAge = 37;
Delivery delivery1 = new Delivery(); delivery1.Location = new Organization("General Hospital"); delivery1.TimeOfDelivery = new ApproximateDateTime(new ApproximateDate(2008, 11, 1), new ApproximateTime(00, 15, 35)); delivery1.LaborDuration = 123; delivery1.Anesthesia.Add(new CodableValue("Epidural analgesia", new CodedValue("EpiduralAnalgesia", "anesthesia-methods", "wc", "1")));
delivery1.DeliveryMethod = new CodableValue("Caesarean section", new CodedValue("CSection", "delivery-methods", "wc", "1")); delivery1.Outcome = new CodableValue("Live birth", new CodedValue("LiveBirth", "pregnancy-outcomes", "wc", "1"));
delivery1.Baby = new Baby(); delivery1.Baby.Name = new Name("Thomas John Andersen"); delivery1.Baby.Gender = new CodableValue("Male", new CodedValue("male", "gender-types", "wc", "1")); delivery1.Baby.Weight = new WeightValue(2.5, new DisplayValue(5.5, "pounds")); delivery1.Baby.Length = new Length(0.46, new DisplayValue(18, "inches")); delivery1.Baby.HeadCircumference = new Length(0.31, new DisplayValue(12.4, "inches"));
pregnancy.Delivery.Add(delivery1);
Delivery delivery2 = new Delivery(); delivery2.Location = new Organization("General Hospital"); delivery2.TimeOfDelivery = new ApproximateDateTime(new ApproximateDate(2008, 11, 1), new ApproximateTime(01, 20, 52)); delivery2.LaborDuration = 198; delivery2.Anesthesia.Add(new CodableValue("Epidural analgesia", new CodedValue("EpiduralAnalgesia", "anesthesia-methods", "wc", "1")));
delivery2.DeliveryMethod = new CodableValue("Caesarean section", new CodedValue("CSection", "delivery-methods", "wc", "1")); delivery2.Outcome = new CodableValue("Live birth", new CodedValue("LiveBirth", "pregnancy-outcomes", "wc", "1"));
delivery2.Baby = new Baby(); delivery2.Baby.Name = new Name("Elizabeth Marie Andersen"); delivery2.Baby.Gender = new CodableValue("Female", new CodedValue("female", "gender-types", "wc", "1")); delivery2.Baby.Weight = new WeightValue(2.4, new DisplayValue(5.3, "pounds")); delivery2.Baby.Length = new Length(0.44, new DisplayValue(17.5, "inches")); delivery2.Baby.HeadCircumference = new Length(0.32, new DisplayValue(12.6, "inches"));
pregnancy.Delivery.Add(delivery2);
PersonInfo.SelectedRecord.NewItem(pregnancy);
|
-
This document contains general guidelines for using the GeneticSnpResults data type. It does not cover all the information that is stored in the type – see the GeneticSnpResults member documentation for more information.
The GeneticSnpResults type is used to store the results of a test that determines single nucleotide polymorphisms in a person’s genome.
Important properties
GenomeBuild
The GenomeBuild provides a definition for the SNP ids that are stored in the result data. The definitions of the SNPs themselves are in the NCBI dbSNP database.
Chromosome
The chromosome on which the SNP is located.
NumberingScheme
The numbering scheme (0-based or 1-based) which defines the physical locations of the start and end positions on the chromosome.
Saving results
Because of the amount of data in a typical result set (currently on the order of a million individual SNPs), the results are grouped into separate instances by chromosome, and the data is stored in a compact format in the other-data section of the instance.
The following code illustrates how to create and save a set of SNP test results:
// for each chromosome in the results { GeneticSnpResults resultsForOneChromosome = new GeneticSnpResults(when, genomeBuild, chromosome, numberingScheme);
// set optional properties
{ // for each SNP result for the current chromosome SnpItem item = new SnpItem("rs1891906", "-", "GT", "SNP_C-315533", 940106, 940107); resultsForOneChromosome.SnpData.SnpItems.Add(item.ReferenceSnpId, item); }
PersonInfo.SelectedRecord.NewItem(resultsForOneChromosome); }
The when value should be set to the date and time when the results were generated, and should be the same across all chromosomes of a set of result.
Loading results
Loading a set of results will require processing multiple instances. There may be multiple sets of results in a single HealthVault record, and it is therefore recommended that applications load the results in two phases. In the first phase, the instances are loaded and then examined to see if they contain data that is of interested, and then the other-data for those instances is retrieved one instance at a time.
The following code illustrates this technique:
HealthRecordSearcher searcher = PersonInfo.SelectedRecord.CreateSearcher(); HealthRecordFilter filter = new HealthRecordFilter(GeneticSnpResults.TypeId); searcher.Filters.Add(filter);
HealthRecordItemCollection items = searcher.GetMatchingItems()[0]; List<HealthRecordItemKey> interestingItems = new List<HealthRecordItemKey>();
// figure out which ones are interesting... foreach (GeneticSnpResults resultsForOneChromosome in items) { if (IsInteresting(resultsForOneChromosome)) { interestingItems.Add(resultsForOneChromosome.Key); } }
// fetch the results data for each of the interesting ones... foreach (HealthRecordItemKey key in interestingItems) { GeneticSnpResults results = (GeneticSnpResults)PersonInfo.SelectedRecord.GetItem(key.Id, HealthRecordItemSections.Core | HealthRecordItemSections.Xml | HealthRecordItemSections.OtherData);
foreach (SnpItem snpItem in results.SnpData.SnpItems.Values) { // process the item here... } }
Implementation details
The low-level details of the format of the results data can be found in the schema for the type (link). Details about how the .NET classes deal with this format can be found here (link).
|
-
The HealthVault comma-separated data format is used to store data in a space-efficient format in the other-data section of data types.
The actual data types provide a layer of abstraction on top of the comma-separated types, and it is recommended that data is accessed through those abstractions rather than using the underlying support types. However, it can be useful to understand how the support types work.
The underlying comma-separated format follows the “C-style” rules for character escaping, where a “\” can be placed in front of any character to escape it.
In addition, the format supports the concept of an “escape”, which is a “name=value” pair that is placed in the comma-separated list instead of a value. The meaning of escapes is defined by a particular data type.
List entry definition
Each item in the comma-separated list is represented as an instance of a class derived from OtherItemDataCsvItem. There are 3 primitive item types derived from this base class:
- OtherItemDataCsvString is a string value.
- OtherItemDataCsvDouble is a double value.
- OtherItemDataCsvEscape is an escape.
class OtherItemDataCsv
This class handles converting between the instance-based model that is used by the data type class and the underlying string representation.
To store data to the string representation, the data type calls SetOtherData() and passes in a collection of OtherItemDataCsvItem instances. This method will take the individual instances in the collection, call the ToString() method on them, and then place the resulting string values into the comma-separated format, applying appropriate character escaping.
To convert data from the string representation to a collection, the data type calls GetAsString(). This returns a collection of OtherItemDataCsvItem that contains either string items or escape items. If the data type knows that the data contains only double values and escapes, it can instead call GetAsDouble(), and all string values will be converted to doubles as a convenience.
Note that there is no type information stored in the raw string format, so all items are inherently strings when they are retrieved, and any interpretation to a different type is done based on information that the data type has, not information stored with the data.
|
-
If you haven't already read through the proposed changes for this data type, please take a look at:
http://blogs.msdn.com/healthvaultdatatypes/archive/2008/09/17/for-review-updates-to-spirometer-measurement.aspx
Here is a draft version of the updated data type:
Peak Flow Measurement type
|
Element |
Type |
Occurrence |
Description |
|
when |
approx-date-time |
1..1 |
The date and time of the measurement. |
|
pef |
flow-value |
0..1 |
The peak expiratory flow, measured in liters/second. |
|
pef-best |
flow-value |
0..1 |
The highest PEF measurement, measured in liters/second. |
|
fev1 |
volume-value |
0..1 |
The forced expiratory volume in one second, measured in liters. |
|
fev6 |
volume-value |
0..1 |
The forced expiratory volume in six seconds, measured in liters. |
|
measurement-flags |
codable-value |
0..1 |
Additional information about the measurement.
Examples: Incomplete measurement. |
Note: fev1 has been updated from type flow-value to type volume-value to accurately describe this data element.
Volume-Value type
|
Element |
Type |
Occurrence |
Description |
|
liters |
positiveDouble |
1..1 |
The volume measurement in liters (L). |
|
display |
display-value |
0..1 |
The display value for the volume measurement.
The display value contains the volume measurement value stored in the user's preference of units. |
|
-
LabTestResults ltr = new LabTestResults();
ltr.OrderedBy = new Organization("39502605");
ltr.When = new ApproximateDateTime("2008-01-26 20:05:00.000");
LabTestResultGroup grp = new LabTestResultGroup(new CodableValue("CBC With Differential/Platelet"));
grp.LaboratoryName = new Organization("MB");
grp.Status = new CodableValue("C");
ltr.Groups.Add(grp);
LabTestResultDetails details = new LabTestResultDetails();
details.CollectionMethod = new CodableValue("Methodraw");
details.ClinicalCode = new CodableValue("Monocytes", new CodedValue("11112-0", "loinc", "regenstrief", "2.22")); // code to a real vocab (loinc?) here...
details.Name = "Monocytes";
details.Status = new CodableValue("F");
details.When = new ApproximateDateTime(); // needs to be set to a real value - was DateTime.Parse("2008-01-26 06:56:00.000"));
details.Value = new LabTestResultValue();
details.Value.Ranges.Add( new TestResultRange(new CodableValue("ReferenceRange"), new DoubleRange(4, 13)));
details.Value.Measurement = new GeneralMeasurement();
details.Value.Measurement.Display = "19%";
details.Value.Measurement.Structured.Add( new StructuredMeasurement(19, new CodableValue("%", new CodedValue("pcnt", "lab-results-units"))));
grp.Results.Add(details);
PersonInfo.SelectedRecord.NewItem(ltr);
|
-
In working with some of you, we’ve determined that the Spriometer Measurement data type is serving a bit of double-duty in its current form. As it turns out, there are two primary but very different types of measurements that this data type is currently thought to store: Spriometry and Peak Flow.
Spirometry is a clinical diagnostic test using clinical devices to map out the lung function of a patient who suffers from a debilitating lung disease. Patients typically are brought into the clinic several times per year to chart out their decline in capacity, volume, force, etc. These visits can range from once per year to many times per year. A typical measurement would include FEV1, FET, SVC, Percentage 25 to 75, Percentage 25 to 50, and a bunch of other values.
Peak Flow, on the other hand, is typically a home monitoring test for people with asthma only. These tests are done at the convenience of the consumer and a high frequency (daily). The measurements are primarily PEF although some can also determine FEV1 (6).
To date, all of solution providers that we have contacted are using the Spriometer Measurement data type to store peak flow measurements – by means of a device or an application. A new data element has been suggested to store the personal best flow measurement at the time of the current flow measurement was taken. By storing this personal best along with the current flow measurement, an application can more easily track and graph the improvement or decline over time.
Assuming everyone is using this data type in the same way (speak up if you’re not), then we propose the following updates:
1. Rename the existing Spirometer Measurement data type to Peak Flow Measurement.
2. Add Personal Best as a new element to the data type.
3. Remove Spirometry specific data elements from the data type. We’ll revisit this and most likely introduce a specific data type for Lung Functions/Spriometry when we hear from partners with this type of clinical scenario.
If your application uses the current Spriometer Measurement data type and you have any comments or questions about this pending update, please post them to the Data Types forum.
|
-
This is a new data type designed to store pregnancy related information. The Pregnancy data type supplements (and would be related to) existing data types like appointments, conditions and medications to help with scenarios that a consumer might find in a pregnancy diary or when talking with a doctor about past pregnancies.
The structure we created includes a top level Pregnancy type which in turn contains Delivery and Resolution sub types. One thing you will notice is that there are no required elements in this data type. This is so the consumer can use the type to build up a record of the pregnancy over time.
Pregnancy type
All the high level information is stored at this level.
|
Element |
Type |
Occurrence |
Description |
|
due date |
approx-date |
0..1 |
The approximate due date. |
|
last-menstrual-period |
approx-date |
0..1 |
The first day of the last menstrual cycle. |
|
conception-method |
codable-value |
0..1 |
The method of conception. |
|
fetus-count |
positiveInteger |
0..1 |
The number of fetuses. |
|
mother-maiden-name |
string |
0..1 |
The maiden name of the mother. |
|
father-name |
string |
0..1 |
The name of the father. |
|
delivery |
delivery |
0..1 |
Details about the delivery. |
|
resolution |
resolution |
0..N |
Details about the resolution for each fetus. |
Delivery sub type
The details describing the delivery event are stored in this sub type.
|
Element |
Type |
Occurrence |
Description |
|
gestational-age |
positiveInteger |
0..1 |
Number of weeks of pregnancy at the time of delivery. |
|
delivery-location |
organization |
0..1 |
The place where the delivery occurred. |
|
delivery-method |
codable-value |
0..1 |
The method of the delivery. |
|
anesthesia |
codable-value |
0..N |
The anesthesia used during labor and delivery. |
|
complications |
codable-value |
0..N |
Any complications during labor and delivery. |
|
labor-duration |
positiveDouble |
0..1 |
The duration of the labor in minutes. |
Resolution sub type
The details describing the resolution of the pregnancy are stored in this sub type.
|
Element |
Type |
Occurrence |
Description |
|
when |
approx-date-time |
0..1 |
The data and time of the resolution. |
|
outcome |
codable-value |
0..1 |
The outcome for a fetus. |
|
child-name |
string |
0..1 |
The name of the child. |
|
gender |
codable-value |
0..1 |
The gender of the child. |
|
weight |
weight-value |
0..1 |
The birth weight of the child. |
|
length |
length-value |
0..1 |
The birth length of the child. |
Vocabularies referenced in the Pregnancy data type
There are several vocabularies mentioned above and described in this section.
|
Conception Method |
|
Intercourse |
|
Intracervical insemination |
|
Intrauterine insemination |
|
In vitro fertilization |
|
Gamete Intrafallopian transfer |
|
Zygote intrafallopian transfer |
|
Delivery Method |
|
Vaginal |
|
Assisted vaginal |
|
Caesarean section |
|
Anesthesia |
|
Systemic analgesics |
|
Local anesthesia |
|
Regional analgesia |
|
Epidural analgesia |
|
Spinal block |
|
Combined spinal-epidural block |
|
General anesthesia |
|
Pudendal block |
|
Complications |
|
Breech |
|
Placenta previa |
|
Big baby (Macrosomia) |
|
Emergency home birth |
|
Pre-term labor |
|
Induced labor |
|
Uterine rupture |
|
Cephalopelvic disproportion |
|
Water break |
|
Episiotomy |
|
Outcome |
|
Live birth |
|
Miscarriage |
|
Stillborn |
|
Abortion |
If this is a type that you would find useful and have any comments or questions, please post them to the Data Types forum.
|
-
This type is intended to store the results of a genetic SNP test. If you want to know more about what a SNP is, I recommend reading the NCBI primer. The data stored in this type is fairly simple – a small amount of metadata, and then a large list of results. | Element | Type | Occurrence | Description | | when | approx-date-time | 1 | The date and time of the test | | genome-build | string | 1 | The genome build that defines the SNPs. Example: NCBI Build 36.3 | | chromosone | string | 1 | The chromosone on which the SNPs are located. Examples: 1, 22, X, MT | The SNP results are stored in the other data portion of the instance, in comma-separated format. Each SNP is encoded as follows: [refSNP id],[strand orientation],[result] Where:
- refSNP id: identifier from NCBI dbSNP database
- strand orientation: "+" encodes top, "-" encodes bottom.
- result: the result of the test
Example: rs1891906,-,GT Any comments on this type should be made in the following data type forum post.
|
-
Please comment on the following proposal… Some types of data – such as exercise sample data or genetic test data – store large amounts of data. Storing that data in an XML format involves a considerable amount of overhead, and the data is therefore stored in a comma-separated format in the other-data section of a thing instance. This document describes how the OtherItemData class and the CSV format are used to store such data. Goals The format should be: - Simple to understand and parse
- Space efficient
- Extensible to support out-of-band data in with the normal data.
Basic format The format is merely a comma-separated list of items, with optional escape values. The list is inherently a one-dimensional series of string values, though each thing type may interpret that list differently. Given the following list: 15,333,999,10,00,399 If this is heart rate sample data, it might represent 6 individual samples. If it is GPS location data, it might represent 3 latitude/longitude pairs. The specifics of such interpretation can be found in the documentation for a specific thing type. Escapes It is useful to be able to insert out-of-band data (that is, data that is not part of the list of values) in the comma-separated information to indicate that the data that follows has a different set of assumptions. For example, an escape might be used to indicate a change in sampling frequency or to provide a value that is common in a batch of data. Escapes use a simple “name=value” format. For example: 15,1333,interval=555,33,22,11 Denotes the following list: 15 1333 33 22 11 With an escape before 33 (ie at index=2). The name and value may include any character with the exception of “=”. Restrictions and special characters Because the “,” and “=” characters are used in the format, they cannot be used directly in a CSV list, but are expressed as follows: Literal “,” in a string value: Literal commas are expressed by enclosing the entire list item in double quotes. For example: 15,1333,”12,13”,15 Encodes the following list: 15 133 12,13 15 Literal “=” in a string value: A literal equals sign is expressed by doubling it in the string value. For example: 15,133,12==13,15 Encodes the following list: 15 133 12=13 15 OtherItemData class The other item data section of the thing type (expressed as the OtherItemData class in the .NET library) is used to store the csv data, and specify its type. Its properties should be set as follows: Content type: The content type is set to the following: text/x-hvcs[1] The “x-hvcs” tag marks this data as being expressed in the HealthVault comma-separated format. Content encoding: x-deflate-base64[2] x-gzip-base64 x-plain The content encoding is set to one of these three values. “x-plain” indicates that the data is stored directly as text. “x-gzip-base64” indicates that the data is compressed using GZIP (RFC 1952, GZipStream class in .NET) and then encoded using base64 encoding (RFC 2045, Convert class in .NET). “x-deflate-base64” indicates that the data is compressed using deflate (RFC 1951, DeflateStream class in .NET) and then encoded using base64 encoding (RFC 2045, Convert class in .NET). Data: The data property stores the comma-separated data. Compressed or plain text? The choice between storing plain text or one of the compressed options should be made based upon the size of the final data. Small amounts of data (< 512 bytes) are generally smaller in plain format, while large amounts (>2K bytes) are generally smaller when compressed and encoded. .NET Library There will very likely be a library in the .NET SDK that encapsulates the type, so a user would write this sort of code: [Test] public void TestRoundTrip() { OtherDataHelperMock helperSave = new OtherDataHelperMock(); List<string> valuesSave = new List<string>(); valuesSave.Add("A"); valuesSave.Add("b"); valuesSave.Add("iii"); helperSave.SetOtherData(valuesSave); //helperSave.ForceCompressAndEncode(); // force because compress doesn't happen on small amounts of data... OtherDataHelper helperLoad = new OtherDataHelper(); helperLoad.OtherItemData = helperSave.OtherItemData; //helperLoad.DecodeAndDecompress(); Collection<string> valuesLoad = helperLoad.ParseAsString(); Assert.AreEqual(3, valuesLoad.Count); Assert.AreEqual("A", valuesLoad[0]); Assert.AreEqual("b", valuesLoad[1]); Assert.AreEqual("iii", valuesLoad[2]); } [1] While the content type “text/csv” is commonly used to indicate the comma-separated-value type, that gives insufficient information as we need to indicate what kind of CSV is being stored. The “x token” approach is therefore used to define an application-specific name. [2] According to the RFCs on mime types, there are no standardized ways of specifying that a string of characters are first compressed using gzip or deflate and then encoded as text (and, in fact, the RFC discourages the creations of new encodings). The content encoding type is therefore expressed using the “x token” syntax for indicating that this method is application specific, while using a name that should be informative to most developers.
|
-
This document contains general guidelines for using the Medication and MedicationFill types. It does not cover all the information that is stored in the type – see the Medication and MedicationFill member documentation for more information. The Medication type stores information about medication that the user is current taking or has taken in the past. The information may be self-reported from the user , or it may enter the record from a clinical or pharmacy system. Additionally, a pharmacy system may choose to write a MedicationFill instance to store fill information as well. The name describes the medication that the user is taking. The text portion should always be a user-understandable name for the medication. For prescription drugs, this is normally the trade or generic name for the drug. For self-reported records, it could also be the name of a class of drugs (such as “multivitamin”, “heart medicine”) or a herbal or other medicine (“echinacea”). If a specific coding for the drug may be encoded in the code section using an appropriate vocabulary. The name is the only required information for the Medication type. Dose, strength, frequency, and route are used together to specify the exact way the user takes the medication. Medications for which there are prescriptions should encode that additional information into the prescription element. Any MedicationFill instances that are created should add the key of the relevent Medication to their RelatedItems collection.
|
-
This document contains general guidelines for using the Question answer data type. It does not cover all the information that is stored in the type – see the QuestionAnswer member documentation for more information. This data type stores a question that a user was asked, and their response to the question. In some cases, answers to specific questions should also be stored in separate HealthVault types. For example, if a user is asked a question about their height, the answer should also be recorded as a height instance. Question The question asked is stored in the Question codable value. The question text is stored as text. Additionally, the question can be coded to indicate that it is a specific question. The question-sets vocabulary contains a list of all the vocabularies that contain questions, and you can code any of these vocabularies with the question. If a question or vocabulary doesn’t exist and you think it would be a good question to standardize, please contact the data type team to suggest that we add it. AnswerChoices The options that can be chosen for the question are stored in the AnswerChoices collection. The text of the option is stored in text portion of the codable value. The code can be used in two different ways: If the question is a yes/no question or uses a standard set of answer, it may be coded to a vocabulary that contains those answer. The answer-choices-set vocabulary has a list of standard vocabularies that can be used for this. For example, if the set of questions are “yes/no” questions, they can be coded using the answer-choices-yes-no vocabulary. Questions that do not have a standard set of answers are coded differently. The text is stored in the text portion of the codable value. The code part may be absent, or may be coded using a vocabulary that more specifically defines the stored value. For example, an answer that indicated the user had Coronary Heart Disease might be coded using an appropriate condition coding. If the question requires the user to fill in a blank, the AnswerChoices collection will be null. Answer The Answer collection records the answer or answers for the user. For answers that are one of the choices in AnswerChoices, the codable value in the Answer collection should be identical to the choice in the AnswerChoices collection. Textual answers for fill-in-the-blank questions should be stored in the text portion without any coding. If the user did not answer a question, the Answer will be null. Example 1: Choose all the apply Question: Do you have any of these neurological conditions (choose all that apply) AnswerChoices: - Head injury
- Seizures
- Stroke
- None of the above
each of these is coded with an appropriate vocabulary. The user chose “head injury” and “seizures”. Answers: these are identically coded to the AnswerChoices of the same names. Example 2: Fill in the blank Question: How long has it been since your last physical? AnswerChoices: null Answers: Example 3: Standard answer set Question: Do you have fair skin? AnswerChoices: These are coded to the answer-choices-yes-no vocabulary. Answer: This is coded to the answer-choices-yes-no vocabulary.
|
-
This document contains general guidelines for using the Health assessment data type. It does not cover all the information that is stored in the type – see the HealthAssessment member documentation for more information. The health assessment type is used to contain the results of a health assessment. An assessment is a judgement typically based upon answers to questions, laboratory results, or other data in a HealthVault record. Examples include Heart attack risk, diabetes risk. The name element is used to store the applications name for the assessment – something like “Fabrikam’s hair breakage assessment”. Category is used to specify a general category for the assessment – in our example it would be “Hair breakage assessment”. It is expected that it will be coded to a vocabulary so that other applications can understand what the assessment is measuring. The result collection stores the results for the assessment. It can support assessments of different complexities. For example, a heart attack risk assessment of low might be stored in the following result: Result name: coded to “Heart attack Risk” Result value: coded to “Low” Some assessments are multi-valued. A heart attack risk might be quantified both as “low” and as “6% over the next ten years”. The value collection allows multiple values to be added: Result name: coded to “Heart attack Risk” Result value: coded to “Low” Result value: coded to “6% over the next 10 years” Some laboratory-based assessments may provide a set of high level assessments. These are encoded by using multiple results: Result1 name: “Type 2 diabetes risk” Result1 value: 15% Result2 name: “Heart attack risk” Result2 value: 3% Result3 name: “Glaucoma risk” Result3 value: 15% In some cases, an overall assessment may be supported by several sub-assessments: Result1 name: “Heart attack risk” Result1 value: 16% Result2 name: Total cholesterol risk factor Result2 value: high Group: Cholesterol factors Result3 name: HDL (good cholesterol) risk factor Result3 value: medium Group: Cholesterol factors
Result4 name: Smoking risk factor Result4 value: low Group: Lifestyle Applications should present results with the same group together, with an appropriate group label.
|
-
This document contains general guidelines for using the body composition data type. It does not cover all the information that is stored in the type – see the BodyComposition documentation for more information. This types stores measurements of the record owner’s body composition, such as the percentage of fat, or the amount of muscle. The kinds of measurements can be found in the body-composition-measurement-names vocabulary (let us know if you would like to request additional entries in the vocabulary), and are coded using the MeasurementName property. Each of these entries in the vocabulary defines the units that you will use to store the measurement – if you code “fat-percent”, you are storing the percentage of fat, while if you code “lean-mass”, you are storing a mass measurement of lean muscle. Set the MassValue or PercentValue properties as appropriate for the value you are storing. The MeasurementMethod property describes the technique that was used to measure the value. Setting this permits applications to make appropriate decisions. Some techniques provide values that are specific to specific regions of the body. The Site property is used to specify what part of the body is being measured.
|
|
|
|