Core Catalog Events
List of Catalogs
Catalog | Description |
---|---|
User Catalog | Catalog representing values for primary users of the app. |
Site Catalog | Catalog representing values for Sites int he app, such as a facility, community, pharmacy, org, etc. |
Required Catalog Fields
Some catalog fields can be marked as optional below but may be required for your app. Please refer to your integration notes to verify which fields are required for your use-case.
User Catalog
Below is the User Catalog values.
Overview
Param | Usability | Format | Description |
---|---|---|---|
id | REQUIRED | STRING | Unique id for a user, provided by the partner. |
name | OPTIONAL | STRING | Name of the user, provided by the partner. |
country | OPTIONAL | STRING | Country in which the user is registered. As a full name. |
region_state | OPTIONAL | STRING | Region/State in which the user is registered. |
city | OPTIONAL | STRING | City in which the user is registered. |
workplace | OPTIONAL | STRING | Workplace for the user. |
profession | OPTIONAL | STRING | Profession of the user in the platform. |
zipcode | OPTIONAL | STRING | ZipCode for the user. |
language | OPTIONAL | STRING | Language user is speaking/using in the app. As a full name. |
experience | OPTIONAL | STRING | Experience of the user as provided by the partner |
education_level | OPTIONAL | STRING | Educational Level of the user based on pre-defined values. |
timezone | REQUIRED | STRING | Timezone for which the user is currently in. (Auto Tracked) |
organization_id | OPTIONAL | STRING | Id for the organization user is associated with. |
organization_name | OPTIONAL | STRING | Name for the organization user is associated with. |
account_type | OPTIONAL | STRING | type of the user account, basic, classic, advanced, admin, other. |
birth_year | OPTIONAL | INT | birth year of the user, in format of YYYY. |
gender | OPTIONAL | STRING | type of the user gender: male, female, other |
marital_status | OPTIONAL | STRING | user's marital status: single, married, widowed, divorced, separated, other, undisclosed |
family_members | OPTIONAL | STRING | user's family members count: none, 1, 2, 3, 4, 5_or_more, undisclosed |
children_under_five | OPTIONAL | STRING | user's children under five count: none, 1, 2, 3, 4, 5_or_more, undisclosed |
Usage
val userCatalogModel = UserCatalogModel(
id = "appUserId",
name = "User Catalog",
country = CountryCode.Spain.name,
regionState = "Barcelona",
city = "Barcelona",
workplace = "facility",
profession = "HCW",
zipcode = "08008",
language = LanguageCode.English.name,
experience = "4 Years",
educationLevel = EducationalLevel.Bachelors.toString(),
organizationId = "organizationID",
organizationName = "Causal Foundry",
accountType = "user",
birthYear = 1980,
gender = UserGender.Male.toString(),
maritalStatus = MaritalStatus.Single.toString(),
familyMembers = MembersCount.FiveOrMore.toString(),
childrenUnderFive = MembersCount.None.toString()
)
CFCoreEvent.logCatalog(
coreCatalogType = CoreCatalogSubject.User,
catalogModel = userCatalogModel
)
let userCatalog = UserCatalogModel(
id = "appUserId",
name: username,
country: CountryCode.Andorra.rawValue,
regionState: "Barcelona",
city: "Barcelona",
workplace: "Planet Earth",
profession: "HCW",
zipcode: "08008",
language: LanguageCode.English.rawValue,
experience: "4 Years",
educationLevel: EducationalLevel.Bachelors.rawValue,
organizationId: "organizationID",
organizationName: "Causal Foundry",
accountType: "user",
birthYear: 1972,
gender = UserGender.Male.rawValue,
maritalStatus = MaritalStatus.Single.rawValue,
familyMembers: MembersCount.Two.rawValue,
childrenUnderFive = MembersCount.None.rawValue
)
CFCoreEvent.shared.logCatalog(coreCatalogType: CoreCatalogSubject.User, catalogModel: userCatalog)
let userProperties = {
id = "appUserId",
name: "John Doe",
organization_id: "cf",
organization_name: "Causal Foundry",
experience: "1 Year",
region_state: "Barcelona",
city: "Barcelona",
workplace: "causalfoundry",
profession: "SDK User",
zipcode: "08008",
country: CountryCode.Spain,
language: LanguageCode.Spanish,
education_level: EducationLevel.Bachelors,
account_type: "user",
birth_year: 1980,
gender: UserGender.Male,
marital_status: MaritalStatus.Single,
family_members: MembersCount.Two,
children_under_five: MembersCount.None
}
CfCore.updateUserCatalog(userProperties);
let user_properties = {
name: "John Doe",
organization_id: "cf",
organization_name: "Causal Foundry",
experience: "1 Year",
region_state: "Barcelona",
city: "Barcelona",
workplace: "causalfoundry",
profession: "SDK User",
zipcode: "08008",
country: CountryCode.Spain,
language: LanguageCode.Spanish,
education_level: EducationLevel.Bachelors,
account_type: UserAccountType.Basic,
birth_year: 1980,
gender: UserGender.Male,
marital_status: MaritalStatus.Single,
family_members: MembersCount.Two,
children_under_five: MembersCount.None
}
cflog.identify(IdentifyAction.Register, <user-id>, user_properties)
OR
cflog.updateUserCatalog(<user-id>, userDetail)
[
{
"id": "appUserId",
"name": "John Doe",
"city": "Barcelona",
"country": "Spain",
"education_level": "bachelors",
"experience": "4 Years",
"language": "English",
"organization_id": "organizationID",
"organization_name": "Causal Foundry",
"profession": "HCW",
"region_state": "Barcelona",
"timezone": "+0100",
"workplace": "facility",
"zipcode": "08008",
"account_type": "basic",
"birth_year": 1980,
"gender": "male",
"marital_status": "single",
"family_members": "2",
"children_under_five": "none",
}
]
Site Catalog
Below is the Site Catalog values.
Format
Param | Usability | Format | Description |
---|---|---|---|
id | REQUIRED | STRING | Unique id for a site, provided by the partner. |
name | REQUIRED | STRING | Name of the site, provided by the partner. |
type | REQUIRED | STRING (ENUM) [pharmacy, clinic, community] | Type of the site, provided by the partner based on the enum. |
country | OPTIONAL | STRING | Country in which the site is at. |
region_state | OPTIONAL | STRING | Region or State in which the site is at. |
city | OPTIONAL | STRING | City in which the site is at. |
street_address | OPTIONAL | STRING | Address of the site. |
zipcode | OPTIONAL | STRING | Zipcode in which the site is at. |
level | OPTIONAL | STRING | Level of the site. |
is_active | OPTIONAL | BOOLEAN | If the Site is currently active. |
latitude | OPTIONAL | DOUBLE | Latitude where the site is at. |
longitude | OPTIONAL | DOUBLE | Longitude where the site is at. |
culture | OPTIONAL | STRING | Culture of the site (if any). |
parent_id | OPTIONAL | STRING | Id of the parent site (if any). |
service_list | OPTIONAL | ARRAY (STRING) | Array of the services provided at that facility. |
Usage
val hcwSiteCatalogModel = SiteCatalogModel(
siteId = "sampleSiteID",
name = "test",
type = SiteCatalogType.Community.toString(),
country = "South Africa",
regionState = "test region_state",
city = "test city",
zipcode = "test zipcode",
level = "test level",
isActive = false,
latitude = 41.63,
longitude = 2.404,
serviceList = listOf("hello", "world"),
)
CFCoreEvent.logCatalog(
coreCatalogType = CoreCatalogSubject.Site,
catalogModel = hcwSiteCatalogModel
)
let siteCatalogModel = SiteCatalogModel(
siteId: "RandomSITEID1",
name: "test",
type: SiteCatalogType.Clinic.rawValue,
country: CountryCode.UnitedArabEmirates.rawValue,
regionState: "test region_state",
city: "test city",
zipcode: "test zipcode",
level: "test level",
category: "test category",
isActive: false,
latitude: 41.385063,
longitude: 2.173404,
culture: "test culture"
)
CFCoreEvent.shared.logCatalog(coreCatalogType: CoreCatalogSubject.Site, catalogModel: siteCatalogModel)
let siteCatalogModel = {
id: "JohnDoeTEST",
name: "test",
type: SiteCatalogType.Clinic,
country: Country.Spain,
region_state: "test region_state",
city: "test city",
zipcode: "test zipcode",
level: "test level",
is_active: false,
street_address: "test address",
latitude: 41.390205,
longitude: 2.154007,
culture: "test culture",
parent_id: "testID123",
};
Navigation.logCatalogEvent(CoreCatalogType.Site, siteCatalogModel)
[
{
"id": "SiteId",
"name": "testSiteName",
"type": "clinic",
"street_address": "test address",
"city": "test city",
"country": "Spain",
"culture": "test culture",
"is_active": true,
"level": "test level",
"latitude": 41.390205,
"longitude": 2.154007,
"region_state": "test region_state",
"parent_id": "parentSiteID",
"zipcode": "test zipcode",
"service_list": ["HIV", "TB"]
}
]