Skip to content
On this page

Subject Demographic Information

In order to provide highly accurate results, the SDK requires demographic information regarding the user who is taking the measurement. This information is not mandatory, but it improves the accuracy of the vital signs that are calculated by the system. The demographic information consists of three fields:

  • Sex (as classified at birth) [unspecified / male / female]
  • Age [years]
  • Weight [Kilograms]

Note

Demographic information can be set only for face and PPG Device measurement sessions.

The application can provide the demographic information as part of the session initiation.

In the following example, the sex is female, the age is 35 years and the weight is 65 kilograms. In the example the measurement session is a face session, but it can be used in a PPG Device session as well.

Swift
do {
    let licenseDetails = LicenseDetails(licenseKey: "<ENTER_YOUR_LICENSE_KEY>")
    let subjectDemographic = SubjectDemographic(sex: .female, age: 35, weight: 65) 
    try let session = FaceSessionBuilder() 
        .withSubjectDemographic(subjectDemographic) 
        .withImageListener(self)
        .withVitalSignsListener(self)
        .withSessionInfoListener(self)
        .build(licenseDetails: licenseDetails);
}
catch {
    let nsError = error as NSError
    print("Received Error. Domain: \(nsError.domain) Code: \(nsError.code)")
}
Objective-C
BNHLicenseDetails *licenseDetails = [[BNHLicenseDetails alloc] initWithLicenseKey:@"<ENTER_YOUR_LICENSE_KEY>"];
BNHSubjectDemographic *subjectDemographic = [[BNHSubjectDemographic alloc] initWithSex:BNHSexFemale
                                                                                   age:@(35)
                                                                                weight:@(65)];

BNHFaceSessionBuilder *sessionBuilder = [[[[[[BNHFaceSessionBuilder alloc] init]
                                            withSubjectDemographic:subjectDemographic]
                                           withImageListener:self]
                                          withVitalSignsListener:self]
                                         withSessionInfoListener:self];

NSError *error = nil;
id<BNHSession> _Nullable session = [sessionBuilder buildWithLicenseDetails:licenseDetails
                                                                     error:&error];

if (error != nil) {
    NSLog(@"Received Error. Domain: %@ Code: %ld", error.domain, (long)error.code);
}

If any of the demographic parameters is unknown, it is recommended to provide the known parameters and to leave the others 'null'/'unspecified'.

Important

When a session is created with demographic information, all measurements performed during that session use the same demographic information. Therefore, a new session must be created in order to update the demographic information.